Type-safe HTTP client for Android and Java by Square, Inc.
Before we start writing our first UI test I want to describe our development process.
- First, we write a test for a UI or logic that does not yet exist.
- We expect to see build errors or failed tests.
- Then we create a UI element or write program logic.
- Finally, we run the test and make sure it passes.
Android has a dedicated XML namespace intended for tools to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. The namespace URI is http://schemas.android.com/tools and is usually bound to the tools: prefix:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
This file contains hidden or 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.app.Activity; | |
| import android.content.Context; | |
| import android.graphics.Rect; | |
| import android.view.View; | |
| import android.view.inputmethod.InputMethodManager; | |
| public class KeyboardUtils { | |
| public static void hideKeyboard(Activity activity) { | |
| View view = activity.findViewById(android.R.id.content); |
This file contains hidden or 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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
| import com.mstv.presentation.scenes.base.view.ContentState | |
| import com.mstv.presentation.scenes.base.view.LoadingState | |
| data class ${NAME}(val loadingState: LoadingState = LoadingState.NONE, | |
| val contentState: ContentState = ContentState.NONE, | |
| val data: ${DataType}? = null, | |
| val errorMessage: String? = null, | |
| val snackMessage: String? = null) { |
This file contains hidden or 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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
| import android.support.v7.widget.RecyclerView | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import java.util.* | |
| class ${NAME} : RecyclerView.Adapter<${Model}Adapter.ViewHolder>() { |
EDIT: You can find this same updated tutorial here -> Medium
Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:
- I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView
OlderNewer