UI fixes
This commit is contained in:
@@ -20,7 +20,6 @@ import androidx.core.view.children
|
|||||||
import androidx.core.widget.TextViewCompat
|
import androidx.core.widget.TextViewCompat
|
||||||
import org.koitharu.kotatsu.R
|
import org.koitharu.kotatsu.R
|
||||||
import org.koitharu.kotatsu.core.util.ext.getAnimationDuration
|
import org.koitharu.kotatsu.core.util.ext.getAnimationDuration
|
||||||
import org.koitharu.kotatsu.core.util.ext.getThemeColor
|
|
||||||
import org.koitharu.kotatsu.core.util.ext.getThemeColorStateList
|
import org.koitharu.kotatsu.core.util.ext.getThemeColorStateList
|
||||||
import org.koitharu.kotatsu.core.util.ext.resolveDp
|
import org.koitharu.kotatsu.core.util.ext.resolveDp
|
||||||
import org.koitharu.kotatsu.core.util.ext.setTextAndVisible
|
import org.koitharu.kotatsu.core.util.ext.setTextAndVisible
|
||||||
@@ -75,10 +74,10 @@ class ProgressButton @JvmOverloads constructor(
|
|||||||
?: context.getThemeColorStateList(materialR.attr.colorPrimaryContainer) ?: colorBase
|
?: context.getThemeColorStateList(materialR.attr.colorPrimaryContainer) ?: colorBase
|
||||||
colorProgress = getColorStateList(R.styleable.ProgressButton_progressColor)
|
colorProgress = getColorStateList(R.styleable.ProgressButton_progressColor)
|
||||||
?: context.getThemeColorStateList(materialR.attr.colorPrimary) ?: colorProgress
|
?: context.getThemeColorStateList(materialR.attr.colorPrimary) ?: colorProgress
|
||||||
val colorText = getColorStateList(R.styleable.ProgressButton_android_textColor)
|
getColorStateList(R.styleable.ProgressButton_android_textColor)?.let { colorText ->
|
||||||
?: context.getThemeColorStateList(materialR.attr.colorOnPrimaryContainer) ?: textViewTitle.textColors
|
textViewTitle.setTextColor(colorText)
|
||||||
textViewTitle.setTextColor(colorText)
|
textViewSubtitle.setTextColor(colorText)
|
||||||
textViewSubtitle.setTextColor(colorText)
|
}
|
||||||
progress = getInt(R.styleable.ProgressButton_android_progress, 0).toFloat() /
|
progress = getInt(R.styleable.ProgressButton_android_progress, 0).toFloat() /
|
||||||
getInt(R.styleable.ProgressButton_android_max, 100).toFloat()
|
getInt(R.styleable.ProgressButton_android_max, 100).toFloat()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,10 +180,7 @@ class DetailsActivity :
|
|||||||
viewBinding.infoLayout.chipBranch.isVisible = it.size > 1
|
viewBinding.infoLayout.chipBranch.isVisible = it.size > 1
|
||||||
}
|
}
|
||||||
viewModel.chapters.observe(this, PrefetchObserver(this))
|
viewModel.chapters.observe(this, PrefetchObserver(this))
|
||||||
viewModel.onDownloadStarted.observeEvent(
|
viewModel.onDownloadStarted.observeEvent(this, DownloadStartedObserver(viewBinding.scrollView))
|
||||||
this,
|
|
||||||
DownloadStartedObserver(viewBinding.scrollView),
|
|
||||||
)
|
|
||||||
|
|
||||||
addMenuProvider(
|
addMenuProvider(
|
||||||
DetailsMenuProvider(
|
DetailsMenuProvider(
|
||||||
@@ -531,6 +528,7 @@ class DetailsActivity :
|
|||||||
info.isIncognitoMode -> getString(R.string.incognito_mode)
|
info.isIncognitoMode -> getString(R.string.incognito_mode)
|
||||||
info.currentChapter >= 0 -> getString(R.string.chapter_d_of_d, info.currentChapter + 1, info.totalChapters)
|
info.currentChapter >= 0 -> getString(R.string.chapter_d_of_d, info.currentChapter + 1, info.totalChapters)
|
||||||
info.totalChapters == 0 -> getString(R.string.no_chapters)
|
info.totalChapters == 0 -> getString(R.string.no_chapters)
|
||||||
|
info.totalChapters == -1 -> getString(R.string.error_occurred)
|
||||||
else -> resources.getQuantityString(R.plurals.chapters, info.totalChapters, info.totalChapters)
|
else -> resources.getQuantityString(R.plurals.chapters, info.totalChapters, info.totalChapters)
|
||||||
}
|
}
|
||||||
buttonRead.setProgress(info.history?.percent?.coerceIn(0f, 1f) ?: 0f, true)
|
buttonRead.setProgress(info.history?.percent?.coerceIn(0f, 1f) ?: 0f, true)
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), AppBarOwner, BottomNav
|
|||||||
|
|
||||||
private fun onFeedCounterChanged(counter: Int) {
|
private fun onFeedCounterChanged(counter: Int) {
|
||||||
navigationDelegate.setCounter(NavItem.FEED, counter)
|
navigationDelegate.setCounter(NavItem.FEED, counter)
|
||||||
|
navigationDelegate.setCounter(NavItem.UPDATED, counter)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onIncognitoModeChanged(isIncognito: Boolean) {
|
private fun onIncognitoModeChanged(isIncognito: Boolean) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import android.view.View
|
|||||||
import androidx.core.view.MenuProvider
|
import androidx.core.view.MenuProvider
|
||||||
import org.koitharu.kotatsu.R
|
import org.koitharu.kotatsu.R
|
||||||
import org.koitharu.kotatsu.core.ui.dialog.CheckBoxAlertDialog
|
import org.koitharu.kotatsu.core.ui.dialog.CheckBoxAlertDialog
|
||||||
import org.koitharu.kotatsu.tracker.ui.updates.UpdatesActivity
|
|
||||||
|
|
||||||
class FeedMenuProvider(
|
class FeedMenuProvider(
|
||||||
private val snackbarHost: View,
|
private val snackbarHost: View,
|
||||||
@@ -51,11 +50,6 @@ class FeedMenuProvider(
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.action_updated -> {
|
|
||||||
context.startActivity(UpdatesActivity.newIntent(context))
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
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"
|
|
||||||
android:id="@+id/info_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:baselineAligned="false"
|
|
||||||
android:divider="?attr/colorSecondary"
|
|
||||||
android:dividerPadding="8dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:showDividers="middle">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_state"
|
|
||||||
style="@style/Widget.Kotatsu.TextView.Indicator.Vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:drawableTopCompat="@drawable/ic_state_finished"
|
|
||||||
tools:text="Completed"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_chapters"
|
|
||||||
style="@style/Widget.Kotatsu.TextView.Indicator.Vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableTopCompat="@drawable/ic_book_page"
|
|
||||||
tools:text="52 chapters"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_nsfw"
|
|
||||||
style="@style/Widget.Kotatsu.TextView.Indicator.Vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/nsfw"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableTopCompat="@drawable/ic_alert_outline"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_source"
|
|
||||||
style="@style/Widget.Kotatsu.TextView.Indicator.Vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/custom_selectable_item_background"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableTopCompat="@drawable/ic_web"
|
|
||||||
tools:text="Source"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_size"
|
|
||||||
style="@style/Widget.Kotatsu.TextView.Indicator.Vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/custom_selectable_item_background"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableTopCompat="@drawable/ic_storage"
|
|
||||||
tools:text="1.8 GiB"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -3,12 +3,6 @@
|
|||||||
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">
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_updated"
|
|
||||||
android:orderInCategory="50"
|
|
||||||
android:title="@string/updated"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_update"
|
android:id="@+id/action_update"
|
||||||
android:orderInCategory="50"
|
android:orderInCategory="50"
|
||||||
|
|||||||
Reference in New Issue
Block a user