Fixed the help url (#172)
* Fixed the help URL. It now opens the user manual for the current app version, not for the latest * updated documentation
This commit is contained in:
parent
f44cbae530
commit
b470f5e939
3 changed files with 41 additions and 6 deletions
|
|
@ -19,7 +19,7 @@ or get the APK from the [Releases Section](https://github.com/sspanak/tt9/releas
|
||||||
_If you own a phone with Android 2.2 up to 4.4, please refer to the original version of Traditional T9 from 2016._
|
_If you own a phone with Android 2.2 up to 4.4, please refer to the original version of Traditional T9 from 2016._
|
||||||
|
|
||||||
## How to use Traditional T9?
|
## How to use Traditional T9?
|
||||||
Before using Traditional T9 for the first time you would need to load a dictionary and configure it. After that, you could start typing right away in one of the three modes: Predictive, ABC or Numeric. And even if you have mastered the keypad back in the days, you would still find the Predictive mode now provides powerful and smart new ways of typing with even less key presses.
|
Before using Traditional T9 for the first time you would need to load a dictionary and configure it. After that, you could start typing right away in one of the three modes: Predictive, ABC or Numeric (123). And even if you have mastered the keypad back in the days, you would still find the Predictive mode now provides powerful and smart new ways of typing with even less key presses.
|
||||||
|
|
||||||
So make sure to read the initial setup and the hotkey tips in the [user manual](docs/user-manual.md).
|
So make sure to read the initial setup and the hotkey tips in the [user manual](docs/user-manual.md).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ Once a dictionary is loaded, it will stay there until you use the Clear option.
|
||||||
|
|
||||||
It also means that if you need to start using language X, you can safely disable all other languages, load only dictionary X (and save time!), then re-enable all languages you used before.
|
It also means that if you need to start using language X, you can safely disable all other languages, load only dictionary X (and save time!), then re-enable all languages you used before.
|
||||||
|
|
||||||
|
Have in mind reloading a dictionary will reset the suggestion popularity to the factory defaults _(your custom added words will not be affected)_. However, there should be nothing to worry about. For the most part, you will see little to no difference in the suggestion order, unless you oftenly use uncommon words.
|
||||||
|
|
||||||
## Hotkeys
|
## Hotkeys
|
||||||
|
|
||||||
#### D-pad Up (↑):
|
#### D-pad Up (↑):
|
||||||
|
|
@ -71,12 +73,11 @@ Add a new word to the dictionary for the current language.
|
||||||
#### Backspace Key (Default: Press ↩ / Back):
|
#### Backspace Key (Default: Press ↩ / Back):
|
||||||
Just deletes text.
|
Just deletes text.
|
||||||
|
|
||||||
**Note:** The default "Back" key plays a somewhat special role in Android. This role needs to be preserved for your phone to remain usable. Have in mind the notes below:
|
_**NB:** Using "Back" as backspace does not work in all applications, most notably Firefox and Spotify. They are able to take full control of the key and redefine its function, meaning it will do whatever the app authors intended. Unfortunately, nothing can be done, because "Back" plays a special role in Android and its usage is restricted by the system._
|
||||||
- **Short Press when there is no text**: Go back to the previous screen (the system default action).
|
|
||||||
- **Short Press when there is text:** Some applications, most notably Firefox and Spotify, take full control of the "Back" key. This means, it may function as the application authors intended, instead of as backspace. In such cases, you could use the on-screen backspace instead. Unfortunately, nothing else could be done, because this is a restriction posed by Android.
|
|
||||||
- **Long Press**: Whatever the system default action is (i.e. show running applications list).
|
|
||||||
|
|
||||||
All this does not apply, when using other keys. They will just delete text.
|
_**NB 2:** Holding "Back" key will always trigger the default system action (i.e. show running applications list)._
|
||||||
|
|
||||||
|
_In these cases, you could assign another key (all other keys are fully usable), or use the on-screen backspace._
|
||||||
|
|
||||||
#### Next Input Mode Key (Default: Press #):
|
#### Next Input Mode Key (Default: Press #):
|
||||||
- **Press when there are no suggestions:** Cycle the input modes (abc → ABC → Predictive → 123). Note that only 123 mode is available in numeric fields and Predictive mode is not available in password fields.
|
- **Press when there are no suggestions:** Cycle the input modes (abc → ABC → Predictive → 123). Note that only 123 mode is available in numeric fields and Predictive mode is not available in password fields.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
package io.github.sspanak.tt9.preferences.screens;
|
package io.github.sspanak.tt9.preferences.screens;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import io.github.sspanak.tt9.BuildConfig;
|
import io.github.sspanak.tt9.BuildConfig;
|
||||||
|
import io.github.sspanak.tt9.Logger;
|
||||||
import io.github.sspanak.tt9.R;
|
import io.github.sspanak.tt9.R;
|
||||||
import io.github.sspanak.tt9.preferences.items.ItemLoadDictionary;
|
import io.github.sspanak.tt9.preferences.items.ItemLoadDictionary;
|
||||||
import io.github.sspanak.tt9.preferences.items.ItemSelectLanguage;
|
import io.github.sspanak.tt9.preferences.items.ItemSelectLanguage;
|
||||||
|
|
@ -12,6 +18,8 @@ import io.github.sspanak.tt9.preferences.items.ItemTruncateDictionary;
|
||||||
import io.github.sspanak.tt9.preferences.PreferencesActivity;
|
import io.github.sspanak.tt9.preferences.PreferencesActivity;
|
||||||
|
|
||||||
public class MainSettingsScreen extends BaseScreenFragment {
|
public class MainSettingsScreen extends BaseScreenFragment {
|
||||||
|
private final Pattern releaseVersionRegex = Pattern.compile("^\\d+\\.\\d+$");
|
||||||
|
|
||||||
public MainSettingsScreen() {
|
public MainSettingsScreen() {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
@ -32,11 +40,13 @@ public class MainSettingsScreen extends BaseScreenFragment {
|
||||||
return R.xml.prefs;
|
return R.xml.prefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
createAboutSection();
|
createAboutSection();
|
||||||
createAppearanceSection();
|
createAppearanceSection();
|
||||||
createDictionarySection();
|
createDictionarySection();
|
||||||
|
createHelpSection();
|
||||||
createPredictiveModeSection();
|
createPredictiveModeSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,6 +87,30 @@ public class MainSettingsScreen extends BaseScreenFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void createHelpSection() {
|
||||||
|
try {
|
||||||
|
if (!releaseVersionRegex.matcher(BuildConfig.VERSION_NAME).find()) {
|
||||||
|
throw new Exception("VERSION_NAME does not match: \\d+.\\d+");
|
||||||
|
}
|
||||||
|
|
||||||
|
Preference helpSection = findPreference("help");
|
||||||
|
if (helpSection == null) {
|
||||||
|
throw new Exception("Could not find Help Preference");
|
||||||
|
}
|
||||||
|
|
||||||
|
String majorVersion = BuildConfig.VERSION_NAME.substring(0, BuildConfig.VERSION_NAME.indexOf('.'));
|
||||||
|
String versionedHelpUrl = getString(R.string.help_url).replace("blob/master", "blob/v" + majorVersion + ".0");
|
||||||
|
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction("android.intent.action.VIEW");
|
||||||
|
intent.setData(Uri.parse(versionedHelpUrl));
|
||||||
|
helpSection.setIntent(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.w("tt9/MainSettingsScreen", "Could not set versioned help URL. Falling back to the default. " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createAboutSection() {
|
private void createAboutSection() {
|
||||||
Preference vi = findPreference("version_info");
|
Preference vi = findPreference("version_info");
|
||||||
if (vi != null) {
|
if (vi != null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue