ui improvements and fixed a slight bug due to ui

This commit is contained in:
zeapo 2014-08-17 14:08:56 +02:00
parent c2fb1a3ee2
commit 2c680cab59
17 changed files with 104 additions and 125 deletions

View file

@ -58,6 +58,24 @@ public class PasswordAdapter extends ArrayAdapter<PasswordItem>{
viewHolder.back_name = (TextView) rowView.findViewById(R.id.label_back);
viewHolder.type = (TextView) rowView.findViewById(R.id.type);
rowView.setTag(viewHolder);
}
ViewHolder holder = (ViewHolder) rowView.getTag();
holder.name.setText(pass.toString());
holder.back_name.setText(pass.toString());
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
holder.name.setTextColor(this.activity.getResources().getColor(android.R.color.holo_blue_dark));
holder.name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
holder.type.setText("Category: ");
} else {
holder.type.setText("Password: ");
holder.name.setTextColor(this.activity.getResources().getColor(android.R.color.holo_orange_dark));
holder.name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
holder.back_name.setTextColor(this.activity.getResources().getColor(android.R.color.white));
holder.back_name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD_ITALIC));
View.OnClickListener onClickListener = new View.OnClickListener() {
@ -78,24 +96,6 @@ public class PasswordAdapter extends ArrayAdapter<PasswordItem>{
((ImageButton) rowView.findViewById(R.id.crypto_delete_button)).setOnClickListener(onClickListener);
}
ViewHolder holder = (ViewHolder) rowView.getTag();
holder.name.setText(pass.toString());
holder.back_name.setText(pass.toString());
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
holder.name.setTextColor(this.activity.getResources().getColor(android.R.color.holo_blue_dark));
holder.name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
holder.type.setText("Category: ");
} else {
holder.type.setText("Password: ");
holder.name.setTextColor(this.activity.getResources().getColor(android.R.color.holo_orange_dark));
holder.name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
holder.back_name.setTextColor(this.activity.getResources().getColor(android.R.color.white));
holder.back_name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD_ITALIC));
}
return rowView;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -16,17 +16,4 @@
android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ico_add"
android:background="@drawable/oval"
android:layout_gravity="center_vertical"
android:onClick="createPassword"
android:layout_column="2"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/main_layout"
android:layout_alignEnd="@+id/main_layout" />
</RelativeLayout>

View file

@ -1,127 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.zeapo.pwdstore.crypto.PgpHandler"
android:background="#eee">
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
tools:context="com.zeapo.pwdstore.crypto.PgpHandler">
android:layout_height="wrap_content"
android:background="@drawable/rectangle"
android:orientation="horizontal"
android:layout_row="1"
android:layout_column="0">
<LinearLayout
android:layout_width="match_parent"
<TextView
android:id="@+id/crypto_password_category"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rectangle"
android:orientation="horizontal"
android:layout_row="1"
android:layout_column="0">
android:textStyle="bold"
android:textColor="@android:color/holo_blue_dark"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="CATEGORY/"/>
<TextView
android:id="@+id/crypto_password_category"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@android:color/holo_blue_dark"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="CATEGORY/"/>
<EditText
android:layout_gravity="center_vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/crypto_password_file_edit"
android:hint="@string/crypto_name_hint"
android:textColor="@android:color/holo_orange_dark"/>
<EditText
android:layout_gravity="center_vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/crypto_password_file_edit"
android:hint="@string/crypto_name_hint"
android:textColor="@android:color/holo_orange_dark"/>
</LinearLayout>
</LinearLayout>
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:background="@drawable/rectangle"
android:layout_weight="1">
<LinearLayout
android:id="@+id/crypto_container"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:background="@drawable/rectangle"
android:layout_height="wrap_content"
android:layout_row="2"
android:layout_column="0">
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
<LinearLayout
android:id="@+id/crypto_password_edit_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/crypto_pass_label"/>
<EditText
android:id="@+id/crypto_password_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:typeface="monospace"/>
</LinearLayout>
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textStyle="bold"
android:text="@string/crypto_extra_label"/>
android:text="@string/crypto_pass_label"/>
<EditText
android:id="@+id/crypto_extra_edit"
android:layout_width="match_parent"
android:id="@+id/crypto_password_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:enabled="true"
android:visibility="visible"
android:typeface="monospace"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textStyle="bold"
android:text="@string/crypto_extra_label"/>
<EditText
android:id="@+id/crypto_extra_edit"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:visibility="visible"
android:typeface="monospace"/>
</LinearLayout>
<RelativeLayout
android:layout_width="fill_parent"
</ScrollView>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0">
<ImageButton
android:layout_height="wrap_content"
android:layout_row="3"
android:layout_column="0">
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ico_check"
android:background="@drawable/oval"
android:id="@+id/crypto_confirm_add"
android:onClick="handleClick"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
android:layout_width="wrap_content"
android:src="@drawable/ico_check"
android:background="@drawable/oval"
android:id="@+id/crypto_confirm_add"
android:onClick="handleClick"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ico_cancel"
android:background="@drawable/oval"
android:id="@+id/crypto_cancel_add"
android:onClick="handleClick"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ico_cancel"
android:background="@drawable/oval"
android:id="@+id/crypto_cancel_add"
android:onClick="handleClick"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</GridLayout>
</ScrollView>
</LinearLayout>

View file

@ -35,7 +35,7 @@
android:id="@+id/crypto_show_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ico_key"
android:src="@drawable/ico_eye"
android:background="@drawable/blue_rectangle"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"

View file

@ -1,7 +1,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".pwdstore" >
<item android:id="@+id/menu_add_password"
android:icon="@drawable/ico_add"
android:showAsAction="always"
android:title="New password"/>
<!--<item android:id="@+id/menu_add_category"-->
@ -15,7 +18,7 @@
<item android:id="@+id/referesh"
android:title="Refresh list"
android:showAsAction="ifRoom"
android:icon="@android:drawable/ic_popup_sync"/>
android:icon="@drawable/ico_sync"/>
<item android:id="@+id/user_pref"
android:title="Settings"