Improve notifications (#764)
Moving translation. Adding option to enable/disable notifications. Fix typos Improve notifications Co-authored-by: opyale <opyale@noreply.codeberg.org> Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/764 Reviewed-by: opyale <opyale@noreply.codeberg.org>
This commit is contained in:
203
app/src/main/res/layout/activity_settings_notifications.xml
Normal file
203
app/src/main/res/layout/activity_settings_notifications.xml
Normal file
@ -0,0 +1,203 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layoutSettingsNotifications"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="@dimen/close_button_size"
|
||||
android:layout_height="@dimen/close_button_size"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/close"
|
||||
android:src="@drawable/ic_close" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/pageTitleNotifications"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:maxLines="1"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/enableNotificationsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enableNotificationsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/enableNotificationsHeaderText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/enableNotificationsMode"
|
||||
android:layout_toEndOf="@+id/enableNotificationsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:switchMinWidth="56dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="25dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="end" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pollingDelayFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pollingDelayHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/notificationsPollingHeaderText"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pollingDelaySelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/pollingDelaySelectedText"
|
||||
android:textColor="?attr/selectedTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/enableLightsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enableLightsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/enableLightsHeaderText"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/enableLightsMode"
|
||||
android:layout_toEndOf="@+id/enableLightsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:switchMinWidth="56dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="25dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="end" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/chooseColorFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chooseColorHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/chooseColorSelectorHeader"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/chooseColorState"
|
||||
android:layout_alignEnd="@id/chooseColorHeader"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:gravity="end"
|
||||
app:cardCornerRadius="15dp"
|
||||
app:cardElevation="0dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/enableVibrationFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enableVibrationHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/enableVibrationHeaderText"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/enableVibrationMode"
|
||||
android:layout_toEndOf="@+id/enableVibrationHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:switchMinWidth="56dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="25dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="end" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
@ -153,34 +153,4 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pollingDelayFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pollingDelayHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/notificationsPollingHeaderText"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pollingDelaySelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/pollingDelaySelectedText"
|
||||
android:textColor="?attr/selectedTextColor"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -177,6 +177,39 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/notificationsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notificationsHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="24dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/pageTitleNotifications"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableStartCompat="@drawable/ic_notifications" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notificationsHintText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/notificationsHintText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/languagesFrame"
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user