Compare commits

...

3 commits

Author SHA1 Message Date
58236b8023
Added .woodpecker.yml
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
2022-01-04 18:05:33 +01:00
01c0a7da7f
Merge remote-tracking branch 'origin/main' 2021-12-01 15:44:05 +01:00
5e77986a74
Minor Webview fix
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
2021-12-01 15:35:56 +01:00
2 changed files with 32 additions and 12 deletions

15
.woodpecker.yml Normal file
View file

@ -0,0 +1,15 @@
pipeline:
gradleBuild:
image: androidsdk/android-30:latest
commands:
- export VERSION_CODE=$(git rev-list --first-parent --count HEAD)
- export PN=$PACKAGE_NAME
- export V=$VERSION
- export APK=$${PN}_$${V}$${VERSION_CODE}.apk
- echo $APK
- ./gradlew assemble
- cp app/build/outputs/apk/release/app-release-unsigned.apk $${APK}
environment:
PACKAGE_NAME: eu.toldi.balazs.caster
VERSION: 010
branches: [ main, dev ]

View file

@ -1,31 +1,24 @@
package eu.toldi.balazs.anotherfeedreader
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.webkit.WebView
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.OpenInBrowser
import androidx.compose.material.icons.filled.Share
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
import eu.toldi.balazs.anotherfeedreader.WebView.Companion.barTitle
import eu.toldi.balazs.anotherfeedreader.WebView.Companion.webURL
import eu.toldi.balazs.anotherfeedreader.ui.theme.AnotherFeedReaderTheme
import eu.toldi.balazs.anotherfeedreader.views.CustomWebViewClient
import android.net.Uri
import android.content.Intent
import androidx.compose.foundation.layout.Row
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.ArrowLeft
import androidx.compose.material.icons.filled.Share
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.startActivity
class WebView : ComponentActivity() {
companion object {
@ -33,6 +26,9 @@ class WebView : ComponentActivity() {
var barTitle = ""
}
lateinit var webView: WebView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -102,6 +98,7 @@ class WebView : ComponentActivity() {
fun ShowWebView(name: String) {
AndroidView(factory = { ctx ->
WebView(ctx).apply {
webView = this
loadUrl(webURL)
webViewClient = CustomWebViewClient()
}
@ -119,4 +116,12 @@ class WebView : ComponentActivity() {
}
}
override fun onBackPressed() {
if (webView.canGoBack()) {
webView.goBack()
} else {
super.onBackPressed()
}
}
}