Skip to content

Commit

Permalink
Widget placeholder UI Improvements (#4649)
Browse files Browse the repository at this point in the history
* Small UI Improvements

* Addressed some comments

* Update widget_camera.xml

Removed Padding
  • Loading branch information
ivorsmorenburg authored Sep 22, 2024
1 parent 6b7bc9c commit c9ecd44
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
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" />
</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

0 comments on commit c9ecd44

Please sign in to comment.