Notifications (#554)

Cleanup

Extending and improving notifications

Using new icons instead

Lowering polling delay to one minute and other improvements

Fixing minor issues

Simplifying progress layout

Fixing bugs and other improvements

Adding translations

Notifications

Co-authored-by: opyale <opyale@noreply.gitea.io>
Co-authored-by: 6543 <6543@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/554
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
opyale
2020-07-22 21:32:42 +02:00
committed by 6543
co-authored by opyale 6543
parent cd55f946f0
commit 39ac49b258
39 changed files with 1856 additions and 129 deletions
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,8A6,6 0,0 0,6 8c0,7 -3,9 -3,9h18s-3,-2 -3,-9"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#368f73"
android:strokeLineCap="round"/>
<path
android:pathData="M13.73,21a2,2 0,0 1,-3.46 0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#368f73"
android:strokeLineCap="round"/>
</vector>
+11
View File
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#368f73"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M7.886,1.553a1.75,1.75 0,0 1,2.869 0.604l0.633,1.629a5.666,5.666 0,0 0,3.725 3.395l3.959,1.131a1.75,1.75 0,0 1,0.757 2.92L16.06,15l5.594,5.595a0.75,0.75 0,1 1,-1.06 1.06L15,16.061l-3.768,3.768a1.75,1.75 0,0 1,-2.92 -0.757l-1.131,-3.96a5.667,5.667 0,0 0,-3.395 -3.724l-1.63,-0.633a1.75,1.75 0,0 1,-0.603 -2.869l6.333,-6.333zM14.475,14.465l-0.005,0.005 -0.005,0.005 -4.294,4.293a0.25,0.25 0,0 1,-0.417 -0.108l-1.13,-3.96A7.166,7.166 0,0 0,4.33 9.99L2.7,9.356a0.25,0.25 0,0 1,-0.086 -0.41l6.333,-6.332a0.25,0.25 0,0 1,0.41 0.086l0.633,1.63a7.167,7.167 0,0 0,4.71 4.293l3.96,1.131a0.25,0.25 0,0 1,0.108 0.417l-4.293,4.294z"
android:fillType="evenOdd"/>
</vector>
@@ -156,4 +156,34 @@
</LinearLayout>
</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>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="12dp"
android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/markPinned"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pinNotification"
android:drawableStart="@drawable/ic_pin"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
<TextView
android:id="@+id/markRead"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/markAsRead"
android:drawableStart="@drawable/ic_unwatch"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
<TextView
android:id="@+id/markUnread"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/markAsUnread"
android:drawableStart="@drawable/ic_watchers"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="12dp"
android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/unreadNotifications"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isUnread"
android:drawableStart="@drawable/ic_watchers"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
<TextView
android:id="@+id/readNotifications"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/isRead"
android:drawableStart="@drawable/ic_unwatch"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<ProgressBar
android:id="@+id/loadingMoreView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="gone"
android:padding="5dp" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_above="@id/loadingMoreView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notifications"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<TextView
android:id="@+id/noDataNotifications"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:gravity="center"
android:text="@string/noDataNotifications"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:visibility="gone" />
<ImageView
android:id="@+id/markAllAsRead"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="15dp"
android:background="@drawable/shape_circle"
android:contentDescription="@string/markAsRead"
android:padding="@dimen/fab_padding"
android:src="@drawable/ic_done"
android:tint="@color/colorWhite" />
</RelativeLayout>
@@ -0,0 +1,84 @@
<?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:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="20dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="20dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_pull_request" />
<Space
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/pinned"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_pin" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
<TextView
android:id="@+id/repository"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColor="?attr/primaryTextColor" />
</LinearLayout>
<ImageView
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:background="@android:color/transparent"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_dotted_menu_horizontal" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dividerColor" />
</LinearLayout>
+20
View File
@@ -5,41 +5,59 @@
<group android:checkableBehavior="single"
android:id="@+id/nav_main">
<item android:id="@+id/nav_home"
android:icon="@drawable/ic_repo"
android:title="@string/navMyRepos" />
<item android:id="@+id/nav_starred_repos"
android:icon="@drawable/ic_star_unfilled"
android:title="@string/navStarredRepos" />
<item android:id="@+id/nav_organizations"
android:icon="@drawable/ic_organization"
android:title="@string/navOrgs" />
<item android:id="@+id/nav_repositories"
android:icon="@drawable/ic_repo"
android:title="@string/navRepos" />
<item
android:id="@+id/nav_notifications"
android:icon="@drawable/ic_notifications"
android:title="@string/pageTitleNotifications"
android:visible="false" />
<item android:id="@+id/nav_explore"
android:icon="@drawable/ic_search"
android:title="@string/navExplore" />
<item android:id="@+id/nav_comments_draft"
android:icon="@drawable/ic_drafts"
android:title="@string/titleDrafts" />
<item android:id="@+id/nav_profile"
android:icon="@drawable/ic_person"
android:title="@string/navProfile" />
<item android:id="@+id/nav_administration"
android:icon="@drawable/ic_tool"
android:title="@string/navAdministration"
android:visible="false" />
</group>
<group android:checkableBehavior="single"
android:id="@+id/nav_menu_settings">
<item android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings"
android:title="@string/navSettings" />
<item android:id="@+id/nav_about"
android:icon="@drawable/ic_info"
android:title="@string/navAbout" />
</group>
<item android:id="@+id/nav_rate_app"
@@ -48,9 +66,11 @@
<group android:checkableBehavior="single"
android:id="@+id/nav_extra">
<item android:id="@+id/nav_logout"
android:icon="@drawable/ic_logout"
android:title="@string/navLogout" />
</group>
</menu>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/filterNotifications"
android:icon="@drawable/ic_filter"
android:title="@string/strFilter"
android:orderInCategory="0"
app:showAsAction="ifRoom" />
</menu>
+21 -1
View File
@@ -618,11 +618,31 @@
<string name="appearanceHintText">Themes, fonts, badges, code block theme</string>
<string name="fileViewerHintText">PDF mode, source code theme</string>
<string name="securityHintText">SSL certificates, cache</string>
<string name="securityHintText">SSL certificates, cache, polling delay</string>
<string name="languagesHintText">Languages</string>
<string name="reportsHintText">Crash reports</string>
<string name="archivedRepository">Archived</string>
<string name="accountDeletedMessage">Account deleted successfully</string>
<!-- 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="isRead">Read</string>
<string name="isUnread">Unread</string>
</resources>
+2
View File
@@ -7,6 +7,7 @@
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorSecondary">@color/colorWhite</item>
<item name="android:textColorPrimary">@color/colorWhite</item>
<item name="diffAddedColor">@color/diffAddedColor</item>
<item name="diffRemovedColor">@color/diffRemovedColor</item>
@@ -35,6 +36,7 @@
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorSecondary">@color/lightThemeTextColor</item>
<item name="android:textColorPrimary">@color/lightThemeTextColor</item>
<item name="diffAddedColor">@color/lightThemeDiffAddedColor</item>
<item name="diffRemovedColor">@color/lightThemeDiffRemovedColor</item>