From 2da06a4ad2a18ee4a3649e523af9c106734e96df Mon Sep 17 00:00:00 2001 From: Michael Ritchie Date: Sun, 20 Oct 2019 14:04:39 -0300 Subject: [PATCH] * added another fix for the slow scrolling on the web view after updating to Android API 28 --- WallPanelApp/build.gradle | 2 +- .../iot/wallpanel/ui/activities/BrowserActivityNative.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WallPanelApp/build.gradle b/WallPanelApp/build.gradle index c68759f..a18edc1 100644 --- a/WallPanelApp/build.gradle +++ b/WallPanelApp/build.gradle @@ -24,7 +24,7 @@ apply plugin: 'com.google.gms.google-services' def versionMajor = 0 def versionMinor = 8 def versionPatch = 9 -def versionBuild = 0 // bump for dog food builds, public betas, etc. +def versionBuild = 1 // bump for dog food builds, public betas, etc. android { kapt { diff --git a/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/ui/activities/BrowserActivityNative.kt b/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/ui/activities/BrowserActivityNative.kt index cfd3882..38424f1 100644 --- a/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/ui/activities/BrowserActivityNative.kt +++ b/WallPanelApp/src/main/java/com/thanksmister/iot/wallpanel/ui/activities/BrowserActivityNative.kt @@ -162,6 +162,14 @@ class BrowserActivityNative : BrowserActivity() { false } + if (configuration.hardwareAccelerated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + // chromium, enable hardware acceleration + mWebView?.setLayerType(View.LAYER_TYPE_HARDWARE, null); + } else { + // older android version, disable hardware acceleration + mWebView?.setLayerType(View.LAYER_TYPE_SOFTWARE, null); + } + configureWebSettings(configuration.browserUserAgent) loadUrl(configuration.appLaunchUrl) }