Misc fixes
This commit is contained in:
@@ -12,8 +12,8 @@ abstract class HistoryDao {
|
||||
* @hide
|
||||
*/
|
||||
@Transaction
|
||||
@Query("SELECT * FROM history ORDER BY :orderBy LIMIT :limit OFFSET :offset")
|
||||
abstract suspend fun findAll(offset: Int, limit: Int, orderBy: String): List<HistoryWithManga>
|
||||
@Query("SELECT * FROM history ORDER BY updated_at DESC LIMIT :limit OFFSET :offset")
|
||||
abstract suspend fun findAll(offset: Int, limit: Int): List<HistoryWithManga>
|
||||
|
||||
@Query("SELECT * FROM history WHERE manga_id = :id")
|
||||
abstract suspend fun find(id: Long): HistoryEntity?
|
||||
|
||||
@@ -17,7 +17,7 @@ class HistoryRepository : KoinComponent {
|
||||
private val db: MangaDatabase by inject()
|
||||
|
||||
suspend fun getList(offset: Int): List<Manga> {
|
||||
val entities = db.historyDao().findAll(offset, 20, "updated_at DESC")
|
||||
val entities = db.historyDao().findAll(offset, 20)
|
||||
return entities.map { it.manga.toManga(it.tags.map(TagEntity::toMangaTag).toSet()) }
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class MangaDetailsFragment : BaseFragment(R.layout.fragment_details), MangaDetai
|
||||
button_read.setText(R.string.read)
|
||||
button_read.setIconResource(R.drawable.ic_read)
|
||||
} else {
|
||||
button_read.setText(R.string.continue_)
|
||||
button_read.setText(R.string._continue)
|
||||
button_read.setIconResource(R.drawable.ic_play)
|
||||
}
|
||||
button_read.setOnClickListener {
|
||||
|
||||
@@ -19,6 +19,9 @@ class WebtoonFrameLayout @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun dispatchVerticalScroll(dy: Int): Int {
|
||||
if (!target.isImageLoaded) {
|
||||
return dy //consume all scrolling
|
||||
}
|
||||
target.getPanRemaining(pan)
|
||||
val c = target.center ?: return 0
|
||||
val s = target.scale
|
||||
|
||||
@@ -11,6 +11,7 @@ class GridTouchHelper(context: Context, private val listener: OnGridTouchListene
|
||||
private val detector = GestureDetector(context, this)
|
||||
private val width = context.resources.displayMetrics.widthPixels
|
||||
private val height = context.resources.displayMetrics.heightPixels
|
||||
private var isDispatching = false
|
||||
|
||||
init {
|
||||
detector.setIsLongpressEnabled(false)
|
||||
@@ -18,12 +19,15 @@ class GridTouchHelper(context: Context, private val listener: OnGridTouchListene
|
||||
}
|
||||
|
||||
fun dispatchTouchEvent(event: MotionEvent) {
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
||||
isDispatching = listener.onProcessTouch(event.rawX.toInt(), event.rawY.toInt())
|
||||
}
|
||||
detector.onTouchEvent(event)
|
||||
}
|
||||
|
||||
override fun onSingleTapConfirmed(event: MotionEvent): Boolean {
|
||||
if (!listener.onProcessTouch(event.rawX.toInt(), event.rawY.toInt())) {
|
||||
return false
|
||||
if (!isDispatching) {
|
||||
return true
|
||||
}
|
||||
val xIndex = (event.rawX * 2f / width).roundToInt()
|
||||
val yIndex = (event.rawY * 2f / height).roundToInt()
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
android:layout_marginEnd="4dp"
|
||||
android:enabled="false"
|
||||
android:text="@string/read"
|
||||
tools:text="@string/_continue"
|
||||
app:icon="@drawable/ic_read"
|
||||
app:iconPadding="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/imageView_cover"
|
||||
@@ -87,8 +88,10 @@
|
||||
android:src="@drawable/ic_tag_heart_outline"
|
||||
app:layout_constraintBottom_toBottomOf="@id/button_read"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_read"
|
||||
app:layout_constraintTop_toTopOf="@id/button_read"
|
||||
app:layout_constraintStart_toStartOf="@id/textView_title"
|
||||
app:tint="?colorAccent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<string name="nothing_found">Ничего не найдено</string>
|
||||
<string name="history_is_empty">История пуста</string>
|
||||
<string name="read">Читать</string>
|
||||
<string name="continue_">Продолжить</string>
|
||||
<string name="add_bookmark">Добавить закладку</string>
|
||||
<string name="you_have_not_favourites_yet">У Вас пока нет избранной манги</string>
|
||||
<string name="add_to_favourites">Добавить в избранное</string>
|
||||
@@ -90,4 +89,8 @@
|
||||
<string name="switch_pages">Листание страниц</string>
|
||||
<string name="taps_on_edges">Нажатия по краям</string>
|
||||
<string name="volume_buttons">Кнопки громкости</string>
|
||||
<string name="_continue">Продолжить</string>
|
||||
<string name="warning">Предупреждение</string>
|
||||
<string name="network_consumption_warning">Данная операция может привести к большому расходу траффика</string>
|
||||
<string name="dont_ask_again">Больше не спрашивать</string>
|
||||
</resources>
|
||||
@@ -23,7 +23,6 @@
|
||||
<string name="nothing_found">Nothing found</string>
|
||||
<string name="history_is_empty">History is empty</string>
|
||||
<string name="read">Read</string>
|
||||
<string name="continue_">Continue</string>
|
||||
<string name="add_bookmark">Add bookmark</string>
|
||||
<string name="you_have_not_favourites_yet">You have not favourites yet</string>
|
||||
<string name="add_to_favourites">Add to favourites</string>
|
||||
|
||||
Reference in New Issue
Block a user