From 2c680cab593b6c58988e058c1c775fa9c1476b28 Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 17 Aug 2014 14:08:56 +0200 Subject: ui improvements and fixed a slight bug due to ui --- .../com/zeapo/pwdstore/utils/PasswordAdapter.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'app/src/main/java/com') diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java index 2aaa0bf5..fb9442fb 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java @@ -58,24 +58,6 @@ public class PasswordAdapter extends ArrayAdapter{ viewHolder.back_name = (TextView) rowView.findViewById(R.id.label_back); viewHolder.type = (TextView) rowView.findViewById(R.id.type); rowView.setTag(viewHolder); - - - View.OnClickListener onClickListener = new View.OnClickListener() { - @Override - public void onClick(View view) { - switch (view.getId()) { - case R.id.crypto_show_button: - activity.decryptPassword(pass); - break; - case R.id.crypto_delete_button: - activity.deletePassword(pass); - break; - } - } - }; - - ((ImageButton) rowView.findViewById(R.id.crypto_show_button)).setOnClickListener(onClickListener); - ((ImageButton) rowView.findViewById(R.id.crypto_delete_button)).setOnClickListener(onClickListener); } ViewHolder holder = (ViewHolder) rowView.getTag(); @@ -94,6 +76,24 @@ public class PasswordAdapter extends ArrayAdapter{ 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() { + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.crypto_show_button: + activity.decryptPassword(pass); + break; + case R.id.crypto_delete_button: + activity.deletePassword(pass); + break; + } + } + }; + + ((ImageButton) rowView.findViewById(R.id.crypto_show_button)).setOnClickListener(onClickListener); + ((ImageButton) rowView.findViewById(R.id.crypto_delete_button)).setOnClickListener(onClickListener); } return rowView; -- cgit v1.2.3