Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId = "com.sameerasw.essentials"
minSdk = 26
targetSdk = 36
versionCode = 35
versionName = "12.4"
versionCode = 36
versionName = "12.5"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -79,8 +79,8 @@ dependencies {
// Android 12+ SplashScreen API with backward compatibility attributes
implementation("androidx.core:core-splashscreen:1.0.1")

// Force latest Material3 1.5.0-alpha12 for ToggleButton & ButtonGroup support
implementation("androidx.compose.material3:material3:1.5.0-alpha12")
// Force latest Material3 1.5.0-alpha16 for new ListItem expressive overloads
implementation("androidx.compose.material3:material3:1.5.0-alpha16")

implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
Expand Down
11 changes: 10 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@
# Emoji data classes for Gson
-keep class com.sameerasw.essentials.ui.ime.EmojiObject { *; }
-keep class com.sameerasw.essentials.ui.ime.EmojiCategory { *; }
-keep class com.sameerasw.essentials.ui.ime.EmojiDataResponse { *; }
-keep class com.sameerasw.essentials.ui.ime.EmojiDataResponse { *; }
# Keep ViewModel constructors for reflection-based instantiation
-keepclassmembers class * extends androidx.lifecycle.ViewModel {
public <init>(...);
}

# Ensure anonymous TypeToken subclasses (used for GSON generic lists) are kept
-keepclassmembers class * extends com.google.gson.reflect.TypeToken {
protected <init>(...);
}
10 changes: 10 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,16 @@
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<service
android:name=".services.tiles.LocationReachedTileService"
android:exported="true"
android:icon="@drawable/rounded_navigation_24"
android:label="@string/tile_location_reached"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>

<service
android:name=".services.tiles.PrivateDnsTileService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,33 +329,25 @@ class FeatureSettingsActivity : AppCompatActivity() {
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.surfaceContainer)
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
) {
val hasScroll = featureId != "Sound mode tile" && featureId != "Quick settings tiles"
val hasScroll = featureId != "Sound mode tile" && featureId != "Quick settings tiles" && featureId != "Location reached"
Column(
modifier = Modifier
.fillMaxSize()
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = with(LocalDensity.current) { 150.dp.toPx() },
direction = BlurDirection.BOTTOM
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = with(LocalDensity.current) { 150.dp.toPx() },
direction = BlurDirection.BOTTOM
)
.then(if (hasScroll) Modifier.verticalScroll(rememberScrollState()) else Modifier)
) {
// Top padding for status bar
if (featureId != "Quick settings tiles") {
if (featureId != "Quick settings tiles" && featureId != "Location reached") {
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(statusBarHeight))
}

Expand Down Expand Up @@ -566,7 +558,7 @@ class FeatureSettingsActivity : AppCompatActivity() {
"Location reached" -> {
LocationReachedSettingsUI(
mainViewModel = viewModel,
modifier = Modifier.padding(top = 16.dp),
modifier = Modifier.fillMaxSize(),
highlightSetting = highlightSetting
)
}
Expand Down Expand Up @@ -645,7 +637,7 @@ class FeatureSettingsActivity : AppCompatActivity() {

}
// Bottom padding for toolbar
if (featureId != "Quick settings tiles") {
if (featureId != "Quick settings tiles" && featureId != "Location reached") {
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(150.dp))
}
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/sameerasw/essentials/LinkPickerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ class LinkPickerActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val locationViewModel = com.sameerasw.essentials.viewmodels.LocationReachedViewModel(application)
if (locationViewModel.handleIntent(intent)) {
val settingsIntent = Intent(this, FeatureSettingsActivity::class.java).apply {
putExtra("feature", "Location reached")
}
startActivity(settingsIntent)
finish()
return
}

val uri = when (intent.action) {
Intent.ACTION_SEND -> {
val text = intent.getStringExtra(Intent.EXTRA_TEXT) ?: ""
Expand Down
29 changes: 13 additions & 16 deletions app/src/main/java/com/sameerasw/essentials/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,10 @@ class MainActivity : AppCompatActivity() {
Box(
modifier = Modifier
.fillMaxSize()
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
) {
val currentTab = remember(tabs, currentPage) {
Expand Down Expand Up @@ -611,14 +607,10 @@ class MainActivity : AppCompatActivity() {
modifier = Modifier
.scale(1f - (backProgress.value * 0.05f))
.alpha(1f - (backProgress.value * 0.3f))
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = with(androidx.compose.ui.platform.LocalDensity.current) { 130.dp.toPx() },
direction = BlurDirection.BOTTOM
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = with(androidx.compose.ui.platform.LocalDensity.current) { 130.dp.toPx() },
direction = BlurDirection.BOTTOM
),
label = "Tab Transition"
) { targetPage ->
Expand Down Expand Up @@ -651,6 +643,11 @@ class MainActivity : AppCompatActivity() {
startActivity(Intent(context, FeatureSettingsActivity::class.java).apply {
putExtra("feature", "Freeze")
})
},
onSettingsClick = {
startActivity(Intent(context, FeatureSettingsActivity::class.java).apply {
putExtra("feature", "Freeze")
})
}
)
}
Expand Down
47 changes: 17 additions & 30 deletions app/src/main/java/com/sameerasw/essentials/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,10 @@ class SettingsActivity : AppCompatActivity() {
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.surfaceContainer)
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = statusBarHeightPx * 1.15f,
direction = BlurDirection.TOP
)
) {
val contentPadding = androidx.compose.foundation.layout.PaddingValues(
Expand All @@ -168,14 +164,10 @@ class SettingsActivity : AppCompatActivity() {
viewModel = viewModel,
contentPadding = contentPadding,
modifier = Modifier
.then(
if (isBlurEnabled) {
Modifier.progressiveBlur(
blurRadius = 40f,
height = with(LocalDensity.current) { 150.dp.toPx() },
direction = BlurDirection.BOTTOM
)
} else Modifier
.progressiveBlur(
blurRadius = if (isBlurEnabled) 40f else 0f,
height = with(LocalDensity.current) { 150.dp.toPx() },
direction = BlurDirection.BOTTOM
)
)

Expand Down Expand Up @@ -390,13 +382,6 @@ fun SettingsContent(
}


Text(
text = "Default tab",
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.padding(start = 16.dp, top = 8.dp, bottom = 8.dp),
color = MaterialTheme.colorScheme.onSurfaceVariant
)

val defaultTab by viewModel.defaultTab
RoundedCardContainer {
val availableTabs = remember { DIYTabs.entries }
Expand Down Expand Up @@ -768,8 +753,8 @@ fun SettingsContent(
.background(
color = MaterialTheme.colorScheme.surfaceBright
)
.padding(start = 12.dp, end = 12.dp, top = 12.dp, bottom = 4.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
.padding(16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Button(
onClick = {
Expand Down Expand Up @@ -799,19 +784,21 @@ fun SettingsContent(
.background(
color = MaterialTheme.colorScheme.surfaceBright
)
.padding(start = 12.dp, end = 12.dp, top = 4.dp, bottom = 12.dp),
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
Button(
onClick = {
HapticUtil.performVirtualKeyHaptic(view)
viewModel.resetOnboarding(context)
// Navigate back to main screen
(context as? ComponentActivity)?.finish()
Toast.makeText(context, "Onboarding reset", Toast.LENGTH_SHORT).show()
},
modifier = Modifier.fillMaxWidth()
modifier = Modifier.fillMaxWidth(),
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.error
)
) {
Text("Reset onboarding")
Text("Reset App Data", color = MaterialTheme.colorScheme.onError)
}
}

Expand Down
Loading