HotFix https://cau.verdnatura.es/scp/tickets.php?id=75703 . No se podían descargar las facturas
This commit is contained in:
parent
4d81ad2105
commit
cf5e7e6d3e
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -11,9 +11,9 @@ android {
|
|||
applicationId "com.verdnatura.verdnaturaventas"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 33
|
||||
versionCode 106
|
||||
versionName "3.0.3"
|
||||
//versionName "3.0.2" versionCode 105
|
||||
versionCode 108
|
||||
versionName "3.0.4"
|
||||
//versionName "3.0.4" versionCode 107
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 106,
|
||||
"versionName": "3.0.3",
|
||||
"versionCode": 108,
|
||||
"versionName": "3.0.4",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package com.verdnatura.verdnaturaventas
|
||||
|
||||
import android.app.DownloadManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.view.View
|
||||
import android.webkit.WebChromeClient
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import android.webkit.*
|
||||
import android.widget.LinearLayout
|
||||
import android.window.OnBackInvokedDispatcher
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var webView: WebView
|
||||
|
@ -46,7 +45,6 @@ class MainActivity : AppCompatActivity() {
|
|||
loading = findViewById(R.id.loading)
|
||||
}
|
||||
|
||||
|
||||
private fun setWebview() {
|
||||
webView = findViewById(R.id.webView)
|
||||
val webSettings = webView.settings
|
||||
|
@ -75,6 +73,19 @@ class MainActivity : AppCompatActivity() {
|
|||
loading.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
webView.setDownloadListener { url, _, contentDisposition, mimetype, _ ->
|
||||
val request = DownloadManager.Request(
|
||||
Uri.parse(url)
|
||||
)
|
||||
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
|
||||
request.setDestinationInExternalPublicDir(
|
||||
Environment.DIRECTORY_DOWNLOADS,
|
||||
URLUtil.guessFileName(url, contentDisposition, mimetype)
|
||||
)
|
||||
val dm = getSystemService(DOWNLOAD_SERVICE) as DownloadManager
|
||||
dm.enqueue(request)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun loadHome() {
|
||||
|
@ -90,7 +101,6 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun backPressed(view: View) {
|
||||
webView.goBack()
|
||||
|
|
Loading…
Reference in New Issue