Skip to content

Commit f97a9da

Browse files
committed
fix failure on non-simulated watches, set explicit broadcast intent package, tweak unit display
1 parent 058d6e1 commit f97a9da

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app/src/main/java/net/rec0de/android/watchwitch/activities/MainActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ class MainActivity : AppCompatActivity() {
211211
}
212212

213213
fun hideWatchSimButton() {
214-
val buttonContainer: LinearLayout = findViewById(R.id.layoutSimulateButton)
215-
buttonContainer.visibility = GONE
214+
runOnUiThread {
215+
val buttonContainer: LinearLayout = findViewById(R.id.layoutSimulateButton)
216+
buttonContainer.visibility = GONE
217+
}
216218
}
217219

218220
fun statusIdle() {

app/src/main/java/net/rec0de/android/watchwitch/adapter/HealthLogAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class HealthLogAdapter(
6666
when(item) {
6767
is DatabaseWrangler.DisplaySample -> {
6868
// Title & main value
69-
holder.title.text = "${item.dataType}: ${roundPretty(item.value)}${item.unit}"
69+
holder.title.text = "${item.dataType}: ${roundPretty(item.value)} ${item.unit}"
7070

7171
val ico = when {
7272
item.dataType.startsWith("Menstrual") -> R.drawable.icon_health_cycletracking
@@ -134,7 +134,7 @@ class HealthLogAdapter(
134134
// Title & main value
135135
holder.title.text = "${item.type}, ${prettyDuration(item.duration)}"
136136

137-
holder.stats.text = "${item.steps} steps, ${roundPretty(item.distance)}km, ${roundPretty(item.energy)} kcal"
137+
holder.stats.text = "${item.steps} steps, ${roundPretty(item.distance)} km, ${roundPretty(item.energy)} kcal"
138138
holder.stats.visibility = VISIBLE
139139

140140
val ico = ResourcesCompat.getDrawable(holder.view.resources, R.drawable.icon_health_workout, null);

app/src/main/java/net/rec0de/android/watchwitch/servicehandlers/messaging/BulletinDistributorService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ object BulletinDistributorService : AlloyService {
164164
else {
165165
Intent().also { intent ->
166166
intent.action = "net.rec0de.android.watchwitch.chitchat"
167+
intent.setPackage("net.rec0de.android.watchwitch")
167168
intent.putExtra("data", "action:${msg.name}")
168169
context.sendBroadcast(intent)
169170
}

0 commit comments

Comments
 (0)