This file contains hidden or 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
class StartLinearSmoothScroller(context: Context): LinearSmoothScroller(context) { | |
override fun getVerticalSnapPreference() = SNAP_TO_START | |
} | |
//Example | |
val smoothScroller = StartLinearSmoothScroller(context) | |
smoothScroller.targetPosition = 0 //replace with your target position | |
layoutManager.startSmoothScroll(smoothScroller) |
This file contains hidden or 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
import android.content.Context | |
import androidx.recyclerview.widget.GridLayoutManager | |
class ScrollLockableGridLayoutManager(context: Context, spansCount: Int) : GridLayoutManager(context, spansCount) { | |
var canScrollVertically = true | |
override fun canScrollVertically(): Boolean = | |
if (!canScrollVertically) false | |
else super.canScrollVertically() |
This file contains hidden or 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
#MIPS equivalent of .NET DateTime.GetDatePart | |
#https://referencesource.microsoft.com/mscorlib/R/ff06f271f088f1a8.html | |
.macro push(%value) | |
addi $sp, $sp, -4 | |
sw %value, 0($sp) | |
.end_macro | |
.macro pop(%storeTo) | |
lw %storeTo, 0($sp) | |
addi $sp ,$sp, 4 |
NewerOlder