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 Manager{ | |
public void requestSomeSerice(){ | |
// some logic for get response form server | |
... | |
if( response.isSuccess(){ | |
RxBus.get().post(new SuccesEvent()); | |
}else{ | |
RxBus.get().post(new FailEvent()); |
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
@RunWith(JUnit4.class) | |
class PresenterManagerIntegrationTest{ | |
@Before | |
public void setup(){ | |
... | |
} | |
@Test | |
public void requestSevice(){ |
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
/** | |
* This rule registers SchedulerHooks for RxJava and RxAndroid to ensure that subscriptions | |
* always subscribeOn and observeOn Schedulers.immediate(). | |
* Warning, this rule will reset RxAndroidPlugins and RxJavaPlugins before and after each test so | |
* if the application code uses RxJava plugins this may affect the behaviour of the testing method. | |
*/ | |
public class RxSchedulersOverrideRule implements TestRule { | |
private final RxAndroidSchedulersHook mRxAndroidSchedulersHook = new RxAndroidSchedulersHook() { |
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
private void setText(CharSequence text, BufferType type, | |
boolean notifyBefore, int oldlen) { | |
if (text == null) { | |
text = ""; | |
} | |
// If suggestions are not enabled, remove the suggestion spans from the text | |
if (!isSuggestionsEnabled()) { | |
text = removeSuggestionSpans(text); | |
} |
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 SpannableStringBuilder append(CharSequence text) { | |
int length = length(); | |
return replace(length, length, text, 0, text.length()); | |
} | |
... | |
public SpannableStringBuilder replace(final int start, final int end, | |
CharSequence tb, int tbstart, int tbend) { | |
checkRange("replace", start, end); |
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 DashTextWatcher implements TextWatcher{ | |
private final String format; | |
private EditText edt; | |
private String strAfter; | |
private String strBefore; | |
private int selectionIndex; | |
private int maxLength; | |
public DashTextWatcher( EditText edt, String format ){ | |
this.format = format; |
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"?> | |
<font-family 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" | |
tools:ignore="UnusedAttribute"> | |
<font | |
android:font="@font/productsans_regular" | |
android:fontStyle="normal" | |
android:fontWeight="400" |
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"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="@color/colorAccent"> | |
<item | |
android:id="@android:id/mask" | |
android:drawable="@drawable/lollipop_round_primary_mask"/> | |
<item> | |
<selector> | |
<item android:drawable="@drawable/lollipop_round_primary_focused" | |
android:state_focused="true" /> |
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"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<corners android:radius="30dp"/> | |
<solid android:color="@android:color/black"/> | |
</shape> |
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
[ slide_in_from_right.xml ] | |
<?xml version="1.0" encoding="utf-8"?> | |
<set> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@integer/fragment_transition_time" | |
android:fromXDelta="100%" | |
android:interpolator="@android:anim/decelerate_interpolator" | |
android:toXDelta="0" /> | |
</set> |