abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/dictionary_status_not_enabled.xml2
-rw-r--r--res/values/strings.xml1
-rw-r--r--srcs/juloo.keyboard2/dict/DictionaryListView.java3
3 files changed, 6 insertions, 0 deletions
diff --git a/res/layout/dictionary_status_not_enabled.xml b/res/layout/dictionary_status_not_enabled.xml
new file mode 100644
index 0000000..7c9984d
--- /dev/null
+++ b/res/layout/dictionary_status_not_enabled.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android" style="@style/paragraph" android:paddingHorizontal="24dp" android:gravity="center" android:text="@string/dictionaries_activity_not_enabled"/>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7cc8d1d..5eb4e85 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -160,6 +160,7 @@
<string name="dictionaries_from_internet">Download a dictionary from the Internet</string>
<string name="dictionaries_download_success">Dictionary installed</string>
<string name="dictionaries_download_failed">Download failed</string>
+ <string name="dictionaries_activity_not_enabled">You must first enable the keyboard to download dictionaries.</string>
<string name="candidates_status_no_dict">No dictionary installed</string>
<string name="candidates_status_install">Install</string>
</resources>
diff --git a/srcs/juloo.keyboard2/dict/DictionaryListView.java b/srcs/juloo.keyboard2/dict/DictionaryListView.java
index 465d373..345a800 100644
--- a/srcs/juloo.keyboard2/dict/DictionaryListView.java
+++ b/srcs/juloo.keyboard2/dict/DictionaryListView.java
@@ -54,6 +54,9 @@ public class DictionaryListView extends LinearLayout
}
}
refresh();
+ // The keyboard is not enabled and the list is empty, show a message.
+ if (locales.installed.size() == 0)
+ addView(View.inflate(ctx, R.layout.dictionary_status_not_enabled, null));
}
/** Update the "installed" status of item views. Meaning whether the