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
suspend fun LazyListState.getFirstVisibleAsState(index: (Int) -> Unit) { | |
this.interactionSource.interactions.collectLatest { | |
index(this.firstVisibleItemIndex) | |
} | |
} | |
data class WeeklyStat( | |
val earning: Float = 0.0f | |
) |
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
class SwipeGestureListener internal constructor( | |
private val onSwipe: (String) -> Unit, | |
) : View.OnTouchListener { | |
companion object { | |
const val minDistance = 200 | |
} | |
private var anchorX = 0F | |
override fun onTouch(view: View, event: MotionEvent): Boolean { |
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
@Composable | |
fun TriStateToggle() { | |
val states = listOf( | |
"State 1", | |
"State 2", | |
"State 3", | |
) | |
var selectedOption by remember { | |
mutableStateOf(states[1]) | |
} |
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
*****Notes on Testing***** | |
Why we need it:- | |
It takes a lot of time and effort to test every functionality in our software manually. And every time we are about to scale our | |
project we'd have to run our software and test each and every functionality manually to check whether it is still working correctly or not. | |
To overcome this effort we write Test Cases for our app so that with single click we can check anytime that whether a given piece of code is working correctly or not. | |
We get JUnit out of the box in our android project to test our code with a single click whenever we want to. | |
There are basically three types of test cases:- | |
-> Unit Tests:- |