Fixes for api<23
This commit is contained in:
@@ -85,7 +85,7 @@ dependencies {
|
|||||||
implementation 'androidx.asynclayoutinflater:asynclayoutinflater:1.0.0'
|
implementation 'androidx.asynclayoutinflater:asynclayoutinflater:1.0.0'
|
||||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
||||||
implementation 'com.google.android.material:material:1.6.0-alpha03'
|
implementation 'com.google.android.material:material:1.6.0-beta01'
|
||||||
//noinspection LifecycleAnnotationProcessorWithJava8
|
//noinspection LifecycleAnnotationProcessorWithJava8
|
||||||
kapt 'androidx.lifecycle:lifecycle-compiler:2.4.1'
|
kapt 'androidx.lifecycle:lifecycle-compiler:2.4.1'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.koitharu.kotatsu.base.ui.widgets
|
package org.koitharu.kotatsu.base.ui.widgets
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.content.res.TypedArray
|
import android.content.res.TypedArray
|
||||||
@@ -14,10 +15,12 @@ import androidx.annotation.AttrRes
|
|||||||
import androidx.appcompat.widget.AppCompatCheckedTextView
|
import androidx.appcompat.widget.AppCompatCheckedTextView
|
||||||
import androidx.core.content.res.use
|
import androidx.core.content.res.use
|
||||||
import androidx.core.content.withStyledAttributes
|
import androidx.core.content.withStyledAttributes
|
||||||
|
import com.google.android.material.ripple.RippleUtils
|
||||||
import com.google.android.material.shape.MaterialShapeDrawable
|
import com.google.android.material.shape.MaterialShapeDrawable
|
||||||
import com.google.android.material.shape.ShapeAppearanceModel
|
import com.google.android.material.shape.ShapeAppearanceModel
|
||||||
import org.koitharu.kotatsu.R
|
import org.koitharu.kotatsu.R
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
class ListItemTextView @JvmOverloads constructor(
|
class ListItemTextView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
@@ -33,9 +36,12 @@ class ListItemTextView @JvmOverloads constructor(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
context.withStyledAttributes(attrs, R.styleable.ListItemTextView, defStyleAttr) {
|
context.withStyledAttributes(attrs, R.styleable.ListItemTextView, defStyleAttr) {
|
||||||
|
val itemRippleColor = getColorStateList(R.styleable.ListItemTextView_rippleColor)
|
||||||
|
?: getRippleColorFallback(context)
|
||||||
|
val shape = createShapeDrawable(this)
|
||||||
background = RippleDrawable(
|
background = RippleDrawable(
|
||||||
getColorStateList(R.styleable.ListItemTextView_rippleColor) ?: getRippleColorFallback(context),
|
RippleUtils.sanitizeRippleDrawableColor(itemRippleColor),
|
||||||
createShapeDrawable(this),
|
shape,
|
||||||
ShapeDrawable(RectShape()),
|
ShapeDrawable(RectShape()),
|
||||||
)
|
)
|
||||||
checkedDrawableStart = getDrawable(R.styleable.ListItemTextView_checkedDrawableStart)
|
checkedDrawableStart = getDrawable(R.styleable.ListItemTextView_checkedDrawableStart)
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ class ReaderActivity : BaseFullscreenActivity<ActivityReaderBinding>(),
|
|||||||
|
|
||||||
private fun onPageSaved(uri: Uri?) {
|
private fun onPageSaved(uri: Uri?) {
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
Snackbar.make(binding.container, R.string.page_saved, Snackbar.LENGTH_INDEFINITE)
|
Snackbar.make(binding.container, R.string.page_saved, Snackbar.LENGTH_LONG)
|
||||||
.setAnchorView(binding.appbarBottom)
|
.setAnchorView(binding.appbarBottom)
|
||||||
.setAction(R.string.share) {
|
.setAction(R.string.share) {
|
||||||
ShareHelper(this).shareImage(uri)
|
ShareHelper(this).shareImage(uri)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import org.koitharu.kotatsu.core.exceptions.resolve.ExceptionResolver
|
import org.koitharu.kotatsu.core.exceptions.resolve.ExceptionResolver
|
||||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||||
|
import org.koitharu.kotatsu.databinding.LayoutPageInfoBinding
|
||||||
import org.koitharu.kotatsu.reader.domain.PageLoader
|
import org.koitharu.kotatsu.reader.domain.PageLoader
|
||||||
|
|
||||||
abstract class BasePageHolder<B : ViewBinding>(
|
abstract class BasePageHolder<B : ViewBinding>(
|
||||||
@@ -16,6 +17,7 @@ abstract class BasePageHolder<B : ViewBinding>(
|
|||||||
) : RecyclerView.ViewHolder(binding.root), PageHolderDelegate.Callback {
|
) : RecyclerView.ViewHolder(binding.root), PageHolderDelegate.Callback {
|
||||||
|
|
||||||
protected val delegate = PageHolderDelegate(loader, settings, this, exceptionResolver)
|
protected val delegate = PageHolderDelegate(loader, settings, this, exceptionResolver)
|
||||||
|
protected val bindingInfo = LayoutPageInfoBinding.bind(binding.root)
|
||||||
|
|
||||||
val context: Context
|
val context: Context
|
||||||
get() = itemView.context
|
get() = itemView.context
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import org.koitharu.kotatsu.databinding.ItemPageBinding
|
|||||||
import org.koitharu.kotatsu.reader.domain.PageLoader
|
import org.koitharu.kotatsu.reader.domain.PageLoader
|
||||||
import org.koitharu.kotatsu.reader.ui.pager.BasePageHolder
|
import org.koitharu.kotatsu.reader.ui.pager.BasePageHolder
|
||||||
import org.koitharu.kotatsu.reader.ui.pager.ReaderPage
|
import org.koitharu.kotatsu.reader.ui.pager.ReaderPage
|
||||||
import org.koitharu.kotatsu.utils.ext.getDisplayMessage
|
import org.koitharu.kotatsu.utils.ext.*
|
||||||
import org.koitharu.kotatsu.utils.ext.ifZero
|
|
||||||
|
|
||||||
open class PageHolder(
|
open class PageHolder(
|
||||||
binding: ItemPageBinding,
|
binding: ItemPageBinding,
|
||||||
@@ -29,7 +28,7 @@ open class PageHolder(
|
|||||||
init {
|
init {
|
||||||
binding.ssiv.setOnImageEventListener(delegate)
|
binding.ssiv.setOnImageEventListener(delegate)
|
||||||
@Suppress("LeakingThis")
|
@Suppress("LeakingThis")
|
||||||
binding.buttonRetry.setOnClickListener(this)
|
bindingInfo.buttonRetry.setOnClickListener(this)
|
||||||
binding.textViewNumber.isVisible = settings.isPagesNumbersEnabled
|
binding.textViewNumber.isVisible = settings.isPagesNumbersEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,17 +44,17 @@ open class PageHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadingStarted() {
|
override fun onLoadingStarted() {
|
||||||
binding.layoutError.isVisible = false
|
bindingInfo.layoutError.isVisible = false
|
||||||
binding.progressBar.isVisible = true
|
bindingInfo.progressBar.showCompat()
|
||||||
binding.ssiv.recycle()
|
binding.ssiv.recycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onProgressChanged(progress: Int) {
|
override fun onProgressChanged(progress: Int) {
|
||||||
if (progress in 0..100) {
|
if (progress in 0..100) {
|
||||||
binding.progressBar.isIndeterminate = false
|
bindingInfo.progressBar.isIndeterminate = false
|
||||||
binding.progressBar.setProgressCompat(progress, true)
|
bindingInfo.progressBar.setProgressCompat(progress, true)
|
||||||
} else {
|
} else {
|
||||||
binding.progressBar.isIndeterminate = true
|
bindingInfo.progressBar.isIndeterminate = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ open class PageHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onImageShown() {
|
override fun onImageShown() {
|
||||||
binding.progressBar.isVisible = false
|
bindingInfo.progressBar.hideCompat()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View) {
|
override fun onClick(v: View) {
|
||||||
@@ -110,11 +109,11 @@ open class PageHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
binding.textViewError.text = e.getDisplayMessage(context.resources)
|
bindingInfo.textViewError.text = e.getDisplayMessage(context.resources)
|
||||||
binding.buttonRetry.setText(
|
bindingInfo.buttonRetry.setText(
|
||||||
ExceptionResolver.getResolveStringId(e).ifZero { R.string.try_again }
|
ExceptionResolver.getResolveStringId(e).ifZero { R.string.try_again }
|
||||||
)
|
)
|
||||||
binding.layoutError.isVisible = true
|
bindingInfo.layoutError.isVisible = true
|
||||||
binding.progressBar.isVisible = false
|
bindingInfo.progressBar.hideCompat()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,8 +13,7 @@ import org.koitharu.kotatsu.databinding.ItemPageWebtoonBinding
|
|||||||
import org.koitharu.kotatsu.reader.domain.PageLoader
|
import org.koitharu.kotatsu.reader.domain.PageLoader
|
||||||
import org.koitharu.kotatsu.reader.ui.pager.BasePageHolder
|
import org.koitharu.kotatsu.reader.ui.pager.BasePageHolder
|
||||||
import org.koitharu.kotatsu.reader.ui.pager.ReaderPage
|
import org.koitharu.kotatsu.reader.ui.pager.ReaderPage
|
||||||
import org.koitharu.kotatsu.utils.ext.getDisplayMessage
|
import org.koitharu.kotatsu.utils.ext.*
|
||||||
import org.koitharu.kotatsu.utils.ext.ifZero
|
|
||||||
|
|
||||||
|
|
||||||
class WebtoonHolder(
|
class WebtoonHolder(
|
||||||
@@ -29,7 +28,7 @@ class WebtoonHolder(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
binding.ssiv.setOnImageEventListener(delegate)
|
binding.ssiv.setOnImageEventListener(delegate)
|
||||||
binding.buttonRetry.setOnClickListener(this)
|
bindingInfo.buttonRetry.setOnClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBind(data: ReaderPage) {
|
override fun onBind(data: ReaderPage) {
|
||||||
@@ -42,17 +41,17 @@ class WebtoonHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadingStarted() {
|
override fun onLoadingStarted() {
|
||||||
binding.layoutError.isVisible = false
|
bindingInfo.layoutError.isVisible = false
|
||||||
binding.progressBar.isVisible = true
|
bindingInfo.progressBar.showCompat()
|
||||||
binding.ssiv.recycle()
|
binding.ssiv.recycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onProgressChanged(progress: Int) {
|
override fun onProgressChanged(progress: Int) {
|
||||||
if (progress in 0..100) {
|
if (progress in 0..100) {
|
||||||
binding.progressBar.isIndeterminate = false
|
bindingInfo.progressBar.isIndeterminate = false
|
||||||
binding.progressBar.setProgressCompat(progress, true)
|
bindingInfo.progressBar.setProgressCompat(progress, true)
|
||||||
} else {
|
} else {
|
||||||
binding.progressBar.isIndeterminate = true
|
bindingInfo.progressBar.isIndeterminate = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +76,7 @@ class WebtoonHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onImageShown() {
|
override fun onImageShown() {
|
||||||
binding.progressBar.isVisible = false
|
bindingInfo.progressBar.hideCompat()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View) {
|
override fun onClick(v: View) {
|
||||||
@@ -87,12 +86,12 @@ class WebtoonHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
binding.textViewError.text = e.getDisplayMessage(context.resources)
|
bindingInfo.textViewError.text = e.getDisplayMessage(context.resources)
|
||||||
binding.buttonRetry.setText(
|
bindingInfo.buttonRetry.setText(
|
||||||
ExceptionResolver.getResolveStringId(e).ifZero { R.string.try_again }
|
ExceptionResolver.getResolveStringId(e).ifZero { R.string.try_again }
|
||||||
)
|
)
|
||||||
binding.layoutError.isVisible = true
|
bindingInfo.layoutError.isVisible = true
|
||||||
binding.progressBar.isVisible = false
|
bindingInfo.progressBar.hideCompat()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getScrollY() = binding.ssiv.getScroll()
|
fun getScrollY() = binding.ssiv.getScroll()
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class SettingsActivity :
|
|||||||
|
|
||||||
override fun onTitleChanged(title: CharSequence?, color: Int) {
|
override fun onTitleChanged(title: CharSequence?, color: Int) {
|
||||||
super.onTitleChanged(title, color)
|
super.onTitleChanged(title, color)
|
||||||
binding.collapsingToolbarLayout.title = title
|
binding.collapsingToolbarLayout?.title = title
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.koitharu.kotatsu.utils.ext
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import android.widget.ProgressBar
|
||||||
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.core.widget.ContentLoadingProgressBar
|
||||||
|
import com.google.android.material.progressindicator.BaseProgressIndicator
|
||||||
|
|
||||||
|
fun ProgressBar.setProgressCompat(progress: Int, animate: Boolean) = when {
|
||||||
|
this is BaseProgressIndicator<*> -> setProgressCompat(progress, animate)
|
||||||
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> setProgress(progress, animate)
|
||||||
|
else -> setProgress(progress)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ProgressBar.showCompat() = when (this) {
|
||||||
|
is BaseProgressIndicator<*> -> show()
|
||||||
|
is ContentLoadingProgressBar -> show()
|
||||||
|
else -> isVisible = true
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ProgressBar.hideCompat() = when (this) {
|
||||||
|
is BaseProgressIndicator<*> -> hide()
|
||||||
|
is ContentLoadingProgressBar -> hide()
|
||||||
|
else -> isVisible = false
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:alpha="0.3" android:color="?colorPrimary" android:state_checked="true"/>
|
||||||
|
<item android:color="@android:color/transparent"/>
|
||||||
|
</selector>
|
||||||
4
app/src/main/res/color-v23/selector_overlay.xml
Normal file
4
app/src/main/res/color-v23/selector_overlay.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:alpha="0.2" android:color="?colorPrimary" />
|
||||||
|
</selector>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:alpha="0.3" android:color="?attr/colorPrimary" android:state_checked="true"/>
|
<!-- https://stackoverflow.com/questions/54685474/theme-attributes-in-color-selector-for-api-22 -->
|
||||||
|
<item android:alpha="0.3" android:color="@color/kotatsu_primary" android:state_checked="true"/>
|
||||||
<item android:color="@android:color/transparent"/>
|
<item android:color="@android:color/transparent"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:alpha="0.2" android:color="?attr/colorPrimary" />
|
<!-- https://stackoverflow.com/questions/54685474/theme-attributes-in-color-selector-for-api-22 -->
|
||||||
|
<item android:alpha="0.2" android:color="@color/kotatsu_primary" />
|
||||||
</selector>
|
</selector>
|
||||||
16
app/src/main/res/layout-v23/item_loading_footer.xml
Normal file
16
app/src/main/res/layout-v23/item_loading_footer.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/list_footer_height_outer">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
app:indicatorSize="@dimen/list_footer_height_inner" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
14
app/src/main/res/layout-v23/item_loading_state.xml
Normal file
14
app/src/main/res/layout-v23/item_loading_state.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="?actionBarSize">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
50
app/src/main/res/layout-v23/layout_page_info.xml
Normal file
50
app/src/main/res/layout-v23/layout_page_info.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<merge
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:parentTag="android.widget.FrameLayout">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:max="100"
|
||||||
|
tools:viewBindingType="android.widget.ProgressBar" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginEnd="60dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawablePadding="12dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
app:drawableTopCompat="@drawable/ic_error_large"
|
||||||
|
tools:text="@tools:sample/lorem[6]" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_retry"
|
||||||
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/try_again" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</merge>
|
||||||
@@ -10,29 +10,20 @@
|
|||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/collapsingToolbarLayout"
|
android:id="@id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/toolbar_height_expanded"
|
android:layout_height="?attr/actionBarSize" />
|
||||||
app:toolbarId="@id/toolbar"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
|
||||||
android:id="@id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
app:layout_collapseMode="pin" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
style="?materialCardViewOutlinedStyle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
|
|||||||
@@ -31,120 +31,116 @@
|
|||||||
tools:background="@tools:sample/backgrounds/scenic"
|
tools:background="@tools:sample/backgrounds/scenic"
|
||||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/textView_title"
|
android:id="@+id/layout_titles"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="16dp"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="16dp"
|
app:layout_constraintBottom_toBottomOf="@id/imageView_cover"
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="3"
|
|
||||||
android:textAppearance="?attr/textAppearanceHeadlineSmall"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="@tools:sample/lorem[15]" />
|
app:layout_constraintVertical_bias="0">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_subtitle"
|
android:id="@+id/textView_title"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:ellipsize="end"
|
||||||
android:ellipsize="end"
|
android:maxLines="3"
|
||||||
android:maxLines="3"
|
android:textAppearance="?attr/textAppearanceHeadlineSmall"
|
||||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
tools:text="@tools:sample/lorem[15]" />
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
|
||||||
tools:text="@tools:sample/lorem[12]" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_author"
|
android:id="@+id/textView_subtitle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:ellipsize="end"
|
||||||
android:background="@drawable/list_selector"
|
android:maxLines="3"
|
||||||
android:padding="2dp"
|
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||||
android:singleLine="true"
|
tools:text="@tools:sample/lorem[12]" />
|
||||||
android:textColor="?attr/colorTertiary"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
|
|
||||||
app:layout_constraintWidth_default="wrap"
|
|
||||||
tools:text="@tools:sample/full_names" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_state"
|
android:id="@+id/textView_author"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginHorizontal="14dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:background="@drawable/list_selector"
|
||||||
android:drawablePadding="4dp"
|
android:padding="2dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
android:textColor="?attr/colorTertiary"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
tools:text="@tools:sample/full_names" />
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView_author"
|
|
||||||
tools:drawableStart="@drawable/ic_state_finished"
|
|
||||||
tools:text="Finished" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Barrier
|
<TextView
|
||||||
android:id="@+id/barrier_header"
|
android:id="@+id/textView_state"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:barrierDirection="bottom"
|
android:layout_marginHorizontal="16dp"
|
||||||
app:barrierMargin="8dp"
|
android:layout_marginTop="4dp"
|
||||||
app:constraint_referenced_ids="imageView_cover,button_read" />
|
android:drawablePadding="4dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||||
|
tools:drawableStart="@drawable/ic_state_finished"
|
||||||
|
tools:text="Finished" />
|
||||||
|
|
||||||
<include
|
<Space
|
||||||
android:id="@+id/info_layout"
|
android:layout_width="wrap_content"
|
||||||
layout="@layout/layout_details_info"
|
android:layout_height="0dp"
|
||||||
android:layout_width="0dp"
|
android:layout_weight="1" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView_state" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<include
|
||||||
android:id="@+id/button_favorite"
|
android:id="@+id/info_layout"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
layout="@layout/layout_details_info"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
app:icon="@drawable/ic_heart_outline"
|
|
||||||
app:iconGravity="textTop"
|
|
||||||
app:iconPadding="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/button_read"
|
|
||||||
app:layout_constraintDimensionRatio="1:1"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/button_read" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/button_read"
|
android:layout_width="match_parent"
|
||||||
style="@style/Widget.Material3.Button.TonalButton"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="0dp"
|
android:orientation="horizontal">
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="16dp"
|
<com.google.android.material.button.MaterialButton
|
||||||
android:layout_marginEnd="16dp"
|
android:id="@+id/button_favorite"
|
||||||
android:enabled="false"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:text="@string/read"
|
android:layout_width="0dp"
|
||||||
android:textAllCaps="false"
|
android:layout_height="0dp"
|
||||||
app:iconGravity="textStart"
|
android:layout_marginStart="16dp"
|
||||||
app:iconPadding="8dp"
|
android:paddingStart="0dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:paddingEnd="0dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/button_favorite"
|
app:icon="@drawable/ic_heart_outline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/info_layout"
|
app:iconGravity="textTop"
|
||||||
tools:text="@string/_continue" />
|
app:iconPadding="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/button_read"
|
||||||
|
app:layout_constraintDimensionRatio="1:1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/button_read" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_read"
|
||||||
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:enabled="false"
|
||||||
|
android:text="@string/read"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:iconPadding="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/button_favorite"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="@string/_continue" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<org.koitharu.kotatsu.base.ui.widgets.ChipsView
|
<org.koitharu.kotatsu.base.ui.widgets.ChipsView
|
||||||
android:id="@+id/chips_tags"
|
android:id="@+id/chips_tags"
|
||||||
@@ -157,7 +153,7 @@
|
|||||||
app:chipSpacingVertical="6dp"
|
app:chipSpacingVertical="6dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/barrier_header" />
|
app:layout_constraintTop_toBottomOf="@+id/layout_titles" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_description"
|
android:id="@+id/textView_description"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:listitem="@layout/item_branch"
|
tools:listitem="@layout/item_branch"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
@@ -73,6 +74,7 @@
|
|||||||
android:id="@+id/guideline"
|
android:id="@+id/guideline"
|
||||||
android:layout_width="1dp"
|
android:layout_width="1dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
android:background="?colorOutline"
|
android:background="?colorOutline"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
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="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_marginHorizontal="32dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="32dp"
|
||||||
|
android:paddingBottom="?actionBarSize">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/icon"
|
android:id="@+id/icon"
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="16dp"
|
||||||
|
android:paddingBottom="?actionBarSize">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_error"
|
android:id="@+id/textView_error"
|
||||||
@@ -15,16 +16,17 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawablePadding="12dp"
|
android:drawablePadding="12dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
|
android:textAlignment="center"
|
||||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||||
app:drawableTopCompat="@drawable/ic_error_large"
|
app:drawableTopCompat="@drawable/ic_error_large"
|
||||||
tools:text="@tools:sample/lorem[6]" />
|
tools:text="@tools:sample/lorem[6]" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button_retry"
|
android:id="@+id/button_retry"
|
||||||
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
style="@style/Widget.Material3.Button.TonalButton"
|
|
||||||
android:text="@string/try_again" />
|
android:text="@string/try_again" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/list_footer_height_outer">
|
android:layout_height="@dimen/list_footer_height_outer">
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/list_footer_height_inner"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/list_footer_height_inner"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true" />
|
||||||
app:indicatorSize="@dimen/list_footer_height_inner" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -2,9 +2,10 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="?actionBarSize">
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
<ProgressBar
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
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="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -12,14 +11,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:max="100" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_number"
|
android:id="@+id/textView_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -31,35 +22,6 @@
|
|||||||
android:textColor="?android:textColorTertiary"
|
android:textColor="?android:textColorTertiary"
|
||||||
tools:text="5" />
|
tools:text="5" />
|
||||||
|
|
||||||
<LinearLayout
|
<include layout="@layout/layout_page_info" />
|
||||||
android:id="@+id/layout_error"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginEnd="60dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_error"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawablePadding="12dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
|
||||||
app:drawableTopCompat="@drawable/ic_error_large"
|
|
||||||
tools:text="@tools:sample/lorem[6]" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_retry"
|
|
||||||
style="@style/Widget.Material3.Button.TonalButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="@string/try_again" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<org.koitharu.kotatsu.reader.ui.pager.webtoon.WebtoonFrameLayout
|
<org.koitharu.kotatsu.reader.ui.pager.webtoon.WebtoonFrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
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"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
@@ -14,44 +13,6 @@
|
|||||||
app:quickScaleEnabled="false"
|
app:quickScaleEnabled="false"
|
||||||
app:zoomEnabled="false" />
|
app:zoomEnabled="false" />
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
<include layout="@layout/layout_page_info" />
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:max="100" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_error"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginEnd="60dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_error"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawablePadding="12dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
|
||||||
app:drawableTopCompat="@drawable/ic_error_large"
|
|
||||||
tools:text="@tools:sample/lorem[6]" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button_retry"
|
|
||||||
style="@style/Widget.Material3.Button.TonalButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="@string/try_again" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</org.koitharu.kotatsu.reader.ui.pager.webtoon.WebtoonFrameLayout>
|
</org.koitharu.kotatsu.reader.ui.pager.webtoon.WebtoonFrameLayout>
|
||||||
51
app/src/main/res/layout/layout_page_info.xml
Normal file
51
app/src/main/res/layout/layout_page_info.xml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<merge
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:parentTag="android.widget.FrameLayout">
|
||||||
|
|
||||||
|
<!-- https://github.com/material-components/material-components-android/issues/2028 -->
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:max="100"
|
||||||
|
tools:viewBindingType="android.widget.ProgressBar" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginEnd="60dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawablePadding="12dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
app:drawableTopCompat="@drawable/ic_error_large"
|
||||||
|
tools:text="@tools:sample/lorem[6]" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_retry"
|
||||||
|
style="@style/Widget.Material3.Button.TonalButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/try_again" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</merge>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<!-- Themes -->
|
<!-- Themes -->
|
||||||
<item name="android:windowLightStatusBar" tools:targetApi="M">@bool/light_status_bar</item>
|
<item name="android:windowLightStatusBar" tools:targetApi="M">@bool/light_status_bar</item>
|
||||||
<item name="android:statusBarColor">@color/surface_amoled</item>
|
<item name="android:statusBarColor">@color/dim</item>
|
||||||
<item name="android:navigationBarColor">@color/surface_amoled</item>
|
<item name="android:navigationBarColor">@color/surface_amoled</item>
|
||||||
<item name="android:navigationBarDividerColor" tools:targetApi="o_mr1">@null</item>
|
<item name="android:navigationBarDividerColor" tools:targetApi="o_mr1">@null</item>
|
||||||
<item name="android:enforceNavigationBarContrast" tools:targetApi="Q">false</item>
|
<item name="android:enforceNavigationBarContrast" tools:targetApi="Q">false</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user