diff --git a/README.md b/README.md
index a04deb5..e8cffaf 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
@@ -10,6 +10,15 @@
Tiny app to redirect outgoing calls to Signal/Telegram/Threema/Whatsapp.
+---
+
+
+
+
+
+
+
+
---
@@ -18,11 +27,11 @@ Tiny app to redirect outgoing calls to Signal/Telegram/Threema/Whatsapp.
-
+
-
+
diff --git a/app/build.gradle b/app/build.gradle
index 9e5deb2..0637905 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,8 +11,8 @@ android {
applicationId = "partisan.weforge.xyz.pulse"
minSdk = 29
targetSdk = 34
- versionCode = 10
- versionName = "1.3.1"
+ versionCode = 12
+ versionName = "1.4.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/java/partisan/weforge/xyz/pulse/PopupWindow.kt b/app/src/main/java/partisan/weforge/xyz/pulse/PopupWindow.kt
index 835f2ab..d5f4aa1 100644
--- a/app/src/main/java/partisan/weforge/xyz/pulse/PopupWindow.kt
+++ b/app/src/main/java/partisan/weforge/xyz/pulse/PopupWindow.kt
@@ -9,21 +9,24 @@ import android.net.Uri
import android.view.Gravity
import android.view.LayoutInflater
import android.view.WindowManager
+import android.view.ContextThemeWrapper
import android.widget.TextView
+import android.animation.ObjectAnimator
+import android.widget.ProgressBar
import androidx.annotation.RequiresPermission
import java.lang.ref.WeakReference
import java.util.*
import kotlin.concurrent.timerTask
class PopupWindow(
- private val ctx: Context,
+ ctx: Context,
private val service: WeakReference?,
) {
- private val prefs = Preferences(ctx)
- private val windowManager = ctx.getSystemService(WindowManager::class.java)
- private val audioManager = ctx.getSystemService(AudioManager::class.java)
- @Suppress("InflateParams")
- private val view = LayoutInflater.from(ctx).inflate(R.layout.popup, null)
+ private val themedCtx = ContextThemeWrapper(ctx, R.style.Theme_Pulse)
+ private val prefs = Preferences(themedCtx)
+ private val windowManager = themedCtx.getSystemService(WindowManager::class.java)
+ private val audioManager = themedCtx.getSystemService(AudioManager::class.java)
+ private val view = LayoutInflater.from(themedCtx).inflate(R.layout.popup, null)
private val layoutParams = WindowManager.LayoutParams().apply {
format = PixelFormat.TRANSLUCENT
flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
@@ -45,7 +48,7 @@ class PopupWindow(
fun preview() {
remove()
layoutParams.y = prefs.popupPosition
- val destinations = mutableListOf(
+ val destinations = listOf(
R.string.destination_signal,
R.string.destination_telegram,
R.string.destination_threema,
@@ -80,6 +83,7 @@ class PopupWindow(
service.cancelCall()
}, prefs.redirectionDelay)
setDescription(destinationId)
+ startProgressAnimation(prefs.redirectionDelay)
if (!add()) {
timer?.cancel()
service.placeCallUnmodified()
@@ -87,33 +91,46 @@ class PopupWindow(
}
private fun setDescription(id: Int) {
- view.findViewById(R.id.description).text = ctx.getString(
+ view.findViewById(R.id.description).text = themedCtx.getString(
R.string.popup,
- ctx.getString(id),
+ themedCtx.getString(id),
)
}
+ private fun startProgressAnimation(duration: Long) {
+ val bar = view.findViewById(R.id.progress)
+ bar.max = 100
+ bar.progress = 0
+ val animator = ObjectAnimator.ofInt(bar, "progress", 100)
+ animator.duration = duration
+ animator.start()
+ }
+
@RequiresPermission(Manifest.permission.CALL_PHONE)
private fun call(data: Uri) {
- Intent(Intent.ACTION_VIEW).let {
- it.data = data
- it.flags = Intent.FLAG_ACTIVITY_NEW_TASK
- ctx.startActivity(it)
+ Intent(Intent.ACTION_VIEW).apply {
+ this.data = data
+ flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ themedCtx.startActivity(this)
}
}
private fun add(): Boolean {
try {
windowManager?.addView(view, layoutParams)
- } catch (exc: WindowManager.BadTokenException) { return false }
+ } catch (exc: WindowManager.BadTokenException) {
+ return false
+ }
return true
}
private fun remove(): Boolean {
try {
windowManager?.removeView(view)
- } catch (exc: IllegalArgumentException) {
- } catch (exc: WindowManager.BadTokenException) { return false }
+ } catch (_: IllegalArgumentException) {
+ } catch (_: WindowManager.BadTokenException) {
+ return false
+ }
return true
}
diff --git a/app/src/main/res/drawable/progress_drawable.xml b/app/src/main/res/drawable/progress_drawable.xml
new file mode 100644
index 0000000..8349831
--- /dev/null
+++ b/app/src/main/res/drawable/progress_drawable.xml
@@ -0,0 +1,17 @@
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/popup.xml b/app/src/main/res/layout/popup.xml
index 6035cbb..1b46631 100644
--- a/app/src/main/res/layout/popup.xml
+++ b/app/src/main/res/layout/popup.xml
@@ -1,19 +1,41 @@
-
+ app:cardBackgroundColor="?attr/colorSurface"
+ android:background="@android:color/white">
-
+ android:orientation="vertical">
+
+
+
+
+
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 3e4e33f..ad74a04 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -7,6 +7,9 @@
- @color/teal_200
- @color/black
-
+
+ - @color/white
+ - @color/black
+ - @style/TextAppearance.Material3.BodyMedium
\ No newline at end of file
diff --git a/data/IzzyOnDroidButton.svg b/data/IzzyOnDroidButton.svg
new file mode 100644
index 0000000..64cf6af
--- /dev/null
+++ b/data/IzzyOnDroidButton.svg
@@ -0,0 +1,75 @@
+
+
\ No newline at end of file
diff --git a/data/icon_appstore.png b/data/icon_appstore.png
index 271fb9f..cedd458 100644
Binary files a/data/icon_appstore.png and b/data/icon_appstore.png differ
diff --git a/data/icon_appstore.svg b/data/icon_appstore.svg
index 5a25a11..4b1375c 100644
--- a/data/icon_appstore.svg
+++ b/data/icon_appstore.svg
@@ -1,58 +1,197 @@
-
-
diff --git a/data/screenshot-redirecting.png b/data/screenshot-redirecting.png
index 8054120..c4df362 100644
Binary files a/data/screenshot-redirecting.png and b/data/screenshot-redirecting.png differ
diff --git a/data/screenshot.png b/data/screenshot.png
index 4107576..92a3059 100644
Binary files a/data/screenshot.png and b/data/screenshot.png differ
diff --git a/fastlane/metadata/android/en-US/changelogs/14.txt b/fastlane/metadata/android/en-US/changelogs/14.txt
new file mode 100644
index 0000000..01c603f
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/14.txt
@@ -0,0 +1 @@
+Fixed crash related to redirect popup
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png
index 271fb9f..cedd458 100644
Binary files a/fastlane/metadata/android/en-US/images/icon.png and b/fastlane/metadata/android/en-US/images/icon.png differ