Added single multiple clock
This commit is contained in:
148
app/src/main/res/layout/activity_time_zone_selector.xml
Normal file
148
app/src/main/res/layout/activity_time_zone_selector.xml
Normal file
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.tommasoberlose.anotherwidget.ui.viewmodels.tabs.TimeZoneSelectorViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout 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:orientation="vertical"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
tools:context="com.tommasoberlose.anotherwidget.ui.activities.tabs.TimeZoneSelectorActivity">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
android:id="@+id/toolbar"
|
||||
app:cardBackgroundColor="@color/colorPrimary">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:id="@+id/action_back"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_arrow_back_24" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/time_zones_header"
|
||||
android:gravity="center"
|
||||
style="@style/AnotherWidget.Main.Title"/>
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
app:cardBackgroundColor="@color/colorPrimary">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="9dp"
|
||||
app:cardElevation="0dp">
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:inputType="textCapWords"
|
||||
android:id="@+id/location"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:gravity="center_vertical|start"
|
||||
android:hint="@string/search"
|
||||
android:textAlignment="viewStart"
|
||||
android:textDirection="locale"
|
||||
android:text="@={viewModel.locationInput}"
|
||||
android:autofillHints="" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_close"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:id="@+id/clear_search" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:gravity="center_vertical">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="4dp"
|
||||
android:src="@drawable/outline_info_24"
|
||||
app:tint="@color/colorSecondaryText"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:duplicateParentState="true"
|
||||
android:linksClickable="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:id="@+id/geoname_credits"
|
||||
android:textColorLink="@color/colorPrimaryText"
|
||||
android:text="@string/geoname_credit"
|
||||
android:textColor="@color/colorSecondaryText"
|
||||
android:letterSpacing="0"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Subtitle"
|
||||
app:textAllCaps="false" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateTint="@color/colorAccent"
|
||||
android:layout_marginTop="-7dp"
|
||||
android:id="@+id/loader"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal" />
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:id="@+id/list_view" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
@ -138,6 +138,51 @@
|
||||
android:text="@string/settings_subtitle_dark_theme_dark"/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/time_zones_header"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_alt_timezone_clock"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_text_fields_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_alt_timezone_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/alt_timezone_clock_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -43,6 +43,50 @@
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"
|
||||
android:gravity="center_vertical"/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/timezones_container"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextClock
|
||||
android:id="@+id/alt_timezone_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="h:mm"
|
||||
android:padding="0dp"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"
|
||||
android:gravity="center_vertical"/>
|
||||
<TextClock
|
||||
android:id="@+id/alt_timezone_time_am_pm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="a"
|
||||
android:format24Hour=""
|
||||
android:padding="0dp"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"
|
||||
android:gravity="center_vertical"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/alt_timezone_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Widget.Subtitle" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -45,6 +45,50 @@
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/timezones_container"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextClock
|
||||
android:id="@+id/alt_timezone_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="h:mm"
|
||||
android:padding="0dp"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"
|
||||
android:gravity="center_vertical"/>
|
||||
<TextClock
|
||||
android:id="@+id/alt_timezone_time_am_pm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="a"
|
||||
android:format24Hour=""
|
||||
android:padding="0dp"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
style="@style/AnotherWidget.Widget.Title"
|
||||
android:gravity="center_vertical"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/alt_timezone_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Widget.Subtitle" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -204,6 +204,11 @@
|
||||
<string name="settings_clock_text_color_title">Text color</string>
|
||||
<string name="settings_ampm_indicator_title">Show AM/PM indicator</string>
|
||||
<string name="clock_text_header">Clock text style</string>
|
||||
<string name="time_zones_header">Time Zones</string>
|
||||
<string name="settings_alt_timezone_title">Multiple clock</string>
|
||||
<string name="no_time_zone_label">None</string>
|
||||
<string name="time_zone_search_error_message">Error searching the time zone.</string>
|
||||
<string name="geoname_credit">Service available thanks to <a href="http://www.geonames.org/">GeoName</a>.</string>
|
||||
|
||||
<!-- Glance -->
|
||||
<string name="settings_show_next_alarm_title">Next clock alarm</string>
|
||||
|
Reference in New Issue
Block a user