Merge branch 'master' into save_kdbx

This commit is contained in:
Brian Pellin committed 2011-02-06 16:06:03 -06:00
commit 7c94b2b95d
3 files changed
+27 -7

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
* Fix date display in .kdbx entries
KeePassDroid (1.9.1)
* Don't default to missing files
* Search the username field
+16 -5
View File
@@ -92,6 +92,9 @@ public class EntryActivity extends LockCloseActivity {
private NotificationManager mNM;
private BroadcastReceiver mIntentReceiver;
private DateFormat dateFormat;
private DateFormat timeFormat;
protected void setEntryView() {
setContentView(R.layout.entry_view);
}
@@ -112,6 +115,10 @@ public class EntryActivity extends LockCloseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setEntryView();
Context appCtx = getApplicationContext();
dateFormat = android.text.format.DateFormat.getDateFormat(appCtx);
timeFormat = android.text.format.DateFormat.getTimeFormat(appCtx);
Database db = App.getDB();
// Likely the app has been killed exit the activity
@@ -205,6 +212,11 @@ public class EntryActivity extends LockCloseActivity {
return notify;
}
private String getDateTime(Date dt) {
return dateFormat.format(dt) + " " + timeFormat.format(dt);
}
protected void fillData() {
ImageView iv = (ImageView) findViewById(R.id.entry_icon);
App.getDB().drawFactory.assignDrawableTo(iv, getResources(), mEntry.getIcon());
@@ -216,14 +228,13 @@ public class EntryActivity extends LockCloseActivity {
populateText(R.id.entry_password, mEntry.getPassword());
setPasswordStyle();
DateFormat df = DateFormat.getInstance();
populateText(R.id.entry_created, df.format(mEntry.getCreate()));
populateText(R.id.entry_modified, df.format(mEntry.getMod()));
populateText(R.id.entry_accessed, df.format(mEntry.getAccess()));
populateText(R.id.entry_created, getDateTime(mEntry.getCreate()));
populateText(R.id.entry_modified, getDateTime(mEntry.getMod()));
populateText(R.id.entry_accessed, getDateTime(mEntry.getAccess()));
Date expires = mEntry.getExpire();
if ( mEntry.expires() ) {
populateText(R.id.entry_expires, df.format(expires));
populateText(R.id.entry_expires, getDateTime(expires));
} else {
populateText(R.id.entry_expires, R.string.never);
}
@@ -30,6 +30,7 @@ import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Stack;
import java.util.TimeZone;
import java.util.UUID;
import java.util.zip.GZIPInputStream;
@@ -48,12 +49,12 @@ import com.keepassdroid.crypto.CipherFactory;
import com.keepassdroid.crypto.PwStreamCipherFactory;
import com.keepassdroid.database.ITimeLogger;
import com.keepassdroid.database.PwCompressionAlgorithm;
import com.keepassdroid.database.PwIconCustom;
import com.keepassdroid.database.PwDatabaseV4;
import com.keepassdroid.database.PwDbHeaderV4;
import com.keepassdroid.database.PwDeletedObject;
import com.keepassdroid.database.PwEntryV4;
import com.keepassdroid.database.PwGroupV4;
import com.keepassdroid.database.PwIconCustom;
import com.keepassdroid.database.exception.ArcFourException;
import com.keepassdroid.database.exception.InvalidDBException;
import com.keepassdroid.database.exception.InvalidPasswordException;
@@ -256,6 +257,13 @@ public class ImporterV4 extends Importer {
private static final String ElemStringDictExItem = "Item";
private static final long DEFAULT_HISTORY_DAYS = 365;
private static final SimpleDateFormat dateFormat;
static {
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
}
private boolean readNextNode = true;
@@ -763,7 +771,6 @@ public class ImporterV4 extends Importer {
}
}
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd'T'HH:mm:ss'Z'");
private Date ReadTime(XmlPullParser xpp) throws IOException, XmlPullParserException {
String sDate = ReadString(xpp);