Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Add UI for BidiHack
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzky committed Oct 8, 2011
1 parent 713a9bd commit 6ba2105
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TransportDroidIL/res/values/strings.xml
Expand Up @@ -26,4 +26,6 @@
<string name="clear_completions">נקה השלמות אוטומטיות</string>
<string name="clear_completions_summary">סמן כדי לנקות כעת את הזכרון מהשלמות אוטומטיות למיקום ולזמן</string>
<string name="clear_completions_toast">ההשלמות האוטומטיות נוקו מהזכרון</string>
<string name="bidi_numbers_fix">תיקון היפוך מספרים</string>
<string name="bidi_numbers_fix_summary">שנה את הסימון בתיבה זו אם מספרים (קווים, שעות, תאריכים) מופיעים הפוך</string>
</resources>
3 changes: 2 additions & 1 deletion TransportDroidIL/res/xml/preferences.xml
Expand Up @@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<ListPreference android:key="provider" android:title="@string/provider_pref" android:entryValues="@array/provider_values" android:entries="@array/providers_names" android:defaultValue="mot"></ListPreference>
<CheckBoxPreference android:key="rtl_fix" android:summary="@string/rtl_fix_summary" android:title="@string/rtl_fix" android:defaultValue="false"></CheckBoxPreference>
<CheckBoxPreference android:title="@string/clear_completions" android:summary="@string/clear_completions_summary" android:defaultValue="false" android:key="clear_completions"></CheckBoxPreference>
<CheckBoxPreference android:key="bidi_numbers_fix" android:title="@string/bidi_numbers_fix" android:summary="@string/bidi_numbers_fix_summary" android:defaultValue="false"></CheckBoxPreference><CheckBoxPreference android:title="@string/clear_completions" android:summary="@string/clear_completions_summary" android:defaultValue="false" android:key="clear_completions"></CheckBoxPreference>


</PreferenceScreen>
Expand Up @@ -40,6 +40,8 @@ private void updateResultText(String result) {
}

private void runQuery(final BusGetter bg) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);

final Handler mHandler = new Handler();

QueryView queryView = (QueryView) findViewById(R.id.queryview);
Expand Down Expand Up @@ -82,6 +84,11 @@ public void run() {
try {
bg.runQuery(query);
lastResult = bg.getFilteredResult();
if (settings.getBoolean("bidi_numbers_fix", false)) {
BidiHack bh = new BidiHack();
lastResult = bh.reorder(lastResult);
}

mHandler.post(mUpdateResults);
} catch (Exception e) {
lastException = e;
Expand Down

0 comments on commit 6ba2105

Please sign in to comment.