mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 14:15:16 +01: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
|
@ -99,11 +99,14 @@
|
|||
android:layout_above="@+id/scrollViewBot"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/moveList"
|
||||
android:tag="moveList"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="true"
|
||||
android:editable="false"
|
||||
android:padding="0dp"
|
||||
android:fontFamily="monospace"
|
||||
android:typeface="monospace"
|
||||
android:textSize="12sp"/>
|
||||
|
|
|
@ -93,11 +93,14 @@
|
|||
android:layout_above="@+id/scrollViewBot"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/moveList"
|
||||
android:tag="moveList"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="true"
|
||||
android:editable="false"
|
||||
android:padding="0dp"
|
||||
android:fontFamily="monospace"
|
||||
android:typeface="monospace"
|
||||
android:textSize="12sp"/>
|
||||
|
|
|
@ -94,11 +94,14 @@
|
|||
android:layout_above="@+id/scrollViewBot"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/moveList"
|
||||
android:tag="moveList"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="true"
|
||||
android:editable="false"
|
||||
android:padding="0dp"
|
||||
android:fontFamily="monospace"
|
||||
android:typeface="monospace"
|
||||
android:textSize="12sp"/>
|
||||
|
|
|
@ -139,6 +139,7 @@ import android.widget.ImageView.ScaleType;
|
|||
import android.widget.ListView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.BufferType;
|
||||
import android.widget.Toast;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
|
@ -1716,7 +1717,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
|
||||
@Override
|
||||
public void moveListUpdated() {
|
||||
moveList.setText(gameTextListener.getSpannableData());
|
||||
moveList.setText(gameTextListener.getSpannableData(), BufferType.SPANNABLE);
|
||||
Layout layout = moveList.getLayout();
|
||||
if (layout != null) {
|
||||
int currPos = gameTextListener.getCurrPos();
|
||||
|
|
|
@ -119,12 +119,13 @@ public final class Util {
|
|||
if (v == null)
|
||||
return;
|
||||
final int bg = ColorTheme.instance().getColor(ColorTheme.GENERAL_BACKGROUND);
|
||||
Object tag = v.getTag();
|
||||
final boolean excludedItems = v instanceof Button ||
|
||||
v instanceof EditText ||
|
||||
((v instanceof EditText) && !"moveList".equals(tag)) ||
|
||||
v instanceof ImageButton ||
|
||||
"title".equals(v.getTag());
|
||||
"title".equals(tag);
|
||||
if (!excludedItems) {
|
||||
if ("drawer".equals(v.getTag()))
|
||||
if ("drawer".equals(tag))
|
||||
return;
|
||||
v.setBackgroundColor(bg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user