Start supporting custom font

This commit is contained in:
Tommaso Berlose
2017-10-23 17:42:12 +02:00
parent c8dd8f711e
commit 9318a99d1f
13 changed files with 488 additions and 90 deletions

View File

@ -37,7 +37,7 @@
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_height="200dp"
android:id="@+id/widget">
<ImageView
android:layout_width="match_parent"
@ -47,7 +47,13 @@
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
layout="@layout/the_widget"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/widget_bitmap"/>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
@ -88,38 +94,17 @@
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_font_color"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_font_color_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/font_color_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="24dp"
android:layout_height="24dp"
android:padding="3dp"
android:orientation="horizontal"
android:background="@drawable/circle_background">
<android.support.v7.widget.CardView
android:layout_width="18dp"
android:layout_height="18dp"
app:cardCornerRadius="9dp"
app:cardElevation="0dp"
android:id="@+id/text_color_icon"
android:orientation="horizontal"
android:background="@android:color/white"/>
</LinearLayout>
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_font_color_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/font_color_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
@ -169,6 +154,81 @@
android:id="@+id/second_text_size_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@color/black_10"
android:alpha="0.5"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/settings_clock_title"
style="@style/AnotherWidget.Settings.Header"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_show_clock"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/title_show_clock"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/show_clock_label"
android:text="@string/description_show_clock"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/clock_settings"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_clock_app"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_clock_app_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/clock_app_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@color/black_10"
android:alpha="0.5"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -442,30 +502,6 @@
android:layout_height="wrap_content"
android:id="@+id/weather_settings"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_custom_location"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_custom_location_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/label_custom_location"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -502,6 +538,30 @@
android:visibility="gone"
android:src="@drawable/ic_action_alert"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_custom_location"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_custom_location_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/label_custom_location"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -46,6 +46,32 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:orientation="vertical"
android:descendantFocusability="beforeDescendants"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:id="@+id/action_change_provider"
android:background="@android:color/white"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_weather_provider_api_key_title"
android:textColor="@android:color/black"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/label_weather_provider"
style="@style/AnotherWidget.Settings.Subtitle"
android:textColor="@android:color/black"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"

View File

@ -3,11 +3,26 @@
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_layout">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20:16"
android:layout_centerHorizontal="true"
android:gravity="center"
android:lineSpacingMultiplier="1"
android:lineSpacingExtra="0dp"
android:includeFontPadding="false"
android:padding="0dp"
android:visibility="gone"
style="@style/AnotherWidget.Title"
android:textSize="90sp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_below="@+id/time"
android:orientation="horizontal"
android:id="@+id/empty_layout">
<TextView
@ -46,7 +61,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Date.Big"
android:singleLine="true"
android:ellipsize="marquee"
android:id="@+id/temp"/>
</LinearLayout>
@ -55,9 +69,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical"
android:visibility="gone"
android:layout_centerHorizontal="true"
android:layout_below="@+id/time"
android:id="@+id/calendar_layout"
android:gravity="center">
<LinearLayout
@ -95,7 +110,6 @@
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="4dp"
android:layout_marginStart="4dp"
android:id="@+id/second_row_icon"

View File

@ -0,0 +1,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_layout">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/bitmap_container"/>
</RelativeLayout>

View File

@ -104,4 +104,10 @@
<string name="settings_font_color_title">Colore Testo</string>
<string name="title_main_text_size">Dimensione Testo Prima Riga</string>
<string name="title_second_text_size">Dimensione Testo Seconda Riga</string>
<string name="settings_clock_title">Impostazioni Orologio</string>
<string name="settings_clock_app_title">L\'orologio apre</string>
<string name="title_show_clock">Mostra Orologio</string>
<string name="description_show_clock">Mostra l\'ora sopra eventi e meteo</string>
<string name="show_clock_visible">Orologio visibile</string>
<string name="show_clock_not_visible">Orologio non visibile</string>
</resources>

View File

@ -52,8 +52,8 @@
<string name="action_refresh_widget">Refresh Widget</string>
<string name="show_events_visible">Events are Visible</string>
<string name="show_events_not_visible">Events are not Visible</string>
<string name="show_weather_visible">Weather Info are Visible</string>
<string name="show_weather_not_visible">Weather Info are not Visible</string>
<string name="show_weather_visible">Weather Info is Visible</string>
<string name="show_weather_not_visible">Weather Info is not Visible</string>
<string name="settings_show_until_subtitle_0">3 Hours later</string>
<string name="settings_show_until_subtitle_1">6 Hours later</string>
<string name="settings_show_until_subtitle_2">12 Hours later</string>
@ -106,4 +106,12 @@
<string name="settings_font_color_title">Text Color</string>
<string name="title_main_text_size">First Row Text Size</string>
<string name="title_second_text_size">Second Row Text Size</string>
<string name="provider_open_weather" translatable="false">OpenWeather</string>
<string name="provider_google_awareness" translatable="false">Google Awareness</string>
<string name="settings_clock_title">Clock Settings</string>
<string name="settings_clock_app_title">Tap on clock opens</string>
<string name="title_show_clock">Show Clock</string>
<string name="description_show_clock">View the time over events and weather</string>
<string name="show_clock_visible">Clock is visible</string>
<string name="show_clock_not_visible">Clock is not visible</string>
</resources>