mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-24 00:26:22 +00:00
Added "About" page on 'Settings' (#6)
* Added "About" page on 'Settings' * configure @string/app_slogan * auto retrieve version * Update links in about screen --------- Co-authored-by: Helium314 <helium314@mailbox.org>
This commit is contained in:
parent
38dfcc407b
commit
3f3a2c4230
12 changed files with 108 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dslul.openboard.inputmethod.latin.settings;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
|
||||
import org.dslul.openboard.inputmethod.latin.BuildConfig;
|
||||
import org.dslul.openboard.inputmethod.latin.R;
|
||||
|
||||
/**
|
||||
* "About" sub screen.
|
||||
*/
|
||||
public final class AboutFragment extends SubScreenFragment {
|
||||
@Override
|
||||
public void onCreate(final Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.prefs_screen_about);
|
||||
Preference versionPreference = findPreference("pref_key_version");
|
||||
versionPreference.setSummary(BuildConfig.VERSION_NAME);
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ import org.dslul.openboard.inputmethod.latin.settings.DebugSettingsFragment;
|
|||
import org.dslul.openboard.inputmethod.latin.settings.GestureSettingsFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.settings.PreferencesSettingsFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.settings.SettingsFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.settings.AboutFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.spellcheck.SpellCheckerSettingsFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.userdictionary.UserDictionaryAddWordFragment;
|
||||
import org.dslul.openboard.inputmethod.latin.userdictionary.UserDictionaryList;
|
||||
|
@ -43,6 +44,7 @@ public class FragmentUtils {
|
|||
sLatinImeFragments.add(AdvancedSettingsFragment.class.getName());
|
||||
sLatinImeFragments.add(DebugSettingsFragment.class.getName());
|
||||
sLatinImeFragments.add(SettingsFragment.class.getName());
|
||||
sLatinImeFragments.add(AboutFragment.class.getName());
|
||||
sLatinImeFragments.add(SpellCheckerSettingsFragment.class.getName());
|
||||
sLatinImeFragments.add(UserDictionaryAddWordFragment.class.getName());
|
||||
sLatinImeFragments.add(UserDictionaryList.class.getName());
|
||||
|
|
BIN
app/src/main/res/drawable-hdpi/ic_settings_about_white.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_settings_about_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 703 B |
6
app/src/main/res/drawable-v21/ic_settings_about.xml
Normal file
6
app/src/main/res/drawable-v21/ic_settings_about.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:inset="@dimen/settings_screen_icon_inset">
|
||||
<bitmap android:src="@drawable/ic_settings_about_white"
|
||||
android:tint="?android:colorForeground"/>
|
||||
</inset>
|
BIN
app/src/main/res/drawable-xhdpi/ic_settings_about_white.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_settings_about_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 963 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_settings_about_white.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_settings_about_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_settings_about_white.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_settings_about_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
3
app/src/main/res/drawable/ic_settings_about.xml
Normal file
3
app/src/main/res/drawable/ic_settings_about.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/ic_settings_about_white"/>
|
|
@ -231,4 +231,9 @@
|
|||
<string name="subtype_with_layout_bn_BD"><xliff:g id="LANGUAGE_NAME" example="Bangla">%s</xliff:g> (অক্ষর)</string>
|
||||
<string name="autospace_after_punctuation">যতিচিহ্নের পরে স্বয়ংক্রিয় স্পেস</string>
|
||||
<string name="autospace_after_punctuation_summary">নতুন শব্দ লেখার সময় যতিচিহ্নের পরে স্বয়ংক্রিয়ভাবে স্পেস বসবে</string>
|
||||
<string name="settings_screen_about">সম্পর্কে</string>
|
||||
<string name="version">সংস্করণ</string>
|
||||
<string name="about_github_link" >গিটহাবে দেখুন</string>
|
||||
<string name="license" >ওপেন-সোর্স লাইসেন্স</string>
|
||||
<string name="gnu_gpl" >জিএনইউ জেনারেল পাবলিক লাইসেন্স v3.0</string>
|
||||
</resources>
|
|
@ -662,4 +662,16 @@ disposition rather than other common dispositions for Latin languages. [CHAR LIM
|
|||
<string name="select_color_key_background">Key background</string>
|
||||
<!-- Selection: accent color. -->
|
||||
<string name="select_color_accent">Accent</string>
|
||||
<!-- Settings screen title for about [CHAR LIMIT=33]-->
|
||||
<string name="settings_screen_about">About</string>
|
||||
<!-- version for about screen-->
|
||||
<string name="version">Version</string>
|
||||
<!-- github repo link for about screen-->
|
||||
<string name="about_github_link" >View on GitHub</string>
|
||||
<!-- license for about screen-->
|
||||
<string name="license" >Open-source license</string>
|
||||
<!-- license link for about screen-->
|
||||
<string name="gnu_gpl" >GNU General Public License v3.0</string>
|
||||
<!-- App slogan-->
|
||||
<string name="app_slogan" >100% FOSS keyboard, based on AOSP.</string>
|
||||
</resources>
|
|
@ -46,4 +46,9 @@
|
|||
android:title="@string/settings_screen_advanced"
|
||||
android:key="screen_advanced"
|
||||
android:icon="@drawable/ic_settings_advanced"/>
|
||||
<PreferenceScreen
|
||||
android:fragment="org.dslul.openboard.inputmethod.latin.settings.AboutFragment"
|
||||
android:title="@string/settings_screen_about"
|
||||
android:key="screen_about"
|
||||
android:icon="@drawable/ic_settings_about"/>
|
||||
</PreferenceScreen>
|
||||
|
|
39
app/src/main/res/xml/prefs_screen_about.xml
Normal file
39
app/src/main/res/xml/prefs_screen_about.xml
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2014 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<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">
|
||||
<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"
|
||||
android:data="https://github.com/Helium314/openboard" />
|
||||
</Preference>
|
||||
</PreferenceScreen>
|
Loading…
Add table
Reference in a new issue