Widgets for HistoryView, ScoreView, etc

This commit is contained in:
2016-02-28 13:55:39 -05:00
parent a2331260e4
commit f0d12e9925
14 changed files with 179 additions and 62 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#30000000" />
<corners android:radius="10dp" />
</shape>

View File

@@ -41,7 +41,7 @@
<org.isoron.uhabits.views.HabitScoreView
android:id="@+id/scoreView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="180dp"/>
</LinearLayout>
@@ -61,7 +61,7 @@
<org.isoron.uhabits.views.HabitHistoryView
android:id="@+id/historyView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="180dp"/>
</LinearLayout>
@@ -81,7 +81,7 @@
<org.isoron.uhabits.views.HabitStreakView
android:id="@+id/streakView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="180dp"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/widget_background"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="4dp"
android:paddingLeft="10dp"
android:paddingRight="0dp">
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Wake up early"
android:textColor="@color/white"/>
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:adjustViewBounds="true"
/>
</LinearLayout>

View File

@@ -2,9 +2,9 @@
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minHeight="40dp"
android:minWidth="40dp"
android:initialLayout="@layout/small_widget"
android:initialLayout="@layout/widget_small"
android:previewImage="@mipmap/ic_small_widget_preview"
android:resizeMode="none"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="3600000"
android:configure="org.isoron.uhabits.HabitWidgetConfigure"
android:widgetCategory="home_screen">