Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget placeholder UI Improvements #4649

Merged
merged 4 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/src/main/res/layout/widget_button.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:id="@+id/widgetLayout"
android:layout_width="match_parent"
Expand Down
28 changes: 18 additions & 10 deletions app/src/main/res/layout/widget_camera.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,27 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:contentDescription="@string/widget_camera_contentdescription"
android:scaleType="fitCenter" />
<ImageView

<FrameLayout
android:id="@+id/widgetCameraPlaceholder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:src="@drawable/app_icon_round"
android:contentDescription="@string/widget_camera_contentdescription"
android:scaleType="fitCenter" />
android:layout_gravity="center"
android:background="@android:color/transparent"
android:layout_height="match_parent">

<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/widget_camera_contentdescription"
android:scaleType="fitCenter"
android:src="@android:drawable/ic_menu_camera" />
</FrameLayout>

<ImageView
android:id="@+id/widgetCameraError"
android:contentDescription="@string/widget_entity_fetch_error"
Expand All @@ -34,5 +42,5 @@
android:layout_marginBottom="4dp"
android:src="@drawable/ic_sync_problem"
android:layout_gravity="center_horizontal|bottom"
android:visibility="gone"/>
</FrameLayout>
android:visibility="gone" />
</FrameLayout>
4 changes: 3 additions & 1 deletion app/src/main/res/layout/widget_media_controls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
android:id="@+id/widgetMediaPlaceholder"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="30dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:contentDescription="@string/widget_media_image_description"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/app_icon_round" />
android:tint="?colorWidgetOnBackground"
android:src="@android:drawable/ic_media_play" />
ivorsmorenburg marked this conversation as resolved.
Show resolved Hide resolved
</FrameLayout>

<RelativeLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/entity_widget_info.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:configure="io.homeassistant.companion.android.widgets.entity.EntityWidgetConfigureActivity"
android:initialKeyguardLayout="@layout/widget_button"
android:initialLayout="@layout/widget_button"
android:initialKeyguardLayout="@layout/widget_static"
android:initialLayout="@layout/widget_static"
android:minWidth="40dp"
android:minHeight="40dp"
android:minResizeWidth="40dp"
Expand Down