Skip to content

Commit 7a73120

Browse files
committed
new name
1 parent 558b3d2 commit 7a73120

34 files changed

+140
-40
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [1.0.0]
10+
### Changed
11+
- App name and package changed **(please uninstall the old version manually)**
12+
- New icon
13+
14+
## [1.0.0-alpha2]
15+
### Added
16+
- Ability to define custom rules
17+
- Predefined sources: Samsung Pay, Bixby, Power Menu
18+
- Predefined targets: Google Pay, Google Assistant Go
19+
20+
## [1.0.0-apha1]
821
### Added
922
- Initial release of Watch 4 PaySwitch

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,29 @@ Watch 4 PaySwitch allows you to start Google Pay by long pressing the back butto
55
## Installation
66

77
TBD
8-
<!-- [![Get it on Google Play](https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png)](https://play.google.com/store/apps/details?id=de.bigboot.watch4payswitch&noprocess) -->
8+
<!-- [![Get it on Google Play](https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png)](https://play.google.com/store/apps/details?id=de.bigboot.gw4remap&noprocess) -->
99

1010
## Usage
1111

12-
| | |
12+
| First launch setup | |
1313
| -------------------- | ----------------------------------------------------------- |
1414
| ![Step 1](img/1.png) | Press the switch to start the setup |
1515
| ![Step 2](img/2.png) | Select `Installed services` |
16-
| ![Step 3](img/3.png) | Select `Watch 4 PaySwitch` |
16+
| ![Step 3](img/3.png) | Select `GW4 Remap` |
1717
| ![Step 4](img/4.png) | Enable the Service |
1818
| ![Step 5](img/5.png) | Confirm |
19-
| ![Step 6](img/6.png) | After going back to the app, the service should be enabled. |
19+
| ![Step 6](img/6.png) | Go back to the app and your should see the rules screen |
2020

2121

22-
That's it. Long pressing the back button should now start up Google Pay
22+
| Creating rules | |
23+
| --------------------- | ------------------------------------------------------------------- |
24+
| ![Step 1](img/7.png) | Press the `+` button to create a new rule |
25+
| ![Step 2](img/8.png) | Press the bookmark icon next to the source input to select a source |
26+
| ![Step 3](img/9.png) | Select the source |
27+
| ![Step 4](img/10.png) | Do the same for the target |
28+
29+
30+
That's it. Your buttons should now be remapped.
2331

2432

2533
## License

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
compileSdk = 31
1313

1414
defaultConfig {
15-
applicationId = "de.bigboot.watch4payswitch"
15+
applicationId = "de.bigboot.gw4remap"
1616
minSdk = 30
1717
targetSdk = 31
1818
versionCode = 1
@@ -56,7 +56,7 @@ dependencies {
5656
implementation("com.google.android.material:material:1.4.0")
5757
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
5858
implementation("com.squareup.moshi:moshi-kotlin:1.13.0") {
59-
// exclude("org.jetbrains.kotlin", "kotlin-reflect ")
59+
exclude("org.jetbrains.kotlin", "kotlin-reflect ")
6060
}
6161
ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")
6262
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="de.bigboot.watch4payswitch">
3+
package="de.bigboot.gw4remap">
44

55
<uses-permission android:name="android.permission.WAKE_LOCK" />
66

@@ -26,7 +26,7 @@
2626
android:name=".MainActivity"
2727
android:exported="true"
2828
android:label="@string/app_name"
29-
android:theme="@style/Theme.AppCompat.Light">
29+
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
3030
<intent-filter>
3131
<action android:name="android.intent.action.MAIN" />
3232
<category android:name="android.intent.category.LAUNCHER" />
@@ -36,7 +36,7 @@
3636
<activity
3737
android:name=".SelectPredefinedActivity"
3838
android:exported="false"
39-
android:theme="@style/Theme.AppCompat.Light" />
39+
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
4040

4141
<service
4242
android:name=".AccessibilityService"
14.7 KB
Loading

app/src/main/kotlin/de/bigboot/watch4payswitch/AccessibilityService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.bigboot.watch4payswitch
1+
package de.bigboot.gw4remap
22

33
import android.accessibilityservice.AccessibilityService
44
import android.content.Intent

app/src/main/kotlin/de/bigboot/watch4payswitch/ActivityRuleFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.bigboot.watch4payswitch
1+
package de.bigboot.gw4remap
22

33
import android.annotation.SuppressLint
44
import android.app.Activity
@@ -11,7 +11,7 @@ import android.view.View
1111
import android.view.ViewGroup
1212
import androidx.activity.result.contract.ActivityResultContract
1313
import androidx.core.widget.doOnTextChanged
14-
import de.bigboot.watch4payswitch.databinding.FragmentActivityRuleBinding
14+
import de.bigboot.gw4remap.databinding.FragmentActivityRuleBinding
1515
import java.lang.IndexOutOfBoundsException
1616
import java.util.*
1717

app/src/main/kotlin/de/bigboot/watch4payswitch/AppPreferences.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.bigboot.watch4payswitch
1+
package de.bigboot.gw4remap
22

33
import android.content.Context
44
import androidx.core.content.edit
@@ -113,7 +113,13 @@ object PredefinedTargets {
113113
R.string.target_google_assistant_go
114114
)
115115

116-
val ALL = listOf(GOOGLE_PAY, GOOGLE_ASSISTANT_GO)
116+
val ULTIMATE_ALEXA = ActivityTarget(
117+
"com.com.customsolutions.android.alexa",
118+
"com.customsolutions.android.alexa.MainActivity",
119+
R.string.target_ultimate_alexa
120+
)
121+
122+
val ALL = listOf(GOOGLE_PAY, GOOGLE_ASSISTANT_GO, ULTIMATE_ALEXA)
117123
}
118124

119125
fun Context.getAppPreferences() = AppPreferences(this)

app/src/main/kotlin/de/bigboot/watch4payswitch/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package de.bigboot.watch4payswitch
1+
package de.bigboot.gw4remap
22

33
import android.os.Bundle
4-
import de.bigboot.watch4payswitch.databinding.ActivityMainBinding
4+
import de.bigboot.gw4remap.databinding.ActivityMainBinding
55
import android.content.Intent
66

77
import android.provider.Settings

app/src/main/kotlin/de/bigboot/watch4payswitch/SelectPredefinedActivity.kt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
package de.bigboot.watch4payswitch
1+
package de.bigboot.gw4remap
22

33
import android.app.Activity
44
import android.content.Intent
5+
import android.graphics.Rect
56
import androidx.appcompat.app.AppCompatActivity
67
import android.os.Bundle
8+
import android.util.TypedValue
9+
import android.view.View
10+
import androidx.recyclerview.widget.RecyclerView
711
import androidx.wear.widget.WearableLinearLayoutManager
8-
import de.bigboot.watch4payswitch.databinding.ActivitySelectPredefinedBinding
12+
import de.bigboot.gw4remap.databinding.ActivitySelectPredefinedBinding
913

1014
class SelectPredefinedActivity : AppCompatActivity() {
1115
enum class ActivityType { Source, Target }
@@ -23,6 +27,31 @@ class SelectPredefinedActivity : AppCompatActivity() {
2327
binding = ActivitySelectPredefinedBinding.inflate(layoutInflater)
2428

2529
binding.recyclerView.layoutManager = WearableLinearLayoutManager(this)
30+
binding.recyclerView.addItemDecoration(object: RecyclerView.ItemDecoration() {
31+
override fun getItemOffsets(
32+
outRect: Rect,
33+
view: View,
34+
parent: RecyclerView,
35+
state: RecyclerView.State
36+
) {
37+
super.getItemOffsets(outRect, view, parent, state)
38+
39+
val index = parent.getChildAdapterPosition(view);
40+
val count = parent.adapter?.itemCount?.minus(1) ?: 0
41+
42+
if (index == 0) {
43+
outRect.top =
44+
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50.0f, resources.displayMetrics)
45+
.toInt()
46+
}
47+
48+
if (index == count) {
49+
outRect.bottom =
50+
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50.0f, resources.displayMetrics)
51+
.toInt()
52+
}
53+
}
54+
})
2655
binding.recyclerView.adapter = SelectPredefinedAdapter(when (activityType) {
2756
ActivityType.Source -> PredefinedSources.ALL.map { source ->
2857
SelectPredefinedAdapter.Item(

0 commit comments

Comments
 (0)