Skip to content

Commit befeb85

Browse files
author
Kaushik Gopal
committed
bef
1 parent d6566c9 commit befeb85

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

app/src/main/java/com/morihacky/android/rxjava/DebounceSearchEmitterFragment.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import rx.android.schedulers.AndroidSchedulers;
2424
import rx.android.widget.OnTextChangeEvent;
2525
import rx.android.widget.WidgetObservable;
26-
import rx.schedulers.Schedulers;
2726
import timber.log.Timber;
2827

2928
import static java.lang.String.format;
@@ -33,7 +32,7 @@ public class DebounceSearchEmitterFragment
3332
extends BaseFragment {
3433

3534
@InjectView(R.id.list_threading_log) ListView _logsList;
36-
@InjectView(R.id.input_txt_subject_debounce) EditText _inputSearchText;
35+
@InjectView(R.id.input_txt_debounce) EditText _inputSearchText;
3736

3837
private LogAdapter _adapter;
3938
private List<String> _logs;
@@ -52,12 +51,12 @@ public void onDestroy() {
5251
public View onCreateView(LayoutInflater inflater,
5352
@Nullable ViewGroup container,
5453
@Nullable Bundle savedInstanceState) {
55-
View layout = inflater.inflate(R.layout.fragment_subject_debounce, container, false);
54+
View layout = inflater.inflate(R.layout.fragment_debounce, container, false);
5655
ButterKnife.inject(this, layout);
5756
return layout;
5857
}
5958

60-
@OnClick(R.id.clr_subject_debounce)
59+
@OnClick(R.id.clr_debounce)
6160
public void onClearLog() {
6261
_logs = new ArrayList<>();
6362
_adapter.clear();

app/src/main/java/com/morihacky/android/rxjava/MainFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void demoBuffer() {
4141
.commit();
4242
}
4343

44-
@OnClick(R.id.btn_demo_subject_debounce)
44+
@OnClick(R.id.btn_demo_debounce)
4545
public void demoThrottling() {
4646
getActivity().getSupportFragmentManager()
4747
.beginTransaction()

app/src/main/res/layout/fragment_subject_debounce.xml renamed to app/src/main/res/layout/fragment_debounce.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:layout_width="match_parent"
1313
android:padding="10dp"
1414
android:gravity="center"
15-
android:text="@string/msg_demo_subject"
15+
android:text="@string/msg_demo_debounce"
1616
/>
1717

1818
<LinearLayout
@@ -22,7 +22,7 @@
2222
>
2323

2424
<EditText
25-
android:id="@+id/input_txt_subject_debounce"
25+
android:id="@+id/input_txt_debounce"
2626
android:layout_weight="7"
2727
android:layout_height="match_parent"
2828
android:layout_width="0dp"
@@ -32,7 +32,7 @@
3232
/>
3333

3434
<ImageButton
35-
android:id="@+id/clr_subject_debounce"
35+
android:id="@+id/clr_debounce"
3636
android:layout_weight="1"
3737
android:layout_height="wrap_content"
3838
android:layout_width="0dp"

app/src/main/res/layout/fragment_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
/>
3333

3434
<Button
35-
android:id="@+id/btn_demo_subject_debounce"
35+
android:id="@+id/btn_demo_debounce"
3636
android:layout_height="wrap_content"
3737
android:layout_width="match_parent"
38-
android:text="@string/btn_demo_subject_debounce"
38+
android:text="@string/btn_demo_debounce"
3939
/>
4040

4141
<Button

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<string name="btn_demo_schedulers">bg work (schedulers &amp; concurrency)</string>
1010
<string name="btn_demo_buffer">accumulate calls (buffer)</string>
11-
<string name="btn_demo_subject_debounce">search text listener(subject debouncing)</string>
11+
<string name="btn_demo_debounce">search text listener(debounce)</string>
1212
<string name="btn_demo_timeout">delayed jobs (timeout)</string>
1313
<string name="btn_demo_retrofit">Retrofit + RxJava</string>
1414
<string name="btn_demo_double_binding_textview">Double binding (PublishSubject)</string>
@@ -20,7 +20,7 @@
2020

2121
<string name="msg_demo_concurrency_schedulers">This is a demo of how long running operations can be offloaded to a background thread. After the operation is done, we resume back on the main thread. All using RxJava! \n\n To really see this shine. Hit the button multiple times and see how the button click which is a ui operation is never blocked because the long operation only runs in the background</string>
2222
<string name="msg_demo_buffer">This is a demo of how events can be accumulated using the "buffer" operation. Tap the button below repetitively and you will notice in the logs that button taps are collected over a span of 2s and printed below.</string>
23-
<string name="msg_demo_subject">As you type in the input box, it will not shoot out log messages at every single input character change, but rather only pick the last one.</string>
23+
<string name="msg_demo_debounce">As you type in the input box, it will not shoot out log messages at every single input character change, but rather only pick the last one.</string>
2424
<string name="msg_demo_timeout">This is a demo of terminating events, that take too long to process. Events in this demo should timeout in 3 seconds. Button 1 is an event that takes 2s to process, and Button 2 is a n event that takes 5s to process. Hit Button 2, and see in the logs that it\'s been cancelled, while this is not the case for Button 1.</string>
2525
<string name="msg_demo_retrofit">Retrofit from Square is a super easy networking helper library. It works really well with RxJava and these are examples taken from Jake Wharton\'s talk at Netflix (see README). Really the only interesting bits here are in the code and logs.</string>
2626
<string name="msg_demo_retrofit_async_task_death">This shows how you can replace an AsyncTask with RxJava. The interesting parts are in the code.</string>

0 commit comments

Comments
 (0)