mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 09:38:52 -06:00
Widgets for HistoryView, ScoreView, etc
This commit is contained in:
7
app/src/main/res/drawable/widget_background.xml
Normal file
7
app/src/main/res/drawable/widget_background.xml
Normal 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>
|
||||
@@ -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>
|
||||
30
app/src/main/res/layout/widget_graph.xml
Normal file
30
app/src/main/res/layout/widget_graph.xml
Normal 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>
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user