From bd02a10fc36c06fda3b5bb2e31b91e77e62a010d Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 2 Apr 2014 08:06:51 -0700 Subject: [PATCH] beginnings of framework to allow localized strings to be read from downloaded modules: in xml replace string references with a custom attribute that's the same thing, then in overridden view subclasses pull the reference from the AttributeSet and look it up myself. Works to uppercase all strings in the NewGames dialog. --- .../android/XWords4/res/layout/new_game.xml | 88 ++++++++++--------- xwords4/android/XWords4/res/values/attrs.xml | 7 ++ .../eehouse/android/xw4/loc/LocButton.java | 34 +++++++ .../eehouse/android/xw4/loc/LocTextView.java | 34 +++++++ .../org/eehouse/android/xw4/loc/LocUtils.java | 52 +++++++++++ 5 files changed, 173 insertions(+), 42 deletions(-) create mode 100644 xwords4/android/XWords4/res/values/attrs.xml create mode 100644 xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocButton.java create mode 100644 xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocTextView.java create mode 100644 xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocUtils.java diff --git a/xwords4/android/XWords4/res/layout/new_game.xml b/xwords4/android/XWords4/res/layout/new_game.xml index a83f5efee..07d76fbac 100644 --- a/xwords4/android/XWords4/res/layout/new_game.xml +++ b/xwords4/android/XWords4/res/layout/new_game.xml @@ -15,20 +15,22 @@ --> + android:layout_width="fill_parent" + android:layout_height="fill_parent" + > - + -