mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Minor group layout tweaks.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ListView android:id="@android:id/list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@android:id/empty"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -18,4 +18,5 @@
|
||||
<string name="menu_copy_user">Copy User</string>
|
||||
<string name="menu_copy_pass">Copy Password</string>
|
||||
<string name="pass_filename">Filename:</string>
|
||||
<color name="group">#FF00FF</color>
|
||||
</resources>
|
||||
|
||||
@@ -69,7 +69,6 @@ public class KeePass extends Activity {
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
||||
saveDefaultPrefs();
|
||||
}
|
||||
|
||||
private void loadDefaultPrefs() {
|
||||
@@ -113,6 +112,7 @@ public class KeePass extends Activity {
|
||||
|
||||
switch (result) {
|
||||
case 0:
|
||||
saveDefaultPrefs();
|
||||
GroupActivity.Launch(mAct, null);
|
||||
break;
|
||||
case -1:
|
||||
|
||||
@@ -22,6 +22,9 @@ package com.android.keepass;
|
||||
import org.phoneid.keepassj2me.PwGroup;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class PwGroupView extends PwItemView {
|
||||
|
||||
@@ -33,6 +36,8 @@ public class PwGroupView extends PwItemView {
|
||||
mAct = act;
|
||||
mPw = pw;
|
||||
|
||||
getTextView().setTextColor(Color.BLUE);
|
||||
|
||||
}
|
||||
|
||||
public void setGroup(PwGroup pw) {
|
||||
|
||||
@@ -33,12 +33,16 @@ abstract public class PwItemView extends LinearLayout {
|
||||
mTitle = new TextView(context);
|
||||
mTitle.setText(title);
|
||||
mTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
|
||||
addView(mTitle, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
|
||||
addView(mTitle, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
|
||||
void setTitle(String title) {
|
||||
protected void setTitle(String title) {
|
||||
mTitle.setText(title);
|
||||
}
|
||||
|
||||
protected TextView getTextView() {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
abstract void onClick();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import android.app.Activity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
|
||||
import org.phoneid.keepassj2me.PwEntry;
|
||||
import org.phoneid.keepassj2me.PwGroup;
|
||||
@@ -67,7 +69,7 @@ public class PwListAdapter extends BaseAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private PwGroupView createGroupView(int position, View convertView) {
|
||||
private View createGroupView(int position, View convertView) {
|
||||
PwGroupView gv;
|
||||
if (convertView == null || ! (convertView instanceof PwGroupView)) {
|
||||
PwGroup group = (PwGroup) mGroup.childGroups.elementAt(position);
|
||||
@@ -76,6 +78,7 @@ public class PwListAdapter extends BaseAdapter {
|
||||
gv = (PwGroupView) convertView;
|
||||
gv.setGroup((PwGroup) mGroup.childGroups.elementAt(position));
|
||||
}
|
||||
|
||||
return gv;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user