mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-02 03:16:07 +02:00
73d67d4093
This PR aims to optimize the method of synchronizing the menu_structure for the openSourceWatchface by making the menu_structure request from the watch obsolete. Instead, when a new menu_structure is sent to GB via the Intent `nodomain.freeyourgadget.gadgetbridge.Q_SET_MENU_STRUCTURE`, GB remembers that JSON. Next time a watchface is built, the JSON is embedded into that app package so the watch doesn't forget the structure. This requires a full GB rebuild to work properky. Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3245 Co-authored-by: Daniel Dakhno <dakhnod@gmail.com> Co-committed-by: Daniel Dakhno <dakhnod@gmail.com>
164 lines
5.9 KiB
XML
164 lines
5.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<ScrollView
|
|
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="wrap_content">
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
tools:context=".devices.qhybrid.HybridHRWatchfaceDesignerActivity">
|
|
|
|
<ProgressBar
|
|
style="@android:style/Widget.DeviceDefault.ProgressBar.Horizontal"
|
|
android:id="@+id/watchface_upload_progress_bar"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="10dp"
|
|
android:scaleY="3"
|
|
android:indeterminate="true"
|
|
android:visibility="gone" />
|
|
|
|
<RelativeLayout
|
|
android:id="@+id/watchface_name_layout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<TextView
|
|
android:id="@+id/watchface_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_marginStart="10dp"
|
|
android:text="NewWatchface"
|
|
android:textSize="16sp" />
|
|
|
|
<Button
|
|
android:id="@+id/button_edit_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_alignParentEnd="true"
|
|
android:text="@string/button_watchface_edit_name" />
|
|
</RelativeLayout>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:orientation="horizontal">
|
|
|
|
<ImageView
|
|
android:id="@+id/watchface_invert_colors"
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
app:srcCompat="@drawable/ic_invert_colors" />
|
|
|
|
<ImageView
|
|
android:id="@+id/watchface_rotate_left"
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
android:layout_alignStart="@+id/watchface_invert_colors"
|
|
app:srcCompat="@drawable/ic_rotate_left" />
|
|
|
|
<ImageView
|
|
android:id="@+id/watchface_rotate_right"
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
android:layout_alignStart="@+id/watchface_rotate_left"
|
|
android:rotationY="180"
|
|
app:srcCompat="@drawable/ic_rotate_left" />
|
|
|
|
<ImageView
|
|
android:id="@+id/watchface_remove_image"
|
|
android:layout_width="40dp"
|
|
android:layout_height="40dp"
|
|
android:layout_alignStart="@+id/watchface_rotate_right"
|
|
app:srcCompat="@drawable/ic_remove_image" />
|
|
</LinearLayout>
|
|
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<RelativeLayout
|
|
android:id="@+id/watchface_preview_layout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="20dp"
|
|
android:layout_marginBottom="20dp">
|
|
|
|
<ImageView
|
|
android:id="@+id/hybridhr_background_image"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerHorizontal="true" />
|
|
</RelativeLayout>
|
|
</RelativeLayout>
|
|
|
|
<RelativeLayout
|
|
android:id="@+id/watchface_widget_delete_layout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="20dp"
|
|
android:visibility="gone">
|
|
|
|
<ImageView
|
|
android:id="@+id/watchface_widget_delete_droparea"
|
|
android:layout_width="60dp"
|
|
android:layout_height="60dp"
|
|
android:layout_centerHorizontal="true"
|
|
app:srcCompat="@drawable/ic_delete_forever" />
|
|
</RelativeLayout>
|
|
|
|
<Button
|
|
android:id="@+id/button_set_background"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/button_watchface_select_image" />
|
|
|
|
<Button
|
|
android:id="@+id/button_add_widget"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/button_watchface_add_widget" />
|
|
|
|
<Button
|
|
android:id="@+id/button_watchface_settings"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/button_watchface_settings" />
|
|
|
|
<Button
|
|
android:id="@+id/button_watchface_open_menu_companion"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/button_open_menu_companion" />
|
|
|
|
<Button
|
|
android:id="@+id/button_watchface_reset_menu_structure"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/button_reset_menu_structure" />
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:id="@+id/fossil_menu_structure_hint_container"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="8dp"
|
|
android:foreground="?android:attr/selectableItemBackground"
|
|
app:cardBackgroundColor="?attr/cardview_background_color"
|
|
app:cardElevation="3dp"
|
|
app:contentPadding="8dp">
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/text_watchface_menu_structure"
|
|
android:lines="1"
|
|
android:ellipsize="end" />
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
|
|
</LinearLayout>
|
|
</ScrollView> |