Skip to content

Instantly share code, notes, and snippets.

View rakib10rr3's full-sized avatar
🏠
Working from home

Rakibul Huda rakib10rr3

🏠
Working from home
View GitHub Profile
@rakib10rr3
rakib10rr3 / AdbCommands
Created August 18, 2019 09:00 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
private fun customScroll(): ViewAction {
return object : ViewAction {
override fun getDescription(): String? {
return null
}
override fun getConstraints(): Matcher<View> {
return CoreMatchers.allOf(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE), isDescendantOfA(anyOf(
isAssignableFrom(ScrollView::class.java),
isAssignableFrom(HorizontalScrollView::class.java),
//This method selects any child from a viewgroup i.e: Chipgroup
private fun nthChildOf(parentMatcher: Matcher<View>, childPosition: Int): Matcher<View> {
return object : TypeSafeMatcher<View>() {
override fun describeTo(description: Description) {
description.appendText("position $childPosition of parent ")
parentMatcher.describeTo(description)
}
public override fun matchesSafely(view: View): Boolean {
//This method will work on a checkbox. It will set the state of checkbox either checked or unchecked
private fun setChecked(checked: Boolean): ViewAction {
return object : ViewAction {
override fun getDescription(): String? {
return null
}
override fun getConstraints(): Matcher<View> {
return object : BaseMatcher<View>() {
override fun matches(item: Any): Boolean {
class ClickCloseIconAction : ViewAction {
override fun getConstraints(): Matcher<View> {
return ViewMatchers.isAssignableFrom(Chip::class.java)
}
override fun getDescription(): String {
return "click drawable "
}
onView(withClassName(Matchers.equalTo(DatePicker::class.java.name))).perform(PickerActions.setDate((1935..2007).random(), (1..12).random(), (1..31).random()))
onView(withId(android.R.id.button1)).perform(click())
1.Add dependencies
def nav_version = "2.1.0"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
@rakib10rr3
rakib10rr3 / MiddleDividerItemDecoration.kt
Created April 13, 2020 18:19 — forked from Veeyikpong/MiddleDividerItemDecoration.kt
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rakib10rr3
rakib10rr3 / build.grade
Created May 13, 2020 08:16
android project level build file for jetpack and other important libraries
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
ext.retrofit_version = '2.6.0'
ext.lifecycle_version = "2.2.0"
ext.nav_version = '2.2.0'
ext.moshi_version = "1.9.2"
ext.room_version = "2.2.5"