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
div | |
{ | |
width: 150px; | |
height: 150px; | |
background: #BADABA; | |
position: relative; | |
} |
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
public class URLRequestUnit extends InstrumentationTestCase | |
{ | |
private static final String API_URL = | |
"http://www.example.com/api/users"; | |
public void testHttpOkay() throws Exception { | |
MockURLStreamHandler handler = new MockURLStreamHandler(); | |
URL.setURLStreamHandlerFactory(handler); | |
UsersRequest request = new UsersRequest(); |
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
public class MainActivity extends ListActivity { | |
private Handler mHandler = new Handler(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
final FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.button_floating_action); | |
floatingActionButton.attachToListView(getListView()); |
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 com.melnykov.booktracker.util; | |
import android.annotation.SuppressLint; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.provider.MediaStore; | |
import android.widget.Toast; |
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
@Parcelize | |
@SuppressLint("ParcelCreator") | |
data class HomeChargerLocation(val connectionId: String, | |
val intervalEnabled: Boolean, | |
val clusterReference: String, | |
val address: Address, | |
val car: Car, | |
val status: Status) : Parcelable { | |
@Parcelize |
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"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<!--suppress AndroidUnknownAttribute --> | |
<data class="LoginFragmentBinding"> | |
<variable | |
name="viewModel" | |
type="com.melnykov.mvvmtesting.ui.login.LoginViewModel" /> |
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
class LoginViewModel @Inject constructor(private val loginGateway: LoginGateway) : ViewModel() { | |
val emailField = ObservableField<String>() | |
val passwordField = ObservableField<String>() | |
val isSignInButtonEnabled = ObservableBoolean() | |
val isProgressBarVisible = ObservableBoolean() | |
val navigateToForgotPasswordPage = SingleLiveEvent<Unit>() |
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
class LoginFragment : Fragment(), Injectable { | |
@Inject | |
@VisibleForTesting | |
lateinit var viewModelFactory: ViewModelProvider.Factory | |
private lateinit var dataBinding: LoginFragmentBinding | |
private lateinit var viewModel: LoginViewModel |
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
object Injector { | |
fun init(application: MvvmTestingApplication) { | |
application.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks { | |
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { | |
if (activity is HasSupportFragmentInjector && activity is Injectable) { | |
AndroidInjection.inject(activity) | |
} | |
if (activity is FragmentActivity) { | |
activity.supportFragmentManager.registerFragmentLifecycleCallbacks( |
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
interface Injectable |
OlderNewer