Converted all other buttons

This commit is contained in:
Daniel Albert 2014-06-30 19:09:13 +02:00
parent 2406842847
commit 1e9789f5b4
23 changed files with 48 additions and 60 deletions

View File

@ -29,8 +29,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Button;
import com.beardedhen.androidbootstrap.BootstrapButton;
import org.openintents.openpgp.OpenPgpSignatureResult; import org.openintents.openpgp.OpenPgpSignatureResult;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
@ -52,7 +51,7 @@ public class DecryptFragment extends Fragment {
protected TextView mUserId; protected TextView mUserId;
protected TextView mUserIdRest; protected TextView mUserIdRest;
protected BootstrapButton mLookupKey; protected Button mLookupKey;
@Override @Override
@ -65,7 +64,7 @@ public class DecryptFragment extends Fragment {
mSignatureStatusImage = (ImageView) getView().findViewById(R.id.ic_signature_status); mSignatureStatusImage = (ImageView) getView().findViewById(R.id.ic_signature_status);
mUserId = (TextView) getView().findViewById(R.id.mainUserId); mUserId = (TextView) getView().findViewById(R.id.mainUserId);
mUserIdRest = (TextView) getView().findViewById(R.id.mainUserIdRest); mUserIdRest = (TextView) getView().findViewById(R.id.mainUserIdRest);
mLookupKey = (BootstrapButton) getView().findViewById(R.id.lookup_key); mLookupKey = (Button) getView().findViewById(R.id.lookup_key);
mLookupKey.setOnClickListener(new OnClickListener() { mLookupKey.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -51,8 +51,8 @@ import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Button;
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;
@ -85,8 +85,8 @@ public class KeyListFragment extends LoaderFragment
private String mQuery; private String mQuery;
private SearchView mSearchView; private SearchView mSearchView;
// empty list layout // empty list layout
private BootstrapButton mButtonEmptyCreate; private Button mButtonEmptyCreate;
private BootstrapButton mButtonEmptyImport; private Button mButtonEmptyImport;
/** /**
@ -101,7 +101,7 @@ public class KeyListFragment extends LoaderFragment
mStickyList.setOnItemClickListener(this); mStickyList.setOnItemClickListener(this);
// empty view // empty view
mButtonEmptyCreate = (BootstrapButton) view.findViewById(R.id.key_list_empty_button_create); mButtonEmptyCreate = (Button) view.findViewById(R.id.key_list_empty_button_create);
mButtonEmptyCreate.setOnClickListener(new OnClickListener() { mButtonEmptyCreate.setOnClickListener(new OnClickListener() {
@Override @Override
@ -113,7 +113,7 @@ public class KeyListFragment extends LoaderFragment
startActivityForResult(intent, 0); startActivityForResult(intent, 0);
} }
}); });
mButtonEmptyImport = (BootstrapButton) view.findViewById(R.id.key_list_empty_button_import); mButtonEmptyImport = (Button) view.findViewById(R.id.key_list_empty_button_import);
mButtonEmptyImport.setOnClickListener(new OnClickListener() { mButtonEmptyImport.setOnClickListener(new OnClickListener() {
@Override @Override

View File

@ -26,8 +26,7 @@ import android.view.animation.AlphaAnimation;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.ImageButton;
import com.beardedhen.androidbootstrap.FontAwesomeText;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
@ -50,7 +49,7 @@ import org.sufficientlysecure.keychain.R;
*/ */
public class FoldableLinearLayout extends LinearLayout { public class FoldableLinearLayout extends LinearLayout {
private FontAwesomeText mFoldableIcon; private ImageButton mFoldableIcon;
private boolean mFolded; private boolean mFolded;
private boolean mHasMigrated = false; private boolean mHasMigrated = false;
private Integer mShortAnimationDuration = null; private Integer mShortAnimationDuration = null;
@ -58,8 +57,6 @@ public class FoldableLinearLayout extends LinearLayout {
private LinearLayout mFoldableContainer = null; private LinearLayout mFoldableContainer = null;
private View mFoldableLayout = null; private View mFoldableLayout = null;
private String mFoldedIconName;
private String mUnFoldedIconName;
private String mFoldedLabel; private String mFoldedLabel;
private String mUnFoldedLabel; private String mUnFoldedLabel;
@ -87,15 +84,11 @@ public class FoldableLinearLayout extends LinearLayout {
if (attrs != null) { if (attrs != null) {
TypedArray a = context.obtainStyledAttributes(attrs, TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.FoldableLinearLayout, 0, 0); R.styleable.FoldableLinearLayout, 0, 0);
mFoldedIconName = a.getString(R.styleable.FoldableLinearLayout_foldedIcon);
mUnFoldedIconName = a.getString(R.styleable.FoldableLinearLayout_unFoldedIcon);
mFoldedLabel = a.getString(R.styleable.FoldableLinearLayout_foldedLabel); mFoldedLabel = a.getString(R.styleable.FoldableLinearLayout_foldedLabel);
mUnFoldedLabel = a.getString(R.styleable.FoldableLinearLayout_unFoldedLabel); mUnFoldedLabel = a.getString(R.styleable.FoldableLinearLayout_unFoldedLabel);
a.recycle(); a.recycle();
} }
// If any attribute isn't found then set a default one // If any attribute isn't found then set a default one
mFoldedIconName = (mFoldedIconName == null) ? "fa-chevron-right" : mFoldedIconName;
mUnFoldedIconName = (mUnFoldedIconName == null) ? "fa-chevron-down" : mUnFoldedIconName;
mFoldedLabel = (mFoldedLabel == null) ? context.getString(R.id.none) : mFoldedLabel; mFoldedLabel = (mFoldedLabel == null) ? context.getString(R.id.none) : mFoldedLabel;
mUnFoldedLabel = (mUnFoldedLabel == null) ? context.getString(R.id.none) : mUnFoldedLabel; mUnFoldedLabel = (mUnFoldedLabel == null) ? context.getString(R.id.none) : mUnFoldedLabel;
} }
@ -146,8 +139,8 @@ public class FoldableLinearLayout extends LinearLayout {
} }
private void initialiseInnerViews() { private void initialiseInnerViews() {
mFoldableIcon = (FontAwesomeText) mFoldableLayout.findViewById(R.id.foldableIcon); mFoldableIcon = (ImageButton) mFoldableLayout.findViewById(R.id.foldableIcon);
mFoldableIcon.setIcon(mFoldedIconName); mFoldableIcon.setImageResource(R.drawable.ic_action_expand);
mFoldableTextView = (TextView) mFoldableLayout.findViewById(R.id.foldableText); mFoldableTextView = (TextView) mFoldableLayout.findViewById(R.id.foldableText);
mFoldableTextView.setText(mFoldedLabel); mFoldableTextView.setText(mFoldedLabel);
@ -160,7 +153,7 @@ public class FoldableLinearLayout extends LinearLayout {
public void onClick(View view) { public void onClick(View view) {
mFolded = !mFolded; mFolded = !mFolded;
if (mFolded) { if (mFolded) {
mFoldableIcon.setIcon(mUnFoldedIconName); mFoldableIcon.setImageResource(R.drawable.ic_action_collapse);
mFoldableContainer.setVisibility(View.VISIBLE); mFoldableContainer.setVisibility(View.VISIBLE);
AlphaAnimation animation = new AlphaAnimation(0f, 1f); AlphaAnimation animation = new AlphaAnimation(0f, 1f);
animation.setDuration(mShortAnimationDuration); animation.setDuration(mShortAnimationDuration);
@ -168,7 +161,7 @@ public class FoldableLinearLayout extends LinearLayout {
mFoldableTextView.setText(mUnFoldedLabel); mFoldableTextView.setText(mUnFoldedLabel);
} else { } else {
mFoldableIcon.setIcon(mFoldedIconName); mFoldableIcon.setImageResource(R.drawable.ic_action_expand);
AlphaAnimation animation = new AlphaAnimation(1f, 0f); AlphaAnimation animation = new AlphaAnimation(1f, 0f);
animation.setDuration(mShortAnimationDuration); animation.setDuration(mShortAnimationDuration);
animation.setAnimationListener(new Animation.AnimationListener() { animation.setAnimationListener(new Animation.AnimationListener() {

View File

@ -36,8 +36,7 @@ import android.widget.LinearLayout;
import android.widget.TableLayout; import android.widget.TableLayout;
import android.widget.TableRow; import android.widget.TableRow;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Button;
import com.beardedhen.androidbootstrap.BootstrapButton;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
@ -59,7 +58,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
TextView mAlgorithm; TextView mAlgorithm;
TextView mKeyId; TextView mKeyId;
TextView mCreationDate; TextView mCreationDate;
BootstrapButton mExpiryDateButton; Button mExpiryDateButton;
Calendar mCreatedDate; Calendar mCreatedDate;
Calendar mExpiryDate; Calendar mExpiryDate;
Calendar mOriginalExpiryDate = null; Calendar mOriginalExpiryDate = null;
@ -123,7 +122,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
mAlgorithm = (TextView) findViewById(R.id.algorithm); mAlgorithm = (TextView) findViewById(R.id.algorithm);
mKeyId = (TextView) findViewById(R.id.keyId); mKeyId = (TextView) findViewById(R.id.keyId);
mCreationDate = (TextView) findViewById(R.id.creation); mCreationDate = (TextView) findViewById(R.id.creation);
mExpiryDateButton = (BootstrapButton) findViewById(R.id.expiry); mExpiryDateButton = (Button) findViewById(R.id.expiry);
mDeleteButton = (ImageButton) findViewById(R.id.delete); mDeleteButton = (ImageButton) findViewById(R.id.delete);
mDeleteButton.setOnClickListener(this); mDeleteButton.setOnClickListener(this);

View File

@ -22,17 +22,16 @@ import android.util.AttributeSet;
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.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.beardedhen.androidbootstrap.BootstrapButton;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
public class KeyServerEditor extends LinearLayout implements Editor, OnClickListener { public class KeyServerEditor extends LinearLayout implements Editor, OnClickListener {
private EditorListener mEditorListener = null; private EditorListener mEditorListener = null;
BootstrapButton mDeleteButton; ImageButton mDeleteButton;
TextView mServer; TextView mServer;
public KeyServerEditor(Context context) { public KeyServerEditor(Context context) {
@ -50,7 +49,7 @@ public class KeyServerEditor extends LinearLayout implements Editor, OnClickList
mServer = (TextView) findViewById(R.id.server); mServer = (TextView) findViewById(R.id.server);
mDeleteButton = (BootstrapButton) findViewById(R.id.delete); mDeleteButton = (ImageButton) findViewById(R.id.delete);
mDeleteButton.setOnClickListener(this); mDeleteButton.setOnClickListener(this);
super.onFinishInflate(); super.onFinishInflate();

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:id="@+id/result" android:id="@+id/result"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -83,16 +82,15 @@
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 <Button
android:id="@+id/lookup_key" android:id="@+id/lookup_key"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/btn_lookup_key" android:text="@string/btn_lookup_key"
bootstrapbutton:bb_icon_left="fa-download" android:drawableRight="@drawable/ic_action_download"
bootstrapbutton:bb_type="info"
bootstrapbutton:bb_size="small"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" /> android:layout_centerVertical="true"
android:background="@drawable/button_edgy"/>
</RelativeLayout> </RelativeLayout>

View File

@ -12,21 +12,21 @@
android:orientation="horizontal" android:orientation="horizontal"
android:clickable="true"> android:clickable="true">
<com.beardedhen.androidbootstrap.FontAwesomeText <ImageButton
android:id="@+id/foldableIcon" android:id="@+id/foldableIcon"
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_marginRight="10dp" android:layout_marginRight="10dp"
android:textSize="12sp" android:src="@drawable/ic_action_expand"
android:paddingTop="@dimen/padding_medium" android:background="@drawable/button_no_style"/>
android:paddingBottom="@dimen/padding_medium"
fontawesometext:fa_icon="fa-chevron-right"/>
<TextView <TextView
android:id="@+id/foldableText" android:id="@+id/foldableText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/none" android:text="@string/none"
android:layout_gravity="center_vertical"
android:paddingTop="@dimen/padding_medium" android:paddingTop="@dimen/padding_medium"
android:paddingBottom="@dimen/padding_medium" android:paddingBottom="@dimen/padding_medium"
android:textColor="@color/emphasis"/> android:textColor="@color/emphasis"/>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout 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="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -49,14 +48,15 @@
android:text="@string/key_list_empty_text2" android:text="@string/key_list_empty_text2"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<com.beardedhen.androidbootstrap.BootstrapButton <Button
android:id="@+id/key_list_empty_button_create" android:id="@+id/key_list_empty_button_create"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="4dp" android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_create" android:text="@string/key_list_empty_button_create"
bootstrapbutton:bb_icon_left="fa-plus" android:drawableLeft="@drawable/ic_action_new_account"
bootstrapbutton:bb_type="default" /> android:background="@drawable/button_edgy"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -66,14 +66,15 @@
android:text="@string/key_list_empty_text3" android:text="@string/key_list_empty_text3"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<com.beardedhen.androidbootstrap.BootstrapButton <Button
android:id="@+id/key_list_empty_button_import" android:id="@+id/key_list_empty_button_import"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="4dp" android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_import" android:text="@string/key_list_empty_button_import"
bootstrapbutton:bb_icon_left="fa-download" android:drawableLeft="@drawable/ic_action_download"
bootstrapbutton:bb_type="default" /> android:background="@drawable/button_edgy" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<org.sufficientlysecure.keychain.ui.widget.KeyServerEditor xmlns:android="http://schemas.android.com/apk/res/android" <org.sufficientlysecure.keychain.ui.widget.KeyServerEditor 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" >
@ -18,17 +17,15 @@
android:layout_weight="1" android:layout_weight="1"
android:inputType="textUri" /> android:inputType="textUri" />
<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="10dp"
android:layout_marginRight="3dip" android:layout_marginRight="3dip"
bootstrapbutton:bb_icon_left="fa-minus" android:background="@drawable/button_rounded_red"
bootstrapbutton:bb_roundedCorners="true" android:src="@drawable/minus" />
bootstrapbutton:bb_size="small"
bootstrapbutton:bb_type="danger" />
</LinearLayout> </LinearLayout>
<View <View

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" > android:orientation="vertical" >
@ -42,7 +41,7 @@
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout> </RelativeLayout>
<com.beardedhen.androidbootstrap.BootstrapButton <ImageButton
android:id="@+id/add" android:id="@+id/add"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -50,10 +49,8 @@
android:layout_margin="10dp" android:layout_margin="10dp"
android:layout_marginLeft="4dip" android:layout_marginLeft="4dip"
android:layout_marginRight="6dip" android:layout_marginRight="6dip"
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>
<View <View