-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
9 changed files
with
122 additions
and
42 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
67 changes: 67 additions & 0 deletions
67
android/src/main/java/com/shabinder/spotiflyer/ui/AnalyticsDialog.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,67 @@ | ||
package com.shabinder.spotiflyer.ui | ||
|
||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.animation.ExperimentalAnimationApi | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.AlertDialog | ||
import androidx.compose.material.Icon | ||
import androidx.compose.material.Text | ||
import androidx.compose.material.TextButton | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.rounded.Insights | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import androidx.compose.ui.window.DialogProperties | ||
import com.shabinder.common.uikit.SpotiFlyerShapes | ||
import com.shabinder.common.uikit.SpotiFlyerTypography | ||
import com.shabinder.common.uikit.colorPrimary | ||
|
||
@OptIn(ExperimentalAnimationApi::class) | ||
@Composable | ||
fun AnalyticsDialog( | ||
isVisible:Boolean, | ||
enableAnalytics: ()->Unit, | ||
dismissDialog: () -> Unit, | ||
) { | ||
// Analytics Permission Dialog | ||
AnimatedVisibility(isVisible) { | ||
AlertDialog( | ||
onDismissRequest = dismissDialog, | ||
title = { | ||
Row(verticalAlignment = Alignment.CenterVertically) { | ||
Icon(Icons.Rounded.Insights,"Analytics", Modifier.size(52.dp)) | ||
Spacer(Modifier.padding(horizontal = 4.dp)) | ||
Text("Grant Analytics Access",style = SpotiFlyerTypography.h5,textAlign = TextAlign.Center) | ||
} | ||
}, | ||
backgroundColor = Color.DarkGray, | ||
buttons = { | ||
TextButton( | ||
{ | ||
dismissDialog() | ||
enableAnalytics() | ||
}, | ||
Modifier.padding(bottom = 16.dp, start = 16.dp, end = 16.dp).fillMaxWidth() | ||
.background(colorPrimary, shape = SpotiFlyerShapes.medium) | ||
.padding(horizontal = 8.dp), | ||
) { | ||
Text("Sure!",color = Color.Black,fontSize = 18.sp,textAlign = TextAlign.Center) | ||
} | ||
}, | ||
text = { | ||
Text("Your Data is Anonymized and will never be shared with any 3rd party service",style = SpotiFlyerTypography.body2,textAlign = TextAlign.Center) | ||
}, | ||
properties = DialogProperties(dismissOnBackPress = true,dismissOnClickOutside = false) | ||
) | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- F-Droid Initial Release. | ||
- Size Reduced to 4.9 MB (14% smalled than previous apk). | ||
- Firebase Analytics/Crashlytics Removed, Self-Hosted Alternatives Used (100% Open Source). | ||
- Dependencies Updated. |