First Commit
BIN
app/src/main/res/drawable-hdpi/ic_action_calendar.png
Normal file
After Width: | Height: | Size: 306 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_feedback.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_gift.png
Normal file
After Width: | Height: | Size: 643 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_location.png
Normal file
After Width: | Height: | Size: 624 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_rate.png
Normal file
After Width: | Height: | Size: 861 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_share.png
Normal file
After Width: | Height: | Size: 608 B |
BIN
app/src/main/res/drawable-hdpi/ic_stat_name.png
Normal file
After Width: | Height: | Size: 316 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_calendar.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_feedback.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_gift.png
Normal file
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_location.png
Normal file
After Width: | Height: | Size: 410 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_rate.png
Normal file
After Width: | Height: | Size: 543 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_share.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
app/src/main/res/drawable-mdpi/ic_stat_name.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
app/src/main/res/drawable-nodpi/example_appwidget_preview.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_calendar.png
Normal file
After Width: | Height: | Size: 337 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_feedback.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_gift.png
Normal file
After Width: | Height: | Size: 787 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_location.png
Normal file
After Width: | Height: | Size: 794 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_rate.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_share.png
Normal file
After Width: | Height: | Size: 828 B |
BIN
app/src/main/res/drawable-xhdpi/ic_stat_name.png
Normal file
After Width: | Height: | Size: 432 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_calendar.png
Normal file
After Width: | Height: | Size: 572 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_feedback.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_gift.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_location.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_rate.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_share.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_stat_name.png
Normal file
After Width: | Height: | Size: 640 B |
12
app/src/main/res/drawable/card_background.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
<stroke
|
||||
android:color="@android:color/white"
|
||||
android:width="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
app/src/main/res/drawable/circle_background.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid
|
||||
android:color="@color/black_30" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
app/src/main/res/drawable/clear_day.png
Executable file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/clear_night.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/cloudy_weather.png
Executable file
After Width: | Height: | Size: 10 KiB |
11
app/src/main/res/drawable/dark_card_background.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
<solid
|
||||
android:color="@color/black_30"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
app/src/main/res/drawable/gradient_background.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:startColor="@color/colorNightDark"
|
||||
android:endColor="@color/colorPrimary"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
app/src/main/res/drawable/haze_day.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/haze_night.png
Executable file
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/haze_weather.png
Executable file
After Width: | Height: | Size: 12 KiB |
113
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="108.0"
|
||||
android:viewportWidth="108.0">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#66FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
|
BIN
app/src/main/res/drawable/mostly_cloudy.png
Executable file
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/drawable/mostly_cloudy_night.png
Executable file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/partly_cloudy.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/partly_cloudy_night.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/rain_snow.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/rain_snow_day.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/rain_snow_night.png
Executable file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/rainy_day.png
Executable file
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/rainy_night.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/rainy_weather.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/showcase.png
Executable file
After Width: | Height: | Size: 48 KiB |
BIN
app/src/main/res/drawable/snow_day.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/snow_night.png
Executable file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/snow_weather.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/storm_weather.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/storm_weather_day.png
Executable file
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/storm_weather_night.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/thunder_day.png
Executable file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/thunder_night.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/thunder_weather.png
Executable file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/unknown.png
Executable file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/windy_day.png
Executable file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/windy_night.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/windy_weather.png
Executable file
After Width: | Height: | Size: 12 KiB |
233
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/gradient_background"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.tommasoberlose.anotherwidget.ui.activity.MainActivity">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/main_pre_title"
|
||||
android:alpha="0.6"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:gravity="center_vertical"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textAllCaps="true"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:gravity="center_vertical"
|
||||
style="@style/AnotherWidget.Main.Title"
|
||||
android:textAllCaps="true"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/menu_container"
|
||||
android:id="@+id/all_set_container">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Title"
|
||||
android:gravity="start"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/all_set_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Description"
|
||||
android:alpha="0.9"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="@string/all_set_subtitle"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Button.Dark"
|
||||
android:id="@+id/action_github"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/all_set_btn"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/no_calendar_permission_container"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="14dp"
|
||||
android:tint="@android:color/white"
|
||||
android:background="@drawable/circle_background"
|
||||
android:src="@drawable/ic_action_calendar"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Title"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingRight="32dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:text="@string/title_permission_calendar"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Description"
|
||||
android:paddingBottom="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:text="@string/description_permission_calendar"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Button"
|
||||
android:id="@+id/request_calendar"
|
||||
android:text="@string/button_request_permission"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/no_location_permission_container"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="14dp"
|
||||
android:tint="@android:color/white"
|
||||
android:background="@drawable/circle_background"
|
||||
android:src="@drawable/ic_action_location"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Title"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingRight="32dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:text="@string/title_permission_location"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Description"
|
||||
android:paddingBottom="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:paddingLeft="32dp"
|
||||
android:text="@string/description_permission_location"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Button"
|
||||
android:id="@+id/request_location"
|
||||
android:text="@string/button_request_permission"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:baselineAligned="false"
|
||||
android:id="@+id/menu_container"
|
||||
android:background="@color/black_10"
|
||||
android:layout_alignParentBottom="true">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:id="@+id/action_share"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="2dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/ic_action_share"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_share"
|
||||
style="@style/AnotherWidget.Main.Button.TabBar"
|
||||
android:background="@android:color/transparent"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:id="@+id/action_rate"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="2dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/ic_action_rate"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_rate"
|
||||
style="@style/AnotherWidget.Main.Button.TabBar"
|
||||
android:background="@android:color/transparent"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:id="@+id/action_support"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="2dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/ic_action_gift"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_support"
|
||||
style="@style/AnotherWidget.Main.Button.TabBar"
|
||||
android:background="@android:color/transparent"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
106
app/src/main/res/layout/the_widget.xml
Normal file
@ -0,0 +1,106 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/main_layout">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/empty_layout">
|
||||
<TextView
|
||||
android:id="@+id/empty_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
style="@style/AnotherWidget.Title" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/weather"
|
||||
android:visibility="gone">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/divider"
|
||||
style="@style/AnotherWidget.Subtitle"/>
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:id="@+id/empty_weather_icon"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/clear_night"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Date.Big"
|
||||
android:id="@+id/temp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/calendar_layout"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:id="@+id/next_event"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Title" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:src="@drawable/ic_action_calendar"/>
|
||||
<TextView
|
||||
android:id="@+id/next_event_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Subtitle" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/calendar_weather">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/divider"
|
||||
style="@style/AnotherWidget.Subtitle"/>
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:id="@+id/weather_icon"
|
||||
android:src="@drawable/clear_night"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Date"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:id="@+id/calendar_temp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
18
app/src/main/res/layout/weather_layout.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="|"
|
||||
style="@style/AnotherWidget.Subtitle"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Date"
|
||||
android:id="@+id/temp"/>
|
||||
</LinearLayout>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/gradient_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/gradient_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 13 KiB |
12
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#0092ca</color>
|
||||
<color name="colorPrimaryDark">#0083B5</color>
|
||||
<color name="colorNightDark">#124E96</color>
|
||||
<color name="colorAccent">#FF008E</color>
|
||||
<color name="colorPrimaryLight">#DAEAF6</color>
|
||||
<color name="black_50">#80000000</color>
|
||||
<color name="black_30">#48000000</color>
|
||||
<color name="black_10">#1A000000</color>
|
||||
<color name="white_80">#CCFFFFFF</color>
|
||||
</resources>
|
10
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Refer to App Widget Documentation for margin information
|
||||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
||||
-->
|
||||
<dimen name="widget_margin">16dp</dimen>
|
||||
|
||||
</resources>
|
19
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<resources>
|
||||
<string name="app_name">Another Widget</string>
|
||||
<string name="add_widget">Add Another Widget</string>
|
||||
<string name="main_pre_title">Just</string>
|
||||
<string name="button_request_permission">Grant Permission</string>
|
||||
<string name="title_permission_calendar">See your Events</string>
|
||||
<string name="title_permission_location">Control the Weather</string>
|
||||
<string name="description_permission_calendar">Grant access to your calendar\nto view events in your widget.</string>
|
||||
<string name="description_permission_location">Grant access to your location\nto view weather in your widget.</string>
|
||||
<string name="notification_title">Get more from your widget</string>
|
||||
<string name="notification_subtitle">View your events and the weather in another widget.</string>
|
||||
<string name="divider">|</string>
|
||||
<string name="action_share">Share</string>
|
||||
<string name="action_rate">Rate</string>
|
||||
<string name="action_support">Support</string>
|
||||
<string name="all_set_title">Good Job!</string>
|
||||
<string name="all_set_subtitle">You have completed the configuration.\nWatch out for updates.</string>
|
||||
<string name="all_set_btn">Stay up to date</string>
|
||||
</resources>
|
91
app/src/main/res/values/styles.xml
Normal file
@ -0,0 +1,91 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Title" parent="TextAppearance.AppCompat.Medium">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Subtitle" parent="TextAppearance.AppCompat.Small">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Description" parent="TextAppearance.AppCompat.Small">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:alpha">0.6</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Button" parent="TextAppearance.AppCompat.Button">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:background">@drawable/card_background</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:foreground">?android:attr/selectableItemBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Button.Dark" parent="TextAppearance.AppCompat.Button">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:background">@drawable/dark_card_background</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:foreground">?android:attr/selectableItemBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Main.Button.TabBar" parent="TextAppearance.AppCompat.Button">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Title" parent="TextAppearance.AppCompat.Medium">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:padding">4dp</item>
|
||||
<item name="android:textSize">26sp</item>
|
||||
<item name="android:shadowColor">@color/black_50</item>
|
||||
<item name="android:shadowRadius">5</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Subtitle" parent="TextAppearance.AppCompat.Small">
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:shadowColor">@color/black_50</item>
|
||||
<item name="android:shadowRadius">5</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Date" parent="AnotherWidget.Subtitle">
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Date.Big" parent="AnotherWidget.Title">
|
||||
<item name="android:textSize">24sp</item>
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
10
app/src/main/res/xml/the_widget_info.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialKeyguardLayout="@layout/the_widget"
|
||||
android:initialLayout="@layout/the_widget"
|
||||
android:minHeight="40dp"
|
||||
android:minWidth="250dp"
|
||||
android:previewImage="@drawable/example_appwidget_preview"
|
||||
android:resizeMode="horizontal"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen"></appwidget-provider>
|