mirror of
https://github.com/yuliskov/LeanKeyboard.git
synced 2026-05-19 13:56:07 -04:00
desc upd
This commit is contained in:
@@ -39,4 +39,6 @@
|
||||
<string name="about_donate">Помочь проекту</string>
|
||||
<string name="about_web_site">Веб-сайт</string>
|
||||
<string name="kbd_activation_error">Не получается открыть системные настройки клавиатуры.\nПеренаправление на сайт с инструкцией по ручной активации…</string>
|
||||
<string name="about_issue">Сообщить о проблеме</string>
|
||||
<string name="about_releases">Скачать новую версию</string>
|
||||
</resources>
|
||||
|
||||
@@ -50,4 +50,6 @@
|
||||
<string name="about_donate">Donate</string>
|
||||
<string name="about_web_site">Web Site</string>
|
||||
<string name="kbd_activation_error">Can\'t open system kbd settings.\nRedirecting to site with manual instructions…</string>
|
||||
<string name="about_issue">Submit an issue</string>
|
||||
<string name="about_releases">Get new version</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,7 +17,10 @@ import java.util.List;
|
||||
public class AboutFragment extends GuidedStepSupportFragment {
|
||||
private static final String MARKET_URL = "https://play.google.com/store/apps/details?id=org.liskovsoft.androidtv.rukeyboard";
|
||||
private static final String DONATE_URL = "https://www.donationalerts.com/r/firsthash";
|
||||
private static final String WEBSITE_URL = "https://github.com/yuliskov/LeankeyKeyboard";
|
||||
private static final String RELEASES_URL = "https://github.com/yuliskov/LeankeyKeyboard/releases";
|
||||
private static final String ISSUE_URL = "https://github.com/yuliskov/LeankeyKeyboard/issues";
|
||||
private static final String[] URL_MAPPING = {DONATE_URL, ISSUE_URL, RELEASES_URL, MARKET_URL};
|
||||
private int mId;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@@ -37,30 +40,27 @@ public class AboutFragment extends GuidedStepSupportFragment {
|
||||
@Override
|
||||
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
|
||||
appendInfoAction(getString(R.string.about_donate), actions);
|
||||
appendInfoAction(getString(R.string.about_web_site), actions);
|
||||
appendInfoAction(getString(R.string.about_issue), actions);
|
||||
appendInfoAction(getString(R.string.about_releases), actions);
|
||||
|
||||
String appName = AppInfoHelpers.getApplicationName(getActivity());
|
||||
String appVersion = AppInfoHelpers.getAppVersionName(getActivity());
|
||||
String flavorName = getString(R.string.flavor_name);
|
||||
appendInfoAction(appName + " (" + appVersion + " " + flavorName + ")", actions);
|
||||
appendInfoAction(String.format("%s (%s %s)", appName, appVersion, flavorName), actions);
|
||||
}
|
||||
|
||||
private void appendInfoAction(String textLine, List<GuidedAction> actions) {
|
||||
GuidedAction action = new GuidedAction.Builder(getActivity())
|
||||
.title(textLine)
|
||||
.id(mId++)
|
||||
.build();
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuidedActionClicked(GuidedAction action) {
|
||||
String link = MARKET_URL;
|
||||
|
||||
if (action.getTitle().equals(getString(R.string.about_donate))) {
|
||||
link = DONATE_URL;
|
||||
} else if (action.getTitle().equals(getString(R.string.about_web_site))) {
|
||||
link = WEBSITE_URL;
|
||||
}
|
||||
int idx = (int) action.getId();
|
||||
String link = URL_MAPPING.length > idx ? URL_MAPPING[idx] : MARKET_URL;
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AboutFragment extends GuidedStepSupportFragment {
|
||||
String appName = AppInfoHelpers.getApplicationName(getActivity());
|
||||
String appVersion = AppInfoHelpers.getAppVersionName(getActivity());
|
||||
String flavorName = getString(R.string.flavor_name);
|
||||
appendInfoAction(appName + " (" + appVersion + " " + flavorName + ")", actions);
|
||||
appendInfoAction(String.format("%s (%s %s)", appName, appVersion, flavorName), actions);
|
||||
}
|
||||
|
||||
private void appendInfoAction(String textLine, List<GuidedAction> actions) {
|
||||
|
||||
Reference in New Issue
Block a user