stability improvements
This commit is contained in:
@@ -11,22 +11,23 @@ namespace KeePass.Util
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static string GetErrorMessage(Exception e)
|
public static string GetErrorMessage(Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
string errorMessage = e.Message;
|
string errorMessage = e.Message;
|
||||||
if (e is Java.Lang.Exception javaException)
|
if (e is Java.Lang.Exception javaException)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
errorMessage = javaException.LocalizedMessage ?? javaException.Message ?? errorMessage;
|
errorMessage = javaException.LocalizedMessage ?? javaException.Message ?? errorMessage;
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,15 @@ namespace keepass2android.view
|
|||||||
ev.FindViewById(Resource.Id.icon).Visibility = ViewStates.Visible;
|
ev.FindViewById(Resource.Id.icon).Visibility = ViewStates.Visible;
|
||||||
ev.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;
|
ev.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;
|
||||||
|
|
||||||
_db = App.Kp2a.FindDatabaseForElement(_entry);
|
_db = App.Kp2a.TryFindDatabaseForElement(_entry);
|
||||||
|
if (_db == null)
|
||||||
|
{
|
||||||
|
ev.FindViewById(Resource.Id.icon).Visibility = ViewStates.Gone;
|
||||||
|
_textView.TextFormatted = new SpannableString("(no data)");
|
||||||
|
_textviewDetails.Visibility = ViewStates.Gone;
|
||||||
|
_textgroupFullPath.Visibility = ViewStates.Gone;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ImageView iv = (ImageView)ev.FindViewById(Resource.Id.icon);
|
ImageView iv = (ImageView)ev.FindViewById(Resource.Id.icon);
|
||||||
bool isExpired = pw.Expires && pw.ExpiryTime < DateTime.Now;
|
bool isExpired = pw.Expires && pw.ExpiryTime < DateTime.Now;
|
||||||
@@ -209,11 +217,6 @@ namespace keepass2android.view
|
|||||||
UpdateTotp();
|
UpdateTotp();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ConvertView(PwEntry pw, int pos)
|
public void ConvertView(PwEntry pw, int pos)
|
||||||
|
|||||||
@@ -15,14 +15,15 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
|
|||||||
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
|
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
|
||||||
using Android.Graphics;
|
using Android.Graphics;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
|
using Android.Text;
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
using keepass2android;
|
using keepass2android;
|
||||||
using KeePassLib;
|
using KeePassLib;
|
||||||
|
using System;
|
||||||
using Object = Java.Lang.Object;
|
using Object = Java.Lang.Object;
|
||||||
|
|
||||||
namespace keepass2android.view
|
namespace keepass2android.view
|
||||||
@@ -64,7 +65,20 @@ namespace keepass2android.view
|
|||||||
_label = (TextView) gv.FindViewById(Resource.Id.group_label);
|
_label = (TextView) gv.FindViewById(Resource.Id.group_label);
|
||||||
_label.TextSize = size-8;
|
_label.TextSize = size-8;
|
||||||
|
|
||||||
Database db = App.Kp2a.FindDatabaseForElement(pw);
|
Database db = App.Kp2a.TryFindDatabaseForElement(pw);
|
||||||
|
|
||||||
|
|
||||||
|
if (db == null)
|
||||||
|
{
|
||||||
|
|
||||||
|
gv.FindViewById(Resource.Id.group_icon_bkg).Visibility = ViewStates.Gone;
|
||||||
|
|
||||||
|
gv.FindViewById(Resource.Id.icon).Visibility = ViewStates.Gone;
|
||||||
|
gv.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;
|
||||||
|
_textview.Text = "(no data)";
|
||||||
|
_label.Text = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
gv.FindViewById(Resource.Id.group_icon_bkg).Visibility = db.DrawableFactory.IsWhiteIconSet ? ViewStates.Visible : ViewStates.Gone;
|
gv.FindViewById(Resource.Id.group_icon_bkg).Visibility = db.DrawableFactory.IsWhiteIconSet ? ViewStates.Visible : ViewStates.Gone;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user