@@ -78,7 +78,6 @@ import androidx.draganddrop.DropHelper
7878import androidx.fragment.app.commit
7979import androidx.lifecycle.flowWithLifecycle
8080import androidx.lifecycle.lifecycleScope
81- import androidx.recyclerview.widget.DividerItemDecoration
8281import androidx.recyclerview.widget.LinearLayoutManager
8382import androidx.recyclerview.widget.RecyclerView
8483import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
@@ -160,6 +159,7 @@ import com.ichi2.anki.settings.Prefs
160159import com.ichi2.anki.snackbar.BaseSnackbarBuilderProvider
161160import com.ichi2.anki.snackbar.SnackbarBuilder
162161import com.ichi2.anki.snackbar.showSnackbar
162+ import com.ichi2.anki.ui.ResizablePaneManager
163163import com.ichi2.anki.utils.ext.dismissAllDialogFragments
164164import com.ichi2.anki.utils.ext.setFragmentResultListener
165165import com.ichi2.anki.utils.ext.showDialogFragment
@@ -528,6 +528,28 @@ open class DeckPicker :
528528 // Open StudyOptionsFragment if in fragmented mode
529529 if (fragmented && ! startupError) {
530530 loadStudyOptionsFragment(false )
531+
532+ val resizingDivider = findViewById<View >(R .id.resizing_divider)
533+ val parentLayout = findViewById<LinearLayout >(R .id.deckpicker_xl_view)
534+
535+ // Get references to the panes
536+ val deckPickerPane = findViewById<View >(R .id.deck_picker_pane)
537+ val studyOptionsPane = findViewById<View >(R .id.studyoptions_fragment)
538+
539+ if (deckPickerPane == null || studyOptionsPane == null ) {
540+ Timber .w(" DeckPicker or StudyOptions pane not found. Resizing divider will not function." )
541+ } else {
542+ // Initialize the ResizablePaneManager
543+ ResizablePaneManager (
544+ parentLayout = parentLayout,
545+ divider = resizingDivider,
546+ leftPane = deckPickerPane,
547+ rightPane = studyOptionsPane,
548+ sharedPrefs = this .sharedPrefs(),
549+ leftPaneWeightKey = PREF_DECK_PICKER_PANE_WEIGHT ,
550+ rightPaneWeightKey = PREF_STUDY_OPTIONS_PANE_WEIGHT ,
551+ )
552+ }
531553 }
532554 registerReceiver()
533555
@@ -542,15 +564,9 @@ open class DeckPicker :
542564 deckPickerContent.visibility = View .GONE
543565 noDecksPlaceholder.visibility = View .GONE
544566
545- // specify a LinearLayoutManager and set up item dividers for the RecyclerView
567+ // specify a LinearLayoutManager for the RecyclerView
546568 recyclerViewLayoutManager = LinearLayoutManager (this )
547569 recyclerView.layoutManager = recyclerViewLayoutManager
548- val ta = this .obtainStyledAttributes(intArrayOf(R .attr.deckDivider))
549- val divider = ta.getDrawable(0 )
550- ta.recycle()
551- val dividerDecorator = DividerItemDecoration (this , recyclerViewLayoutManager.orientation)
552- dividerDecorator.setDrawable(divider!! )
553- recyclerView.addItemDecoration(dividerDecorator)
554570
555571 // Add background to Deckpicker activity
556572 val view = if (fragmented) findViewById(R .id.deckpicker_xl_view) else findViewById<View >(R .id.root_layout)
@@ -2565,6 +2581,9 @@ open class DeckPicker :
25652581 private const val AUTOMATIC_SYNC_MINIMAL_INTERVAL_IN_MINUTES : Long = 10
25662582 private const val SWIPE_TO_SYNC_TRIGGER_DISTANCE = 400
25672583
2584+ private const val PREF_DECK_PICKER_PANE_WEIGHT = " deckPickerPaneWeight"
2585+ private const val PREF_STUDY_OPTIONS_PANE_WEIGHT = " studyOptionsPaneWeight"
2586+
25682587 // Animation utility methods used by renderPage() method
25692588 fun fadeIn (
25702589 view : View ? ,
0 commit comments