From 567e5cc6a52277dce4f3e1214ff3b247ca26f68f Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Fri, 27 Jun 2014 21:03:19 +0200 Subject: [PATCH] Added unlock icon, fixed drawer items, switched to icons from resource in drawer --- .../keychain/ui/DrawerActivity.java | 26 ++++++++++-------- .../drawable-hdpi/ic_action_not_secure.png | Bin 0 -> 373 bytes .../drawable-mdpi/ic_action_not_secure.png | Bin 0 -> 321 bytes .../drawable-xhdpi/ic_action_not_secure.png | Bin 0 -> 483 bytes .../drawable-xxhdpi/ic_action_not_secure.png | Bin 0 -> 619 bytes .../src/main/res/layout/drawer_list_item.xml | 8 ++++-- 6 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_not_secure.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_not_secure.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_not_secure.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_not_secure.png diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java index 9a5050eba..586442bb0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java @@ -37,8 +37,7 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; - -import com.beardedhen.androidbootstrap.FontAwesomeText; +import android.widget.ImageView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -79,10 +78,10 @@ public class DrawerActivity extends ActionBarActivity { } NavItem mItemIconTexts[] = new NavItem[]{ - new NavItem("fa-user", getString(R.string.nav_keys)), - new NavItem("fa-lock", getString(R.string.nav_encrypt)), - new NavItem("fa-unlock", getString(R.string.nav_decrypt)), - new NavItem("fa-android", getString(R.string.nav_apps))}; + new NavItem(R.drawable.ic_action_person, getString(R.string.nav_keys)), + new NavItem(R.drawable.ic_action_secure, getString(R.string.nav_encrypt)), + new NavItem(R.drawable.ic_action_not_secure, getString(R.string.nav_decrypt)), + new NavItem(R.drawable.ic_action_view_as_list, getString(R.string.nav_apps))}; mDrawerList.setAdapter(new NavigationDrawerAdapter(this, R.layout.drawer_list_item, mItemIconTexts)); @@ -239,10 +238,15 @@ public class DrawerActivity extends ActionBarActivity { } private class NavItem { - public String icon; + public int icon; // res-id public String title; - public NavItem(String icon, String title) { + /** + * NavItem constructor + * @param icon The icons resource-id + * @param title The title of the menu entry + */ + public NavItem(int icon, String title) { super(); this.icon = icon; this.title = title; @@ -271,7 +275,7 @@ public class DrawerActivity extends ActionBarActivity { row = inflater.inflate(mLayoutResourceId, parent, false); holder = new NavItemHolder(); - holder.mImg = (FontAwesomeText) row.findViewById(R.id.drawer_item_icon); + holder.mImg = (ImageView) row.findViewById(R.id.drawer_item_icon); holder.mTxtTitle = (TextView) row.findViewById(R.id.drawer_item_text); row.setTag(holder); @@ -281,7 +285,7 @@ public class DrawerActivity extends ActionBarActivity { NavItem item = mData[position]; holder.mTxtTitle.setText(item.title); - holder.mImg.setIcon(item.icon); + holder.mImg.setImageResource(item.icon); return row; } @@ -289,7 +293,7 @@ public class DrawerActivity extends ActionBarActivity { } static class NavItemHolder { - FontAwesomeText mImg; + ImageView mImg; TextView mTxtTitle; } diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_not_secure.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_not_secure.png new file mode 100644 index 0000000000000000000000000000000000000000..5ee1480802a3dd9e8f033b3f7607f4658c0b989c GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@jN+ayjv*Dd-b}ORYjO~AJs7c(EjQORk#pOvTd$;Y*5<}C zuVakL))LB!(pkCjtDlid${};(nx5|}`Ys7=)ekHaB3lHUOg8xXzu5JTPdZThO4K{Q z!2A#y*FYO@Mi%kJ^Gh$3a?DhBxpb4`#E0-HmkT}ms%A{sz}q6e@V)87?uOS=ozf~r zb6@N8+B5{a{$Tj3b;$Fi?W+K*;}etju4LVIDxd%0;ZJ;;kDOHwf4gL`&7Aw}x0@Q} z_JN1Bl^#U|)o~T|WwK~h?LI9ex&4gcs)pdt%X6dMWzopr008TeI{*Lx literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_not_secure.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_action_not_secure.png new file mode 100644 index 0000000000000000000000000000000000000000..dd5289ee4557606f88d73183d1af2e37902da899 GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1Gk3C%+Ln>}1B}lL;%Nk5teeuSP2r-XBr=9oD&$InKLywOk zDu-dop@s+v-&eW<>zS;cFljzBoSd;!b%GablAg{b1;b!X&6V5F&$q94DrINTWsjV| zeq>F+!p9DKSUb)$e3Vz1*4nk2QMORxMaTUkGfq1>F+?c+tl>6TVXk~KmcdFugw-y< zRAFm%r{R=N7WNZL8#hYs6K{`NWyvt_MZ>=TZF-$*YChcT7g&0%8eYUO^gO#Rg6WcrI}5HbF6NUcJ+Ok=V^vQd<40evw-wg6eoM0cU~p()WZ2ekx^8m0 RStHQ944$rjF6*2UngCnqbZY@Q+uD}ZWd?Zl3Z6_V-78YJ=6Crk_<2NEnj+fp8C$1ZQt&Ft9`fb?bc&JTN&PH zve(KRcuq22sTTE0B3wBE4JvZprjw2CZphYC6%~AMt>_?RKlRl$<-+M5$1f;9 z(kS>;Hsii!+iw1{RWWXXQ>Lf>w6tQ}I?w*Sz_DXH1UU1R9$Fu%lw+4+xL*I|k5|{+ z$5a2=O%%#rzux#_#OaGM%wN3zKe&3atgU_Dnns*KMK#Z!DV%4nI#< KKbLh*2~7a3m%{M? literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_not_secure.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_not_secure.png new file mode 100644 index 0000000000000000000000000000000000000000..4aa9dc85cc4ae1480573204cb416922d326f5b75 GIT binary patch literal 619 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGok|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n0P&1978H@y_v0>f5<_i;k21?&hir*T$NU}-8oZt(4ELi@ZUYhAwIKb_s#e8i~lu_)83xnCMx;uq!K$kG3(Yq&ku?ewG0aP2>? zN*Xt(3K<9sX0y!j|2KKwAFV(kJHZLIKbu39L^po+@rwC$Rxl3RAu6{*8U9F;ewQtrN81nEq4EUr*d-O z+Nte0fu=&b+Qw+ R3r~TBJzf1=);T3K0RXmi^tk{4 literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/layout/drawer_list_item.xml b/OpenKeychain/src/main/res/layout/drawer_list_item.xml index 158e72c01..4719483da 100644 --- a/OpenKeychain/src/main/res/layout/drawer_list_item.xml +++ b/OpenKeychain/src/main/res/layout/drawer_list_item.xml @@ -4,9 +4,10 @@ android:layout_height="wrap_content"> + android:layout_alignParentTop="true" + android:layout_toRightOf="@id/drawer_item_icon"/>