Compare commits
9 Commits
3c68bde62b
...
v122123641
Author | SHA1 | Date | |
---|---|---|---|
c718b966a1 | |||
99438e142f | |||
4d8076c3cf | |||
db75c5b74a | |||
966a082147 | |||
cd20a5ec29 | |||
cc4c1c9201 | |||
ff021d572c | |||
89992967be |
@ -46,11 +46,12 @@ steps:
|
||||
image: ubuntu:latest
|
||||
commands:
|
||||
- apt-get update && apt-get install -y git
|
||||
- git fetch --tags -p
|
||||
- VER=$(git describe --tags --abbrev=0)
|
||||
- CHANGELOG=$(git log $VER..HEAD --pretty="- %s")
|
||||
- echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
||||
- git add CHANGELOG.md
|
||||
- git commit -m "Changelog for $VER"
|
||||
- git commit -m "Changelog for $VER [CI SKIP]"
|
||||
- ./build.sh --publish --from-ci
|
||||
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
||||
- git push pushing master
|
||||
|
20
CHANGELOG.md
20
CHANGELOG.md
@ -1,3 +1,23 @@
|
||||
**v122123631**
|
||||
|
||||
- build: Added back maven repos (see https://gitlab.com/fdroid/fdroiddata/-/commit/1fb9d60dc58511abc2bb4eb321977922a0682c8b#note_1223925153)
|
||||
- build: Added back maven repos (see https://gitlab.com/fdroid/fdroiddata/-/commit/1fb9d60dc58511abc2bb4eb321977922a0682c8b#note_1223925153)
|
||||
- debug: trying to resolve `Canvas: trying to use a recycled bitmap`.
|
||||
- fix: NPE may be caused by the binding or the title that was null.
|
||||
- chore: Skip drone pipeline on changelog push.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
**v122123621**
|
||||
|
||||
- fix: Automatic CHANGELOG generation.
|
||||
- Merge pull request 'Sources Upsert' (#119) from sources-edit into master
|
||||
- Source update screen.
|
||||
- Sources menu.
|
||||
- chore: Automatic CHANGELOG generation.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
# V2/Multiplatform rewrite
|
||||
|
||||
**v1**
|
||||
|
@ -66,8 +66,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
private lateinit var allImages : ArrayList<String>
|
||||
private lateinit var fab: FloatingActionButton
|
||||
private lateinit var textAlignment: String
|
||||
private var _binding: FragmentArticleBinding? = null
|
||||
private val binding get() = _binding
|
||||
private lateinit var binding: FragmentArticleBinding
|
||||
|
||||
override val di : DI by closestDI()
|
||||
private val repository: Repository by instance()
|
||||
@ -95,7 +94,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
try {
|
||||
_binding = FragmentArticleBinding.inflate(inflater, container, false)
|
||||
binding = FragmentArticleBinding.inflate(inflater, container, false)
|
||||
|
||||
url = item.getLinkDecoded()
|
||||
contentText = item.content
|
||||
@ -110,13 +109,13 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
|
||||
refreshAlignment()
|
||||
|
||||
fab = binding!!.fab
|
||||
fab = binding.fab
|
||||
|
||||
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorAccent))
|
||||
|
||||
fab.rippleColor = resources.getColor(R.color.colorAccentDark)
|
||||
|
||||
val floatingToolbar: FloatingToolbar = binding!!.floatingToolbar
|
||||
val floatingToolbar: FloatingToolbar = binding.floatingToolbar
|
||||
floatingToolbar.attachFab(fab)
|
||||
|
||||
floatingToolbar.background = ColorDrawable(resources.getColor(R.color.colorAccent))
|
||||
@ -164,35 +163,35 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
floatingToolbar.show()
|
||||
}
|
||||
|
||||
binding!!.source.text = contentSource
|
||||
binding.source.text = contentSource
|
||||
if (typeface != null) {
|
||||
binding!!.source.typeface = typeface
|
||||
binding.source.typeface = typeface
|
||||
}
|
||||
|
||||
if (contentText.isEmptyOrNullOrNullString()) {
|
||||
getContentFromMercury()
|
||||
} else {
|
||||
binding!!.titleView.text = contentTitle
|
||||
binding.titleView.text = contentTitle
|
||||
if (typeface != null) {
|
||||
binding!!.titleView.typeface = typeface
|
||||
binding.titleView.typeface = typeface
|
||||
}
|
||||
|
||||
htmlToWebview()
|
||||
|
||||
if (!contentImage.isEmptyOrNullOrNullString() && context != null) {
|
||||
binding!!.imageView.visibility = View.VISIBLE
|
||||
binding.imageView.visibility = View.VISIBLE
|
||||
Glide
|
||||
.with(requireContext())
|
||||
.asBitmap()
|
||||
.load(contentImage)
|
||||
.apply(RequestOptions.fitCenterTransform())
|
||||
.into(binding!!.imageView)
|
||||
.into(binding.imageView)
|
||||
} else {
|
||||
binding!!.imageView.visibility = View.GONE
|
||||
binding.imageView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
binding!!.nestedScrollView.setOnScrollChangeListener(
|
||||
binding.nestedScrollView.setOnScrollChangeListener(
|
||||
NestedScrollView.OnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
|
||||
if (scrollY > oldScrollY) {
|
||||
floatingToolbar.hide()
|
||||
@ -221,12 +220,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
.show()
|
||||
}
|
||||
|
||||
return binding!!.root
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
return binding.root
|
||||
}
|
||||
|
||||
private fun refreshAlignment() {
|
||||
@ -239,16 +233,16 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
|
||||
private fun getContentFromMercury() {
|
||||
if (repository.isNetworkAvailable()) {
|
||||
binding!!.progressBar.visibility = View.VISIBLE
|
||||
binding.progressBar.visibility = View.VISIBLE
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
try {
|
||||
val response = mercuryApi.query(url)
|
||||
if (response.success && response.data != null && !response.data?.content.isNullOrEmpty()) {
|
||||
binding!!.titleView.text = response.data!!.title.orEmpty()
|
||||
binding.titleView.text = response.data!!.title.orEmpty()
|
||||
try {
|
||||
if (typeface != null) {
|
||||
binding!!.titleView.typeface = typeface
|
||||
binding.titleView.typeface = typeface
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > typeface")
|
||||
@ -272,7 +266,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
|
||||
if (!response.data?.lead_image_url.isNullOrEmpty() && context != null) {
|
||||
try {
|
||||
binding!!.imageView.visibility = View.VISIBLE
|
||||
binding.imageView.visibility = View.VISIBLE
|
||||
try {
|
||||
Glide
|
||||
.with(requireContext())
|
||||
@ -281,7 +275,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
response.data!!.lead_image_url.orEmpty()
|
||||
)
|
||||
.apply(RequestOptions.fitCenterTransform())
|
||||
.into(binding!!.imageView)
|
||||
.into(binding.imageView)
|
||||
} catch (e: Exception) {
|
||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > glide lead image")
|
||||
}
|
||||
@ -289,12 +283,12 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > outside glide lead image")
|
||||
}
|
||||
} else {
|
||||
binding!!.imageView.visibility = View.GONE
|
||||
binding.imageView.visibility = View.GONE
|
||||
}
|
||||
|
||||
try {
|
||||
binding!!.nestedScrollView.scrollTo(0, 0)
|
||||
binding!!.progressBar.visibility = View.GONE
|
||||
binding.nestedScrollView.scrollTo(0, 0)
|
||||
binding.progressBar.visibility = View.GONE
|
||||
} catch (e: Exception) {
|
||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > scrollview")
|
||||
}
|
||||
@ -317,8 +311,8 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
val a: TypedArray = requireContext().obtainStyledAttributes(resId, attrs)
|
||||
|
||||
|
||||
binding!!.webcontent.settings.standardFontFamily = a.getString(0)
|
||||
binding!!.webcontent.visibility = View.VISIBLE
|
||||
binding.webcontent.settings.standardFontFamily = a.getString(0)
|
||||
binding.webcontent.visibility = View.VISIBLE
|
||||
|
||||
val colorOnSurface = TypedValue()
|
||||
requireContext().theme.resolveAttribute(R.attr.colorOnSurface, colorOnSurface, true)
|
||||
@ -326,14 +320,14 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
val colorSurface = TypedValue()
|
||||
requireContext().theme.resolveAttribute(R.attr.colorSurface, colorSurface, true)
|
||||
|
||||
binding!!.webcontent.settings.useWideViewPort = true
|
||||
binding!!.webcontent.settings.loadWithOverviewMode = true
|
||||
binding!!.webcontent.settings.javaScriptEnabled = false
|
||||
binding.webcontent.settings.useWideViewPort = true
|
||||
binding.webcontent.settings.loadWithOverviewMode = true
|
||||
binding.webcontent.settings.javaScriptEnabled = false
|
||||
|
||||
binding!!.webcontent.webViewClient = object : WebViewClient() {
|
||||
binding.webcontent.webViewClient = object : WebViewClient() {
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun shouldOverrideUrlLoading(view: WebView?, url : String): Boolean {
|
||||
if (binding!!.webcontent.hitTestResult.type != WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||
if (binding.webcontent.hitTestResult.type != WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||
requireContext().startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||
}
|
||||
return true
|
||||
@ -377,9 +371,9 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
}
|
||||
})
|
||||
|
||||
binding!!.webcontent.setOnTouchListener { _, event -> gestureDetector.onTouchEvent(event)}
|
||||
binding.webcontent.setOnTouchListener { _, event -> gestureDetector.onTouchEvent(event)}
|
||||
|
||||
binding!!.webcontent.settings.layoutAlgorithm =
|
||||
binding.webcontent.settings.layoutAlgorithm =
|
||||
WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING
|
||||
|
||||
var baseUrl: String? = null
|
||||
@ -410,7 +404,7 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
""
|
||||
}
|
||||
|
||||
binding!!.webcontent.loadDataWithBaseURL(
|
||||
binding.webcontent.loadDataWithBaseURL(
|
||||
baseUrl,
|
||||
"""<html>
|
||||
|<head>
|
||||
@ -463,17 +457,17 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
}
|
||||
|
||||
fun scrollDown() {
|
||||
val height = binding!!.nestedScrollView.measuredHeight
|
||||
binding!!.nestedScrollView.smoothScrollBy(0, height/2)
|
||||
val height = binding.nestedScrollView.measuredHeight
|
||||
binding.nestedScrollView.smoothScrollBy(0, height/2)
|
||||
}
|
||||
|
||||
fun scrollUp() {
|
||||
val height = binding!!.nestedScrollView.measuredHeight
|
||||
binding!!.nestedScrollView.smoothScrollBy(0, -height/2)
|
||||
val height = binding.nestedScrollView.measuredHeight
|
||||
binding.nestedScrollView.smoothScrollBy(0, -height/2)
|
||||
}
|
||||
|
||||
private fun openInBrowserAfterFailing() {
|
||||
binding!!.progressBar.visibility = View.GONE
|
||||
binding.progressBar.visibility = View.GONE
|
||||
requireActivity().openInBrowserAsNewTask(this@ArticleFragment.item)
|
||||
}
|
||||
|
||||
@ -492,10 +486,10 @@ class ArticleFragment : Fragment(), DIAware {
|
||||
}
|
||||
|
||||
fun performClick(): Boolean {
|
||||
if (binding!!.webcontent.hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||
|
||||
binding!!.webcontent.hitTestResult.type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||
if (binding.webcontent.hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||
|
||||
binding.webcontent.hitTestResult.type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||
|
||||
val position : Int = allImages.indexOf(binding!!.webcontent.hitTestResult.extra)
|
||||
val position : Int = allImages.indexOf(binding.webcontent.hitTestResult.extra)
|
||||
|
||||
val intent = Intent(activity, ImageActivity::class.java)
|
||||
intent.putExtra("allImages", allImages)
|
||||
|
@ -67,18 +67,22 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
||||
val c = Chip(context)
|
||||
c.text = tag.tag
|
||||
|
||||
val gd = GradientDrawable()
|
||||
val gdColor = try {
|
||||
Color.parseColor(tag.color)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
e.sendSilentlyWithAcraWithName("color issue " + tag.color)
|
||||
resources.getColor(R.color.colorPrimary)
|
||||
try {
|
||||
val gd = GradientDrawable()
|
||||
val gdColor = try {
|
||||
Color.parseColor(tag.color)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
e.sendSilentlyWithAcraWithName("color issue " + tag.color)
|
||||
resources.getColor(R.color.colorPrimary)
|
||||
}
|
||||
gd.setColor(gdColor)
|
||||
gd.shape = GradientDrawable.RECTANGLE
|
||||
gd.setSize(30, 30)
|
||||
gd.cornerRadius = 30F
|
||||
c.chipIcon = gd
|
||||
} catch (e: Exception) {
|
||||
e.sendSilentlyWithAcraWithName("tags > GradientDrawable")
|
||||
}
|
||||
gd.setColor(gdColor)
|
||||
gd.shape = GradientDrawable.RECTANGLE
|
||||
gd.setSize(30, 30)
|
||||
gd.cornerRadius = 30F
|
||||
c.chipIcon = gd
|
||||
|
||||
c.setOnCloseIconClickListener {
|
||||
(it as Chip).isCloseIconVisible = false
|
||||
@ -127,7 +131,11 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
||||
dataSource: DataSource?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
c.chipIcon = resource
|
||||
try {
|
||||
c.chipIcon = resource
|
||||
} catch (e: Exception) {
|
||||
e.sendSilentlyWithAcraWithName("sources > onResourceReady")
|
||||
}
|
||||
return false
|
||||
}
|
||||
}).preload()
|
||||
|
@ -17,12 +17,11 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
// IMPORTANT : Add back when new library added
|
||||
// google()
|
||||
// mavenCentral()
|
||||
// jcenter()
|
||||
// maven { url = uri("https://www.jitpack.io") }
|
||||
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
google()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url = uri("https://www.jitpack.io") }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,20 +2,18 @@ val pushCache: String by settings
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
// IMPORTANT : Add back when new plugin added
|
||||
// google()
|
||||
// gradlePluginPortal()
|
||||
// mavenCentral()
|
||||
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
google()
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
// IMPORTANT : Add back when new library added
|
||||
// google()
|
||||
// mavenCentral()
|
||||
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ class MercuryModel {
|
||||
|
||||
@Serializable
|
||||
class ParsedContent(
|
||||
val title: String,
|
||||
val title: String?,
|
||||
val content: String?,
|
||||
val lead_image_url: String?,
|
||||
val url: String
|
||||
|
Reference in New Issue
Block a user