Created
October 29, 2015 08:20
-
-
Save ckurtm/8e185ad9b4df9c0f98d1 to your computer and use it in GitHub Desktop.
Dynamically change color of a drawable using TintDrawables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
tools:context="com.peirra.notification.InfoScreen"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:id="@+id/container" | |
android:gravity="center" | |
android:layout_gravity="center"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/image1" | |
android:src="@drawable/ic_android" /> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/image2" | |
android:src="@drawable/ic_android" /> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/image3" | |
android:src="@drawable/ic_android" /> | |
</LinearLayout> | |
<Button | |
style="?android:attr/buttonStyleSmall" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Change Color" | |
android:id="@+id/button" | |
android:layout_below="@+id/container" | |
android:layout_centerHorizontal="true" | |
android:layout_marginTop="44dp" /> | |
</RelativeLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
�PNG | |