mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
make export settings activity transparent
This commit is contained in:
parent
2250e1bcab
commit
72ae132fcd
@ -46,13 +46,13 @@
|
|||||||
android:name=".ExportSettingsActivity"
|
android:name=".ExportSettingsActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/ExportSettingsTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme"/>
|
android:resource="@style/ExportSettingsTheme"/>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
@ -3,6 +3,7 @@ package app.revanced.manager.flutter
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
import io.flutter.embedding.android.TransparencyMode
|
||||||
import io.flutter.embedding.engine.FlutterEngine
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
@ -37,4 +38,8 @@ class ExportSettingsActivity : FlutterActivity() {
|
|||||||
override fun getDartEntrypointFunctionName(): String {
|
override fun getDartEntrypointFunctionName(): String {
|
||||||
return "mainExportSettings"
|
return "mainExportSettings"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getTransparencyMode(): TransparencyMode {
|
||||||
|
return TransparencyMode.transparent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@
|
|||||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="ExportSettingsTheme" parent="android:Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowBackground">#52000000</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -306,9 +306,9 @@
|
|||||||
"managerContributors": "Manager contributors"
|
"managerContributors": "Manager contributors"
|
||||||
},
|
},
|
||||||
"exportSettingsView": {
|
"exportSettingsView": {
|
||||||
"widgetTitle": "Export settings",
|
"widgetTitle": "Import settings",
|
||||||
"description": "Would you like to export your settings to the latest version of ReVanced Manager?",
|
"description": "Would you like to import your settings to the previous version of ReVanced Manager?",
|
||||||
"exportButton": "Export",
|
"exportButton": "Import",
|
||||||
"dismissButton": "No thanks"
|
"dismissButton": "No thanks"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,26 +10,23 @@ class ExportSettingsView extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_exportSettingsViewModel.init(context);
|
return AlertDialog(
|
||||||
return Material(
|
title: I18nText('exportSettingsView.widgetTitle'),
|
||||||
child: AlertDialog(
|
content: I18nText('exportSettingsView.description'),
|
||||||
title: I18nText('exportSettingsView.widgetTitle'),
|
icon: const Icon(Icons.update),
|
||||||
content: I18nText('exportSettingsView.description'),
|
actions: <Widget> [
|
||||||
icon: const Icon(Icons.update),
|
CustomMaterialButton(
|
||||||
actions: <Widget> [
|
isFilled: false,
|
||||||
CustomMaterialButton(
|
label: I18nText('exportSettingsView.dismissButton'),
|
||||||
isFilled: false,
|
onPressed: _exportSettingsViewModel.deny,
|
||||||
label: I18nText('exportSettingsView.dismissButton'),
|
|
||||||
onPressed: _exportSettingsViewModel.deny,
|
|
||||||
),
|
|
||||||
CustomMaterialButton(
|
|
||||||
label: I18nText('exportSettingsView.exportButton'),
|
|
||||||
onPressed: () async {
|
|
||||||
await _exportSettingsViewModel.accept();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
CustomMaterialButton(
|
||||||
|
label: I18nText('exportSettingsView.exportButton'),
|
||||||
|
onPressed: () async {
|
||||||
|
await _exportSettingsViewModel.accept();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,19 +15,6 @@ class ExportSettingsViewModel extends BaseViewModel {
|
|||||||
final _channel = const MethodChannel('app.revanced.manager.flutter/settings');
|
final _channel = const MethodChannel('app.revanced.manager.flutter/settings');
|
||||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||||
|
|
||||||
void init(BuildContext context) {
|
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
|
||||||
SystemUiOverlayStyle(
|
|
||||||
systemNavigationBarColor: Colors.transparent,
|
|
||||||
systemNavigationBarIconBrightness:
|
|
||||||
DynamicTheme.of(context)!.theme.brightness == Brightness.light
|
|
||||||
? Brightness.dark
|
|
||||||
: Brightness.light,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> accept() async {
|
Future<void> accept() async {
|
||||||
final externalDir = await getExternalStorageDirectory();
|
final externalDir = await getExternalStorageDirectory();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user