Compare commits
3 commits
227f3fd002
...
58236b8023
Author | SHA1 | Date | |
---|---|---|---|
58236b8023 | |||
01c0a7da7f | |||
5e77986a74 |
2 changed files with 32 additions and 12 deletions
15
.woodpecker.yml
Normal file
15
.woodpecker.yml
Normal 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 ]
|
|
@ -1,31 +1,24 @@
|
||||||
package eu.toldi.balazs.anotherfeedreader
|
package eu.toldi.balazs.anotherfeedreader
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.material.icons.Icons
|
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.OpenInBrowser
|
||||||
|
import androidx.compose.material.icons.filled.Share
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.viewinterop.AndroidView
|
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.ui.theme.AnotherFeedReaderTheme
|
||||||
import eu.toldi.balazs.anotherfeedreader.views.CustomWebViewClient
|
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() {
|
class WebView : ComponentActivity() {
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -33,6 +26,9 @@ class WebView : ComponentActivity() {
|
||||||
var barTitle = ""
|
var barTitle = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lateinit var webView: WebView
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
@ -102,6 +98,7 @@ class WebView : ComponentActivity() {
|
||||||
fun ShowWebView(name: String) {
|
fun ShowWebView(name: String) {
|
||||||
AndroidView(factory = { ctx ->
|
AndroidView(factory = { ctx ->
|
||||||
WebView(ctx).apply {
|
WebView(ctx).apply {
|
||||||
|
webView = this
|
||||||
loadUrl(webURL)
|
loadUrl(webURL)
|
||||||
webViewClient = CustomWebViewClient()
|
webViewClient = CustomWebViewClient()
|
||||||
}
|
}
|
||||||
|
@ -119,4 +116,12 @@ class WebView : ComponentActivity() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (webView.canGoBack()) {
|
||||||
|
webView.goBack()
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue