diff --git a/android/app/src/main/java/com/soniox/remotemic/MainActivity.kt b/android/app/src/main/java/com/soniox/remotemic/MainActivity.kt
index 15a6eb1..90df95e 100644
--- a/android/app/src/main/java/com/soniox/remotemic/MainActivity.kt
+++ b/android/app/src/main/java/com/soniox/remotemic/MainActivity.kt
@@ -150,9 +150,11 @@ class MainActivity : AppCompatActivity() {
binding.tvInstruction.setTextColor(ContextCompat.getColor(this, R.color.accent_blue))
},
onAudioLevel = { level ->
- val scale = 1.0f + (level * 0.35f)
- binding.viewGlow.scaleX = scale
- binding.viewGlow.scaleY = scale
+ if (isCurrentlyRecording) {
+ val scale = 1.0f + (level * 0.22f)
+ binding.viewGlow.scaleX = scale
+ binding.viewGlow.scaleY = scale
+ }
},
onSpeechCompleted = { finalText ->
vibrate(100)
@@ -479,12 +481,12 @@ class MainActivity : AppCompatActivity() {
}
private fun startPulseAnimation() {
- val scaleX = PropertyValuesHolder.ofFloat(View.SCALE_X, 1.0f, 1.25f, 1.0f)
- val scaleY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1.0f, 1.25f, 1.0f)
- val alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 0.3f, 0.7f, 0.3f)
+ val scaleX = PropertyValuesHolder.ofFloat(View.SCALE_X, 1.0f, 1.18f, 1.0f)
+ val scaleY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1.0f, 1.18f, 1.0f)
+ val alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 0.4f, 0.85f, 0.4f)
pulseAnimator = ObjectAnimator.ofPropertyValuesHolder(binding.viewGlow, scaleX, scaleY, alpha).apply {
- duration = 1000
+ duration = 900
repeatCount = ValueAnimator.INFINITE
interpolator = AccelerateDecelerateInterpolator()
start()
@@ -495,7 +497,7 @@ class MainActivity : AppCompatActivity() {
pulseAnimator?.cancel()
binding.viewGlow.scaleX = 1.0f
binding.viewGlow.scaleY = 1.0f
- binding.viewGlow.alpha = 0.3f
+ binding.viewGlow.alpha = 0.0f
}
private fun vibrate(durationMs: Long) {
diff --git a/android/app/src/main/res/drawable/bg_glow.xml b/android/app/src/main/res/drawable/bg_glow.xml
new file mode 100644
index 0000000..e69dba3
--- /dev/null
+++ b/android/app/src/main/res/drawable/bg_glow.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/android/app/src/main/res/drawable/ic_mic_minimal.xml b/android/app/src/main/res/drawable/ic_mic_minimal.xml
new file mode 100644
index 0000000..621cbdc
--- /dev/null
+++ b/android/app/src/main/res/drawable/ic_mic_minimal.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml
index 825b590..981e298 100644
--- a/android/app/src/main/res/layout/activity_main.xml
+++ b/android/app/src/main/res/layout/activity_main.xml
@@ -6,6 +6,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_dark"
+ android:clipChildren="false"
+ android:clipToPadding="false"
android:padding="12dp">
@@ -79,7 +81,7 @@
android:background="@drawable/bg_card"
android:contentDescription="لاگها"
android:padding="8dp"
- android:src="@drawable/ic_mic"
+ android:src="@drawable/ic_mic_minimal"
app:tint="@color/accent_blue" />
@@ -89,7 +91,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp"
+ android:layout_marginBottom="16dp"
android:background="@drawable/bg_card"
android:orientation="vertical"
android:padding="12dp"
@@ -133,7 +135,7 @@
android:textSize="11sp" />
-
+
-
+
@@ -206,35 +211,39 @@
+ android:layout_width="140dp"
+ android:layout_height="140dp"
+ android:layout_marginBottom="8dp"
+ android:clipChildren="false"
+ android:clipToPadding="false">
-
+
+ android:alpha="0.0"
+ android:background="@drawable/bg_glow" />
-
+
+
+ android:src="@drawable/ic_mic_minimal" />
@@ -243,7 +252,7 @@
android:id="@+id/tvInstruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
+ android:layout_marginBottom="6dp"
android:text="@string/hold_to_speak"
android:textColor="@color/text_secondary"
android:textSize="13sp"