Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ksp)
id("org.jetbrains.kotlin.plugin.serialization") version "2.3.21"
Expand Down Expand Up @@ -33,11 +34,23 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
buildFeatures {
compose = true
buildConfig = true
aidl = true
}
applicationVariants.all {
outputs.all {
val output = this as? com.android.build.gradle.internal.api.BaseVariantOutputImpl
output?.outputFileName = "米灵.apk"

}
}
}

dependencies {
Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 0 additions & 25 deletions app/src/main/java/com/d4viddf/hyperbridge/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import androidx.compose.ui.unit.dp
import androidx.navigation3.ui.NavDisplay
import com.d4viddf.hyperbridge.data.AppPreferences
import com.d4viddf.hyperbridge.data.db.AppDatabase
import com.d4viddf.hyperbridge.ui.components.ChangelogSheet
import com.d4viddf.hyperbridge.ui.navigation.Navigator
import com.d4viddf.hyperbridge.ui.navigation.Screen
import com.d4viddf.hyperbridge.ui.navigation.mainNavGraph
Expand Down Expand Up @@ -122,10 +121,7 @@ private fun MainNavigationContent(
onExit: () -> Unit
) {
val isInitiallySetup = remember { isSetupComplete }
val lastSeenVersion by preferences.lastSeenVersion.collectAsState(initial = -1)

var showChangelog by remember { mutableStateOf(false) }

// Check for Troubleshoot Intent
val activity = context as? AppCompatActivity
val shouldOpenTroubleshoot = activity?.intent?.getBooleanExtra("open_troubleshoot", false) ?: false
Expand All @@ -140,14 +136,6 @@ private fun MainNavigationContent(
)
val navigator = remember(navigationState) { Navigator(navigationState) }

LaunchedEffect(isSetupComplete, lastSeenVersion) {
if (isSetupComplete && isInitiallySetup && lastSeenVersion != -1) {
if (currentVersionCode > lastSeenVersion) {
showChangelog = true
}
}
}

val entryProvider = mainNavGraph(
context = context,
scope = scope,
Expand Down Expand Up @@ -209,19 +197,6 @@ private fun MainNavigationContent(
.clip(RoundedCornerShape(32.dp))
)

if (showChangelog) {
ChangelogSheet(
currentVersionName = currentVersionName,
changelogText = stringResource(R.string.changelog_0_5_5),
onDismiss = {
showChangelog = false
scope.launch {
preferences.setLastSeenVersion(currentVersionCode)
}
}
)
}

if (showTroubleshootDialog) {
androidx.compose.material3.AlertDialog(
onDismissRequest = { showTroubleshootDialog = false },
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/com/d4viddf/hyperbridge/data/AppPreferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ class AppPreferences(context: Context) {
save(SettingsKeys.ALLOWED_PACKAGES, newSet.serialize())
}

suspend fun setAllApps(packageNames: List<String>, enabled: Boolean) {
if (enabled) {
save(SettingsKeys.ALLOWED_PACKAGES, packageNames.toSet().serialize())
} else {
save(SettingsKeys.ALLOWED_PACKAGES, emptySet<String>().serialize())
}
}

// ========================================================================
// THEME ENGINE
// ========================================================================
Expand Down Expand Up @@ -463,7 +471,7 @@ class AppPreferences(context: Context) {
private val IS_SHIZUKU_WORKAROUND_ENABLED = "is_shizuku_workaround_enabled"

val useNativeLiveUpdates: Flow<Boolean> = dao.getSettingFlow(USE_NATIVE_ENGINE)
.map { it?.toBoolean() ?: false }
.map { it?.toBoolean() ?: true }

val isShizukuWorkaroundEnabled: Flow<Boolean> = dao.getSettingFlow(IS_SHIZUKU_WORKAROUND_ENABLED)
.map { it?.toBoolean() ?: false }
Expand Down Expand Up @@ -587,6 +595,6 @@ class AppPreferences(context: Context) {
}

fun useNativeLiveUpdatesSync(): Boolean {
return memoryCache[USE_NATIVE_ENGINE]?.toBoolean() ?: false
return memoryCache[USE_NATIVE_ENGINE]?.toBoolean() ?: true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,10 @@ class NotificationReaderService : NotificationListenerService() {
}
manager.createNotificationChannel(notifChannel)

val widgetChannel = NotificationChannel(WIDGET_CHANNEL_ID, "Widgets Overlay", NotificationManager.IMPORTANCE_LOW).apply {
setSound(null, null); enableVibration(false); setShowBadge(false)
}
manager.createNotificationChannel(widgetChannel)
// val widgetChannel = NotificationChannel(WIDGET_CHANNEL_ID, "Widgets Overlay", NotificationManager.IMPORTANCE_LOW).apply {
// setSound(null, null); enableVibration(false); setShowBadge(false)
// }
// manager.createNotificationChannel(widgetChannel)

val liveUpdateChannel = NotificationChannel(LIVE_UPDATE_CHANNEL_ID, getString(R.string.channel_live_updates), NotificationManager.IMPORTANCE_DEFAULT).apply {
setSound(null, null); enableVibration(false); setShowBadge(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.os.IBinder
import android.util.Log
import androidx.annotation.RequiresPermission
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.d4viddf.hyperbridge.MainActivity
import com.d4viddf.hyperbridge.R
import com.d4viddf.hyperbridge.data.AppPreferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ class AppListViewModel(application: Application) : AndroidViewModel(application)
}
}

fun toggleAllApps(enable: Boolean) {
viewModelScope.launch {
val allPackageNames = libraryAppsState.value.map { it.packageName }
preferences.setAllApps(allPackageNames, enable)
}
}

// Standard non-flow getter if needed by other parts of the app
suspend fun getAppConfig(packageName: String) = preferences.getAppConfigFlow(packageName).first()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ fun DesignScreenContent(
},
colors = TopAppBarDefaults.topAppBarColors(containerColor = MaterialTheme.colorScheme.background)
)
},
floatingActionButton = {
FloatingActionButton(
onClick = onFabClick,
containerColor = MaterialTheme.colorScheme.primaryContainer
) {
Icon(Icons.Rounded.Add, contentDescription = stringResource(R.string.design_add_design))
}
}
) { padding ->
Column(
Expand All @@ -272,8 +264,6 @@ fun DesignScreenContent(
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.spacedBy(24.dp)
) {
HeroSection()

Column(
modifier = Modifier.fillMaxWidth()
) {
Expand All @@ -287,17 +277,6 @@ fun DesignScreenContent(
)
}

Column(
modifier = Modifier.fillMaxWidth()
) {
SectionHeader(stringResource(R.string.design_section_widgets), onNavigateToWidgets)
WidgetsCarousel(
savedCount = savedWidgetCount,
icons = widgetIcons,
onNavigateToWidgets = onNavigateToWidgets,
onAddWidget = onFabClick
)
}
Spacer(Modifier.height(24.dp))
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.d4viddf.hyperbridge.ui.screens.home

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -96,6 +98,26 @@ fun LibraryPage(
onSortChange = { viewModel.librarySort.value = it }
)

Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
androidx.compose.material3.FilledTonalButton(
onClick = { viewModel.toggleAllApps(true) },
modifier = Modifier.weight(1f)
) {
Text(stringResource(R.string.enable_all))
}
androidx.compose.material3.FilledTonalButton(
onClick = { viewModel.toggleAllApps(false) },
modifier = Modifier.weight(1f)
) {
Text(stringResource(R.string.disable_all))
}
}

Box(
modifier = Modifier
.weight(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,6 @@ fun PrivacyPage() {
fun CompatibilityPage() {
val isXiaomi = DeviceUtils.isXiaomi
val isCompatibleOS = DeviceUtils.isCompatibleOS()
val isCN = DeviceUtils.isCNRom
val osVersion = DeviceUtils.getHyperOSVersion()
val deviceName = DeviceUtils.getDeviceMarketName()

Expand Down Expand Up @@ -1078,25 +1077,6 @@ fun CompatibilityPage() {
onClick = {},
trailingContent = {}
)

if (isCN && isXiaomi) {
Card(
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.errorContainer),
shape = RoundedCornerShape(24.dp),
modifier = Modifier.fillMaxWidth()
) {
Row(Modifier.padding(16.dp), verticalAlignment = Alignment.CenterVertically) {
Icon(Icons.Default.Warning, null, tint = MaterialTheme.colorScheme.error)
Spacer(Modifier.width(12.dp))
Text(
stringResource(R.string.warning_cn_rom_title),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onErrorContainer,
fontWeight = FontWeight.Bold
)
}
}
}
}
}
}
Expand Down
Loading