mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-16 09:02:45 +02:00
DroidFish: Use EditText instead of TextView to display the move list.
About twice as fast for games with lots of comments on an HTC One M9.
This commit is contained in:
parent
929f77ced2
commit
58e10bbc79
DroidFish
res
src/org/petero/droidfish
@ -99,11 +99,14 @@
|
|||||||
android:layout_above="@+id/scrollViewBot"
|
android:layout_above="@+id/scrollViewBot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/moveList"
|
android:id="@+id/moveList"
|
||||||
|
android:tag="moveList"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:includeFontPadding="true"
|
android:includeFontPadding="true"
|
||||||
|
android:editable="false"
|
||||||
|
android:padding="0dp"
|
||||||
android:fontFamily="monospace"
|
android:fontFamily="monospace"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:textSize="12sp"/>
|
android:textSize="12sp"/>
|
||||||
|
@ -93,11 +93,14 @@
|
|||||||
android:layout_above="@+id/scrollViewBot"
|
android:layout_above="@+id/scrollViewBot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/moveList"
|
android:id="@+id/moveList"
|
||||||
|
android:tag="moveList"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:includeFontPadding="true"
|
android:includeFontPadding="true"
|
||||||
|
android:editable="false"
|
||||||
|
android:padding="0dp"
|
||||||
android:fontFamily="monospace"
|
android:fontFamily="monospace"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:textSize="12sp"/>
|
android:textSize="12sp"/>
|
||||||
|
@ -94,11 +94,14 @@
|
|||||||
android:layout_above="@+id/scrollViewBot"
|
android:layout_above="@+id/scrollViewBot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/moveList"
|
android:id="@+id/moveList"
|
||||||
|
android:tag="moveList"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:includeFontPadding="true"
|
android:includeFontPadding="true"
|
||||||
|
android:editable="false"
|
||||||
|
android:padding="0dp"
|
||||||
android:fontFamily="monospace"
|
android:fontFamily="monospace"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:textSize="12sp"/>
|
android:textSize="12sp"/>
|
||||||
|
@ -139,6 +139,7 @@ import android.widget.ImageView.ScaleType;
|
|||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.TextView.BufferType;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@ -1716,7 +1717,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void moveListUpdated() {
|
public void moveListUpdated() {
|
||||||
moveList.setText(gameTextListener.getSpannableData());
|
moveList.setText(gameTextListener.getSpannableData(), BufferType.SPANNABLE);
|
||||||
Layout layout = moveList.getLayout();
|
Layout layout = moveList.getLayout();
|
||||||
if (layout != null) {
|
if (layout != null) {
|
||||||
int currPos = gameTextListener.getCurrPos();
|
int currPos = gameTextListener.getCurrPos();
|
||||||
|
@ -119,12 +119,13 @@ public final class Util {
|
|||||||
if (v == null)
|
if (v == null)
|
||||||
return;
|
return;
|
||||||
final int bg = ColorTheme.instance().getColor(ColorTheme.GENERAL_BACKGROUND);
|
final int bg = ColorTheme.instance().getColor(ColorTheme.GENERAL_BACKGROUND);
|
||||||
|
Object tag = v.getTag();
|
||||||
final boolean excludedItems = v instanceof Button ||
|
final boolean excludedItems = v instanceof Button ||
|
||||||
v instanceof EditText ||
|
((v instanceof EditText) && !"moveList".equals(tag)) ||
|
||||||
v instanceof ImageButton ||
|
v instanceof ImageButton ||
|
||||||
"title".equals(v.getTag());
|
"title".equals(tag);
|
||||||
if (!excludedItems) {
|
if (!excludedItems) {
|
||||||
if ("drawer".equals(v.getTag()))
|
if ("drawer".equals(tag))
|
||||||
return;
|
return;
|
||||||
v.setBackgroundColor(bg);
|
v.setBackgroundColor(bg);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user