mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-01-30 09:03:50 +01:00
DroidFish: Use different background color for move list and thinking
output.
This commit is contained in:
parent
8420e628e1
commit
613e068aee
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user