mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-23 15:49:09 +00:00
Add descriptions of hidden features to the "About" section (#227)
- icons added in this section - translation in French done
This commit is contained in:
parent
c0597a46bc
commit
ecadcce08d
10 changed files with 162 additions and 6 deletions
|
@ -6,13 +6,22 @@
|
|||
|
||||
package org.dslul.openboard.inputmethod.latin.settings;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import org.dslul.openboard.inputmethod.latin.BuildConfig;
|
||||
import org.dslul.openboard.inputmethod.latin.R;
|
||||
|
||||
import org.dslul.openboard.inputmethod.latin.utils.SpannableStringUtils;
|
||||
|
||||
/**
|
||||
* "About" sub screen.
|
||||
*/
|
||||
|
@ -21,7 +30,36 @@ public final class AboutFragment extends SubScreenFragment {
|
|||
public void onCreate(final Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.prefs_screen_about);
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
// need to set icon tint because old android versions don't use the vector drawables
|
||||
for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
|
||||
final Preference p = getPreferenceScreen().getPreference(0);
|
||||
final Drawable icon = p.getIcon();
|
||||
if (icon != null)
|
||||
DrawableCompat.setTint(icon, Color.WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
Preference versionPreference = findPreference("pref_key_version");
|
||||
versionPreference.setSummary(BuildConfig.VERSION_NAME);
|
||||
|
||||
Preference hiddenFeaturesPreference = findPreference("hidden_features");
|
||||
hiddenFeaturesPreference.setOnPreferenceClickListener(preference -> {
|
||||
final String link = "<a href=\"https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()\">"
|
||||
+ getString(R.string.hidden_features_text) + "</a>";
|
||||
final String message = getContext().getString(R.string.hidden_features_message, link);
|
||||
final Spanned dialogMessage = SpannableStringUtils.fromHtml(message);
|
||||
|
||||
final AlertDialog builder = new AlertDialog.Builder(getContext())
|
||||
.setIcon(R.drawable.ic_settings_about_hidden_features)
|
||||
.setTitle(R.string.hidden_features_title)
|
||||
.setMessage(dialogMessage)
|
||||
.setPositiveButton(R.string.dialog_close, null)
|
||||
.create();
|
||||
builder.show();
|
||||
((TextView)builder.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
4
app/src/main/res/drawable/ic_settings_about_github.xml
Normal file
4
app/src/main/res/drawable/ic_settings_about_github.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/settings_screen_icon_inset"
|
||||
android:drawable="@drawable/ic_settings_about_github_foreground"/>
|
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
icon from icons8.com
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/foreground"
|
||||
android:pathData="M10.9,2.1c-4.6,0.5 -8.3,4.2 -8.8,8.7c-0.5,4.7 2.2,8.9 6.3,10.5C8.7,21.4 9,21.2 9,20.8v-1.6c0,0 -0.4,0.1 -0.9,0.1c-1.4,0 -2,-1.2 -2.1,-1.9c-0.1,-0.4 -0.3,-0.7 -0.6,-1C5.1,16.3 5,16.3 5,16.2C5,16 5.3,16 5.4,16c0.6,0 1.1,0.7 1.3,1c0.5,0.8 1.1,1 1.4,1c0.4,0 0.7,-0.1 0.9,-0.2c0.1,-0.7 0.4,-1.4 1,-1.8c-2.3,-0.5 -4,-1.8 -4,-4c0,-1.1 0.5,-2.2 1.2,-3C7.1,8.8 7,8.3 7,7.6C7,7.2 7,6.6 7.3,6c0,0 1.4,0 2.8,1.3C10.6,7.1 11.3,7 12,7s1.4,0.1 2,0.3C15.3,6 16.8,6 16.8,6C17,6.6 17,7.2 17,7.6c0,0.8 -0.1,1.2 -0.2,1.4c0.7,0.8 1.2,1.8 1.2,3c0,2.2 -1.7,3.5 -4,4c0.6,0.5 1,1.4 1,2.3v2.6c0,0.3 0.3,0.6 0.7,0.5c3.7,-1.5 6.3,-5.1 6.3,-9.3C22,6.1 16.9,1.4 10.9,2.1z"/>
|
||||
</vector>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/settings_screen_icon_inset"
|
||||
android:drawable="@drawable/ic_settings_about_hidden_features_foreground"/>
|
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
icon available in Android Studio
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="32dp"
|
||||
android:width="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/foreground"
|
||||
android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/>
|
||||
</vector>
|
4
app/src/main/res/drawable/ic_settings_about_license.xml
Normal file
4
app/src/main/res/drawable/ic_settings_about_license.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/settings_screen_icon_inset"
|
||||
android:drawable="@drawable/ic_settings_about_license_foreground"/>
|
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
icon from pictogrammers.com
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="32dp"
|
||||
android:width="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/foreground"
|
||||
android:pathData="M9 10A3.04 3.04 0 0 1 12 7A3.04 3.04 0 0 1 15 10A3.04 3.04 0 0 1 12 13A3.04 3.04 0 0 1 9 10M12 19L16 20V16.92A7.54 7.54 0 0 1 12 18A7.54 7.54 0 0 1 8 16.92V20M12 4A5.78 5.78 0 0 0 7.76 5.74A5.78 5.78 0 0 0 6 10A5.78 5.78 0 0 0 7.76 14.23A5.78 5.78 0 0 0 12 16A5.78 5.78 0 0 0 16.24 14.23A5.78 5.78 0 0 0 18 10A5.78 5.78 0 0 0 16.24 5.74A5.78 5.78 0 0 0 12 4M20 10A8.04 8.04 0 0 1 19.43 12.8A7.84 7.84 0 0 1 18 15.28V23L12 21L6 23V15.28A7.9 7.9 0 0 1 4 10A7.68 7.68 0 0 1 6.33 4.36A7.73 7.73 0 0 1 12 2A7.73 7.73 0 0 1 17.67 4.36A7.68 7.68 0 0 1 20 10Z"/>
|
||||
</vector>
|
|
@ -254,4 +254,27 @@ Nouveau dictionnaire:
|
|||
<string name="settings_screen_appearance">"Apparence"</string>
|
||||
<string name="dialog_close">Fermer</string>
|
||||
<string name="text_tap_languages">Appuyez sur la langue pour ouvrir les paramètres</string>
|
||||
<string name="hidden_features_title">Description des fonctionnalités cachées</string>
|
||||
<string name="hidden_features_summary">Montre les caractéristiques qui peuvent passer inaperçues</string>
|
||||
<string name="hidden_features_text">stockage protégé de l\'appareil</string>
|
||||
<string name="hidden_features_message">
|
||||
► Un appui long sur la touche presse-papiers (celle qui est optionnelle dans la bande de suggestions) permet de coller le contenu du presse-papiers. <br> <br>
|
||||
► Un appui long sur les touches de la barre d\'outils permet de les épingler à la bande de suggestions. <br> <br>
|
||||
► Appuyez longuement sur la virgule pour accéder à l\'affichage du presse-papiers, des emoji, au mode à une main, aux paramètres ou au changement de langue : <br>
|
||||
\t• l\'affichage des emojis et le changement de langue disparaîtront si les touches correspondantes sont affichées ; <br>
|
||||
\t• pour certaines dispositions, ce n\'est pas sur la touche virgule, mais sur la touche à la même position (par exemple, c\'est `q` pour la disposition Dvorak). <br> <br>
|
||||
► Appuyez sur l\'icône incognito pour ouvrir la barre d\'outils. <br> <br>
|
||||
► Saisie par balayage des touches : passez de la touche Maj à une autre touche pour taper une seule touche majuscule : <br>
|
||||
\t• fonctionne également pour la touche `?123` qui permet de taper un seul symbole à partir du clavier des symboles, ainsi que pour les touches associées. <br> <br>
|
||||
► Un appui long sur une suggestion dans la bande de suggestions permet d\'afficher d\'autres suggestions, et un bouton de suppression permet de supprimer cette suggestion. <br> <br>
|
||||
► Balayez vers le haut à partir d\'une suggestion pour ouvrir d\'autres suggestions, puis relâchez la pression sur la suggestion pour la sélectionner. <br> <br>
|
||||
► Vous pouvez ajouter des dictionnaires en les ouvrant dans un explorateur de fichiers : <br>
|
||||
\t• ne fonctionne qu\'avec <i>content-uris</i> et non avec <i>file-uris</i>, ce qui signifie qu\'il peut ne pas fonctionner avec certains explorateurs de fichiers. <br> <br>
|
||||
<i> Version Debug uniquement </i> <br>
|
||||
► Un appui-long sur une suggestion montre la source du dictionnaire.<br> <br>
|
||||
► Paramètres de débogage dans les préférences avancées, bien qu\'ils ne soient pas très utiles, sauf pour transférer les dictionnaires dans le journal de débogage. <br> <br>
|
||||
► Lorsque l\'application se bloque, un message vous demande où vous souhaitez enregistrer les journaux d\'incidents lorsque vous ouvrez les paramètres. <br> <br>
|
||||
► Pour les utilisateurs effectuant des sauvegardes manuelles avec un accès root : à partir d\'Android 7, le fichier de préférences partagées ne se trouve pas dans l\'emplacement par défaut, car l\'application utilise le %s. <br>
|
||||
Cela est nécessaire pour que les paramètres puissent être lus avant que l\'appareil ne soit déverrouillé, par exemple au démarrage. <br>
|
||||
Le fichier se trouve dans <i>/data/user_de/0/package_id/shared_prefs/</i>, mais cela peut dépendre de l\'appareil et de la version d\'Android.</string>
|
||||
</resources>
|
||||
|
|
|
@ -632,4 +632,31 @@ New dictionary:
|
|||
<string name="settings_screen_appearance_and_layouts">Appearance & Layouts</string>
|
||||
<!-- Settings screen title for appearance preferences [CHAR LIMIT=33] -->
|
||||
<string name="settings_screen_appearance">"Appearance"</string>
|
||||
<!-- Hidden features title -->
|
||||
<string name="hidden_features_title">Description of hidden features</string>
|
||||
<!-- Hidden features summary -->
|
||||
<string name="hidden_features_summary">Show features that may go unnoticed</string>
|
||||
<!-- Title of the link to the web page inserted into messages -->
|
||||
<string name="hidden_features_text">device protected storage</string>
|
||||
<!-- Hidden features text -->
|
||||
<string name="hidden_features_message">
|
||||
► Long pressing the clipboard key (the optional one in suggestion strip) pastes system clipboard contents. <br> <br>
|
||||
► Long pressing keys in the suggestion strip toolbar pins them to the suggestion strip. <br> <br>
|
||||
► Long-press comma to access clipboard view, emoji view, one-handed mode, settings, or switch language : <br>
|
||||
\t• emoji view and language switch will disappear if you have the corresponding key enabled; <br>
|
||||
\t• for some layouts it\'s not the comma-key, but the key at the same position (e.g. it\'s `q` for Dvorak layout). <br> <br>
|
||||
► Press the incognito icon to get the toolbar. <br> <br>
|
||||
► Sliding key input: swipe from shift to another key to type a single uppercase key: <br>
|
||||
\t• also works for the `?123` key to type a single symbol from the symbols keyboard, and for related keys. <br> <br>
|
||||
► Long-press a suggestion in suggestion strip to show more suggestions, and a delete button to remove this suggestion. <br> <br>
|
||||
► Swipe up from a suggestion to open more suggestions, and release on the suggestion to select it. <br> <br>
|
||||
► You can add dictionaries by opening them in a file explorer: <br>
|
||||
\t• only works with <i>content-uris</i> and not with <i>file-uris</i>, meaning that it may not work with some file explorers. <br> <br>
|
||||
<i>Debug APK only</i> <br>
|
||||
► Long-press a suggestion to show the source dictionary.<br> <br>
|
||||
► Debug settings in advanced preferences, though not very useful except for dumping dictionaries into the log. <br> <br>
|
||||
► When the app crashes, you will be asked whether you want crash logs when you open the settings. <br> <br>
|
||||
► For users doing manual backups with root access: starting at Android 7, the shared preferences file is not in the default location, because the app is using %s. <br>
|
||||
This is necessary so the settings can be read before the device is unlocked, e.g. at boot. <br>
|
||||
File is located in /data/user_de/0/package_id/shared_prefs/, though this may depend on the device and Android version.</string>
|
||||
</resources>
|
||||
|
|
|
@ -7,21 +7,38 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/settings_screen_about"
|
||||
android:key="@string/settings_screen_about">
|
||||
|
||||
<Preference
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:title="@string/english_ime_name"
|
||||
android:summary="@string/app_slogan"/>
|
||||
|
||||
<Preference
|
||||
android:title="@string/version"
|
||||
android:summary="@string/version_text"
|
||||
android:key="pref_key_version" />
|
||||
<Preference android:title="@string/license"
|
||||
android:summary="@string/gnu_gpl">
|
||||
android:key="pref_key_version"
|
||||
android:icon="@drawable/ic_settings_about"/>
|
||||
|
||||
<Preference
|
||||
android:title="@string/license"
|
||||
android:summary="@string/gnu_gpl"
|
||||
android:icon="@drawable/ic_settings_about_license">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:data="https://github.com/Helium314/openboard/blob/master/LICENSE" />
|
||||
</Preference>
|
||||
<Preference android:title="@string/about_github_link">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
|
||||
<Preference
|
||||
android:title="@string/hidden_features_title"
|
||||
android:summary="@string/hidden_features_summary"
|
||||
android:key="hidden_features"
|
||||
android:icon="@drawable/ic_settings_about_hidden_features">
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:title="@string/about_github_link"
|
||||
android:icon="@drawable/ic_settings_about_github">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="https://github.com/Helium314/openboard" />
|
||||
</Preference>
|
||||
</PreferenceScreen>
|
||||
|
|
Loading…
Add table
Reference in a new issue