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"
|
||||
|
||||
@@ -642,7 +642,7 @@
|
||||
|
||||
<string name="appearanceHintText">Themes, fonts, badges</string>
|
||||
<string name="fileViewerHintText">PDF mode, source code theme</string>
|
||||
<string name="securityHintText">SSL certificates, cache, polling delay</string>
|
||||
<string name="securityHintText">SSL certificates, cache</string>
|
||||
<string name="languagesHintText">Languages</string>
|
||||
<string name="reportsHintText">Crash reports</string>
|
||||
<string name="rateAppHintText">If you like GitNex you can give it a thumbs up</string>
|
||||
@@ -662,18 +662,23 @@
|
||||
<!-- Notifications -->
|
||||
<string name="pageTitleNotifications">Notifications</string>
|
||||
<string name="noDataNotifications">No notifications found</string>
|
||||
|
||||
<string name="notificationBody">You have received a new notification. (%s)</string>
|
||||
|
||||
<string name="notificationsPollingHeaderText">Notifications Polling Delay</string>
|
||||
<string name="pollingDelaySelectedText">%d Minutes</string>
|
||||
<string name="pollingDelayDialogHeaderText">Select Polling Delay</string>
|
||||
<string name="pollingDelayDialogDescriptionText">Choose a minutely delay in which GitNex tries to poll new notifications</string>
|
||||
|
||||
<string name="markAsRead">Mark as Read</string>
|
||||
<string name="markAsUnread">Mark as Unread</string>
|
||||
<string name="pinNotification">Pin Notification</string>
|
||||
<string name="markedNotificationsAsRead">Successfully marked all notifications as read</string>
|
||||
<string name="notificationsHintText">Polling delay, light, vibration</string>
|
||||
<string name="enableNotificationsHeaderText">Enable Notifications</string>
|
||||
<string name="enableLightsHeaderText">Enable Light</string>
|
||||
<string name="enableVibrationHeaderText">Enable Vibration</string>
|
||||
<string name="chooseColorSelectorHeader">Choose Color</string>
|
||||
<string name="newMessages">New messages</string>
|
||||
<string name="youHaveGotNewNotifications">You\'ve got %d new notifications.</string>
|
||||
<string name="notificationChannelDescription" translatable="false">This is the main notification channel of GitNex.</string>
|
||||
<string name="notificationExtraInfo" translatable="false">- %s (%s)</string>
|
||||
|
||||
<string name="isRead">Read</string>
|
||||
<string name="isUnread">Unread</string>
|
||||
|
||||
Reference in New Issue
Block a user