This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| public class ColoredSnackBar { | |
| private static final int red = 0xfff44336; | |
| private static final int green = 0xff4caf50; | |
| private static final int blue = 0xff2195f3; | |
| private static final int orange = 0xffffc107; | |
| private static View getSnackBarLayout(Snackbar snackbar) { | |
| if (snackbar != null) { |
| package retrofit.converter; | |
| import com.bluelinelabs.logansquare.LoganSquare; | |
| import java.lang.reflect.ParameterizedType; | |
| import java.lang.reflect.Type; | |
| import java.util.List; | |
| import retrofit.converter.ConversionException; | |
| import retrofit.converter.Converter; |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- Add this as a debug manifest so the permissions won't be required by your production app --> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | |
| <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | |
| </manifest> |
This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| // Searching for a toString() method in Swift? Use the printable protocol! | |
| // Implement Printable protocol and create a description variable | |
| // https://developer.apple.com/library/ios/documentation/General/Reference/SwiftStandardLibraryReference/Printable.html | |
| class Person : Printable { | |
| var name : String! | |
| init(name : String) { | |
| self.name = name | |
| } |
| public static class HideExtraOnScroll extends RecyclerView.OnScrollListener{ | |
| final static Interpolator ACCELERATE = new AccelerateInterpolator(); | |
| final static Interpolator DECELERATE = new DecelerateInterpolator(); | |
| WeakReference<View> mTarget; | |
| HideExtraOnScrollHelper mScrollHelper; | |
| boolean isExtraObjectsOutside; |
| /** | |
| * An enhanced {@code CheckBox} that differentiates between user clicks and | |
| * programmatic clicks. In particular, the {@code OnCheckedChangeListener} is | |
| * <strong>not</strong> triggered when the state of the checkbox is changed | |
| * programmatically. | |
| * | |
| */ | |
| public class EnhancedCheckBox extends CheckBox implements ProgrammaticallyCheckable{ | |
| private CompoundButton.OnCheckedChangeListener mListener = null; | |
| public EnhancedCheckBox(Context context) { |
| /* | |
| * Copyright (C) 2014 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |