Skip to content

Commit

Permalink
Update Widget style with solid background
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Dunn committed Aug 5, 2018
1 parent 6b05621 commit 933acaf
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 74 deletions.
20 changes: 0 additions & 20 deletions src/main/res/drawable/accuracy_background.xml

This file was deleted.

Binary file modified src/main/res/drawable/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/main/res/drawable/refresh_button_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@android:drawable/stat_notify_sync_noanim" android:gravity="left"/>
</item>
</layer-list>
13 changes: 0 additions & 13 deletions src/main/res/drawable/widget_background.xml

This file was deleted.

72 changes: 35 additions & 37 deletions src/main/res/layout/appwidget.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/postcodewidget"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/widget_padding"
android:background="@drawable/widget_background">
android:id="@+id/postcodewidget"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="@dimen/widget_padding"
style="@style/widget_background">

<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="8dp">

<TextView
android:id="@+id/postcode"
android:paddingTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="10"
android:paddingLeft="10dp"
android:textColor="@android:color/white"
android:text="@string/nopostcode"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large"/>
android:text="@string/app_name"
android:textColor="#FF0"
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="10"
android:paddingLeft="10dp"
android:textColor="@android:color/white"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small.Inverse"/>
android:id="@+id/postcode"
android:layout_width="110sp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dp"
android:textColor="@android:color/white"
android:text="@string/locating"
style="@style/widget_postcode" />

<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dp"
android:textColor="@android:color/white"/>
</LinearLayout>

<Button
android:id="@+id/refresh"
android:layout_width="@dimen/button_width"
android:layout_height="@dimen/button_height"
android:layout_weight="2"
android:layout_margin="8dp"
android:background="@drawable/accuracy_background"
android:textColor="@android:color/white"/>


android:id="@+id/refresh"
android:layout_width="@dimen/button_width"
android:layout_height="match_parent"
android:background="@drawable/refresh_button_background"
android:textColor="@android:color/white"/>
</LinearLayout>

10 changes: 10 additions & 0 deletions src/main/res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="widget_postcode">
<item name="android:textAppearance">@android:style/TextAppearance.DeviceDefault.Large</item>
</style>

<style name="widget_background">
<item name="android:background">@android:drawable/dialog_holo_dark_frame</item>
</style>
</resources>
1 change: 0 additions & 1 deletion src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<resources>

<string name="app_name">Postcode</string>
<string name="nopostcode">--- ---</string>
<string name="locating">Locating</string>
<string name="updating">Updating</string>
<string name="lookup_fail">Lookup Failed</string>
Expand Down
10 changes: 10 additions & 0 deletions src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="widget_postcode">
<item name="android:textSize">20sp</item>
</style>

<style name="widget_background">
<item name="android:background">@android:color/darker_gray</item>
</style>
</resources>
3 changes: 0 additions & 3 deletions src/main/res/xml/postcode_appwidget_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="150dp"
android:minHeight="50dp"
android:minResizeWidth="150dp"
android:minResizeHeight="50dp"
android:updatePeriodMillis="1800000"
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen|keyguard"
android:initialLayout="@layout/appwidget"
android:initialKeyguardLayout="@layout/appwidget"
Expand Down

0 comments on commit 933acaf

Please sign in to comment.