Skip to content

Commit

Permalink
Merge pull request #32 from RowlandOti/rowland/upgradeTooling
Browse files Browse the repository at this point in the history
chore: fix lint errors
  • Loading branch information
RowlandOti authored Jul 12, 2024
2 parents 9cf75e0 + 16acd37 commit ce25b8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kapt.use.worker.api=false
kapt.incremental.apt=false
# Always maintain in alpahabetical order
# start of build tool chain versions
miniSdkVersion=23
miniSdkVersion=26
comSdkVersion=34
tarSdkVersion=34
# end of build tool chain versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,37 @@ import kotlin.math.min
* Created by rowlandoti on 08/03/2021
*
*/
class BottomNavigationBehavior(@NonNull context: Context?, @NonNull attrs: AttributeSet?) :
class BottomNavigationBehavior(context: Context?, attrs: AttributeSet?) :
CoordinatorLayout.Behavior<BottomNavigationView?>(context, attrs) {

override fun onStartNestedScroll(
@NonNull coordinatorLayout: CoordinatorLayout,
@NonNull child: BottomNavigationView,
@NonNull directTargetChild: View,
@NonNull target: View,
coordinatorLayout: CoordinatorLayout,
child: BottomNavigationView,
directTargetChild: View,
target: View,
axes: Int,
type: Int
): Boolean {
return axes == ViewCompat.SCROLL_AXIS_VERTICAL
}

override fun onNestedPreScroll(
@NonNull coordinatorLayout: CoordinatorLayout,
@NonNull child: BottomNavigationView,
@NonNull target: View,
coordinatorLayout: CoordinatorLayout,
child: BottomNavigationView,
target: View,
dx: Int,
dy: Int,
@NonNull consumed: IntArray,
consumed: IntArray,
type: Int
) {
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type)
child.translationY = max(0.0f, min(child.height.toFloat(), child.translationY + dy))
}

override fun layoutDependsOn(
@Nullable parent: CoordinatorLayout,
parent: CoordinatorLayout,
child: BottomNavigationView,
@Nullable dependency: View
dependency: View
): Boolean {
if (dependency is SnackbarLayout) {
this.updateSnackbar(child, dependency)
Expand Down

0 comments on commit ce25b8a

Please sign in to comment.