Move Reader settings button to bottom settings sheet

This commit is contained in:
Jays2Kings 2021-03-30 02:03:01 -04:00
parent 21343225e3
commit b7b91f4230
3 changed files with 19 additions and 25 deletions

View File

@ -16,7 +16,6 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter
import com.mikepenz.fastadapter.listeners.ClickEventHook
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.databinding.ReaderChaptersSheetBinding
import eu.kanade.tachiyomi.ui.main.SearchActivity
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter
import eu.kanade.tachiyomi.ui.reader.settings.TabbedReaderSettingsSheet
@ -73,11 +72,6 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
TabbedReaderSettingsSheet(activity).show()
}
binding.fullSettings.setOnClickListener {
val intent = SearchActivity.openReaderSettings(activity)
activity.startActivity(intent)
}
post {
binding.chapterRecycler.alpha = if (sheetBehavior.isExpanded()) 1f else 0f
binding.chapterRecycler.isClickable = sheetBehavior.isExpanded()

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.settings
import android.view.View
import com.google.android.material.tabs.TabLayout
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.main.SearchActivity
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.visInvisIf
@ -53,7 +54,23 @@ class TabbedReaderSettingsSheet(val readerActivity: ReaderActivity) : TabbedBott
filterView.activity = readerActivity
generalView.sheet = this
binding.menu.gone()
sheetBehavior = BottomSheetBehavior.from(binding.root.parent as ViewGroup)
binding.menu.visible()
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
binding.menu.tooltipText = context.getString(R.string.reader_settings)
}
binding.menu.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.ic_settings_24dp
)
)
binding.menu.setOnClickListener {
val intent = SearchActivity.openReaderSettings(readerActivity)
readerActivity.startActivity(intent)
dismiss()
}
val attrs = window?.attributes
val ogDim = attrs?.dimAmount ?: 0.25f
binding.pager.adapter?.notifyDataSetChanged()

View File

@ -74,27 +74,10 @@
app:layout_constraintHorizontal_chainStyle="spread"
android:tooltipText="@string/display_options"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/full_settings"
app:layout_constraintStart_toEndOf="@id/webview_button"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_tune_24dp" />
<ImageButton
android:id="@+id/full_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/next_title"
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
app:tint="?actionBarTintColor"
android:visibility="gone"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintEnd_toEndOf="parent"
android:tooltipText="@string/reader_settings"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/display_options"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_settings_24dp" />
app:srcCompat="@drawable/ic_tune_24dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView