This commit is contained in:
1 parent
357edf9a2d
commit
5517792387
9 files changed
+50
-33
No files matched your search
@@ -29,9 +29,6 @@ jobs:
|
|||||||
- name: Lint and test
|
- name: Lint and test
|
||||||
working-directory: android
|
working-directory: android
|
||||||
run: ./gradlew --no-daemon lintDebug testDebugUnitTest
|
run: ./gradlew --no-daemon lintDebug testDebugUnitTest
|
||||||
- name: Build debug APK
|
|
||||||
working-directory: android
|
|
||||||
run: ./gradlew --no-daemon assembleDebug
|
|
||||||
- name: Build signed release APK
|
- name: Build signed release APK
|
||||||
working-directory: android
|
working-directory: android
|
||||||
env:
|
env:
|
||||||
@@ -52,12 +49,13 @@ jobs:
|
|||||||
working-directory: android
|
working-directory: android
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ../artifacts
|
mkdir -p ../artifacts
|
||||||
cp app/build/outputs/apk/debug/app-debug.apk ../artifacts/transui-android-debug.apk
|
|
||||||
if [ -f app/build/outputs/apk/release/app-release.apk ]; then
|
if [ -f app/build/outputs/apk/release/app-release.apk ]; then
|
||||||
cp app/build/outputs/apk/release/app-release.apk ../artifacts/transui-android-release.apk
|
cp app/build/outputs/apk/release/app-release.apk ../artifacts/transui-android-release.apk
|
||||||
fi
|
|
||||||
cd ../artifacts
|
cd ../artifacts
|
||||||
sha256sum ./*.apk > SHA256SUMS-android
|
sha256sum ./*.apk > SHA256SUMS-android
|
||||||
|
else
|
||||||
|
echo "No release APK to publish"
|
||||||
|
fi
|
||||||
- name: Attach APKs to the Gitea release
|
- name: Attach APKs to the Gitea release
|
||||||
if: gitea.event_name == 'release'
|
if: gitea.event_name == 'release'
|
||||||
env:
|
env:
|
||||||
@@ -72,4 +70,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: transui-android
|
name: transui-android
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
if-no-files-found: error
|
if-no-files-found: warn
|
||||||
@@ -80,25 +80,29 @@ public final class SpeechRecognitionActivity extends Activity {
|
|||||||
|
|
||||||
private void configureRecordButton() {
|
private void configureRecordButton() {
|
||||||
record.setAlpha(1);
|
record.setAlpha(1);
|
||||||
resizeRecordButton(config.pushToTalk ? 80 : 64, config.pushToTalk ? 23 : 19);
|
|
||||||
if (config.pushToTalk) {
|
if (config.pushToTalk) {
|
||||||
record.setImageResource(R.drawable.ic_mic);
|
record.setBackgroundResource(R.drawable.voice_pill_button);
|
||||||
|
resizeRecordButton(132, 64, 16);
|
||||||
|
record.setImageResource(R.drawable.ic_apps);
|
||||||
record.setContentDescription(getString(R.string.hold_to_talk));
|
record.setContentDescription(getString(R.string.hold_to_talk));
|
||||||
record.setPushToTalkActions(this::startRecording, this::stopRecording);
|
record.setPushToTalkActions(this::startRecording, this::stopRecording);
|
||||||
} else {
|
} else {
|
||||||
|
record.setBackgroundResource(R.drawable.voice_primary_button);
|
||||||
|
resizeRecordButton(64, 64, 19);
|
||||||
record.setImageResource(R.drawable.ic_stop);
|
record.setImageResource(R.drawable.ic_stop);
|
||||||
record.setContentDescription(getString(R.string.stop));
|
record.setContentDescription(getString(R.string.stop));
|
||||||
record.setOnClickListener(view -> stopRecording());
|
record.setOnClickListener(view -> stopRecording());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resizeRecordButton(int sizeDp, int paddingDp) {
|
private void resizeRecordButton(int widthDp, int heightDp, int paddingDp) {
|
||||||
float density = getResources().getDisplayMetrics().density;
|
float density = getResources().getDisplayMetrics().density;
|
||||||
int size = Math.round(sizeDp * density);
|
int width = Math.round(widthDp * density);
|
||||||
|
int height = Math.round(heightDp * density);
|
||||||
int padding = Math.round(paddingDp * density);
|
int padding = Math.round(paddingDp * density);
|
||||||
ViewGroup.LayoutParams parameters = record.getLayoutParams();
|
ViewGroup.LayoutParams parameters = record.getLayoutParams();
|
||||||
parameters.width = size;
|
parameters.width = width;
|
||||||
parameters.height = size;
|
parameters.height = height;
|
||||||
record.setLayoutParams(parameters);
|
record.setLayoutParams(parameters);
|
||||||
record.setPadding(padding, padding, padding, padding);
|
record.setPadding(padding, padding, padding, padding);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,25 +109,29 @@ public final class TransuiInputMethodService extends InputMethodService {
|
|||||||
record.setAlpha(1);
|
record.setAlpha(1);
|
||||||
record.setOnClickListener(null);
|
record.setOnClickListener(null);
|
||||||
record.setPushToTalkActions(null, null);
|
record.setPushToTalkActions(null, null);
|
||||||
resizeRecordButton(config.pushToTalk ? 76 : 64, config.pushToTalk ? 22 : 19);
|
|
||||||
if (config.pushToTalk) {
|
if (config.pushToTalk) {
|
||||||
record.setImageResource(R.drawable.ic_mic);
|
record.setBackgroundResource(R.drawable.voice_pill_button);
|
||||||
|
resizeRecordButton(132, 64, 16);
|
||||||
|
record.setImageResource(R.drawable.ic_apps);
|
||||||
record.setContentDescription(getString(R.string.hold_to_talk));
|
record.setContentDescription(getString(R.string.hold_to_talk));
|
||||||
record.setPushToTalkActions(this::startRecording, this::stopRecording);
|
record.setPushToTalkActions(this::startRecording, this::stopRecording);
|
||||||
} else {
|
} else {
|
||||||
|
record.setBackgroundResource(R.drawable.voice_primary_button);
|
||||||
|
resizeRecordButton(64, 64, 19);
|
||||||
record.setImageResource(R.drawable.ic_stop);
|
record.setImageResource(R.drawable.ic_stop);
|
||||||
record.setContentDescription(getString(R.string.stop));
|
record.setContentDescription(getString(R.string.stop));
|
||||||
record.setOnClickListener(view -> stopRecording());
|
record.setOnClickListener(view -> stopRecording());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resizeRecordButton(int sizeDp, int paddingDp) {
|
private void resizeRecordButton(int widthDp, int heightDp, int paddingDp) {
|
||||||
float density = getResources().getDisplayMetrics().density;
|
float density = getResources().getDisplayMetrics().density;
|
||||||
int size = Math.round(sizeDp * density);
|
int width = Math.round(widthDp * density);
|
||||||
|
int height = Math.round(heightDp * density);
|
||||||
int padding = Math.round(paddingDp * density);
|
int padding = Math.round(paddingDp * density);
|
||||||
ViewGroup.LayoutParams parameters = record.getLayoutParams();
|
ViewGroup.LayoutParams parameters = record.getLayoutParams();
|
||||||
parameters.width = size;
|
parameters.width = width;
|
||||||
parameters.height = size;
|
parameters.height = height;
|
||||||
record.setLayoutParams(parameters);
|
record.setLayoutParams(parameters);
|
||||||
record.setPadding(padding, padding, padding, padding);
|
record.setPadding(padding, padding, padding, padding);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/paper"
|
||||||
|
android:pathData="M4,8h4V4H4v4zM10,20h4v-4h-4v4zM4,20h4v-4H4v4zM4,14h4v-4H4v4zM10,14h4v-4h-4v4zM16,4v4h4V4h-4zM10,8h4V4h-4v4zM16,14h4v-4h-4v4zM16,20h4v-4h-4v4z" />
|
||||||
|
</vector>
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M12,14c1.66,0 3,-1.34 3,-3V5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17,11c0,2.76 -2.24,5 -5,5s-5,-2.24 -5,-5H5c0,3.53 2.61,6.43 6,6.92V21h2v-3.08c3.39,-0.49 6,-3.39 6,-6.92h-2z" />
|
|
||||||
</vector>
|
|
||||||
@@ -4,5 +4,8 @@
|
|||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path android:fillColor="#FF000000" android:pathData="M6,6h12v12H6z" />
|
<path
|
||||||
|
android:fillColor="@color/paper"
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM16,16H8V8h8v8z" />
|
||||||
</vector>
|
</vector>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/ripple_on_signal">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/signal" />
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
@@ -61,8 +61,7 @@
|
|||||||
android:background="@drawable/voice_primary_button"
|
android:background="@drawable/voice_primary_button"
|
||||||
android:contentDescription="@string/stop"
|
android:contentDescription="@string/stop"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:src="@drawable/ic_stop"
|
android:src="@drawable/ic_stop" />
|
||||||
android:tint="@color/paper" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/recognition_cancel"
|
android:id="@+id/recognition_cancel"
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
android:background="@drawable/voice_primary_button"
|
android:background="@drawable/voice_primary_button"
|
||||||
android:contentDescription="@string/stop"
|
android:contentDescription="@string/stop"
|
||||||
android:padding="21dp"
|
android:padding="21dp"
|
||||||
android:src="@drawable/ic_stop"
|
android:src="@drawable/ic_stop" />
|
||||||
android:tint="@color/paper" />
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Reference in new issue
Block a user