certify: selectsecretkeyfragment cosmetics

This commit is contained in:
Vincent Breitmoser 2014-03-15 13:18:52 +01:00
parent db25c56b64
commit 9920196f70
2 changed files with 22 additions and 6 deletions

View File

@ -39,6 +39,7 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
private TextView mKeyUserId; private TextView mKeyUserId;
private TextView mKeyUserIdRest; private TextView mKeyUserIdRest;
private TextView mKeyMasterKeyIdHex; private TextView mKeyMasterKeyIdHex;
private TextView mNoKeySelected;
private BootstrapButton mSelectKeyButton; private BootstrapButton mSelectKeyButton;
private Boolean mFilterCertify; private Boolean mFilterCertify;
@ -60,10 +61,10 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
public void selectKey(long secretKeyId) { public void selectKey(long secretKeyId) {
if (secretKeyId == Id.key.none) { if (secretKeyId == Id.key.none) {
mKeyMasterKeyIdHex.setText(R.string.api_settings_no_key); mNoKeySelected.setVisibility(View.VISIBLE);
mKeyUserIdRest.setText("");
mKeyUserId.setVisibility(View.GONE); mKeyUserId.setVisibility(View.GONE);
mKeyUserIdRest.setVisibility(View.GONE); mKeyUserIdRest.setVisibility(View.GONE);
mKeyMasterKeyIdHex.setVisibility(View.GONE);
} else { } else {
PGPSecretKeyRing keyRing = ProviderHelper.getPGPSecretKeyRingByMasterKeyId( PGPSecretKeyRing keyRing = ProviderHelper.getPGPSecretKeyRingByMasterKeyId(
@ -93,20 +94,25 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
mKeyMasterKeyIdHex.setText(masterkeyIdHex); mKeyMasterKeyIdHex.setText(masterkeyIdHex);
mKeyUserId.setText(userName); mKeyUserId.setText(userName);
mKeyUserIdRest.setText(userEmail); mKeyUserIdRest.setText(userEmail);
mKeyMasterKeyIdHex.setVisibility(View.VISIBLE);
mKeyUserId.setVisibility(View.VISIBLE); mKeyUserId.setVisibility(View.VISIBLE);
mKeyUserIdRest.setVisibility(View.VISIBLE); mKeyUserIdRest.setVisibility(View.VISIBLE);
mNoKeySelected.setVisibility(View.GONE);
} else { } else {
mKeyMasterKeyIdHex.setText(getActivity().getResources().getString(R.string.no_key)); mKeyMasterKeyIdHex.setVisibility(View.GONE);
mKeyUserId.setVisibility(View.GONE); mKeyUserId.setVisibility(View.GONE);
mKeyUserIdRest.setVisibility(View.GONE); mKeyUserIdRest.setVisibility(View.GONE);
mNoKeySelected.setVisibility(View.VISIBLE);
} }
} else { } else {
mKeyMasterKeyIdHex.setText( mKeyMasterKeyIdHex.setText(
getActivity().getResources() getActivity().getResources()
.getString(R.string.no_keys_added_or_updated) .getString(R.string.no_keys_added_or_updated)
+ " for master id: " + secretKeyId); + " for master id: " + secretKeyId);
mKeyMasterKeyIdHex.setVisibility(View.VISIBLE);
mKeyUserId.setVisibility(View.GONE); mKeyUserId.setVisibility(View.GONE);
mKeyUserIdRest.setVisibility(View.GONE); mKeyUserIdRest.setVisibility(View.GONE);
mNoKeySelected.setVisibility(View.GONE);
} }
} }
@ -124,6 +130,7 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.select_secret_key_layout_fragment, container, false); View view = inflater.inflate(R.layout.select_secret_key_layout_fragment, container, false);
mNoKeySelected = (TextView) view.findViewById(R.id.no_key_selected);
mKeyUserId = (TextView) view.findViewById(R.id.select_secret_key_user_id); mKeyUserId = (TextView) view.findViewById(R.id.select_secret_key_user_id);
mKeyUserIdRest = (TextView) view.findViewById(R.id.select_secret_key_user_id_rest); mKeyUserIdRest = (TextView) view.findViewById(R.id.select_secret_key_user_id_rest);
mKeyMasterKeyIdHex = (TextView) view.findViewById(R.id.select_secret_key_master_key_hex); mKeyMasterKeyIdHex = (TextView) view.findViewById(R.id.select_secret_key_master_key_hex);

View File

@ -52,16 +52,25 @@
android:layout_marginRight="5dip" android:layout_marginRight="5dip"
android:text="" android:text=""
android:visibility="gone" android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
android:paddingLeft="10dp" />
<TextView <TextView
android:id="@+id/select_secret_key_master_key_hex" android:id="@+id/select_secret_key_master_key_hex"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="left" android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone"
android:layout_marginRight="15dip" />
<TextView
android:id="@+id/no_key_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/api_settings_no_key" android:text="@string/api_settings_no_key"
android:layout_marginRight="5dip" /> android:layout_marginTop="15dp" />
</LinearLayout> </LinearLayout>