ui: use textview buttons in decrypt verify dialogue

This commit is contained in:
Vincent Breitmoser 2014-05-06 19:18:32 +02:00
parent 0d05ff98cb
commit e0985878d7
5 changed files with 75 additions and 53 deletions

View File

@ -54,7 +54,7 @@ public class DecryptFileFragment extends DecryptFragment {
private EditText mFilename; private EditText mFilename;
private CheckBox mDeleteAfter; private CheckBox mDeleteAfter;
private BootstrapButton mBrowse; private BootstrapButton mBrowse;
private BootstrapButton mDecryptButton; private View mDecryptButton;
private String mInputFilename = null; private String mInputFilename = null;
private String mOutputFilename = null; private String mOutputFilename = null;
@ -71,7 +71,7 @@ public class DecryptFileFragment extends DecryptFragment {
mFilename = (EditText) view.findViewById(R.id.decrypt_file_filename); mFilename = (EditText) view.findViewById(R.id.decrypt_file_filename);
mBrowse = (BootstrapButton) view.findViewById(R.id.decrypt_file_browse); mBrowse = (BootstrapButton) view.findViewById(R.id.decrypt_file_browse);
mDeleteAfter = (CheckBox) view.findViewById(R.id.decrypt_file_delete_after_decryption); mDeleteAfter = (CheckBox) view.findViewById(R.id.decrypt_file_delete_after_decryption);
mDecryptButton = (BootstrapButton) view.findViewById(R.id.decrypt_file_action_decrypt); mDecryptButton = view.findViewById(R.id.decrypt_file_action_decrypt);
mBrowse.setOnClickListener(new View.OnClickListener() { mBrowse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
FileHelper.openFile(DecryptFileFragment.this, mFilename.getText().toString(), "*/*", FileHelper.openFile(DecryptFileFragment.this, mFilename.getText().toString(), "*/*",

View File

@ -47,8 +47,8 @@ public class DecryptMessageFragment extends DecryptFragment {
// view // view
private EditText mMessage; private EditText mMessage;
private BootstrapButton mDecryptButton; private View mDecryptButton;
private BootstrapButton mDecryptFromCLipboardButton; private View mDecryptFromCLipboardButton;
// model // model
private String mCiphertext; private String mCiphertext;
@ -61,8 +61,8 @@ public class DecryptMessageFragment extends DecryptFragment {
View view = inflater.inflate(R.layout.decrypt_message_fragment, container, false); View view = inflater.inflate(R.layout.decrypt_message_fragment, container, false);
mMessage = (EditText) view.findViewById(R.id.message); mMessage = (EditText) view.findViewById(R.id.message);
mDecryptButton = (BootstrapButton) view.findViewById(R.id.action_decrypt); mDecryptButton = view.findViewById(R.id.action_decrypt);
mDecryptFromCLipboardButton = (BootstrapButton) view.findViewById(R.id.action_decrypt_from_clipboard); mDecryptFromCLipboardButton = view.findViewById(R.id.action_decrypt_from_clipboard);
mDecryptButton.setOnClickListener(new OnClickListener() { mDecryptButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -74,15 +74,18 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" /> android:layout_alignParentStart="true" />
<com.beardedhen.androidbootstrap.BootstrapButton <TextView
android:id="@+id/decrypt_file_action_decrypt" android:id="@+id/decrypt_file_action_decrypt"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:minHeight="?android:attr/listPreferredItemHeight"
android:layout_marginBottom="4dp"
android:text="@string/btn_decrypt_verify" android:text="@string/btn_decrypt_verify"
bootstrapbutton:bb_icon_left="fa-unlock" android:drawableRight="@drawable/ic_action_save"
bootstrapbutton:bb_type="info" android:drawablePadding="8dp"
android:gravity="center_vertical"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" /> android:layout_alignParentStart="true" />

View File

@ -37,43 +37,46 @@
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:layout_weight="1" /> android:layout_weight="1" />
<TextView
style="@style/SectionHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/section_decrypt_verify"
android:id="@+id/decrypt_message_section" />
<LinearLayout <LinearLayout
android:id="@+id/decrypt_buttons" android:id="@+id/action_decrypt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true"
style="@style/SelectableItem"
android:orientation="horizontal"> android:orientation="horizontal">
<com.beardedhen.androidbootstrap.BootstrapButton <TextView
android:id="@+id/action_decrypt" android:paddingLeft="8dp"
android:layout_width="match_parent" android:paddingRight="8dp"
android:layout_height="50dp" android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginRight="4dp" android:layout_width="wrap_content"
android:layout_marginTop="4dp" android:layout_height="wrap_content"
android:layout_marginBottom="4dp" android:minHeight="?android:attr/listPreferredItemHeight"
android:layout_weight="1"
android:text="@string/btn_decrypt_verify" android:text="@string/btn_decrypt_verify"
bootstrapbutton:bb_icon_left="fa-unlock" android:gravity="center_vertical"
bootstrapbutton:bb_type="info" /> android:layout_weight="1" />
<com.beardedhen.androidbootstrap.BootstrapButton <View
android:layout_width="1dip"
android:layout_height="match_parent"
android:gravity="right"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider" />
<ImageButton
android:id="@+id/action_decrypt_from_clipboard" android:id="@+id/action_decrypt_from_clipboard"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="50dp" android:layout_height="match_parent"
android:layout_marginLeft="4dp" android:padding="8dp"
android:layout_marginTop="4dp" android:src="@drawable/ic_action_copy"
android:layout_marginBottom="4dp" android:layout_gravity="center_vertical"
android:layout_weight="1" style="@style/SelectableItem" />
android:text="@string/btn_decrypt_verify_clipboard"
bootstrapbutton:bb_icon_left="fa-clipboard"
bootstrapbutton:bb_type="info" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -11,20 +11,36 @@
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:background="@color/result_blue"> android:background="@color/result_blue">
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"
android:layout_marginTop="4dp" />
<TextView <TextView
android:id="@+id/result_text" android:id="@+id/result_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:text="result text" android:text="result text"
android:textColor="@color/white" /> android:textColor="@color/white"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<RelativeLayout <RelativeLayout
android:id="@+id/result_signature" android:id="@+id/result_signature"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true" android:clickable="true"
android:orientation="horizontal"> android:orientation="horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -67,17 +83,17 @@
android:layout_toRightOf="@+id/result_signature_image" android:layout_toRightOf="@+id/result_signature_image"
android:textColor="@color/white" /> android:textColor="@color/white" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/lookup_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_lookup_key"
bootstrapbutton:bb_icon_left="fa-download"
bootstrapbutton:bb_type="info"
bootstrapbutton:bb_size="small"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout> </RelativeLayout>
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/lookup_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:text="@string/btn_lookup_key"
bootstrapbutton:bb_icon_left="fa-download"
bootstrapbutton:bb_type="info"
bootstrapbutton:bb_size="small" />
</LinearLayout> </LinearLayout>