-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from muun/51-release-branch
Apollo: Release source code for 51
- Loading branch information
Showing
66 changed files
with
1,791 additions
and
658 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
...o/src/main/java/io/muun/apollo/data/preferences/NotificationPermissionDeniedRepository.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,28 @@ | ||
package io.muun.apollo.data.preferences | ||
|
||
import android.content.Context | ||
import io.muun.apollo.data.preferences.rx.Preference | ||
import javax.inject.Inject | ||
|
||
class NotificationPermissionDeniedRepository @Inject constructor( | ||
context: Context, | ||
repositoryRegistry: RepositoryRegistry, | ||
) : BaseRepository(context, repositoryRegistry) { | ||
|
||
companion object { | ||
private const val NOTIFICATION_PERMISSION_DENIED = "notification_permission_denied" | ||
} | ||
|
||
private val permissionDeniedPref: Preference<Boolean> = rxSharedPreferences | ||
.getBoolean(NOTIFICATION_PERMISSION_DENIED) | ||
|
||
override fun getFileName() = | ||
"notification_permission_denied" | ||
|
||
fun setHasPreviouslyDeniedNotificationPermission() { | ||
permissionDeniedPref.set(true) | ||
} | ||
|
||
fun hasPreviouslyDeniedNotificationPermission(): Boolean = | ||
permissionDeniedPref.get()!! | ||
} |
28 changes: 28 additions & 0 deletions
28
.../src/main/java/io/muun/apollo/data/preferences/NotificationPermissionSkippedRepository.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,28 @@ | ||
package io.muun.apollo.data.preferences | ||
|
||
import android.content.Context | ||
import io.muun.apollo.data.preferences.rx.Preference | ||
import javax.inject.Inject | ||
|
||
class NotificationPermissionSkippedRepository @Inject constructor( | ||
context: Context, | ||
repositoryRegistry: RepositoryRegistry, | ||
) : BaseRepository(context, repositoryRegistry) { | ||
|
||
companion object { | ||
private const val NOTIFICATION_PERMISSION_SKIPPED = "notification_permission_skipped" | ||
} | ||
|
||
private val permissionSkippedPref: Preference<Boolean> = rxSharedPreferences | ||
.getBoolean(NOTIFICATION_PERMISSION_SKIPPED) | ||
|
||
override fun getFileName() = | ||
"notification_permission_skipped" | ||
|
||
fun store(permissionSkipped: Boolean) { | ||
permissionSkippedPref.set(permissionSkipped) | ||
} | ||
|
||
fun get(): Boolean = | ||
permissionSkippedPref.get()!! | ||
} |
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
34 changes: 34 additions & 0 deletions
34
.../java/io/muun/apollo/data/preferences/permission/NotificationPermissionStateRepository.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,34 @@ | ||
package io.muun.apollo.data.preferences.permission | ||
|
||
import android.content.Context | ||
import io.muun.apollo.data.preferences.BaseRepository | ||
import io.muun.apollo.data.preferences.RepositoryRegistry | ||
import io.muun.apollo.data.preferences.rx.Preference | ||
import io.muun.apollo.domain.model.PermissionState | ||
import javax.inject.Inject | ||
|
||
class NotificationPermissionStateRepository @Inject constructor( | ||
context: Context, | ||
repositoryRegistry: RepositoryRegistry, | ||
) : BaseRepository(context, repositoryRegistry) { | ||
|
||
companion object { | ||
private const val NOTIFICATION_PERMISSION_STATE = "notification_permission_state" | ||
} | ||
|
||
private val permissionStatePref: Preference<PermissionState> = rxSharedPreferences.getEnum( | ||
NOTIFICATION_PERMISSION_STATE, | ||
PermissionState.NOT_DETERMINED, | ||
PermissionState::class.java | ||
) | ||
|
||
override fun getFileName() = | ||
"notification_permission_state" | ||
|
||
fun store(permissionState: PermissionState) { | ||
permissionStatePref.set(permissionState) | ||
} | ||
|
||
fun get(): PermissionState = | ||
permissionStatePref.get()!! | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...n/java/io/muun/apollo/domain/action/notification/SetNotificationPermissionDeniedAction.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,13 @@ | ||
package io.muun.apollo.domain.action.notification | ||
|
||
import io.muun.apollo.data.preferences.NotificationPermissionDeniedRepository | ||
import javax.inject.Inject | ||
|
||
class SetNotificationPermissionDeniedAction @Inject constructor( | ||
private val notificationPermissionDeniedRepository: NotificationPermissionDeniedRepository, | ||
) { | ||
|
||
fun run() { | ||
return notificationPermissionDeniedRepository.setHasPreviouslyDeniedNotificationPermission() | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../java/io/muun/apollo/domain/action/notification/SetNotificationPermissionSkippedAction.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,13 @@ | ||
package io.muun.apollo.domain.action.notification | ||
|
||
import io.muun.apollo.data.preferences.NotificationPermissionSkippedRepository | ||
import javax.inject.Inject | ||
|
||
class SetNotificationPermissionSkippedAction @Inject constructor( | ||
private val notificationPermissionSkippedRepository: NotificationPermissionSkippedRepository, | ||
) { | ||
|
||
fun run() { | ||
return notificationPermissionSkippedRepository.store(true) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...a/io/muun/apollo/domain/action/permission/SetNotificationPermissionNeverAskAgainAction.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,14 @@ | ||
package io.muun.apollo.domain.action.permission | ||
|
||
import io.muun.apollo.data.preferences.permission.NotificationPermissionStateRepository | ||
import io.muun.apollo.domain.model.PermissionState | ||
import javax.inject.Inject | ||
|
||
class SetNotificationPermissionNeverAskAgainAction @Inject constructor( | ||
private val notificationPermissionStateRepository: NotificationPermissionStateRepository, | ||
) { | ||
|
||
fun run() { | ||
return notificationPermissionStateRepository.store(PermissionState.PERMANENTLY_DENIED) | ||
} | ||
} |
Oops, something went wrong.