Ok, I have a Preferences activity set with an XML layout. Here I have a couple of Preferences that open some dialogs. On these preferences I want to have an arrow on the right of them like in the screenshot. How I do this, is something related to the theme ? First screenshot is how I want to look, second is what I have now.
http://img545.imageshack.us/i/screenshot1zlk.png/
http://img405.imageshack.us/i/tsc3.png/
In your preference activity you can set whatever you want to appear in each preferences "widget_layout" (the area to right of the title/summary) like so:
Via XML:
<Preference
android:key="Settings_CustomBG"
android:title="@string/Custom_BG"
android:widgetLayout="@layout/ic_custom"
/>
OR programatically:
Preference BGColor = findPreference("Setting_BG_Color");
BGColor.setWidgetLayoutResource(R.layout.ic_custom);
Where ic_custom.xml (in /layout) is:
<?xml version="1.0" encoding="utf-8"?>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_custom"
/>
and ic_custom is just an image file in the resources folder(s). In my case this looks like the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With