Compare commits
10 Commits
cc4c1c9201
...
9109eb36c1
Author | SHA1 | Date | |
---|---|---|---|
9109eb36c1 | |||
|
e0c118a73e | ||
|
4e61b2aed6 | ||
|
ba2758c0a3 | ||
|
c718b966a1 | ||
|
99438e142f | ||
|
4d8076c3cf | ||
|
db75c5b74a | ||
|
966a082147 | ||
|
cd20a5ec29 |
@ -51,7 +51,7 @@ steps:
|
|||||||
- CHANGELOG=$(git log $VER..HEAD --pretty="- %s")
|
- CHANGELOG=$(git log $VER..HEAD --pretty="- %s")
|
||||||
- echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
- echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
||||||
- git add 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
|
- ./build.sh --publish --from-ci
|
||||||
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
||||||
- git push pushing master
|
- git push pushing master
|
||||||
|
22
CHANGELOG.md
22
CHANGELOG.md
@ -1,3 +1,25 @@
|
|||||||
|
- feat: Close images by swiping down
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
**v122123641**
|
||||||
|
|
||||||
|
- feat: Disable the failing source in the filter sheet.
|
||||||
|
- feat: Display the source error in the sources list.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
**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**
|
**v122123621**
|
||||||
|
|
||||||
- fix: Automatic CHANGELOG generation.
|
- fix: Automatic CHANGELOG generation.
|
||||||
|
@ -19,6 +19,7 @@ class ImageActivity : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityImageBinding.inflate(layoutInflater)
|
binding = ActivityImageBinding.inflate(layoutInflater)
|
||||||
val view = binding.root
|
val view = binding.root
|
||||||
|
binding.pager.requestDisallowInterceptTouchEvent(true)
|
||||||
|
|
||||||
setContentView(view)
|
setContentView(view)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import android.app.Activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
@ -60,6 +61,13 @@ class SourcesListAdapter(
|
|||||||
c.circularBitmapDrawable(itm.getIcon(repository.baseUrl), binding.itemImage)
|
c.circularBitmapDrawable(itm.getIcon(repository.baseUrl), binding.itemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (itm.error.isNotBlank()) {
|
||||||
|
binding.errorText.visibility = View.VISIBLE
|
||||||
|
binding.errorText.text = itm.error
|
||||||
|
} else {
|
||||||
|
binding.errorText.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
binding.sourceTitle.text = itm.title.getHtmlDecoded()
|
binding.sourceTitle.text = itm.title.getHtmlDecoded()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
private lateinit var allImages : ArrayList<String>
|
private lateinit var allImages : ArrayList<String>
|
||||||
private lateinit var fab: FloatingActionButton
|
private lateinit var fab: FloatingActionButton
|
||||||
private lateinit var textAlignment: String
|
private lateinit var textAlignment: String
|
||||||
private var _binding: FragmentArticleBinding? = null
|
private lateinit var binding: FragmentArticleBinding
|
||||||
private val binding get() = _binding
|
|
||||||
|
|
||||||
override val di : DI by closestDI()
|
override val di : DI by closestDI()
|
||||||
private val repository: Repository by instance()
|
private val repository: Repository by instance()
|
||||||
@ -95,7 +94,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View {
|
): View {
|
||||||
try {
|
try {
|
||||||
_binding = FragmentArticleBinding.inflate(inflater, container, false)
|
binding = FragmentArticleBinding.inflate(inflater, container, false)
|
||||||
|
|
||||||
url = item.getLinkDecoded()
|
url = item.getLinkDecoded()
|
||||||
contentText = item.content
|
contentText = item.content
|
||||||
@ -110,13 +109,13 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
|
|
||||||
refreshAlignment()
|
refreshAlignment()
|
||||||
|
|
||||||
fab = binding!!.fab
|
fab = binding.fab
|
||||||
|
|
||||||
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorAccent))
|
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorAccent))
|
||||||
|
|
||||||
fab.rippleColor = resources.getColor(R.color.colorAccentDark)
|
fab.rippleColor = resources.getColor(R.color.colorAccentDark)
|
||||||
|
|
||||||
val floatingToolbar: FloatingToolbar = binding!!.floatingToolbar
|
val floatingToolbar: FloatingToolbar = binding.floatingToolbar
|
||||||
floatingToolbar.attachFab(fab)
|
floatingToolbar.attachFab(fab)
|
||||||
|
|
||||||
floatingToolbar.background = ColorDrawable(resources.getColor(R.color.colorAccent))
|
floatingToolbar.background = ColorDrawable(resources.getColor(R.color.colorAccent))
|
||||||
@ -164,35 +163,35 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
floatingToolbar.show()
|
floatingToolbar.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding!!.source.text = contentSource
|
binding.source.text = contentSource
|
||||||
if (typeface != null) {
|
if (typeface != null) {
|
||||||
binding!!.source.typeface = typeface
|
binding.source.typeface = typeface
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contentText.isEmptyOrNullOrNullString()) {
|
if (contentText.isEmptyOrNullOrNullString()) {
|
||||||
getContentFromMercury()
|
getContentFromMercury()
|
||||||
} else {
|
} else {
|
||||||
binding!!.titleView.text = contentTitle
|
binding.titleView.text = contentTitle
|
||||||
if (typeface != null) {
|
if (typeface != null) {
|
||||||
binding!!.titleView.typeface = typeface
|
binding.titleView.typeface = typeface
|
||||||
}
|
}
|
||||||
|
|
||||||
htmlToWebview()
|
htmlToWebview()
|
||||||
|
|
||||||
if (!contentImage.isEmptyOrNullOrNullString() && context != null) {
|
if (!contentImage.isEmptyOrNullOrNullString() && context != null) {
|
||||||
binding!!.imageView.visibility = View.VISIBLE
|
binding.imageView.visibility = View.VISIBLE
|
||||||
Glide
|
Glide
|
||||||
.with(requireContext())
|
.with(requireContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(contentImage)
|
.load(contentImage)
|
||||||
.apply(RequestOptions.fitCenterTransform())
|
.apply(RequestOptions.fitCenterTransform())
|
||||||
.into(binding!!.imageView)
|
.into(binding.imageView)
|
||||||
} else {
|
} else {
|
||||||
binding!!.imageView.visibility = View.GONE
|
binding.imageView.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding!!.nestedScrollView.setOnScrollChangeListener(
|
binding.nestedScrollView.setOnScrollChangeListener(
|
||||||
NestedScrollView.OnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
|
NestedScrollView.OnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
|
||||||
if (scrollY > oldScrollY) {
|
if (scrollY > oldScrollY) {
|
||||||
floatingToolbar.hide()
|
floatingToolbar.hide()
|
||||||
@ -221,12 +220,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
return binding!!.root
|
return binding.root
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
|
||||||
super.onDestroyView()
|
|
||||||
_binding = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshAlignment() {
|
private fun refreshAlignment() {
|
||||||
@ -239,16 +233,16 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
|
|
||||||
private fun getContentFromMercury() {
|
private fun getContentFromMercury() {
|
||||||
if (repository.isNetworkAvailable()) {
|
if (repository.isNetworkAvailable()) {
|
||||||
binding!!.progressBar.visibility = View.VISIBLE
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
|
|
||||||
CoroutineScope(Dispatchers.Main).launch {
|
CoroutineScope(Dispatchers.Main).launch {
|
||||||
try {
|
try {
|
||||||
val response = mercuryApi.query(url)
|
val response = mercuryApi.query(url)
|
||||||
if (response.success && response.data != null && !response.data?.content.isNullOrEmpty()) {
|
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 {
|
try {
|
||||||
if (typeface != null) {
|
if (typeface != null) {
|
||||||
binding!!.titleView.typeface = typeface
|
binding.titleView.typeface = typeface
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > typeface")
|
e.sendSilentlyWithAcraWithName("getContentFromMercury > typeface")
|
||||||
@ -272,7 +266,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
|
|
||||||
if (!response.data?.lead_image_url.isNullOrEmpty() && context != null) {
|
if (!response.data?.lead_image_url.isNullOrEmpty() && context != null) {
|
||||||
try {
|
try {
|
||||||
binding!!.imageView.visibility = View.VISIBLE
|
binding.imageView.visibility = View.VISIBLE
|
||||||
try {
|
try {
|
||||||
Glide
|
Glide
|
||||||
.with(requireContext())
|
.with(requireContext())
|
||||||
@ -281,7 +275,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
response.data!!.lead_image_url.orEmpty()
|
response.data!!.lead_image_url.orEmpty()
|
||||||
)
|
)
|
||||||
.apply(RequestOptions.fitCenterTransform())
|
.apply(RequestOptions.fitCenterTransform())
|
||||||
.into(binding!!.imageView)
|
.into(binding.imageView)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > glide lead image")
|
e.sendSilentlyWithAcraWithName("getContentFromMercury > glide lead image")
|
||||||
}
|
}
|
||||||
@ -289,12 +283,12 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > outside glide lead image")
|
e.sendSilentlyWithAcraWithName("getContentFromMercury > outside glide lead image")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
binding!!.imageView.visibility = View.GONE
|
binding.imageView.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
binding!!.nestedScrollView.scrollTo(0, 0)
|
binding.nestedScrollView.scrollTo(0, 0)
|
||||||
binding!!.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.sendSilentlyWithAcraWithName("getContentFromMercury > scrollview")
|
e.sendSilentlyWithAcraWithName("getContentFromMercury > scrollview")
|
||||||
}
|
}
|
||||||
@ -317,8 +311,8 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
val a: TypedArray = requireContext().obtainStyledAttributes(resId, attrs)
|
val a: TypedArray = requireContext().obtainStyledAttributes(resId, attrs)
|
||||||
|
|
||||||
|
|
||||||
binding!!.webcontent.settings.standardFontFamily = a.getString(0)
|
binding.webcontent.settings.standardFontFamily = a.getString(0)
|
||||||
binding!!.webcontent.visibility = View.VISIBLE
|
binding.webcontent.visibility = View.VISIBLE
|
||||||
|
|
||||||
val colorOnSurface = TypedValue()
|
val colorOnSurface = TypedValue()
|
||||||
requireContext().theme.resolveAttribute(R.attr.colorOnSurface, colorOnSurface, true)
|
requireContext().theme.resolveAttribute(R.attr.colorOnSurface, colorOnSurface, true)
|
||||||
@ -326,14 +320,14 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
val colorSurface = TypedValue()
|
val colorSurface = TypedValue()
|
||||||
requireContext().theme.resolveAttribute(R.attr.colorSurface, colorSurface, true)
|
requireContext().theme.resolveAttribute(R.attr.colorSurface, colorSurface, true)
|
||||||
|
|
||||||
binding!!.webcontent.settings.useWideViewPort = true
|
binding.webcontent.settings.useWideViewPort = true
|
||||||
binding!!.webcontent.settings.loadWithOverviewMode = true
|
binding.webcontent.settings.loadWithOverviewMode = true
|
||||||
binding!!.webcontent.settings.javaScriptEnabled = false
|
binding.webcontent.settings.javaScriptEnabled = false
|
||||||
|
|
||||||
binding!!.webcontent.webViewClient = object : WebViewClient() {
|
binding.webcontent.webViewClient = object : WebViewClient() {
|
||||||
@Deprecated("Deprecated in Java")
|
@Deprecated("Deprecated in Java")
|
||||||
override fun shouldOverrideUrlLoading(view: WebView?, url : String): Boolean {
|
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)))
|
requireContext().startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||||
}
|
}
|
||||||
return true
|
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
|
WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING
|
||||||
|
|
||||||
var baseUrl: String? = null
|
var baseUrl: String? = null
|
||||||
@ -410,7 +404,7 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
binding!!.webcontent.loadDataWithBaseURL(
|
binding.webcontent.loadDataWithBaseURL(
|
||||||
baseUrl,
|
baseUrl,
|
||||||
"""<html>
|
"""<html>
|
||||||
|<head>
|
|<head>
|
||||||
@ -463,17 +457,17 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun scrollDown() {
|
fun scrollDown() {
|
||||||
val height = binding!!.nestedScrollView.measuredHeight
|
val height = binding.nestedScrollView.measuredHeight
|
||||||
binding!!.nestedScrollView.smoothScrollBy(0, height/2)
|
binding.nestedScrollView.smoothScrollBy(0, height/2)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun scrollUp() {
|
fun scrollUp() {
|
||||||
val height = binding!!.nestedScrollView.measuredHeight
|
val height = binding.nestedScrollView.measuredHeight
|
||||||
binding!!.nestedScrollView.smoothScrollBy(0, -height/2)
|
binding.nestedScrollView.smoothScrollBy(0, -height/2)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun openInBrowserAfterFailing() {
|
private fun openInBrowserAfterFailing() {
|
||||||
binding!!.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
requireActivity().openInBrowserAsNewTask(this@ArticleFragment.item)
|
requireActivity().openInBrowserAsNewTask(this@ArticleFragment.item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,10 +486,10 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun performClick(): Boolean {
|
fun performClick(): Boolean {
|
||||||
if (binding!!.webcontent.hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||
|
if (binding.webcontent.hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||
|
||||||
binding!!.webcontent.hitTestResult.type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_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)
|
val intent = Intent(activity, ImageActivity::class.java)
|
||||||
intent.putExtra("allImages", allImages)
|
intent.putExtra("allImages", allImages)
|
||||||
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@ -67,18 +68,22 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
|||||||
val c = Chip(context)
|
val c = Chip(context)
|
||||||
c.text = tag.tag
|
c.text = tag.tag
|
||||||
|
|
||||||
val gd = GradientDrawable()
|
try {
|
||||||
val gdColor = try {
|
val gd = GradientDrawable()
|
||||||
Color.parseColor(tag.color)
|
val gdColor = try {
|
||||||
} catch (e: IllegalArgumentException) {
|
Color.parseColor(tag.color)
|
||||||
e.sendSilentlyWithAcraWithName("color issue " + tag.color)
|
} catch (e: IllegalArgumentException) {
|
||||||
resources.getColor(R.color.colorPrimary)
|
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 {
|
c.setOnCloseIconClickListener {
|
||||||
(it as Chip).isCloseIconVisible = false
|
(it as Chip).isCloseIconVisible = false
|
||||||
@ -127,7 +132,11 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
|||||||
dataSource: DataSource?,
|
dataSource: DataSource?,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean
|
||||||
): Boolean {
|
): Boolean {
|
||||||
c.chipIcon = resource
|
try {
|
||||||
|
c.chipIcon = resource
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.sendSilentlyWithAcraWithName("sources > onResourceReady")
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}).preload()
|
}).preload()
|
||||||
@ -157,6 +166,12 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
|||||||
selectedChip = c
|
selectedChip = c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.isEnabled = source.error.isBlank()
|
||||||
|
|
||||||
|
if (source.error.isNotBlank() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
c.tooltipText = source.error
|
||||||
|
}
|
||||||
|
|
||||||
sourceGroup.addView(c)
|
sourceGroup.addView(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,11 @@ class ImageFragment : Fragment() {
|
|||||||
_binding = FragmentImageBinding.inflate(inflater, container, false)
|
_binding = FragmentImageBinding.inflate(inflater, container, false)
|
||||||
val view = binding?.root
|
val view = binding?.root
|
||||||
|
|
||||||
|
binding?.swipeRefreshLayout?.setProgressViewEndTarget(false, 0)
|
||||||
|
binding?.swipeRefreshLayout?.setOnRefreshListener {
|
||||||
|
activity?.finish()
|
||||||
|
}
|
||||||
|
|
||||||
binding!!.photoView.visibility = View.VISIBLE
|
binding!!.photoView.visibility = View.VISIBLE
|
||||||
Glide.with(requireActivity())
|
Glide.with(requireActivity())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
|
@ -4,13 +4,19 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.github.chrisbanes.photoview.PhotoView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/photoView"
|
android:id="@+id/swipeRefreshLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:adjustViewBounds="true"
|
<com.github.chrisbanes.photoview.PhotoView
|
||||||
android:background="@drawable/checkerboard"
|
android:id="@+id/photoView"
|
||||||
app:srcCompat="@android:drawable/screen_background_dark" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@drawable/checkerboard"
|
||||||
|
app:srcCompat="@android:drawable/screen_background_dark" />
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -3,18 +3,40 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/deleteBtn"
|
||||||
|
style="@style/Widget.AppCompat.Button.Borderless"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:background="@drawable/ic_remove_circle_outline_black_24dp"
|
||||||
|
android:backgroundTint="?android:textColorSecondary"
|
||||||
|
android:contentDescription="@string/remove_source"
|
||||||
|
android:elevation="4dp"
|
||||||
|
app:iconSize="34dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/itemImage"
|
android:id="@+id/itemImage"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sourceTitle"
|
android:id="@+id/sourceTitle"
|
||||||
@ -25,26 +47,30 @@
|
|||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textSize="13sp"
|
|
||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:textSize="13sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/errorText"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/deleteBtn"
|
app:layout_constraintEnd_toStartOf="@+id/deleteBtn"
|
||||||
app:layout_constraintStart_toEndOf="@+id/itemImage"
|
app:layout_constraintStart_toEndOf="@+id/itemImage"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="source title" />
|
tools:text="source title" />
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/deleteBtn"
|
android:id="@+id/errorText"
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"
|
android:layout_width="0dp"
|
||||||
android:layout_width="34dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="34dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:background="@drawable/ic_remove_circle_outline_black_24dp"
|
android:layout_marginStart="16dp"
|
||||||
android:backgroundTint="?android:textColorSecondary"
|
android:layout_marginTop="8dp"
|
||||||
android:elevation="4dp"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
android:contentDescription="@string/remove_source"
|
android:textColor="@color/red"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/itemImage"
|
||||||
|
tools:text="Test"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -17,12 +17,11 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||||
// IMPORTANT : Add back when new library added
|
google()
|
||||||
// google()
|
mavenCentral()
|
||||||
// mavenCentral()
|
jcenter()
|
||||||
// jcenter()
|
maven { url = uri("https://www.jitpack.io") }
|
||||||
// maven { url = uri("https://www.jitpack.io") }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,18 @@ val pushCache: String by settings
|
|||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||||
// IMPORTANT : Add back when new plugin added
|
google()
|
||||||
// google()
|
gradlePluginPortal()
|
||||||
// gradlePluginPortal()
|
mavenCentral()
|
||||||
// mavenCentral()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
// maven { url = uri("https://nexus.amine-louveau.fr/repository/maven-public/")}
|
||||||
// IMPORTANT : Add back when new library added
|
google()
|
||||||
// google()
|
mavenCentral()
|
||||||
// mavenCentral()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ class MercuryModel {
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class ParsedContent(
|
class ParsedContent(
|
||||||
val title: String,
|
val title: String?,
|
||||||
val content: String?,
|
val content: String?,
|
||||||
val lead_image_url: String?,
|
val lead_image_url: String?,
|
||||||
val url: String
|
val url: String
|
||||||
|
Loading…
Reference in New Issue
Block a user