-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to: #882
- Loading branch information
Showing
15 changed files
with
286 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...e/app/src/main/java/com/emmsale/presentation/common/layoutManager/CenterSmoothScroller.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.emmsale.presentation.common.layoutManager | ||
|
||
import android.content.Context | ||
import androidx.recyclerview.widget.LinearSmoothScroller | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import javax.inject.Inject | ||
|
||
class CenterSmoothScroller @Inject constructor( | ||
@ApplicationContext context: Context, | ||
) : LinearSmoothScroller(context) { | ||
|
||
override fun calculateDtToFit( | ||
viewStart: Int, | ||
viewEnd: Int, | ||
boxStart: Int, | ||
boxEnd: Int, | ||
snapPreference: Int, | ||
): Int = (boxStart + (boxEnd - boxStart) / 2) - (viewStart + (viewEnd - viewStart) / 2) | ||
} |
13 changes: 13 additions & 0 deletions
13
...sale/app/src/main/java/com/emmsale/presentation/common/layoutManager/EndSmoothScroller.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.emmsale.presentation.common.layoutManager | ||
|
||
import android.content.Context | ||
import androidx.recyclerview.widget.LinearSmoothScroller | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import javax.inject.Inject | ||
|
||
class EndSmoothScroller @Inject constructor( | ||
@ApplicationContext context: Context, | ||
) : LinearSmoothScroller(context) { | ||
|
||
override fun getVerticalSnapPreference(): Int = SNAP_TO_END | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.