This commit is contained in:
2024-11-04 23:44:21 +01:00
parent 792216e22d
commit fdbf73720b
12 changed files with 127 additions and 61 deletions
+8 -1
View File
@@ -10,7 +10,6 @@ android {
applicationId 'eu.cfpi_fpsi.titanboard' applicationId 'eu.cfpi_fpsi.titanboard'
minSdk 3 minSdk 3
targetSdk 35 targetSdk 35
//noinspection OldTargetApi
versionCode 30 versionCode 30
versionName "0.3" versionName "0.3"
} }
@@ -21,6 +20,13 @@ android {
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
debug {
minifyEnabled false
shrinkResources false
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
}
} }
compileOptions { compileOptions {
@@ -31,3 +37,4 @@ android {
+25 -2
View File
@@ -1,15 +1,39 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
~ An input method for the Unihertz Titan/physical keyboard phones
~ Copyright (C) 2024 Emil Kosz
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
~
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_CLIPBOARD" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:roundIcon="@drawable/icon_round"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@drawable/icon_round"
android:supportsRtl="true" android:supportsRtl="true"
tools:targetApi="31"> tools:targetApi="31">
<profileable
android:shell="true"
tools:targetApi="q" />
<service <service
android:name=".InputMethod" android:name=".InputMethod"
android:directBootAware="true" android:directBootAware="true"
@@ -27,7 +51,6 @@
<activity <activity
android:name=".PreferenceActivity" android:name=".PreferenceActivity"
android:exported="false" android:exported="false"
android:icon="@drawable/icon"
android:label="@string/preferences_name"> android:label="@string/preferences_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -47,10 +47,10 @@ public class InputMethod extends InputMethodService {
public PreferenceHolder mPreferenceHolder; public PreferenceHolder mPreferenceHolder;
public ClipManager mClipManager; public ClipManager mClipManager;
public InputView mInputView; public InputView mInputView;
public Vibrator mVibrator;
private int mCurrentCursorPosition; private int mCurrentCursorPosition;
private Handler mHandler; private Handler mHandler;
private Cycler mSymbolCycler; private Cycler mSymbolCycler;
public Vibrator mVibrator;
@Override @Override
public void onCreate() { public void onCreate() {
@@ -125,7 +125,7 @@ public class InputMethod extends InputMethodService {
} }
} }
public void handleSpacebar(KeyEvent event) { public void handleSpacebar(KeyEvent ignoredEvent) {
getCurrentInputConnection().commitText(" ", 1); getCurrentInputConnection().commitText(" ", 1);
mMetaKeyManager.adjustMetaStateAfterKeypress(); mMetaKeyManager.adjustMetaStateAfterKeypress();
mInputView.updateStateText(); mInputView.updateStateText();
@@ -183,6 +183,7 @@ public class InputMethod extends InputMethodService {
mHandler.postDelayed(this, mPreferenceHolder.getCycleSpeed()); mHandler.postDelayed(this, mPreferenceHolder.getCycleSpeed());
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void onFirstCycle() { public void onFirstCycle() {
@@ -42,17 +42,16 @@ import java.util.ArrayList;
// scrollview // scrollview
public class InputView extends RelativeLayout { public class InputView extends RelativeLayout {
protected final int[] BUTTON_STATE_TOGGLED = { R.attr.state_toggled }; protected final int[] BUTTON_STATE_TOGGLED = {R.attr.state_toggled};
private final InputMethod mInputMethod; private final InputMethod mInputMethod;
private final LinearLayout.LayoutParams mSymbolLayout; private final LinearLayout.LayoutParams mSymbolLayout;
private final LinearLayout.LayoutParams mClipLayout; private final LinearLayout.LayoutParams mClipLayout;
public PopupWindow mClipboardPopup;
private LinearLayout mSymbolList; private LinearLayout mSymbolList;
private LinearLayout mClipList; private LinearLayout mClipList;
private Button mStateButton; private Button mStateButton;
private ImageButton mClipboardButton; private ImageButton mClipboardButton;
private ScrollView mClipboardView;
public PopupWindow mClipboardPopup;
public InputView(Context context, AttributeSet attrs) { public InputView(Context context, AttributeSet attrs) {
super(context, attrs, 0); super(context, attrs, 0);
@@ -80,7 +79,7 @@ public class InputView extends RelativeLayout {
mSymbolList = findViewById(R.id.symbol_list); mSymbolList = findViewById(R.id.symbol_list);
mStateButton = findViewById(R.id.state_button); mStateButton = findViewById(R.id.state_button);
mClipboardButton = findViewById(R.id.clipboard_button); mClipboardButton = findViewById(R.id.clipboard_button);
mClipboardView = (ScrollView) inflate(this.getContext(), R.layout.clipboard, null); ScrollView mClipboardView = (ScrollView) inflate(this.getContext(), R.layout.clipboard, null);
mClipList = mClipboardView.findViewById(R.id.clip_list); mClipList = mClipboardView.findViewById(R.id.clip_list);
mClipboardPopup = new PopupWindow(mClipboardView, mClipboardPopup = new PopupWindow(mClipboardView,
getResources().getDimensionPixelSize(R.dimen.clipboard_popup_width), getResources().getDimensionPixelSize(R.dimen.clipboard_popup_width),
+14 -9
View File
@@ -21,7 +21,8 @@
<!-- Background --> <!-- Background -->
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<size android:width="128px" <size
android:width="128px"
android:height="128px" /> android:height="128px" />
<solid android:color="#333" /> <solid android:color="#333" />
</shape> </shape>
@@ -36,19 +37,21 @@
<!-- </shape>--> <!-- </shape>-->
<!-- </item>--> <!-- </item>-->
<!-- Top --> <!-- Top -->
<item android:top="24px" <item
android:bottom="90px"
android:left="24px" android:left="24px"
android:right="24px" android:right="24px"
android:bottom="90px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
<corners android:radius="36px" /> <corners android:radius="36px" />
</shape> </shape>
</item> </item>
<!-- Stem of the T --> <!-- Stem of the T -->
<item android:left="40px" <item
android:right="72px"
android:bottom="24px" android:bottom="24px"
android:left="40px"
android:right="72px"
android:top="24px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
@@ -56,9 +59,10 @@
</shape> </shape>
</item> </item>
<!-- Stem of the I --> <!-- Stem of the I -->
<item android:left="72px" <item
android:right="40px"
android:bottom="24px" android:bottom="24px"
android:left="72px"
android:right="40px"
android:top="24px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
@@ -66,10 +70,11 @@
</shape> </shape>
</item> </item>
<!-- Bottom of the I --> <!-- Bottom of the I -->
<item android:top="90px" <item
android:bottom="24px"
android:left="60px" android:left="60px"
android:right="29px" android:right="29px"
android:bottom="24px"> android:top="90px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
<corners android:radius="36px" /> <corners android:radius="36px" />
+14 -9
View File
@@ -21,7 +21,8 @@
<!-- Background --> <!-- Background -->
<item> <item>
<shape android:shape="oval"> <shape android:shape="oval">
<size android:width="128px" <size
android:width="128px"
android:height="128px" /> android:height="128px" />
<solid android:color="#333" /> <solid android:color="#333" />
</shape> </shape>
@@ -36,19 +37,21 @@
<!-- </shape>--> <!-- </shape>-->
<!-- </item>--> <!-- </item>-->
<!-- Top --> <!-- Top -->
<item android:top="24px" <item
android:bottom="90px"
android:left="24px" android:left="24px"
android:right="24px" android:right="24px"
android:bottom="90px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
<corners android:radius="36px" /> <corners android:radius="36px" />
</shape> </shape>
</item> </item>
<!-- Stem of the T --> <!-- Stem of the T -->
<item android:left="40px" <item
android:right="72px"
android:bottom="24px" android:bottom="24px"
android:left="40px"
android:right="72px"
android:top="24px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
@@ -56,9 +59,10 @@
</shape> </shape>
</item> </item>
<!-- Stem of the I --> <!-- Stem of the I -->
<item android:left="72px" <item
android:right="40px"
android:bottom="24px" android:bottom="24px"
android:left="72px"
android:right="40px"
android:top="24px"> android:top="24px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
@@ -66,10 +70,11 @@
</shape> </shape>
</item> </item>
<!-- Bottom of the I --> <!-- Bottom of the I -->
<item android:top="90px" <item
android:bottom="24px"
android:left="60px" android:left="60px"
android:right="29px" android:right="29px"
android:bottom="24px"> android:top="90px">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/text_color" /> <solid android:color="@color/text_color" />
<corners android:radius="36px" /> <corners android:radius="36px" />
+38 -27
View File
@@ -22,52 +22,63 @@
<!-- It is tempting to use insets here, but they lead to unexpected behaviour. --> <!-- It is tempting to use insets here, but they lead to unexpected behaviour. -->
<!-- Helper: so that the icon is relatively proportional --> <!-- Helper: so that the icon is relatively proportional -->
<!-- <item android:top="11dp"--> <!-- <item android:top="11dp"-->
<!-- android:bottom="11dp"--> <!-- android:bottom="11dp"-->
<!-- android:right="14dp"--> <!-- android:right="14dp"-->
<!-- android:left="14dp">--> <!-- android:left="14dp">-->
<!-- <shape android:shape="rectangle">--> <!-- <shape android:shape="rectangle">-->
<!-- <solid android:color="@android:color/darker_gray" />--> <!-- <solid android:color="@android:color/darker_gray" />-->
<!-- </shape>--> <!-- </shape>-->
<!-- </item>--> <!-- </item>-->
<!-- Handle --> <!-- Handle -->
<item android:top="11dp" <item
android:bottom="31dp"
android:left="19dp" android:left="19dp"
android:right="19dp" android:right="19dp"
android:bottom="31dp"> android:top="11dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke android:width="2dp" <stroke
android:width="2dp"
android:color="@color/danger_text_color" /> android:color="@color/danger_text_color" />
<corners android:radius="8dp" /> <corners android:radius="8dp" />
</shape> </shape>
</item> </item>
<!-- Lid --> <!-- Lid -->
<item android:bottom="16dp" <item
android:bottom="16dp"
android:left="13dp" android:left="13dp"
android:right="13dp"> android:right="13dp">
<shape android:shape="line"> <shape android:shape="line">
<stroke android:width="2dp" android:color="@color/danger_text_color" /> <stroke
android:width="2dp"
android:color="@color/danger_text_color" />
</shape> </shape>
</item> </item>
<!-- Bin --> <!-- Bin -->
<item android:top="15dp" <item
android:bottom="11dp" android:bottom="11dp"
android:left="15dp" android:left="15dp"
android:right="15dp"> android:right="15dp"
<shape android:shape="rectangle">
<stroke android:width="2dp"
android:color="@color/danger_text_color" />
<corners android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp"/>
</shape>
</item>
<!-- Stripes -->
<item android:left="20dp"
android:right="20dp"
android:bottom="11dp"
android:top="15dp"> android:top="15dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke android:width="2dp" android:color="@color/danger_text_color" /> <stroke
android:width="2dp"
android:color="@color/danger_text_color" />
<corners
android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp" />
</shape>
</item>
<!-- Stripes -->
<item
android:bottom="11dp"
android:left="20dp"
android:right="20dp"
android:top="15dp">
<shape android:shape="rectangle">
<stroke
android:width="2dp"
android:color="@color/danger_text_color" />
</shape> </shape>
</item> </item>
</layer-list> </layer-list>
+1 -1
View File
@@ -35,7 +35,7 @@
android:singleLine="true" android:singleLine="true"
android:text="@string/clip_default_text" android:text="@string/clip_default_text"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/long_text_size" /> android:textSize="@dimen/default_text_size" />
<ImageButton <ImageButton
android:id="@+id/button_delete" android:id="@+id/button_delete"
-1
View File
@@ -27,7 +27,6 @@
<dimen name="default_text_size">16sp</dimen> <dimen name="default_text_size">16sp</dimen>
<dimen name="symbol_text_size">18sp</dimen> <dimen name="symbol_text_size">18sp</dimen>
<dimen name="long_text_size">14sp</dimen>
<dimen name="default_border_radius">8dp</dimen> <dimen name="default_border_radius">8dp</dimen>
</resources> </resources>
+1 -1
View File
@@ -1602,7 +1602,7 @@
</key> </key>
<key code="53"> <!-- Y --> <key code="53"> <!-- Y -->
<!-- Space for diacritics --> <!-- Space for diacritics -->
<base value="ؘ" /> <!-- Fatha --> <base value="َ" /> <!-- Fatha -->
<alt value=")" /> <alt value=")" />
<alt value="&gt;" /> <alt value="&gt;" />
<alt value="]" /> <alt value="]" />
+19
View File
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
~ An input method for the Unihertz Titan/physical keyboard phones
~ Copyright (C) 2024 Emil Kosz
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
~
-->
<input-method xmlns:android="http://schemas.android.com/apk/res/android" <input-method xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:settingsActivity="eu.cfpi_fpsi.titanboard.PreferenceActivity"> android:settingsActivity="eu.cfpi_fpsi.titanboard.PreferenceActivity">
+1 -4
View File
@@ -1,8 +1,5 @@
[versions] [versions]
#noinspection AndroidGradlePluginVersion agp = "8.4.2"
agp = "8.4.1"
[libraries]
[plugins] [plugins]
android-application = { id = "com.android.application", version.ref = "agp" } android-application = { id = "com.android.application", version.ref = "agp" }