summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/controls_preview.xml27
-rw-r--r--src/org/cyanogenmod/themes/provider/util/LayoutRenderUtils.java12
2 files changed, 28 insertions, 11 deletions
diff --git a/res/layout/controls_preview.xml b/res/layout/controls_preview.xml
index e85b53c..7b35b17 100644
--- a/res/layout/controls_preview.xml
+++ b/res/layout/controls_preview.xml
@@ -44,15 +44,16 @@
<Button
android:layout_width="96dp"
- android:layout_height="30dp"
+ android:layout_height="42dp"
android:layout_marginEnd="72dp"
- android:textSize="10dp"
+ android:textSize="8dp"
android:text="@string/controls_preview_button_text" />
<Switch
android:layout_width="96dp"
android:layout_height="24dp"
- android:checked="true"/>
+ android:checked="true"
+ android:tint="?*android:attr/colorControlActivated" />
</LinearLayout>
@@ -70,35 +71,39 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content">
- <ImageView
+ <CheckBox
android:layout_width="32dp"
android:layout_height="32dp"
+ android:checked="false"
android:layout_gravity="bottom"
- android:src="@*android:drawable/ic_checkbox_checked" />
+ android:tint="?*android:attr/colorControlNormal" />
- <ImageView
+ <CheckBox
android:layout_width="32dp"
android:layout_height="32dp"
+ android:checked="true"
android:layout_gravity="bottom"
android:layout_marginEnd="44dp"
- android:src="@*android:drawable/ic_checkbox_checked" />
+ android:tint="?*android:attr/colorControlActivated" />
<ProgressBar
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="44dp" />
- <ImageView
+ <RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:checked="false"
android:layout_gravity="bottom"
- android:src="@*android:drawable/btn_radio_to_on_mtrl_000" />
+ android:tint="?*android:attr/colorControlNormal" />
- <ImageView
+ <RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:src="@*android:drawable/btn_radio_to_on_mtrl_015" />
+ android:checked="true"
+ android:tint="?*android:attr/colorControlActivated" />
</LinearLayout>
diff --git a/src/org/cyanogenmod/themes/provider/util/LayoutRenderUtils.java b/src/org/cyanogenmod/themes/provider/util/LayoutRenderUtils.java
index c174d8e..5ccd196 100644
--- a/src/org/cyanogenmod/themes/provider/util/LayoutRenderUtils.java
+++ b/src/org/cyanogenmod/themes/provider/util/LayoutRenderUtils.java
@@ -18,6 +18,7 @@ package org.cyanogenmod.themes.provider.util;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.FrameLayout;
public class LayoutRenderUtils {
@@ -35,6 +36,17 @@ public class LayoutRenderUtils {
// Assign a size and position to the view and all of its descendants
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
+ // Make sure views with stateful drawables are in their correct state
+ if (view instanceof ViewGroup) {
+ final ViewGroup vg = (ViewGroup) view;
+ final int N = vg.getChildCount();
+ for (int i = 0; i < N; i++) {
+ vg.getChildAt(i).jumpDrawablesToCurrentState();
+ }
+ } else {
+ view.jumpDrawablesToCurrentState();
+ }
+
// Create the bitmap
Bitmap bitmap = Bitmap.createBitmap(view.getMeasuredWidth(),
view.getMeasuredHeight(),