Skip to content

Commit

Permalink
fix failure on non-simulated watches, set explicit broadcast intent p…
Browse files Browse the repository at this point in the history
…ackage, tweak unit display
  • Loading branch information
rec0de committed Nov 6, 2024
1 parent 058d6e1 commit f97a9da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ class MainActivity : AppCompatActivity() {
}

fun hideWatchSimButton() {
val buttonContainer: LinearLayout = findViewById(R.id.layoutSimulateButton)
buttonContainer.visibility = GONE
runOnUiThread {
val buttonContainer: LinearLayout = findViewById(R.id.layoutSimulateButton)
buttonContainer.visibility = GONE
}
}

fun statusIdle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class HealthLogAdapter(
when(item) {
is DatabaseWrangler.DisplaySample -> {
// Title & main value
holder.title.text = "${item.dataType}: ${roundPretty(item.value)}${item.unit}"
holder.title.text = "${item.dataType}: ${roundPretty(item.value)} ${item.unit}"

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

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

val ico = ResourcesCompat.getDrawable(holder.view.resources, R.drawable.icon_health_workout, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ object BulletinDistributorService : AlloyService {
else {
Intent().also { intent ->
intent.action = "net.rec0de.android.watchwitch.chitchat"
intent.setPackage("net.rec0de.android.watchwitch")
intent.putExtra("data", "action:${msg.name}")
context.sendBroadcast(intent)
}
Expand Down

0 comments on commit f97a9da

Please sign in to comment.