Skip to content

Instantly share code, notes, and snippets.

View alorma's full-sized avatar
🤡

Bernat Borrás Paronella alorma

🤡
View GitHub Profile
android.support.test.espresso.AmbiguousViewMatcherException: '(with id: com.******.dev:id/addressView)' matches multiple views in the hierarchy.
Problem views are marked with '****MATCHES****' below.
View Hierarchy:
+>DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) sim=#20 ty=1 fl=#81810100 wanim=0x1030465 needsMenuKey=2}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
|
+->LinearLayout{id=-1, visibility=VISIBLE, width=1080, height=1794, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@e45b57d, tag=null, root-is-layout-requested=false, ha
import com.crashlytics.android.answers.*
import io.fabric.sdk.android.Fabric
import java.math.BigDecimal
import java.util.*
@DslMarker
annotation class FabricEventDsl
@FabricEventDsl
class CustomAttribute {
import android.content.Context
import android.content.DialogInterface
import android.support.annotation.LayoutRes
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.alorma.R
@DslMarker
import com.karumi.dexter.DexterBuilder
import com.karumi.dexter.PermissionToken
import com.karumi.dexter.listener.PermissionDeniedResponse
import com.karumi.dexter.listener.PermissionGrantedResponse
import com.karumi.dexter.listener.PermissionRequest
import com.karumi.dexter.listener.single.PermissionListener
@DslMarker
annotation class PermissionDsl
inline fun <reified T: View> T.asRecyclerViewCell(): T {
layoutParams = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT)
return this
}
fun RecyclerView.divider(orientation: Int = DividerItemDecoration.VERTICAL,
@DrawableRes drawable : Int = R.drawable.list_divider) {
val itemDecoration = DividerItemDecoration(context, orientation).apply {
ContextCompat.getDrawable(context, drawable)?.let {
setDrawable(it)
}
}
addItemDecoration(itemDecoration)
}
import android.graphics.Canvas
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.helper.ItemTouchHelper
import android.support.v7.widget.helper.ItemTouchHelper.*
import android.view.View
import com.stronix.lio.ui.features.broadcasts.BroadcastsSwipeCallback
abstract class GenericSwipeCallback(
private var swipeLeft: SwipeAction? = null,
class ResourcesProvider @Inject constructor(private val context: Context) {
fun getPlural(@PluralsRes plural: Int, number: Int, formatted: String): String
= context.resources.getQuantityString(plural, number, formatted)
fun getString(@StringRes stringId: Int): String
= context.resources.getString(stringId)
}
#!/bin/sh
./gradlew clean testDebug
#!/bin/sh
# Your code belongs here