add separate icon for unread only switchbox

This commit is contained in:
Andrew Dolgov 2015-06-04 14:31:11 +03:00
parent 42358f6f6d
commit e4afee1014
11 changed files with 10 additions and 2 deletions

View File

@ -64,6 +64,11 @@ public abstract class BaseFeedlistFragment extends Fragment {
TextView text = (TextView) footer.findViewById(R.id.title);
text.setText(R.string.unread_only);
ImageView icon = (ImageView) footer.findViewById(R.id.icon);
TypedValue tv = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.ic_filter_variant, tv, true);
icon.setImageResource(tv.resourceId);
final SwitchCompat rowSwitch = (SwitchCompat) footer.findViewById(R.id.row_switch);
rowSwitch.setChecked(activity.getUnreadOnly());
@ -88,8 +93,8 @@ public abstract class BaseFeedlistFragment extends Fragment {
text = (TextView) footer.findViewById(R.id.title);
text.setText(R.string.preferences);
ImageView icon = (ImageView) footer.findViewById(R.id.icon);
TypedValue tv = new TypedValue();
icon = (ImageView) footer.findViewById(R.id.icon);
tv = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.ic_settings, tv, true);
icon.setImageResource(tv.resourceId);

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

View File

@ -37,4 +37,5 @@
<attr name="ic_share" format="reference" />
<attr name="ic_keyboard_backspace" format="reference" />
<attr name="ic_settings" format="reference" />
<attr name="ic_filter_variant" format="reference" />
</resources>

View File

@ -45,6 +45,7 @@
<item name="ic_share">@drawable/ic_share_dark</item>
<item name="ic_keyboard_backspace">@drawable/ic_keyboard_backspace_dark</item>
<item name="ic_settings">@drawable/ic_settings_dark</item>
<item name="ic_filter_variant">@drawable/ic_filter_variant_dark</item>
</style>
<style name="DarkTheme" parent="Theme.AppCompat.NoActionBar">
@ -92,6 +93,7 @@
<item name="ic_share">@drawable/ic_share</item>
<item name="ic_keyboard_backspace">@drawable/ic_keyboard_backspace</item>
<item name="ic_settings">@drawable/ic_settings</item>
<item name="ic_filter_variant">@drawable/ic_filter_variant</item>
</style>
<style name="DarkDialogTheme" parent="android:Theme"></style>