Fix slow upload by turning on hardware accelleration on the webview (#1173)
This commit is contained in:
parent
beeb0d16c0
commit
5b03c64e8d
1 changed files with 2 additions and 0 deletions
|
@ -14,6 +14,7 @@ import android.webkit.WebView
|
||||||
import android.webkit.WebMessage
|
import android.webkit.WebMessage
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
|
import android.view.View
|
||||||
import android.webkit.ConsoleMessage
|
import android.webkit.ConsoleMessage
|
||||||
import android.webkit.JavascriptInterface
|
import android.webkit.JavascriptInterface
|
||||||
import android.webkit.WebChromeClient
|
import android.webkit.WebChromeClient
|
||||||
|
@ -60,6 +61,7 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
|
||||||
mWebView!!.setListener(this, this)
|
mWebView!!.setListener(this, this)
|
||||||
mWebView!!.setWebChromeClient(LoggingWebChromeClient())
|
mWebView!!.setWebChromeClient(LoggingWebChromeClient())
|
||||||
mWebView!!.addJavascriptInterface(WebAppInterface(this), "Android")
|
mWebView!!.addJavascriptInterface(WebAppInterface(this), "Android")
|
||||||
|
mWebView!!.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||||
|
|
||||||
val webSettings = mWebView!!.getSettings()
|
val webSettings = mWebView!!.getSettings()
|
||||||
webSettings.setUserAgentString("Send Android")
|
webSettings.setUserAgentString("Send Android")
|
||||||
|
|
Loading…
Reference in a new issue