-
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
Showing
20 changed files
with
292 additions
and
139 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
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
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
40 changes: 40 additions & 0 deletions
40
...src/main/java/ru/n00byara/notificationcode/ui/components/permissioncard/PermissionCard.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,40 @@ | ||
package ru.n00byara.notificationcode.ui.components.permissioncard | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Card | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import ru.n00byara.notificationcode.R | ||
|
||
@Composable | ||
fun PermissionCard(permissionCardModel: PermissionCardModel) { | ||
Card( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(start = 15.dp, end = 15.dp, top = 7.dp, bottom = 7.dp) | ||
.clip(RoundedCornerShape(19.dp)) | ||
.clickable { | ||
permissionCardModel.openSettings() | ||
} | ||
) { | ||
Row( | ||
modifier = Modifier.padding(10.dp), | ||
horizontalArrangement = Arrangement.Center | ||
) { | ||
Text( | ||
text = stringResource(R.string.access_notification_listener), | ||
fontSize = 15.sp | ||
) | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...ain/java/ru/n00byara/notificationcode/ui/components/permissioncard/PermissionCardModel.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,5 @@ | ||
package ru.n00byara.notificationcode.ui.components.permissioncard | ||
|
||
data class PermissionCardModel( | ||
val openSettings: () -> Unit | ||
) |
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
7 changes: 5 additions & 2 deletions
7
app/src/main/java/ru/n00byara/notificationcode/ui/components/switcher/SwitcherModel.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package ru.n00byara.notificationcode.ui.components.switcher | ||
|
||
import androidx.compose.runtime.MutableState | ||
|
||
data class SwitcherModel( | ||
val title: Int, | ||
val prefName: String, | ||
val state: Boolean, | ||
val setState: (String, Boolean) -> Unit, | ||
val moduleActive: Boolean, | ||
val isRoot: Boolean | ||
val useCase: MutableState<Int>, | ||
val moduleActive: MutableState<Boolean>, | ||
val premissionAccess: MutableState<Boolean> | ||
) |
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
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
Oops, something went wrong.