More library layout fixes

This commit is contained in:
Jay 2020-03-14 17:54:55 -07:00
parent d62c0f00c4
commit 238b59784e
5 changed files with 16 additions and 16 deletions

View File

@ -52,7 +52,9 @@ abstract class LibraryHolder(
}
override fun onLongClick(view: View?): Boolean {
super.onLongClick(view)
return false // !adapter.libraryListener.recyclerIsScrolling()
return if (adapter.isLongPressDragEnabled) {
super.onLongClick(view)
false
} else super.onLongClick(view)
}
}

View File

@ -355,11 +355,11 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
private fun setRecyclerLayout() {
if (libraryLayout == 0) {
recycler.spanCount = 1
recycler.setPaddingRelative(0,0,0,0)
recycler.updatePaddingRelative(start = 0, end = 0)
}
else {
recycler.columnWidth = (90 + (preferences.gridSize().getOrDefault() * 30)).dpToPx
recycler.setPaddingRelative(3.dpToPx,0,3.dpToPx, 0)
recycler.updatePaddingRelative(start = 5.dpToPx, end = 5.dpToPx)
}
}
@ -594,7 +594,7 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
return if (adapter.mode == SelectableAdapter.Mode.MULTI) {
lastClickPosition = position
toggleSelection(position)
true
false
} else {
openManga(item.manga, null)
false
@ -812,7 +812,6 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
return
val distance = recycler_layout.alpha
val speed = max(3000f / abs(x), 0.75f)
Timber.d("Flinged $distance, velo ${abs(x)}, speed $speed")
if (sign(recycler_layout.x) == sign(x)) {
flinging = true
val duration = (distance * 100 * speed).toLong()

View File

@ -3,9 +3,8 @@
android:color="@color/fullRippleColor">
<item android:id="@android:id/mask"
android:top="6dp"
android:bottom="8dp"
android:left="4dp"
android:right="4dp">
android:left="6dp"
android:right="6dp">
<shape android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@color/fullRippleColor" />
@ -13,9 +12,8 @@
</item>
<item
android:top="6dp"
android:bottom="8dp"
android:left="4dp"
android:right="4dp">
android:left="6dp"
android:right="6dp">
<selector>
<item android:state_selected="true">
<shape android:shape="rectangle">

View File

@ -35,6 +35,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:foreground="?android:attr/selectableItemBackground"
android:background="?android:attr/colorBackground"
android:maxHeight="250dp"
tools:background="?android:attr/colorBackground"
@ -113,7 +114,7 @@
<include
layout="@layout/unread_download_badge"
android:layout_width="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginStart="1dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/badge_guide"
app:layout_constraintStart_toStartOf="parent" />
@ -124,8 +125,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:orientation="vertical"
android:layout_height="30sp">
<com.google.android.material.textview.MaterialTextView

View File

@ -6,7 +6,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:cardElevation="5dp"
app:cardElevation="2dp"
android:layout_marginStart="2dp"
android:layout_marginTop="5dp"
android:visibility="gone"