mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-05-21 16:28:43 +00:00
android: hide reconnect when app hasn't connected once
This commit is contained in:
@@ -552,19 +552,22 @@ fun AirPodsSettingsScreen(viewModel: AirPodsViewModel, navController: NavControl
|
|||||||
}
|
}
|
||||||
Spacer(Modifier.height(16.dp))
|
Spacer(Modifier.height(16.dp))
|
||||||
}
|
}
|
||||||
StyledButton(
|
if (state.connectionSuccessful) {
|
||||||
onClick = {
|
StyledButton(
|
||||||
viewModel.reconnectFromSavedMac()
|
onClick = {
|
||||||
}, backdrop = backdrop, modifier = Modifier.fillMaxWidth(0.9f)
|
viewModel.reconnectFromSavedMac()
|
||||||
) {
|
}, backdrop = backdrop, modifier = Modifier.fillMaxWidth(0.9f)
|
||||||
Text(
|
) {
|
||||||
text = stringResource(R.string.reconnect_to_last_device), style = TextStyle(
|
Text(
|
||||||
fontSize = 16.sp,
|
text = stringResource(R.string.reconnect_to_last_device),
|
||||||
fontWeight = FontWeight.Medium,
|
style = TextStyle(
|
||||||
fontFamily = FontFamily(Font(R.font.sf_pro)),
|
fontSize = 16.sp,
|
||||||
color = if (isSystemInDarkTheme()) Color.White else Color.Black
|
fontWeight = FontWeight.Medium,
|
||||||
|
fontFamily = FontFamily(Font(R.font.sf_pro)),
|
||||||
|
color = if (isSystemInDarkTheme()) Color.White else Color.Black
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,9 @@ data class AirPodsUiState(
|
|||||||
val isPremium: Boolean = false,
|
val isPremium: Boolean = false,
|
||||||
val vendorIdHook: Boolean = false,
|
val vendorIdHook: Boolean = false,
|
||||||
|
|
||||||
val dynamicEndOfCharge: Boolean = false
|
val dynamicEndOfCharge: Boolean = false,
|
||||||
|
|
||||||
|
val connectionSuccessful: Boolean = false
|
||||||
)
|
)
|
||||||
|
|
||||||
class AirPodsViewModel(
|
class AirPodsViewModel(
|
||||||
@@ -354,6 +356,8 @@ class AirPodsViewModel(
|
|||||||
val vendorIdHook = xposedRemotePref.getBoolean("vendor_id_hook", false)
|
val vendorIdHook = xposedRemotePref.getBoolean("vendor_id_hook", false)
|
||||||
val dynamicEndOfCharge = sharedPreferences.getBoolean("dynamic_end_of_charge", false)
|
val dynamicEndOfCharge = sharedPreferences.getBoolean("dynamic_end_of_charge", false)
|
||||||
|
|
||||||
|
val connectionSuccessful = sharedPreferences.getBoolean("connection_successful", false)
|
||||||
|
|
||||||
_uiState.update {
|
_uiState.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
offListeningMode = offListeningModeEnabled,
|
offListeningMode = offListeningModeEnabled,
|
||||||
@@ -363,7 +367,8 @@ class AirPodsViewModel(
|
|||||||
leftAction = leftAction,
|
leftAction = leftAction,
|
||||||
rightAction = rightAction,
|
rightAction = rightAction,
|
||||||
vendorIdHook = vendorIdHook,
|
vendorIdHook = vendorIdHook,
|
||||||
dynamicEndOfCharge = dynamicEndOfCharge
|
dynamicEndOfCharge = dynamicEndOfCharge,
|
||||||
|
connectionSuccessful = connectionSuccessful
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user