TheTimeWalker / wallpanel-android

WallPanel is an Android application for Web Based Dashboards and Home Automation Platforms
https://wallpanel.xyz
Apache License 2.0
451 stars 45 forks source link

[FEATURE] Add a way to export and import settings #141

Open pardofelis opened 3 months ago

pardofelis commented 3 months ago

Your feature request. Please describe. As of now, the settings have to be set manually. This isn't that bad, unless you have multiple devices you want to have the same settings, or want to reinstall the app. For that reason, a way to export and import the settings would save time.

If I understand these lines 51 ff. in the file CustomWebView.kt correctly, there is already a class called settings whose variables carry the settings, so maybe the export feature could take this class, put it into plain text and save it as a file?


        settings.domStorageEnabled = true
        settings.databaseEnabled = true
        settings.saveFormData = true
        settings.javaScriptCanOpenWindowsAutomatically = true
        settings.cacheMode = WebSettings.LOAD_NO_CACHE
        settings.allowFileAccess = true
        settings.allowFileAccessFromFileURLs = true
        settings.allowContentAccess = true
        settings.setSupportZoom(true)
        settings.loadWithOverviewMode = true
        settings.useWideViewPort = true
        settings.pluginState = WebSettings.PluginState.ON
        settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        // settings.cacheMode = WebSettings.LOAD_NO_CACHE;
        settings.mediaPlaybackRequiresUserGesture = false;```