-
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.
Setup initial Notification structure
- Loading branch information
1 parent
e189cc2
commit 9f7e546
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
grabbit/src/main/java/com/gunishjain/grabbit/internal/NotificationConfig.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,12 @@ | ||
package com.gunishjain.grabbit.internal | ||
|
||
import com.gunishjain.grabbit.utils.NotificationConst | ||
|
||
data class NotificationConfig( | ||
val enabled: Boolean = NotificationConst.DEFAULT_VALUE_NOTIFICATION_ENABLED, | ||
val channelName: String = NotificationConst.DEFAULT_VALUE_NOTIFICATION_CHANNEL_NAME, | ||
val channelDescription: String = NotificationConst.DEFAULT_VALUE_NOTIFICATION_CHANNEL_DESCRIPTION, | ||
val showSpeed: Boolean = true, | ||
val showSize: Boolean = true, | ||
val smallIcon: Int | ||
) |
30 changes: 30 additions & 0 deletions
30
...rc/main/java/com/gunishjain/grabbit/internal/notifications/DownloadNotificationManager.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,30 @@ | ||
package com.gunishjain.grabbit.internal.notifications | ||
|
||
import android.content.Context | ||
import android.os.Build | ||
import com.gunishjain.grabbit.internal.NotificationConfig | ||
|
||
class DownloadNotificationManager( | ||
private val context: Context, | ||
private val notificationConfig: NotificationConfig, | ||
private val requestId: Int, | ||
private val fileName: String | ||
) { | ||
|
||
init { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
createNotificationChannel() | ||
} | ||
|
||
} | ||
|
||
private fun createNotificationChannel() { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
//Need to add code for notification builder | ||
//NEED to Implement sending notifications based on status | ||
|
||
|
||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
grabbit/src/main/java/com/gunishjain/grabbit/utils/NotificationConst.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,15 @@ | ||
package com.gunishjain.grabbit.utils | ||
|
||
object NotificationConst { | ||
|
||
const val KEY_NOTIFICATION_CHANNEL_NAME = "key_notification_channel_name" | ||
const val DEFAULT_VALUE_NOTIFICATION_CHANNEL_NAME = "File Download" | ||
const val NOTIFICATION_CHANNEL_ID = "download_channel" | ||
const val DEFAULT_VALUE_NOTIFICATION_ENABLED = false | ||
const val KEY_NOTIFICATION_ID = "key_notification_id" | ||
const val DEFAULT_VALUE_NOTIFICATION_CHANNEL_DESCRIPTION = "Notify File Download Status" | ||
|
||
|
||
|
||
|
||
} |