-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16cdf34
commit c9607e5
Showing
8 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/src/main/java/me/profiluefter/profinote/NavigationDeepLinkProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package me.profiluefter.profinote | ||
|
||
import android.app.PendingIntent | ||
import android.content.Context | ||
import androidx.navigation.NavDeepLinkBuilder | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import me.profiluefter.profinote.activities.NoteDetailsFragmentArgs | ||
import me.profiluefter.profinote.data.DeepLinkProvider | ||
import me.profiluefter.profinote.data.entities.Note | ||
import javax.inject.Inject | ||
|
||
class NavigationDeepLinkProvider @Inject constructor(@ApplicationContext private val context: Context) : DeepLinkProvider { | ||
override fun deepLinkToNote(note: Note): PendingIntent = NavDeepLinkBuilder(context) | ||
.setGraph(R.navigation.nav_graph) | ||
.setDestination(R.id.noteDetailsFragment) | ||
.setArguments(NoteDetailsFragmentArgs(note).toBundle()) | ||
.createPendingIntent() | ||
} | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
interface NavigationDeepLinkProviderBinding { | ||
@Binds | ||
fun navigationDeepLinkProvider(provider: NavigationDeepLinkProvider): DeepLinkProvider | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
data-lib/src/main/java/me/profiluefter/profinote/data/DeepLinkProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package me.profiluefter.profinote.data | ||
|
||
import android.app.PendingIntent | ||
import me.profiluefter.profinote.data.entities.Note | ||
|
||
interface DeepLinkProvider { | ||
fun deepLinkToNote(note: Note): PendingIntent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,2H5.5C4.67,2 4,2.67 4,3.5v13C4,17.33 4.67,18 5.5,18h9c0.83,0 1.5,-0.67 1.5,-1.5V6L12,2zM9.15,15l-2.83,-2.83l1.13,-1.13l1.7,1.7l3.47,-3.46l1.13,1.13L9.15,15zM11,7V3l4,4H11z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M14,2H6C4.9,2 4.01,2.9 4.01,4L4,20c0,1.1 0.89,2 1.99,2H18c1.1,0 2,-0.9 2,-2V8L14,2zM10.94,18L7.4,14.46l1.41,-1.41l2.12,2.12l4.24,-4.24l1.41,1.41L10.94,18zM13,9V3.5L18.5,9H13z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M14,2H6C4.9,2 4.01,2.9 4.01,4L4,20c0,1.1 0.89,2 1.99,2H18c1.1,0 2,-0.9 2,-2V8L14,2zM10.94,18L7.4,14.46l1.41,-1.41l2.12,2.12l4.24,-4.24l1.41,1.41L10.94,18zM13,9V3.5L18.5,9H13z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="notification_upload_channel_id">upload</string> | ||
<string name="notification_upload_channel_name">Upload Notifications</string> | ||
<string name="notification_upload_group_id">upload_notification_group</string> | ||
<string name="notification_upload_title">Tasks uploaded</string> | ||
<string name="notification_upload_description">The following tasks were uploaded</string> | ||
</resources> |