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
package sx.android | |
import android.os.Build | |
import android.support.test.InstrumentationRegistry | |
import android.util.Log | |
import org.junit.rules.TestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement | |
import java.io.FileInputStream |
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
#!/bin/bash | |
sp="/-\|" | |
sc=0 | |
spin() { | |
printf "\b${sp:sc++:1}" | |
((sc==${#sp})) && sc=0 | |
} | |
endspin() { | |
printf "\r" | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Put this file in the "debug" folder so it only gets merged into debug builds --> | |
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
package="org.bookdash.android"> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | |
<uses-permission android:name="android.permission.WAKE_LOCK"/> | |
<!-- Disable animations on debug builds so that the animations do not interfere with Espresso |
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
import android.support.test.espresso.NoMatchingViewException; | |
import android.support.test.espresso.ViewAssertion; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import com.google.common.truth.Truth; | |
import java.util.ArrayList; | |
import org.hamcrest.Matcher; | |
import org.junit.Assert; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright (C) 2015 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 |
You can use this class to realize a simple sectioned RecyclerView.Adapter
without changing your code.
The RecyclerView
should use a LinearLayoutManager
.
You can use this code also with the TwoWayView
with the ListLayoutManager
(https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter
provided by Google
Example:
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
import java.util.Locale; | |
import org.junit.rules.TestWatcher; | |
import org.junit.runner.Description; | |
public class DefaultLocaleRule extends TestWatcher { | |
private Locale originalDefault; | |
private Locale currentDefault; | |
public DefaultLocaleRule() { |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.