diff --git a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt index e6179bfb..11a68111 100644 --- a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt +++ b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt @@ -128,20 +128,21 @@ open class DpadRecyclerView @JvmOverloads constructor( ): PivotLayoutManager { val properties = LayoutManager.getProperties(context, attrs, 0, 0) val layout = PivotLayoutManager(properties) + val config = layout.getConfig() layout.setFocusOutAllowed( throughFront = typedArray.getBoolean( - R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutFront, false + R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutFront, config.focusOutFront ), throughBack = typedArray.getBoolean( - R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutBack, false + R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutBack, config.focusOutBack ) ) layout.setFocusOutSideAllowed( throughFront = typedArray.getBoolean( - R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutSideFront, true + R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutSideFront, config.focusOutSideFront ), throughBack = typedArray.getBoolean( - R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutSideBack, true + R.styleable.DpadRecyclerView_dpadRecyclerViewFocusOutSideBack, config.focusOutSideBack ) ) layout.setFocusableDirection( diff --git a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/layoutmanager/LayoutConfiguration.kt b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/layoutmanager/LayoutConfiguration.kt index 626f5e83..8d5f203a 100644 --- a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/layoutmanager/LayoutConfiguration.kt +++ b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/layoutmanager/LayoutConfiguration.kt @@ -45,7 +45,7 @@ internal class LayoutConfiguration(properties: Properties) { * For horizontal orientation, this means navigating out from the start of the first view * For vertical orientation, this means navigation out from the top of the first view */ - var focusOutFront = false + var focusOutFront = true private set /** @@ -54,7 +54,7 @@ internal class LayoutConfiguration(properties: Properties) { * For horizontal orientation, this means navigating out from the end of the last view * For vertical orientation, this means navigation out from the bottom of the last view */ - var focusOutBack = false + var focusOutBack = true private set /** diff --git a/sample/src/main/res/layout/screen_recyclerview.xml b/sample/src/main/res/layout/screen_recyclerview.xml index 52cbada3..cf425d16 100644 --- a/sample/src/main/res/layout/screen_recyclerview.xml +++ b/sample/src/main/res/layout/screen_recyclerview.xml @@ -20,6 +20,15 @@ android:layout_height="match_parent" android:clipChildren="false"> + + -