Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8313b55
Added PushNotificationActivity and handle navigation for it
jaypanchal-13 Aug 29, 2025
e80fc4f
Merge branch 'master' into CCCT-1623-show-action-button-for-pn-history
jaypanchal-13 Sep 1, 2025
46436b5
Added notifications in side nav drawer
jaypanchal-13 Sep 1, 2025
b468a46
As per new changes placed notification item in footer
jaypanchal-13 Sep 2, 2025
098abfd
Hidden bell icon
jaypanchal-13 Sep 2, 2025
41b639e
Merge remote-tracking branch 'origin/master' into CCCT-1624-pn-in-nav…
jaypanchal-13 Sep 3, 2025
134ef25
Used ConnectNavHelper.goToNotification()
jaypanchal-13 Sep 3, 2025
185eefb
Merge remote-tracking branch 'origin/CCCT-1623-show-action-button-for…
jaypanchal-13 Sep 3, 2025
3975e22
Merge remote-tracking branch 'origin/master' into CCCT-1623-show-acti…
jaypanchal-13 Sep 3, 2025
b1ca828
Merge branch 'CCCT-1623-show-action-button-for-pn-history' into CCCT-…
jaypanchal-13 Sep 3, 2025
a19d80a
Added suggested back navigation
jaypanchal-13 Sep 3, 2025
dcdb19b
Merge remote-tracking branch 'origin/CCCT-1623-show-action-button-for…
jaypanchal-13 Sep 3, 2025
16ed3a3
Merge branch 'master' into CCCT-1623-show-action-button-for-pn-history
jaypanchal-13 Sep 8, 2025
ec3fae5
Merge branch 'CCCT-1623-show-action-button-for-pn-history' into CCCT-…
jaypanchal-13 Sep 8, 2025
bf8e794
Added new notification bell icon
jaypanchal-13 Sep 8, 2025
c01fd27
Merge branch 'CCCT-1623-show-action-button-for-pn-history' into CCCT-…
jaypanchal-13 Sep 9, 2025
4eebd9f
Merge branch 'master' into CCCT-1623-show-action-button-for-pn-history
jaypanchal-13 Sep 9, 2025
667f8dc
Merge branch 'CCCT-1623-show-action-button-for-pn-history' into CCCT-…
jaypanchal-13 Sep 9, 2025
c1967db
Merge pull request #3318 from dimagi/CCCT-1624-pn-in-nav-drawer
jaypanchal-13 Sep 9, 2025
8f3534e
Merge branch 'master' into CCCT-1623-show-action-button-for-pn-history
jaypanchal-13 Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@
<receiver
android:name="org.commcare.services.PaymentAcknowledgeReceiver"
android:exported="false"/>
<activity android:name="org.commcare.activities.connect.PersonalIdCredentialActivity"/>
<activity android:name="org.commcare.activities.PushNotificationActivity" />
</application>
Comment on lines +583 to 584
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Harden component declaration: explicitly set exported, parent activity, and label.

The activity has no intent-filters, so it should not be exported. Also wire Up-navigation at the manifest level and set the screen label.

Apply:

-        <activity android:name="org.commcare.activities.PushNotificationActivity" />
+        <activity
+            android:name="org.commcare.activities.PushNotificationActivity"
+            android:exported="false"
+            android:label="@string/personalid_notification"
+            android:parentActivityName="org.commcare.activities.connect.ConnectActivity">
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="org.commcare.activities.connect.ConnectActivity" />
+        </activity>
🤖 Prompt for AI Agents
In app/AndroidManifest.xml around lines 583-584, the PushNotificationActivity
declaration must be hardened: add android:exported="false", set a descriptive
android:label (e.g. a new or existing string resource like
@string/push_notification_label), and declare Up-navigation by adding
android:parentActivityName pointing to your app's main/home activity (and
include the legacy meta-data entry
android:name="android.support.PARENT_ACTIVITY" with the same value for pre-API
16 support). Ensure no intent-filter is added so exported remains false.


</manifest>
9 changes: 9 additions & 0 deletions app/res/drawable/ic_bell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<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="M20.431,15.078C19.306,14.043 18.447,12.954 18.447,9.262C18.447,6.151 15.901,3.617 12.661,3.309V2.625C12.66,2.278 12.375,2 12.018,2C11.66,2 11.375,2.278 11.375,2.625V3.309C8.136,3.616 5.553,6.152 5.553,9.262C5.553,12.953 4.694,14.043 3.569,15.078C3.006,15.601 2.83,16.387 3.117,17.08C3.444,17.793 4.147,18.25 4.946,18.25H19.089C19.887,18.25 20.59,17.791 20.882,17.113C21.17,16.387 20.993,15.598 20.431,15.078ZM19.089,17H4.946C4.373,17 4.087,16.355 4.489,16.02C5.89,14.721 6.874,13.27 6.874,9.297C6.839,6.629 9.173,4.5 12.018,4.5C14.862,4.5 17.16,6.629 17.16,9.262C17.16,13.223 18.135,14.684 19.546,15.984C19.949,16.359 19.656,17 19.089,17ZM13.95,19.5C13.651,19.5 13.373,19.662 13.271,19.925C13.086,20.406 12.592,20.75 11.981,20.75C11.371,20.75 10.912,20.405 10.726,19.925C10.66,19.66 10.382,19.5 10.081,19.5C9.655,19.5 9.343,19.89 9.475,20.27C9.824,21.273 10.832,22 11.981,22C13.165,22 14.174,21.272 14.522,20.27C14.689,19.855 14.38,19.5 13.95,19.5Z"
android:fillColor="#ffffff"/>
</vector>
19 changes: 19 additions & 0 deletions app/res/drawable/ic_new_notification_bell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<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="M20.431,15.078C19.306,14.043 18.447,12.954 18.447,9.262C18.447,6.151 15.901,3.617 12.661,3.309V2.625C12.66,2.278 12.375,2 12.018,2C11.66,2 11.375,2.278 11.375,2.625V3.309C8.136,3.616 5.553,6.152 5.553,9.262C5.553,12.953 4.694,14.043 3.569,15.078C3.006,15.601 2.83,16.387 3.117,17.08C3.444,17.793 4.147,18.25 4.946,18.25H19.089C19.887,18.25 20.59,17.791 20.882,17.113C21.17,16.387 20.993,15.598 20.431,15.078ZM19.089,17H4.946C4.373,17 4.087,16.355 4.489,16.02C5.89,14.721 6.874,13.27 6.874,9.297C6.839,6.629 9.173,4.5 12.018,4.5C14.862,4.5 17.16,6.629 17.16,9.262C17.16,13.223 18.135,14.684 19.546,15.984C19.949,16.359 19.656,17 19.089,17ZM13.95,19.5C13.651,19.5 13.373,19.662 13.271,19.925C13.086,20.406 12.592,20.75 11.981,20.75C11.371,20.75 10.912,20.405 10.726,19.925C10.66,19.66 10.382,19.5 10.081,19.5C9.655,19.5 9.343,19.89 9.475,20.27C9.824,21.273 10.832,22 11.981,22C13.165,22 14.174,21.272 14.522,20.27C14.689,19.855 14.38,19.5 13.95,19.5Z"
android:fillColor="#ffffff"/>
<group>
<clip-path
android:pathData="M20.431,15.078C19.306,14.043 18.447,12.954 18.447,9.262C18.447,6.151 15.901,3.617 12.661,3.309V2.625C12.66,2.278 12.375,2 12.018,2C11.66,2 11.375,2.278 11.375,2.625V3.309C8.136,3.616 5.553,6.152 5.553,9.262C5.553,12.953 4.694,14.043 3.569,15.078C3.006,15.601 2.83,16.387 3.117,17.08C3.444,17.793 4.147,18.25 4.946,18.25H19.089C19.887,18.25 20.59,17.791 20.882,17.113C21.17,16.387 20.993,15.598 20.431,15.078ZM19.089,17H4.946C4.373,17 4.087,16.355 4.489,16.02C5.89,14.721 6.874,13.27 6.874,9.297C6.839,6.629 9.173,4.5 12.018,4.5C14.862,4.5 17.16,6.629 17.16,9.262C17.16,13.223 18.135,14.684 19.546,15.984C19.949,16.359 19.656,17 19.089,17ZM13.95,19.5C13.651,19.5 13.373,19.662 13.271,19.925C13.086,20.406 12.592,20.75 11.981,20.75C11.371,20.75 10.912,20.405 10.726,19.925C10.66,19.66 10.382,19.5 10.081,19.5C9.655,19.5 9.343,19.89 9.475,20.27C9.824,21.273 10.832,22 11.981,22C13.165,22 14.174,21.272 14.522,20.27C14.689,19.855 14.38,19.5 13.95,19.5Z"/>
<path
android:pathData="M20.431,15.078L27.216,7.732L27.209,7.726L27.202,7.719L20.431,15.078ZM12.661,3.309H2.661V12.401L11.713,13.264L12.661,3.309ZM12.661,2.625H22.661V2.613L22.661,2.602L12.661,2.625ZM11.375,3.309L12.321,13.264L21.375,12.403V3.309H11.375ZM3.569,15.078L-3.202,7.719L-3.22,7.736L-3.238,7.752L3.569,15.078ZM3.117,17.08L-6.125,20.899L-6.051,21.078L-5.97,21.254L3.117,17.08ZM20.882,17.113L30.069,21.062L30.124,20.934L30.176,20.803L20.882,17.113ZM4.489,16.02L10.903,23.691L11.099,23.528L11.286,23.354L4.489,16.02ZM6.874,9.297H16.874V9.23L16.874,9.163L6.874,9.297ZM19.546,15.984L26.362,8.667L26.343,8.649L26.323,8.631L19.546,15.984ZM13.271,19.925L3.948,16.308L3.942,16.324L3.936,16.34L13.271,19.925ZM10.726,19.925L1.025,22.353L1.177,22.96L1.403,23.543L10.726,19.925ZM9.475,20.27L18.921,16.986L18.919,16.983L9.475,20.27ZM14.522,20.27L5.252,16.518L5.158,16.751L5.075,16.99L14.522,20.27ZM20.431,15.078L27.202,7.719C27.079,7.606 27.272,7.77 27.524,8.093C27.814,8.463 28.075,8.9 28.264,9.359C28.603,10.181 28.447,10.443 28.447,9.262H18.447H8.447C8.447,11.773 8.721,14.425 9.77,16.973C10.931,19.793 12.641,21.5 13.66,22.437L20.431,15.078ZM18.447,9.262H28.447C28.447,0.321 21.28,-5.916 13.61,-6.646L12.661,3.309L11.713,13.264C10.521,13.15 8.447,11.982 8.447,9.262H18.447ZM12.661,3.309H22.661V2.625H12.661H2.661V3.309H12.661ZM12.661,2.625L22.661,2.602C22.647,-3.498 17.646,-8 12.018,-8V2V12C7.104,12 2.674,8.055 2.661,2.648L12.661,2.625ZM12.018,2V-8C6.394,-8 1.375,-3.498 1.375,2.625H11.375H21.375C21.375,8.055 16.926,12 12.018,12V2ZM11.375,2.625H1.375V3.309H11.375H21.375V2.625H11.375ZM11.375,3.309L10.429,-6.647C2.836,-5.925 -4.447,0.249 -4.447,9.262H5.553H15.553C15.553,10.575 14.988,11.631 14.356,12.271C13.747,12.885 13.017,13.198 12.321,13.264L11.375,3.309ZM5.553,9.262H-4.447C-4.447,10.442 -4.602,10.181 -4.264,9.359C-4.075,8.9 -3.815,8.464 -3.525,8.093C-3.273,7.77 -3.08,7.606 -3.202,7.719L3.569,15.078L10.34,22.437C11.36,21.499 13.069,19.792 14.23,16.973C15.279,14.425 15.553,11.773 15.553,9.262H5.553ZM3.569,15.078L-3.238,7.752C-6.783,11.046 -8.046,16.251 -6.125,20.899L3.117,17.08L12.359,13.262C13.707,16.523 12.795,20.156 10.376,22.404L3.569,15.078ZM3.117,17.08L-5.97,21.254C-4.019,25.503 0.224,28.25 4.946,28.25V18.25V8.25C8.071,8.25 10.907,10.083 12.204,12.906L3.117,17.08ZM4.946,18.25V28.25H19.089V18.25V8.25H4.946V18.25ZM19.089,18.25V28.25C23.663,28.25 28.115,25.61 30.069,21.062L20.882,17.113L11.694,13.165C13.067,9.972 16.111,8.25 19.089,8.25V18.25ZM20.882,17.113L30.176,20.803C31.961,16.307 30.875,11.111 27.216,7.732L20.431,15.078L13.646,22.424C11.113,20.084 10.379,16.466 11.588,13.423L20.882,17.113ZM19.089,17V7H4.946V17V27H19.089V17ZM4.946,17V7C8.656,7 11.945,9.197 13.445,12.474C14.994,15.859 14.571,20.625 10.903,23.691L4.489,16.02L-1.926,8.348C-5.995,11.75 -6.476,17.006 -4.741,20.797C-3.055,24.481 0.663,27 4.946,27V17ZM4.489,16.02L11.286,23.354C12.579,22.156 14.279,20.318 15.452,17.473C16.546,14.819 16.874,12.038 16.874,9.297H6.874H-3.126C-3.126,9.891 -3.163,10.184 -3.176,10.264C-3.187,10.329 -3.165,10.158 -3.038,9.849C-2.902,9.519 -2.714,9.199 -2.509,8.929C-2.326,8.688 -2.204,8.588 -2.309,8.685L4.489,16.02ZM6.874,9.297L16.874,9.163C16.924,12.905 13.875,14.5 12.018,14.5V4.5V-5.5C4.471,-5.5 -3.246,0.353 -3.125,9.431L6.874,9.297ZM12.018,4.5V14.5C10.077,14.5 7.161,12.862 7.161,9.262H17.16H27.16C27.16,0.396 19.648,-5.5 12.018,-5.5V4.5ZM17.16,9.262H7.161C7.161,11.989 7.484,14.766 8.574,17.419C9.743,20.268 11.444,22.117 12.769,23.338L19.546,15.984L26.323,8.631C26.228,8.543 26.356,8.649 26.543,8.896C26.751,9.17 26.94,9.493 27.075,9.822C27.201,10.13 27.222,10.3 27.211,10.232C27.198,10.15 27.16,9.856 27.16,9.262H17.16ZM19.546,15.984L12.73,23.302C9.553,20.342 9.031,15.908 10.573,12.505C12.059,9.226 15.35,7 19.089,7V17V27C23.395,27 27.116,24.454 28.789,20.76C30.519,16.944 29.942,12.001 26.362,8.667L19.546,15.984ZM13.95,19.5V9.5C10.366,9.5 5.826,11.468 3.948,16.308L13.271,19.925L22.594,23.542C20.921,27.856 16.937,29.5 13.95,29.5V19.5ZM13.271,19.925L3.936,16.34C5.361,12.629 8.815,10.75 11.981,10.75V20.75V30.75C16.369,30.75 20.812,28.184 22.607,23.51L13.271,19.925ZM11.981,20.75V10.75C15.474,10.75 18.733,12.918 20.048,16.307L10.726,19.925L1.403,23.543C3.092,27.892 7.268,30.75 11.981,30.75V20.75ZM10.726,19.925L20.427,17.497C18.872,11.287 13.224,9.5 10.081,9.5V19.5V29.5C7.54,29.5 2.447,28.033 1.025,22.353L10.726,19.925ZM10.081,19.5V9.5C3.968,9.5 -2.742,15.591 0.031,23.558L9.475,20.27L18.919,16.983C21.428,24.19 15.341,29.5 10.081,29.5V19.5ZM9.475,20.27L0.03,23.554C1.82,28.704 6.71,32 11.981,32V22V12C14.955,12 17.828,13.843 18.921,16.986L9.475,20.27ZM11.981,22V32C17.217,32 22.156,28.768 23.968,23.551L14.522,20.27L5.075,16.99C6.191,13.777 9.114,12 11.981,12V22ZM14.522,20.27L23.791,24.023C25.169,20.619 24.729,16.626 22.336,13.568C20.12,10.735 16.882,9.5 13.95,9.5V19.5V29.5C11.448,29.5 8.58,28.443 6.584,25.891C4.411,23.114 4.042,19.507 5.252,16.518L14.522,20.27Z"
android:fillColor="#ffffff"/>
</group>
<path
android:pathData="M20.417,2.5m-2.5,0a2.5,2.5 0,1 1,5 0a2.5,2.5 0,1 1,-5 0"
android:fillColor="#E44434"/>
</vector>
10 changes: 10 additions & 0 deletions app/res/layout/activity_push_notification.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.commcare.activities.PushNotificationActivity">

</androidx.constraintlayout.widget.ConstraintLayout>
29 changes: 29 additions & 0 deletions app/res/layout/nav_drawer_footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@
android:layout_height="1dp"
android:background="@color/darker_grey"/>

<LinearLayout
android:id="@+id/notification_view"
android:layout_width="match_parent"
android:layout_height="48dp"
android:paddingStart="16dp"
android:clickable="true"
android:visibility="gone"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:paddingEnd="16dp"
android:orientation="horizontal"
android:gravity="center_vertical">

<ImageView
android:id="@+id/ivNotification"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_bell"/>

<TextView
android:id="@+id/tvNotification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/personalid_notification"
android:textAppearance="@style/TextAppearance.NavDrawerItem"
android:layout_marginStart="8dp"
android:fontFamily="sans-serif-medium" />
</LinearLayout>

<LinearLayout
android:id="@+id/about_view"
android:layout_width="match_parent"
Expand Down
8 changes: 8 additions & 0 deletions app/res/menu/menu_connect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
android:title="@string/personalid_credential"
android:visible="false"
app:showAsAction="always" />

<item
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets hide it for now on UI untill we decide to publish this out to the users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we need to show icon with dot if there are new push notifications available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jignesh-dimagi I think this can be managed using flag while creating db schema for push notification

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaypanchal-13 do you plan to address that in a separate PR or this one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shubham1g5 there is different PR for notification db schema in that we can add flag for it and manage it there. What's your suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaypanchal-13 I agree for the logic but we need to have bell icon with dot in this PR only so that it can directly used in your next PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jignesh-dimagi Added new notification bell icon

android:id="@+id/action_bell"
android:icon="@drawable/ic_bell"
android:title="@string/personalid_notification"
android:visible="false"
app:showAsAction="always" />

<item
android:id="@+id/action_sync"
android:icon="@drawable/ic_backup"
Expand Down
11 changes: 11 additions & 0 deletions app/res/menu/menu_notification.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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/notification_cloud_sync"
android:icon="@drawable/ic_backup"
app:iconTint="@color/white"
android:title="@string/personalid_sync_menu_title"
app:showAsAction="always" />
</menu>
Comment on lines +5 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Add tooltip and verify string exists across locales.

  • Add tooltip for better accessibility/UX.
  • Please verify @string/personalid_sync_menu_title exists in all targeted locales.

Apply:

 <item
     android:id="@+id/notification_cloud_sync"
     android:icon="@drawable/ic_backup"
     app:iconTint="@color/white"
     android:title="@string/personalid_sync_menu_title"
+    android:tooltipText="@string/personalid_sync_menu_title"
     app:showAsAction="always" />

Run to verify strings:


🏁 Script executed:

#!/bin/bash
rg -nP '<string name="personalid_sync_menu_title"\b' app/res/values*/*.xml -C0

Length of output: 1401


Add tooltip and define missing string resource

  • Add android:tooltipText="@string/personalid_sync_menu_title" to the menu item in app/res/menu/menu_notification.xml
  • Define <string name="personalid_sync_menu_title">…</string> in app/res/values/strings.xml and add corresponding translations in all targeted locale folders
 <item
     android:id="@+id/notification_cloud_sync"
     android:icon="@drawable/ic_backup"
     app:iconTint="@color/white"
     android:title="@string/personalid_sync_menu_title"
+    android:tooltipText="@string/personalid_sync_menu_title"
     app:showAsAction="always" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<item
android:id="@+id/notification_cloud_sync"
android:icon="@drawable/ic_backup"
app:iconTint="@color/white"
android:title="@string/personalid_sync_menu_title"
app:showAsAction="always" />
</menu>
<item
android:id="@+id/notification_cloud_sync"
android:icon="@drawable/ic_backup"
app:iconTint="@color/white"
android:title="@string/personalid_sync_menu_title"
android:tooltipText="@string/personalid_sync_menu_title"
app:showAsAction="always" />
🤖 Prompt for AI Agents
In app/res/menu/menu_notification.xml around lines 5 to 11, the menu item lacks
a tooltip and references a string that may be missing; add
android:tooltipText="@string/personalid_sync_menu_title" to the <item>
declaration so the title is shown as a tooltip, and then in
app/res/values/strings.xml define the resource <string
name="personalid_sync_menu_title">Your sync title here</string> (replace with
the actual copy), and add the same string key with translated values in each
targeted locale folder (e.g., app/res/values-XX/strings.xml) to ensure all
locales have the translation.

2 changes: 2 additions & 0 deletions app/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@
<string name="personalid_credential_level_12_month_active">12 Meses de\nActividad</string>
<string name="personalid_credential_no_pending_credential">No hay credenciales pendientes</string>

<string name="personalid_notification">Notificaciones</string>

<string name="nav_drawer_signin_register">Iniciar sesión / Registrarse</string>
<string name="nav_drawer_help">Ayuda</string>
<string name="nav_drawer_not_signed_in_to_personal_id">No has iniciado sesión en la ID personal</string>
Expand Down
2 changes: 2 additions & 0 deletions app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ License.
<string name="personalid_credential_level_12_month_active">12 Mois d\'\nActivité</string>
<string name="personalid_credential_no_pending_credential">Il n\'y a aucune lettre de créance en attente</string>

<string name="personalid_notification">Notifications</string>

<string name="nav_drawer_signin_register">Se connecter / S’inscrire</string>
<string name="nav_drawer_help">Aide</string>
<string name="nav_drawer_not_signed_in_to_personal_id">Vous n\'êtes pas connecté à l\'identifiant personnel</string>
Expand Down
3 changes: 3 additions & 0 deletions app/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ License.
<string name="personalid_credential_level_6_month_active">6 महीने की\nगतिविधि</string>
<string name="personalid_credential_level_9_month_active">9 महीने की\nगतिविधि</string>
<string name="personalid_credential_level_12_month_active">12 महीने की\nगतिविधि</string>

<string name="personalid_notification">सूचनाएं</string>

<string name="personalid_credential_no_pending_credential">कोई भी क्रेडेंशियल लंबित नहीं हैं</string>

<string name="nav_drawer_signin_register">साइन इन / रजिस्टर</string>
Expand Down
2 changes: 2 additions & 0 deletions app/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@
<string name="personalid_credential_level_12_month_active">12 Meses de\nAtividade</string>
<string name="personalid_credential_no_pending_credential">Não há credenciais pendentes</string>

<string name="personalid_notification">Notificações</string>

<string name="nav_drawer_signin_register">Entrar / Registrar-se</string>
<string name="nav_drawer_help">Ajuda</string>
<string name="nav_drawer_not_signed_in_to_personal_id">Você não está conectado ao ID Pessoal</string>
Expand Down
2 changes: 2 additions & 0 deletions app/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@
<string name="personalid_credential_level_12_month_active">Miezi 12 ya\nShughuli</string>
<string name="personalid_credential_no_pending_credential">Hakuna vitambulisho vinavyosubiri</string>

<string name="personalid_notification">Arifa</string>

<string name="nav_drawer_signin_register">Ingia / Jisajili</string>
<string name="nav_drawer_help">Msaada</string>
<string name="nav_drawer_not_signed_in_to_personal_id">Hujaingia kwenye Kitambulisho Binafsi</string>
Expand Down
3 changes: 3 additions & 0 deletions app/res/values-ti/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@
<string name="personalid_credential_level_6_month_active">6 ኣዋርሕ\nተግባር</string>
<string name="personalid_credential_level_9_month_active">9 ኣዋርሕ\nተግባር</string>
<string name="personalid_credential_level_12_month_active">12 ኣዋርሕ\nተግባር</string>

<string name="personalid_notification">መፍለጥታትን</string>

<string name="personalid_credential_no_pending_credential">ዝኾነ ኣብ መስርሕ ዘሎ ምስክር ወረቐት የለን</string>

<string name="nav_drawer_signin_register">እቶም ኣእትዉ / ይመዝገቡ</string>
Expand Down
2 changes: 2 additions & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@
<string name="personalid_credential_level_12_month_active">12 Months of\nActivity</string>
<string name="personalid_credential_no_pending_credential">There are no pending credentials</string>

<string name="personalid_notification">Notifications</string>

<string name="play_service_update_error">Please make sure Google Play services is supported on the device and is up to date.</string>
<string name="nav_drawer_open">Open navigation drawer</string>
<string name="nav_drawer_close">Close navigation drawer</string>
Expand Down
49 changes: 49 additions & 0 deletions app/src/org/commcare/activities/PushNotificationActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package org.commcare.activities

import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import org.commcare.dalvik.R
import org.commcare.dalvik.databinding.ActivityPushNotificationBinding

class PushNotificationActivity : AppCompatActivity() {
private val binding: ActivityPushNotificationBinding by lazy {
ActivityPushNotificationBinding.inflate(layoutInflater)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
setUpUi()
}

private fun setUpUi() {
supportActionBar!!.apply {
title = getString(R.string.personalid_notification)
setDisplayShowHomeEnabled(true)
setDisplayHomeAsUpEnabled(true)
}
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_notification, menu)
return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
android.R.id.home -> {
onBackPressedDispatcher.onBackPressed()
true
}

R.id.notification_cloud_sync -> {
//api call to sync notification
true
}

else -> super.onOptionsItemSelected(item)
}
}
}
6 changes: 6 additions & 0 deletions app/src/org/commcare/activities/connect/ConnectActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.common.base.Strings;

import org.commcare.activities.NavigationHostCommCareActivity;
import org.commcare.activities.PushNotificationActivity;
import org.commcare.android.database.connect.models.ConnectJobRecord;
import org.commcare.connect.ConnectConstants;
import org.commcare.connect.ConnectNavHelper;
Expand Down Expand Up @@ -188,6 +189,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
}

if (item.getItemId() == R.id.action_bell) {
ConnectNavHelper.goToNotification(this);
return true;
}

if(item.getItemId() == R.id.action_sync) {
RefreshableFragment refreshable = getRefreshableFragment();
if(refreshable != null) {
Expand Down
7 changes: 7 additions & 0 deletions app/src/org/commcare/connect/ConnectNavHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.commcare.connect
import android.content.Context
import android.content.Intent
import org.commcare.activities.CommCareActivity
import org.commcare.activities.PushNotificationActivity
import org.commcare.activities.connect.ConnectActivity
import org.commcare.activities.connect.ConnectMessagingActivity
import org.commcare.android.database.connect.models.ConnectJobRecord
Expand Down Expand Up @@ -30,6 +31,12 @@ object ConnectNavHelper {
context.startActivity(i)
}

@JvmStatic
fun goToNotification(context: Context) {
val i = Intent(context, PushNotificationActivity::class.java)
context.startActivity(i)
}

fun unlockAndGoToConnectJobsList(activity: CommCareActivity<*>, listener: ConnectActivityCompleteListener) {
val personalIdManager: PersonalIdManager = PersonalIdManager.getInstance()
personalIdManager.init(activity)
Expand Down
8 changes: 7 additions & 1 deletion app/src/org/commcare/navdrawer/BaseDrawerController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.bumptech.glide.request.RequestOptions
import org.commcare.CommCareApplication
import org.commcare.activities.CommCareActivity
import org.commcare.connect.ConnectConstants
import org.commcare.connect.ConnectNavHelper
import org.commcare.connect.PersonalIdManager
import org.commcare.connect.database.ConnectMessagingDatabaseHelper
import org.commcare.connect.database.ConnectUserDatabaseUtil
Expand All @@ -38,7 +39,7 @@ class BaseDrawerController(
COMMCARE_APPS,
WORK_HISTORY,
MESSAGING,
PAYMENTS
PAYMENTS,
}

fun setupDrawer() {
Expand Down Expand Up @@ -115,6 +116,10 @@ class BaseDrawerController(
closeDrawer()
}
binding.aboutView.setOnClickListener { DialogCreationHelpers.showAboutCommCareDialog(activity) }
binding.notificationView.setOnClickListener {
ConnectNavHelper.goToNotification(activity)
closeDrawer()
}
binding.helpView.setOnClickListener { /* Future Help Action */ }
}

Expand Down Expand Up @@ -210,6 +215,7 @@ class BaseDrawerController(
binding.signoutView.visibility = if (isSignedIn) View.GONE else View.VISIBLE
binding.navDrawerRecycler.visibility = if (isSignedIn) View.VISIBLE else View.GONE
binding.profileCard.visibility = if (isSignedIn) View.VISIBLE else View.GONE
binding.notificationView.visibility = if (isSignedIn) View.VISIBLE else View.GONE
}

fun closeDrawer() {
Expand Down
Loading
Loading