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'
minSdk 3
targetSdk 35
//noinspection OldTargetApi
versionCode 30
versionName "0.3"
}
@@ -21,6 +20,13 @@ android {
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
}
}
compileOptions {
@@ -31,3 +37,4 @@ android {
+25 -2
View File
@@ -1,15 +1,39 @@
<?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"
xmlns:tools="http://schemas.android.com/tools">
<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
android:icon="@drawable/icon"
android:roundIcon="@drawable/icon_round"
android:label="@string/app_name"
android:roundIcon="@drawable/icon_round"
android:supportsRtl="true"
tools:targetApi="31">
<profileable
android:shell="true"
tools:targetApi="q" />
<service
android:name=".InputMethod"
android:directBootAware="true"
@@ -27,7 +51,6 @@
<activity
android:name=".PreferenceActivity"
android:exported="false"
android:icon="@drawable/icon"
android:label="@string/preferences_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -47,10 +47,10 @@ public class InputMethod extends InputMethodService {
public PreferenceHolder mPreferenceHolder;
public ClipManager mClipManager;
public InputView mInputView;
public Vibrator mVibrator;
private int mCurrentCursorPosition;
private Handler mHandler;
private Cycler mSymbolCycler;
public Vibrator mVibrator;
@Override
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);
mMetaKeyManager.adjustMetaStateAfterKeypress();
mInputView.updateStateText();
@@ -183,6 +183,7 @@ public class InputMethod extends InputMethodService {
mHandler.postDelayed(this, mPreferenceHolder.getCycleSpeed());
}
}
@SuppressWarnings("unchecked")
@Override
public void onFirstCycle() {
@@ -47,12 +47,11 @@ public class InputView extends RelativeLayout {
private final InputMethod mInputMethod;
private final LinearLayout.LayoutParams mSymbolLayout;
private final LinearLayout.LayoutParams mClipLayout;
public PopupWindow mClipboardPopup;
private LinearLayout mSymbolList;
private LinearLayout mClipList;
private Button mStateButton;
private ImageButton mClipboardButton;
private ScrollView mClipboardView;
public PopupWindow mClipboardPopup;
public InputView(Context context, AttributeSet attrs) {
super(context, attrs, 0);
@@ -80,7 +79,7 @@ public class InputView extends RelativeLayout {
mSymbolList = findViewById(R.id.symbol_list);
mStateButton = findViewById(R.id.state_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);
mClipboardPopup = new PopupWindow(mClipboardView,
getResources().getDimensionPixelSize(R.dimen.clipboard_popup_width),
+14 -9
View File
@@ -21,7 +21,8 @@
<!-- Background -->
<item>
<shape android:shape="rectangle">
<size android:width="128px"
<size
android:width="128px"
android:height="128px" />
<solid android:color="#333" />
</shape>
@@ -36,19 +37,21 @@
<!-- </shape>-->
<!-- </item>-->
<!-- Top -->
<item android:top="24px"
<item
android:bottom="90px"
android:left="24px"
android:right="24px"
android:bottom="90px">
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
<corners android:radius="36px" />
</shape>
</item>
<!-- Stem of the T -->
<item android:left="40px"
android:right="72px"
<item
android:bottom="24px"
android:left="40px"
android:right="72px"
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
@@ -56,9 +59,10 @@
</shape>
</item>
<!-- Stem of the I -->
<item android:left="72px"
android:right="40px"
<item
android:bottom="24px"
android:left="72px"
android:right="40px"
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
@@ -66,10 +70,11 @@
</shape>
</item>
<!-- Bottom of the I -->
<item android:top="90px"
<item
android:bottom="24px"
android:left="60px"
android:right="29px"
android:bottom="24px">
android:top="90px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
<corners android:radius="36px" />
+14 -9
View File
@@ -21,7 +21,8 @@
<!-- Background -->
<item>
<shape android:shape="oval">
<size android:width="128px"
<size
android:width="128px"
android:height="128px" />
<solid android:color="#333" />
</shape>
@@ -36,19 +37,21 @@
<!-- </shape>-->
<!-- </item>-->
<!-- Top -->
<item android:top="24px"
<item
android:bottom="90px"
android:left="24px"
android:right="24px"
android:bottom="90px">
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
<corners android:radius="36px" />
</shape>
</item>
<!-- Stem of the T -->
<item android:left="40px"
android:right="72px"
<item
android:bottom="24px"
android:left="40px"
android:right="72px"
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
@@ -56,9 +59,10 @@
</shape>
</item>
<!-- Stem of the I -->
<item android:left="72px"
android:right="40px"
<item
android:bottom="24px"
android:left="72px"
android:right="40px"
android:top="24px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
@@ -66,10 +70,11 @@
</shape>
</item>
<!-- Bottom of the I -->
<item android:top="90px"
<item
android:bottom="24px"
android:left="60px"
android:right="29px"
android:bottom="24px">
android:top="90px">
<shape android:shape="rectangle">
<solid android:color="@color/text_color" />
<corners android:radius="36px" />
+23 -12
View File
@@ -31,43 +31,54 @@
<!-- </shape>-->
<!-- </item>-->
<!-- Handle -->
<item android:top="11dp"
<item
android:bottom="31dp"
android:left="19dp"
android:right="19dp"
android:bottom="31dp">
android:top="11dp">
<shape android:shape="rectangle">
<stroke android:width="2dp"
<stroke
android:width="2dp"
android:color="@color/danger_text_color" />
<corners android:radius="8dp" />
</shape>
</item>
<!-- Lid -->
<item android:bottom="16dp"
<item
android:bottom="16dp"
android:left="13dp"
android:right="13dp">
<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>
</item>
<!-- Bin -->
<item android:top="15dp"
<item
android:bottom="11dp"
android:left="15dp"
android:right="15dp">
android:right="15dp"
android:top="15dp">
<shape android:shape="rectangle">
<stroke android:width="2dp"
<stroke
android:width="2dp"
android:color="@color/danger_text_color" />
<corners android:bottomLeftRadius="4dp"
<corners
android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp" />
</shape>
</item>
<!-- Stripes -->
<item android:left="20dp"
android:right="20dp"
<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" />
<stroke
android:width="2dp"
android:color="@color/danger_text_color" />
</shape>
</item>
</layer-list>
+1 -1
View File
@@ -35,7 +35,7 @@
android:singleLine="true"
android:text="@string/clip_default_text"
android:textColor="@color/text_color"
android:textSize="@dimen/long_text_size" />
android:textSize="@dimen/default_text_size" />
<ImageButton
android:id="@+id/button_delete"
-1
View File
@@ -27,7 +27,6 @@
<dimen name="default_text_size">16sp</dimen>
<dimen name="symbol_text_size">18sp</dimen>
<dimen name="long_text_size">14sp</dimen>
<dimen name="default_border_radius">8dp</dimen>
</resources>
+1 -1
View File
@@ -1602,7 +1602,7 @@
</key>
<key code="53"> <!-- Y -->
<!-- Space for diacritics -->
<base value="ؘ" /> <!-- Fatha -->
<base value="َ" /> <!-- Fatha -->
<alt value=")" />
<alt value="&gt;" />
<alt value="]" />
+19
View File
@@ -1,4 +1,23 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:settingsActivity="eu.cfpi_fpsi.titanboard.PreferenceActivity">
+1 -4
View File
@@ -1,8 +1,5 @@
[versions]
#noinspection AndroidGradlePluginVersion
agp = "8.4.1"
[libraries]
agp = "8.4.2"
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }