From c1b41d9de8559240fa6c0b8f6cae8b4266830270 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 18 May 2013 13:19:16 +0400 Subject: [PATCH] add holo triangle back --- .../ic_mailbox_collapsed_holo_dark.png | Bin 0 -> 274 bytes .../ic_mailbox_collapsed_holo_light.png | Bin 0 -> 350 bytes res/layout/headlines_row.xml | 9 +++++++++ res/layout/headlines_row_selected.xml | 10 ++++++++++ res/layout/headlines_row_selected_unread.xml | 9 +++++++++ res/layout/headlines_row_unread.xml | 12 +++++++++++- src/org/fox/ttrss/CommonActivity.java | 7 +++++++ src/org/fox/ttrss/HeadlinesFragment.java | 9 ++++++--- .../ttrss/offline/OfflineHeadlinesFragment.java | 11 +++++++---- 9 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 res/drawable-hdpi/ic_mailbox_collapsed_holo_dark.png create mode 100644 res/drawable-hdpi/ic_mailbox_collapsed_holo_light.png diff --git a/res/drawable-hdpi/ic_mailbox_collapsed_holo_dark.png b/res/drawable-hdpi/ic_mailbox_collapsed_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..eb1a7bd8c4b37b17937b82c949c5c56ff8f2f382 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!pj3%#L`iUdT1k0gQ7S_~VrE{6o}X)oLYc9i zsh**M!Iz?iKvj*NE{-7<{%bEg@--;%xCDOjl8LM8$@BPPVs**Q++m^5r|?JIdOVA} z4YOv8%=kIs__n_STeK$ySv~crH+^!`)g`iTYq)cPu!7o&rV>T%OD%2_v`o4bD!<<5 zX?pT?QzQ%LL+1-ZEV_b0QdMtbAv%36$bn}k6X5c=?+eU`7535<70y>7l M)78&qol`;+0J@x9N&o-= literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_mailbox_collapsed_holo_light.png b/res/drawable-hdpi/ic_mailbox_collapsed_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..2c395b800c887cbb2d7399f95ee2530754bcc40a GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah2>S z4={E+nQaFWEGuwK2hw1@49XUHUO-Nor;B5V#`)H>hJ1${1eg!p6t#aOeckoR|NRb& z9%u+DI^0>OEv{^>Q`CCEWRpTm=8a7XFEel0E>blA{&=gRQq`x;U*^{=6#eOt{Yg*M zGTXOfo`9`l^&!`eSu)A1TSs4+9F=JSWhQv!Nl!A8&ykOBT7;dOH!?pi&B9U zgOP!up{{|Yu7P2Qp`n$bxs`#5t^trVI9On^4@E<6eoAIqCAtPvD`PW=hP5ZWz5+E! vf@}!RPb(=;EJ|f?Ovz75Rq)JBOiv9;O-!jQJeg_(RK(!v>gTe~DWM4f(w1$T literal 0 HcmV?d00001 diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index 94d5f856..d339e281 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -120,6 +120,15 @@ android:clickable="true" android:src="@drawable/ic_rss_bw" /> + \ No newline at end of file diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml index e1788ad5..be2239d9 100644 --- a/res/layout/headlines_row_selected.xml +++ b/res/layout/headlines_row_selected.xml @@ -120,6 +120,16 @@ android:layout_weight="0" android:clickable="true" android:src="@drawable/ic_rss_bw" /> + + diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml index a91d5407..0367199e 100644 --- a/res/layout/headlines_row_selected_unread.xml +++ b/res/layout/headlines_row_selected_unread.xml @@ -121,6 +121,15 @@ android:clickable="true" android:src="@drawable/ic_rss_bw" /> + \ No newline at end of file diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index df794891..a4cbae11 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -119,9 +119,19 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" - android:clickable="true" + android:clickable="true" android:src="@drawable/ic_rss_bw" /> + + \ No newline at end of file diff --git a/src/org/fox/ttrss/CommonActivity.java b/src/org/fox/ttrss/CommonActivity.java index e1cacb02..78d1937c 100644 --- a/src/org/fox/ttrss/CommonActivity.java +++ b/src/org/fox/ttrss/CommonActivity.java @@ -166,6 +166,13 @@ public class CommonActivity extends SherlockFragmentActivity { toast.show(); } + public boolean isDarkTheme() { + String defaultTheme = "THEME_DARK"; + + return (m_prefs.getString("theme", defaultTheme).equals("THEME_DARK")) || + m_prefs.getString("theme", defaultTheme).equals("THEME_DARK_GRAY"); + } + protected void setAppTheme(SharedPreferences prefs) { String defaultTheme = "THEME_DARK"; diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index f9cc51d8..0c5b09ec 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -41,6 +41,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.CheckBox; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -721,17 +722,19 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, }); } - /* ImageButton ib = (ImageButton) v.findViewById(R.id.article_menu_button); + ImageButton ib = (ImageButton) v.findViewById(R.id.article_menu_button); if (ib != null) { - ib.setVisibility(android.os.Build.VERSION.SDK_INT >= 10 ? View.VISIBLE : View.GONE); + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + ib.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { getActivity().openContextMenu(v); } }); - } */ + } return v; } diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index e7e848d2..85588195 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -38,6 +38,7 @@ import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.CheckBox; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -576,18 +577,20 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis }); } - /* ImageButton ib = (ImageButton) v.findViewById(R.id.article_menu_button); + ImageButton ib = (ImageButton) v.findViewById(R.id.article_menu_button); if (ib != null) { - ib.setVisibility(android.os.Build.VERSION.SDK_INT >= 10 ? View.VISIBLE : View.GONE); + if (m_activity.isDarkTheme()) + ib.setImageResource(R.drawable.ic_mailbox_collapsed_holo_dark); + ib.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { getActivity().openContextMenu(v); } }); - } */ - + } + return v; }