Skip to content

Instantly share code, notes, and snippets.

View ablenesi's full-sized avatar

Blénesi Attila ablenesi

View GitHub Profile
@ablenesi
ablenesi / BaseTest.kt
Last active February 25, 2019 22:06
Test Rules Rules
class BaseTest {
@get:Rule
val testName = TestName()
@Before
fun setUp() {
assertDeviceOrSkip()
//...
}
@ablenesi
ablenesi / layout - activity_main_land.xml
Last active January 31, 2019 12:00
In case you have to use a specific landscape layout only mobile. Using layout aliases, might be an optimal solution you don't have to duplicate layout xml's or add any logic when inflating the layout.
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Hello World! LANDSCAPE"
android:gravity="center"/>
val image = FirebaseVisionImage.fromBitmap(selectedImage)
val detector = FirebaseVision.getInstance()
.getVisionTextDetector()
detector.detectInImage(image)
.addOnSuccessListener { texts ->
processTextRecognitionResult(texts)
}
.addOnFailureListener(...)
@ablenesi
ablenesi / dimens.xml
Last active June 1, 2017 00:17
Recyclable card list items. No shadow glitches & backward compatible.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="card_hiding_margin">-5dp</dimen>
<dimen name="card_margin">5dp</dimen>
</resources>