Update main design
This commit is contained in:
@ -63,7 +63,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
style="@style/CustomCardViewStyle"
|
||||
app:cardBackgroundColor="@color/colorPrimary">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -5,16 +5,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="?android:attr/colorPrimary"
|
||||
android:background="?android:attr/colorPrimaryDark"
|
||||
tools:context=".ui.activities.MainActivity">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
android:id="@+id/toolbar"
|
||||
android:transitionName="@string/toolbar_transition_name"
|
||||
style="@style/CustomCardViewStyle"
|
||||
app:cardBackgroundColor="@color/colorPrimary">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -72,6 +72,7 @@
|
||||
app:cardBackgroundColor="@color/colorPrimary"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:cardCornerRadius="9dp"
|
||||
app:cardElevation="0dp">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
@ -103,43 +104,26 @@
|
||||
android:id="@+id/widget_loader" />
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
app:tabGravity="start"
|
||||
app:tabIndicatorColor="@color/colorAccent"
|
||||
app:tabBackground="@color/colorPrimary"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabMode="scrollable"
|
||||
app:tabIndicatorHeight="3dp"
|
||||
app:tabUnboundedRipple="true"
|
||||
app:tabRippleColor="@color/colorPrimary"
|
||||
app:tabTextColor="@color/colorSecondaryText"
|
||||
app:tabSelectedTextColor="@color/colorAccent"
|
||||
app:tabIndicator="@drawable/custom_tab_indicator"
|
||||
app:tabPadding="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:clipToPadding="false"
|
||||
app:tabMinWidth="110dp"
|
||||
app:tabMaxWidth="0dp"
|
||||
android:background="@color/colorPrimary"
|
||||
app:tabTextAppearance="@style/AnotherWidget.Settings.Header" />
|
||||
android:layout_height="16dp"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/bottom_padding" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:orientation="vertical">
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/settings_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/settings_nav_graph"
|
||||
android:layout_width="match_parent"
|
||||
android:elevation="0dp"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
android:layout_height="match_parent"/>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -25,72 +25,11 @@
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
<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_show_events"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_today_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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/title_permission_calendar"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/show_events_label"
|
||||
android:text="@string/description_permission_calendar"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
android:letterSpacing="0"
|
||||
android:textAllCaps="false"
|
||||
android:clickable="true"
|
||||
android:layout_marginStart="-8dp"
|
||||
android:layout_marginBottom="-8dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:paddingTop="0dp"
|
||||
android:focusable="true"
|
||||
android:id="@+id/read_calendar_permission_alert"
|
||||
android:textColor="@color/errorColorText"
|
||||
android:text="@string/action_grant_permission"/>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{isCalendarEnabled}"
|
||||
android:id="@+id/show_events_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/calendar_settings"
|
||||
android:alpha="@{isCalendarEnabled ? 1f : 0.2f, default=1}"
|
||||
android:alpha="@{isCalendarEnabled ? 1f : 1f, default=1}"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -68,56 +68,11 @@
|
||||
android:layout_gravity="end" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<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_show_clock"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_schedule_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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/title_show_clock"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/show_clock_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{isClockVisible}"
|
||||
android:id="@+id/show_clock_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/clock_settings"
|
||||
android:alpha="@{isClockVisible ? 1f : 0.2f, default=1}"
|
||||
android:alpha="@{isClockVisible ? 1f : 1f, default=1}"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -30,7 +30,6 @@
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
@ -51,7 +50,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_text_fields_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -88,7 +87,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_palette_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
@ -147,7 +146,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/round_text_format_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -174,7 +173,6 @@
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
@ -195,7 +193,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_text_fields_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -232,7 +230,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_palette_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
@ -291,7 +289,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_format_line_spacing"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -318,7 +316,6 @@
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
@ -339,7 +336,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_texture_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
@ -398,7 +395,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_font_download_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -436,7 +433,7 @@
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_vertical_align_center_24"
|
||||
android:rotation="90"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
@ -470,7 +467,6 @@
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
@ -491,7 +487,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_aspect_ratio_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
app:tint="@color/colorAccent"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
|
@ -22,56 +22,11 @@
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
<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_show_glance"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="10dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_pageview"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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/title_show_glance"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/show_glance_label"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{isGlanceVisible}"
|
||||
android:id="@+id/show_glance_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/calendar_settings"
|
||||
android:alpha="@{isGlanceVisible ? 1f : 0.2f, default=1}"
|
||||
android:alpha="@{isGlanceVisible ? 1f : 1f, default=1}"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
|
382
app/src/main/res/layout/fragment_tab_selector.xml
Normal file
382
app/src/main/res/layout/fragment_tab_selector.xml
Normal file
@ -0,0 +1,382 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel" />
|
||||
<variable
|
||||
name="isCalendarEnabled"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="isWeatherVisible"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="isClockVisible"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="isGlanceVisible"
|
||||
type="Boolean" />
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
<com.tommasoberlose.anotherwidget.components.FixedFocusScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/scrollView"
|
||||
android:scrollbarThumbVertical="@color/colorPrimary"
|
||||
android:background="@color/colorPrimaryDark">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Apperances"
|
||||
android:paddingTop="16dp"
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:strokeColor="@color/cardBorder"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="8dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_general_settings"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/round_palette_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
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="Look & feel"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change the widget design"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/round_chevron_right_24"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp"
|
||||
android:text="Content"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAlignment="viewStart"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textAppearance="@style/AnotherWidget.Settings.Header"
|
||||
app:textAllCaps="false" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:strokeColor="@color/cardBorder"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="8dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_show_events"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_today_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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="Calendar"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change the widget design"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardBorder"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:alpha="0.6" />
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{isCalendarEnabled}"
|
||||
app:kswBackRadius="16dp"
|
||||
app:kswTintColor="@color/colorAccent"
|
||||
android:id="@+id/show_events_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:strokeColor="@color/cardBorder"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="8dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_show_weather"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:id="@+id/weather_icon_pack"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_brightness_5_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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="Weather"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change the widget design"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardBorder"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:alpha="0.6" />
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:kswBackRadius="16dp"
|
||||
app:kswTintColor="@color/colorAccent"
|
||||
android:checked="@{isWeatherVisible}"
|
||||
android:id="@+id/show_weather_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:strokeColor="@color/cardBorder"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="8dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_show_clock"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_schedule_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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="Clock"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change the clock "
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardBorder"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:alpha="0.6" />
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:kswBackRadius="16dp"
|
||||
app:kswTintColor="@color/colorAccent"
|
||||
android:checked="@{isClockVisible}"
|
||||
android:id="@+id/show_clock_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:strokeColor="@color/cardBorder"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="@color/colorPrimaryDark"
|
||||
app:cardCornerRadius="8dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_show_glance"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="10dp"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_pageview"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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="Glance"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change glace info"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cardBorder"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:alpha="0.6" />
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:kswBackRadius="16dp"
|
||||
app:kswTintColor="@color/colorAccent"
|
||||
android:checked="@{isGlanceVisible}"
|
||||
android:id="@+id/show_glance_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</LinearLayout>
|
||||
</com.tommasoberlose.anotherwidget.components.FixedFocusScrollView>
|
||||
</layout>
|
@ -21,58 +21,11 @@
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
<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_show_weather"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:id="@+id/weather_icon_pack"
|
||||
app:tint="@color/colorPrimaryText"
|
||||
android:src="@drawable/round_brightness_5_24"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
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/title_permission_location"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/show_weather_label"
|
||||
android:text="@string/description_permission_location"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{isWeatherVisible}"
|
||||
android:id="@+id/show_weather_switch"
|
||||
android:buttonTint="@color/colorAccent" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/weather_settings"
|
||||
android:alpha="@{isWeatherVisible ? 1f : 0.2f, default=1}"
|
||||
android:alpha="@{isWeatherVisible ? 1f : 1f, default=1}"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
|
46
app/src/main/res/navigation/settings_nav_graph.xml
Normal file
46
app/src/main/res/navigation/settings_nav_graph.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/settings_nav_graph"
|
||||
app:startDestination="@id/tabSelectorFragment">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/calendarTabFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.CalendarTabFragment"
|
||||
android:label="CalendarTabFragment" />
|
||||
<fragment
|
||||
android:id="@+id/clockTabFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.ClockTabFragment"
|
||||
android:label="ClockTabFragment" />
|
||||
<fragment
|
||||
android:id="@+id/glanceTabFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.GlanceTabFragment"
|
||||
android:label="GlanceTabFragment" />
|
||||
<fragment
|
||||
android:id="@+id/generalTabFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.GeneralTabFragment"
|
||||
android:label="GeneralTabFragment" />
|
||||
<fragment
|
||||
android:id="@+id/weatherTabFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.WeatherTabFragment"
|
||||
android:label="WeatherTabFragment" />
|
||||
<fragment
|
||||
android:id="@+id/tabSelectorFragment"
|
||||
android:name="com.tommasoberlose.anotherwidget.ui.fragments.TabSelectorFragment"
|
||||
android:label="TabSelectorFragment" >
|
||||
<action
|
||||
android:id="@+id/action_tabSelectorFragment_to_generalTabFragment"
|
||||
app:destination="@id/generalTabFragment" />
|
||||
<action
|
||||
android:id="@+id/action_tabSelectorFragment_to_weatherTabFragment"
|
||||
app:destination="@id/weatherTabFragment" />
|
||||
<action
|
||||
android:id="@+id/action_tabSelectorFragment_to_glanceTabFragment"
|
||||
app:destination="@id/glanceTabFragment" />
|
||||
<action
|
||||
android:id="@+id/action_tabSelectorFragment_to_calendarTabFragment"
|
||||
app:destination="@id/calendarTabFragment" />
|
||||
<action
|
||||
android:id="@+id/action_tabSelectorFragment_to_clockTabFragment"
|
||||
app:destination="@id/clockTabFragment" />
|
||||
</fragment>
|
||||
</navigation>
|
@ -25,4 +25,5 @@
|
||||
<!-- <color name="disabledButtonBackground">#131D28</color>-->
|
||||
<color name="disabledButtonBackground">#33000000</color>
|
||||
<color name="badgeBackground">#202020</color>
|
||||
<color name="cardBorder">#252525</color>
|
||||
</resources>
|
@ -34,5 +34,6 @@
|
||||
<color name="disabledButtonBackground">#efefef</color>
|
||||
<color name="success">#43A047</color>
|
||||
<color name="badgeBackground">#efefef</color>
|
||||
<color name="cardBorder">#DADADA</color>
|
||||
|
||||
</resources>
|
||||
|
@ -72,7 +72,7 @@
|
||||
</style>
|
||||
|
||||
<style name="AnotherWidget.Settings.Header" parent="TextAppearance.AppCompat.Medium">
|
||||
<item name="android:textColor">@color/colorPrimaryText</item>
|
||||
<item name="android:textColor">@color/colorSecondaryText</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:fontFamily">@font/google_sans</item>
|
||||
@ -150,5 +150,16 @@
|
||||
|
||||
<style name="BottomSheetDialogTheme" parent="BaseBottomSheetDialog" />
|
||||
|
||||
<style name="CustomCardViewStyle" parent="@style/Widget.MaterialComponents.CardView">
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.MaterialCardView.Cut</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.MaterialCardView.Cut" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">0dp</item>
|
||||
<item name="cornerSizeTopLeft">0dp</item>
|
||||
<item name="cornerSizeBottomRight">24dp</item>
|
||||
<item name="cornerSizeBottomLeft">24dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user