mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-07 18:40:19 -05:00
Ported even more buttons to use new design (Key and User editor)
Added drawables for them
This commit is contained in:
parent
e8bb14ca26
commit
2406842847
@ -34,13 +34,13 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
import com.devspark.appmsg.AppMsg;
|
import com.devspark.appmsg.AppMsg;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
@ -97,7 +97,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
|||||||
private boolean mNeedsSaving;
|
private boolean mNeedsSaving;
|
||||||
private boolean mIsBrandNewKeyring = false;
|
private boolean mIsBrandNewKeyring = false;
|
||||||
|
|
||||||
private BootstrapButton mChangePassphrase;
|
private Button mChangePassphrase;
|
||||||
|
|
||||||
private CheckBox mNoPassphrase;
|
private CheckBox mNoPassphrase;
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
|||||||
setContentView(R.layout.edit_key_activity);
|
setContentView(R.layout.edit_key_activity);
|
||||||
|
|
||||||
// find views
|
// find views
|
||||||
mChangePassphrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_passphrase);
|
mChangePassphrase = (Button) findViewById(R.id.edit_key_btn_change_passphrase);
|
||||||
mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
|
mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
|
||||||
// Build layout based on given userIds and keys
|
// Build layout based on given userIds and keys
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.DatePicker;
|
import android.widget.DatePicker;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TableLayout;
|
import android.widget.TableLayout;
|
||||||
import android.widget.TableRow;
|
import android.widget.TableRow;
|
||||||
@ -54,7 +55,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
private EditorListener mEditorListener = null;
|
private EditorListener mEditorListener = null;
|
||||||
|
|
||||||
private boolean mIsMasterKey;
|
private boolean mIsMasterKey;
|
||||||
BootstrapButton mDeleteButton;
|
ImageButton mDeleteButton;
|
||||||
TextView mAlgorithm;
|
TextView mAlgorithm;
|
||||||
TextView mKeyId;
|
TextView mKeyId;
|
||||||
TextView mCreationDate;
|
TextView mCreationDate;
|
||||||
@ -124,7 +125,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
mCreationDate = (TextView) findViewById(R.id.creation);
|
mCreationDate = (TextView) findViewById(R.id.creation);
|
||||||
mExpiryDateButton = (BootstrapButton) findViewById(R.id.expiry);
|
mExpiryDateButton = (BootstrapButton) findViewById(R.id.expiry);
|
||||||
|
|
||||||
mDeleteButton = (BootstrapButton) findViewById(R.id.delete);
|
mDeleteButton = (ImageButton) findViewById(R.id.delete);
|
||||||
mDeleteButton.setOnClickListener(this);
|
mDeleteButton.setOnClickListener(this);
|
||||||
mChkCertify = (CheckBox) findViewById(R.id.chkCertify);
|
mChkCertify = (CheckBox) findViewById(R.id.chkCertify);
|
||||||
mChkCertify.setOnCheckedChangeListener(mCheckChanged);
|
mChkCertify.setOnCheckedChangeListener(mCheckChanged);
|
||||||
|
@ -32,8 +32,7 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
|
||||||
@ -52,7 +51,7 @@ import java.util.Vector;
|
|||||||
|
|
||||||
public class SectionView extends LinearLayout implements OnClickListener, EditorListener, Editor {
|
public class SectionView extends LinearLayout implements OnClickListener, EditorListener, Editor {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private BootstrapButton mPlusButton;
|
private ImageButton mPlusButton;
|
||||||
private ViewGroup mEditors;
|
private ViewGroup mEditors;
|
||||||
private TextView mTitle;
|
private TextView mTitle;
|
||||||
private int mType = 0;
|
private int mType = 0;
|
||||||
@ -126,7 +125,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
|||||||
setDrawingCacheEnabled(true);
|
setDrawingCacheEnabled(true);
|
||||||
setAlwaysDrawnWithCacheEnabled(true);
|
setAlwaysDrawnWithCacheEnabled(true);
|
||||||
|
|
||||||
mPlusButton = (BootstrapButton) findViewById(R.id.plusbutton);
|
mPlusButton = (ImageButton) findViewById(R.id.plusbutton);
|
||||||
mPlusButton.setOnClickListener(this);
|
mPlusButton.setOnClickListener(this);
|
||||||
|
|
||||||
mEditors = (ViewGroup) findViewById(R.id.editors);
|
mEditors = (ViewGroup) findViewById(R.id.editors);
|
||||||
|
@ -31,8 +31,7 @@ import android.widget.AutoCompleteTextView;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
||||||
@ -43,7 +42,7 @@ import java.util.regex.Matcher;
|
|||||||
public class UserIdEditor extends LinearLayout implements Editor, OnClickListener {
|
public class UserIdEditor extends LinearLayout implements Editor, OnClickListener {
|
||||||
private EditorListener mEditorListener = null;
|
private EditorListener mEditorListener = null;
|
||||||
|
|
||||||
private BootstrapButton mDeleteButton;
|
private ImageButton mDeleteButton;
|
||||||
private RadioButton mIsMainUserId;
|
private RadioButton mIsMainUserId;
|
||||||
private String mOriginalID;
|
private String mOriginalID;
|
||||||
private EditText mName;
|
private EditText mName;
|
||||||
@ -103,7 +102,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
|||||||
setDrawingCacheEnabled(true);
|
setDrawingCacheEnabled(true);
|
||||||
setAlwaysDrawnWithCacheEnabled(true);
|
setAlwaysDrawnWithCacheEnabled(true);
|
||||||
|
|
||||||
mDeleteButton = (BootstrapButton) findViewById(R.id.delete);
|
mDeleteButton = (ImageButton) findViewById(R.id.delete);
|
||||||
mDeleteButton.setOnClickListener(this);
|
mDeleteButton.setOnClickListener(this);
|
||||||
mIsMainUserId = (RadioButton) findViewById(R.id.isMainUserId);
|
mIsMainUserId = (RadioButton) findViewById(R.id.isMainUserId);
|
||||||
mIsMainUserId.setOnClickListener(this);
|
mIsMainUserId.setOnClickListener(this);
|
||||||
|
BIN
OpenKeychain/src/main/res/drawable-mdpi/minus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-mdpi/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 B |
BIN
OpenKeychain/src/main/res/drawable-mdpi/plus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-mdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 231 B |
BIN
OpenKeychain/src/main/res/drawable-xhdpi/minus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-xhdpi/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 323 B |
BIN
OpenKeychain/src/main/res/drawable-xhdpi/plus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-xhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 281 B |
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/minus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 447 B |
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/plus.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 493 B |
@ -8,8 +8,8 @@
|
|||||||
android:left="6dip"
|
android:left="6dip"
|
||||||
android:right="6dip"
|
android:right="6dip"
|
||||||
android:top="6dip" />
|
android:top="6dip" />
|
||||||
|
<solid android:color="#ebebeb" />
|
||||||
<stroke android:color="#cccccc" android:width="1.5dip" />
|
<stroke android:color="#cccccc" android:width="1.5dip" />
|
||||||
<stroke android:color="#ebebeb" />
|
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_focused="true">
|
<item android:state_focused="true">
|
||||||
@ -19,8 +19,8 @@
|
|||||||
android:left="6dip"
|
android:left="6dip"
|
||||||
android:right="6dip"
|
android:right="6dip"
|
||||||
android:top="6dip" />
|
android:top="6dip" />
|
||||||
<stroke android:color="#cccccc" android:width="1.5dip" />
|
|
||||||
<solid android:color="#ebebeb"/>
|
<solid android:color="#ebebeb"/>
|
||||||
|
<stroke android:color="#cccccc" android:width="1.5dip" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item >
|
<item >
|
||||||
@ -30,8 +30,8 @@
|
|||||||
android:left="6dip"
|
android:left="6dip"
|
||||||
android:right="6dip"
|
android:right="6dip"
|
||||||
android:top="6dip" />
|
android:top="6dip" />
|
||||||
<stroke android:color="#cccccc" android:width="1.5dip" />
|
|
||||||
<solid android:color="#ffffff" />
|
<solid android:color="#ffffff" />
|
||||||
|
<stroke android:color="#cccccc" android:width="1.5dip" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
</selector>
|
</selector>
|
37
OpenKeychain/src/main/res/drawable/button_rounded_green.xml
Normal file
37
OpenKeychain/src/main/res/drawable/button_rounded_green.xml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true" >
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#47a447" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_focused="true">
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#47a447"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item >
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#5cb85c" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
37
OpenKeychain/src/main/res/drawable/button_rounded_red.xml
Normal file
37
OpenKeychain/src/main/res/drawable/button_rounded_red.xml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true" >
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#d2322d" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_focused="true">
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#d2322d"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item >
|
||||||
|
<shape android:shape="rectangle" >
|
||||||
|
<padding
|
||||||
|
android:bottom="6dip"
|
||||||
|
android:left="6dip"
|
||||||
|
android:right="6dip"
|
||||||
|
android:top="6dip" />
|
||||||
|
<corners android:radius="6dip" />
|
||||||
|
<solid android:color="#d9534f" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -26,14 +26,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/label_no_passphrase" />
|
android:text="@string/label_no_passphrase" />
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
<Button
|
||||||
android:id="@+id/edit_key_btn_change_passphrase"
|
android:id="@+id/edit_key_btn_change_passphrase"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:text="@string/btn_set_passphrase"
|
android:text="@string/btn_set_passphrase"
|
||||||
bootstrapbutton:bb_icon_left="fa-pencil"
|
android:drawableLeft="@drawable/ic_action_edit"
|
||||||
bootstrapbutton:bb_type="default" />
|
android:background="@drawable/button_edgy" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/edit_key_container"
|
android:id="@+id/edit_key_container"
|
||||||
|
@ -155,15 +155,13 @@
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
<ImageButton
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
bootstrapbutton:bb_icon_left="fa-minus"
|
android:src="@drawable/minus"
|
||||||
bootstrapbutton:bb_roundedCorners="true"
|
android:background="@drawable/button_rounded_red"/>
|
||||||
bootstrapbutton:bb_size="small"
|
|
||||||
bootstrapbutton:bb_type="danger" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<org.sufficientlysecure.keychain.ui.widget.SectionView xmlns:android="http://schemas.android.com/apk/res/android"
|
<org.sufficientlysecure.keychain.ui.widget.SectionView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
@ -23,15 +22,13 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="Section Name" />
|
android:text="Section Name" />
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
<ImageButton
|
||||||
android:id="@+id/plusbutton"
|
android:id="@+id/plusbutton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
bootstrapbutton:bb_icon_left="fa-plus"
|
android:src="@drawable/plus"
|
||||||
bootstrapbutton:bb_roundedCorners="true"
|
android:background="@drawable/button_rounded_green"/>
|
||||||
bootstrapbutton:bb_size="small"
|
|
||||||
bootstrapbutton:bb_type="success" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<org.sufficientlysecure.keychain.ui.widget.UserIdEditor xmlns:android="http://schemas.android.com/apk/res/android"
|
<org.sufficientlysecure.keychain.ui.widget.UserIdEditor xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
@ -76,18 +75,16 @@
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|
||||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
<ImageButton
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dip"
|
||||||
android:layout_marginLeft="4dip"
|
android:layout_marginLeft="4dip"
|
||||||
android:layout_marginRight="6dip"
|
android:layout_marginRight="6dip"
|
||||||
bootstrapbutton:bb_icon_left="fa-minus"
|
android:src="@drawable/minus"
|
||||||
bootstrapbutton:bb_roundedCorners="true"
|
android:background="@drawable/button_rounded_red" />
|
||||||
bootstrapbutton:bb_size="small"
|
|
||||||
bootstrapbutton:bb_type="danger" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
Loading…
Reference in New Issue
Block a user