DroidFish: Use different background color for move list and thinking

output.
This commit is contained in:
Peter Osterlund 2016-01-01 18:21:42 +01:00
parent 8420e628e1
commit 613e068aee
4 changed files with 12 additions and 1 deletions

View File

@ -100,6 +100,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/thinking"
android:tag="thinking"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:includeFontPadding="true"

View File

@ -94,6 +94,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/thinking"
android:tag="thinking"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:includeFontPadding="true"

View File

@ -95,6 +95,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/thinking"
android:tag="thinking"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:includeFontPadding="true"

View File

@ -13,6 +13,7 @@ import org.petero.droidfish.gamelogic.Position;
import android.app.Activity;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
@ -127,7 +128,14 @@ public final class Util {
if (!excludedItems) {
if ("drawer".equals(tag))
return;
v.setBackgroundColor(bg);
int c = bg;
if ("thinking".equals(tag)) {
float[] hsv = new float[3];
Color.colorToHSV(c, hsv);
hsv[2] += hsv[2] > 0.5f ? -0.1f : 0.1f;
c = Color.HSVToColor(Color.alpha(c), hsv);
}
v.setBackgroundColor(c);
}
if (v instanceof ListView)
((ListView) v).setCacheColorHint(bg);