Refactoring

This commit is contained in:
darken
2022-09-14 18:00:18 +02:00
committed by Matthias Urhahn
parent 2210561af3
commit de9a30eb93
19 changed files with 1 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.darken.capod">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.DeviceDefault">
<uses-library
android:name="com.google.android.wearable"
android:required="true" />
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<activity
android:name=".wear.ui.MainActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".wear.core.CAPodTileService"
android:description="@string/wear_service_description"
android:exported="true"
android:icon="@drawable/common_full_open_on_phone"
android:label="@string/wear_service_label"
android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER">
<intent-filter>
<action android:name="androidx.wear.tiles.action.BIND_TILE_PROVIDER" />
</intent-filter>
<!-- The tile preview shown when configuring tiles on your phone -->
<meta-data
android:name="androidx.wear.tiles.PREVIEW"
android:resource="@layout/wear_tile_preview" />
</service>
</application>
</manifest>
@@ -0,0 +1,53 @@
package eu.darken.capod.wear.core
import androidx.wear.tiles.*
import com.google.android.horologist.tiles.CoroutinesTileService
import eu.darken.capod.R
private const val RESOURCES_VERSION = "0"
class CAPodTileService : CoroutinesTileService() {
override suspend fun resourcesRequest(
requestParams: RequestBuilders.ResourcesRequest
): ResourceBuilders.Resources {
return ResourceBuilders.Resources.Builder()
.setVersion(RESOURCES_VERSION)
.build()
}
override suspend fun tileRequest(
requestParams: RequestBuilders.TileRequest
): TileBuilders.Tile {
val singleTileTimeline = TimelineBuilders.Timeline.Builder()
.addTimelineEntry(
TimelineBuilders.TimelineEntry.Builder()
.setLayout(
LayoutElementBuilders.Layout.Builder()
.setRoot(tileLayout())
.build()
)
.build()
)
.build()
return TileBuilders.Tile.Builder()
.setResourcesVersion(RESOURCES_VERSION)
.setTimeline(singleTileTimeline)
.build()
}
private fun tileLayout(): LayoutElementBuilders.LayoutElement {
val text = getString(R.string.app_name)
return LayoutElementBuilders.Box.Builder()
.setVerticalAlignment(LayoutElementBuilders.VERTICAL_ALIGN_CENTER)
.setWidth(DimensionBuilders.expand())
.setHeight(DimensionBuilders.expand())
.addContent(
LayoutElementBuilders.Text.Builder()
.setText(text)
.build()
)
.build()
}
}
@@ -0,0 +1,18 @@
package eu.darken.capod.wear.ui
import android.app.Activity
import android.os.Bundle
import eu.darken.capod.databinding.ActivityMainBinding
class MainActivity : Activity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
}
}
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.wear.widget.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/box_inset_layout_padding"
tools:context=".wear.ui.MainActivity"
tools:deviceIds="wear">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/inner_frame_layout_padding"
app:layout_boxedEdges="all">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name" />
</FrameLayout>
</androidx.wear.widget.BoxInsetLayout>
@@ -0,0 +1,278 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
tools:context=".wear.ui.MainActivity">
<ImageView
android:id="@+id/device_icon"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toTopOf="@+id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_airpod_both_24" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/name"
style="@style/TextAppearance.Material3.BodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintBottom_toTopOf="@+id/status"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/device_icon"
tools:text="Apple AirPods Pro" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/status"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:lines="2"
android:maxLines="2"
app:layout_constraintBottom_toTopOf="@id/barrier_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name"
tools:text="Music Active, Case Closed" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="status" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_left_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
app:layout_constraintBottom_toTopOf="@id/barrier_bottom"
app:layout_constraintEnd_toStartOf="@id/pod_case_container"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_top"
app:layout_constraintVertical_bias="0.2">
<ImageView
android:id="@+id/pod_left_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:contentDescription="@string/pods_dual_left_label"
android:src="@drawable/ic_airpod_left_24"
app:layout_constraintEnd_toStartOf="@+id/pod_left_wear_icon"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_left_wear_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:src="@drawable/ic_baseline_hearing_24"
app:layout_constraintBottom_toBottomOf="@id/pod_left_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_left_icon"
app:layout_constraintTop_toTopOf="@id/pod_left_icon" />
<ImageView
android:id="@+id/pod_left_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_left_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_left_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_left_icon" />
<ImageView
android:id="@+id/pod_left_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_left_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_left_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_left_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_left_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="@id/pod_left_charging_icon"
app:layout_constraintStart_toStartOf="@id/pod_left_battery_icon"
app:layout_constraintTop_toBottomOf="@id/pod_left_battery_icon" />
<ImageView
android:id="@+id/pod_left_microphone_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_keyboard_voice_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.85"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_left_battery_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_case_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
app:layout_constraintBottom_toBottomOf="@id/pod_left_container"
app:layout_constraintEnd_toStartOf="@id/pod_right_container"
app:layout_constraintStart_toEndOf="@id/pod_left_container"
app:layout_constraintTop_toTopOf="@id/pod_left_container"
app:layout_constraintVertical_bias="0.0">
<ImageView
android:id="@+id/pod_case_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_airpod_case_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_case_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_case_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_case_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_case_icon" />
<ImageView
android:id="@+id/pod_case_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_case_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_case_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_case_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_case_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_case_battery_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_right_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
app:layout_constraintBottom_toTopOf="@id/barrier_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_case_container"
app:layout_constraintTop_toBottomOf="@id/barrier_top"
app:layout_constraintVertical_bias="0.2">
<ImageView
android:id="@+id/pod_right_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:contentDescription="@string/pods_dual_right_label"
android:src="@drawable/ic_airpod_right_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toEndOf="@+id/pod_right_wear_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_right_wear_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:src="@drawable/ic_baseline_hearing_24"
app:layout_constraintBottom_toBottomOf="@id/pod_right_icon"
app:layout_constraintEnd_toStartOf="@id/pod_right_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/pod_right_icon" />
<ImageView
android:id="@+id/pod_right_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_right_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_right_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_right_icon" />
<ImageView
android:id="@+id/pod_right_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_right_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_right_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_right_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_right_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="@id/pod_right_charging_icon"
app:layout_constraintStart_toStartOf="@id/pod_right_battery_icon"
app:layout_constraintTop_toBottomOf="@id/pod_right_battery_icon" />
<ImageView
android:id="@+id/pod_right_microphone_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_keyboard_voice_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_right_battery_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="last_seen" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/last_seen"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:drawableStartCompat="@drawable/ic_baseline_watch_later_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="3s ago" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
tools:context=".wear.ui.MainActivity">
<ImageView
android:id="@+id/device_icon"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toTopOf="@+id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_device_generic_headphones" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/name"
style="@style/TextAppearance.Material3.BodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintBottom_toTopOf="@+id/status"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/device_icon"
tools:text="Apple AirPods Max" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/status"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:lines="2"
android:maxLines="2"
app:layout_constraintBottom_toTopOf="@id/barrier_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name"
tools:text="Music Active, Case Closed" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="status" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_case_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
app:layout_constraintBottom_toTopOf="@id/barrier_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_top"
app:layout_constraintVertical_bias="0.20">
<ImageView
android:id="@+id/battery_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toBottomOf="@id/battery_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/battery_label" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/battery_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/charging_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/charging_label" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/charging_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:text="@string/pods_charging_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/charging_icon"
app:layout_constraintTop_toBottomOf="@id/battery_label" />
<ImageView
android:id="@+id/wear_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_hearing_24"
app:layout_constraintBottom_toBottomOf="@id/wear_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/wear_label" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/wear_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:text="@string/headset_being_worn_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/wear_icon"
app:layout_constraintTop_toBottomOf="@id/charging_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="last_seen" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/last_seen"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:drawableStartCompat="@drawable/ic_baseline_watch_later_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="3s ago" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,278 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
tools:context=".wear.ui.MainActivity">
<ImageView
android:id="@+id/device_icon"
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintBottom_toTopOf="@+id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_airpod_both_24" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/name"
style="@style/TextAppearance.Material3.BodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintBottom_toTopOf="@+id/status"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/device_icon"
tools:text="Apple AirPods Pro" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/status"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:lines="2"
android:maxLines="2"
app:layout_constraintBottom_toTopOf="@id/barrier_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/name"
tools:text="Music Active, Case Closed" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="status" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_left_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
app:layout_constraintBottom_toTopOf="@id/barrier_bottom"
app:layout_constraintEnd_toStartOf="@id/pod_case_container"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_top"
app:layout_constraintVertical_bias="0.2">
<ImageView
android:id="@+id/pod_left_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:contentDescription="@string/pods_dual_left_label"
android:src="@drawable/ic_airpod_left_24"
app:layout_constraintEnd_toStartOf="@+id/pod_left_wear_icon"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_left_wear_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:src="@drawable/ic_baseline_hearing_24"
app:layout_constraintBottom_toBottomOf="@id/pod_left_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_left_icon"
app:layout_constraintTop_toTopOf="@id/pod_left_icon" />
<ImageView
android:id="@+id/pod_left_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_left_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_left_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_left_icon" />
<ImageView
android:id="@+id/pod_left_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_left_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_left_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_left_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_left_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="@id/pod_left_charging_icon"
app:layout_constraintStart_toStartOf="@id/pod_left_battery_icon"
app:layout_constraintTop_toBottomOf="@id/pod_left_battery_icon" />
<ImageView
android:id="@+id/pod_left_microphone_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_keyboard_voice_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.85"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_left_battery_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_case_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
app:layout_constraintBottom_toBottomOf="@id/pod_left_container"
app:layout_constraintEnd_toStartOf="@id/pod_right_container"
app:layout_constraintStart_toEndOf="@id/pod_left_container"
app:layout_constraintTop_toTopOf="@id/pod_left_container"
app:layout_constraintVertical_bias="0.0">
<ImageView
android:id="@+id/pod_case_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_airpod_case_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_case_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_case_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_case_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_case_icon" />
<ImageView
android:id="@+id/pod_case_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_case_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_case_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_case_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_case_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_case_battery_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pod_right_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
app:layout_constraintBottom_toTopOf="@id/barrier_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_case_container"
app:layout_constraintTop_toBottomOf="@id/barrier_top"
app:layout_constraintVertical_bias="0.2">
<ImageView
android:id="@+id/pod_right_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:contentDescription="@string/pods_dual_right_label"
android:src="@drawable/ic_airpod_right_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toEndOf="@+id/pod_right_wear_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/pod_right_wear_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:src="@drawable/ic_baseline_hearing_24"
app:layout_constraintBottom_toBottomOf="@id/pod_right_icon"
app:layout_constraintEnd_toStartOf="@id/pod_right_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/pod_right_icon" />
<ImageView
android:id="@+id/pod_right_battery_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_battery_unknown_24"
app:layout_constraintBottom_toTopOf="@id/pod_right_battery_label"
app:layout_constraintEnd_toStartOf="@+id/pod_right_charging_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_right_icon" />
<ImageView
android:id="@+id/pod_right_charging_icon"
style="@style/PodInfoItemIconWearTile"
android:src="@drawable/ic_baseline_power_24"
app:layout_constraintBottom_toBottomOf="@id/pod_right_battery_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/pod_right_battery_icon"
app:layout_constraintTop_toTopOf="@id/pod_right_battery_icon" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pod_right_battery_label"
style="@style/PodInfoItemTextWearTile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/general_value_not_available_label"
app:layout_constraintEnd_toEndOf="@id/pod_right_charging_icon"
app:layout_constraintStart_toStartOf="@id/pod_right_battery_icon"
app:layout_constraintTop_toBottomOf="@id/pod_right_battery_icon" />
<ImageView
android:id="@+id/pod_right_microphone_icon"
style="@style/PodInfoItemIconWearTile"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_baseline_keyboard_voice_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pod_right_battery_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="last_seen" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/last_seen"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:drawableStartCompat="@drawable/ic_baseline_watch_later_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="3s ago" />
</androidx.constraintlayout.widget.ConstraintLayout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens.
-->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!--
This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens.
-->
<dimen name="inner_frame_layout_padding">5dp</dimen>
</resources>
+4
View File
@@ -0,0 +1,4 @@
<resources>
<string name="wear_service_label">CAPod for WearOS</string>
<string name="wear_service_description">View details about your AirPood devices on your WearOS device.</string>
</resources>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="PodInfoItemIconWearTile" parent="TextAppearance.Material3.BodySmall">
<item name="android:layout_height">16dp</item>
<item name="android:layout_width">16dp</item>
</style>
<style name="PodInfoItemTextWearTile" parent="TextAppearance.Material3.BodyMedium">
<item name="android:singleLine">true</item>
<item name="android:gravity">center</item>
<item name="android:ellipsize">end</item>
</style>
</resources>