Skip to content

Commit

Permalink
Merge pull request #88 from huttneab/phone_bug_fix
Browse files Browse the repository at this point in the history
fix composite subscription bug
  • Loading branch information
huttneab authored Aug 27, 2016
2 parents fbde7ef + 232f294 commit 30c6f11
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Manifest version information!
def versionMajor = 1
def versionMinor = 1
def versionPatch = 0
def versionPatch = 1
def versionBuild = 0 // bump for dogfood builds, public betas, etc.

apply plugin: 'com.android.application'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class AdditionalInfoFragment extends BaseRegistrationFragment {
@Inject BriteDatabase db;

private ObservableValidator validator;
private CompositeSubscription subscriptions = new CompositeSubscription();
private CompositeSubscription subscriptions;
private EnumAdapter<Race> raceEnumAdapter;
private EnumAdapter<Party> partyEnumAdapter;

Expand Down Expand Up @@ -192,9 +192,9 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
@Override
public void onResume() {
super.onResume();

phoneFormatter = new PhoneNumberFormattingTextWatcher();
phone.addTextChangedListener(phoneFormatter);
subscriptions = new CompositeSubscription();

subscriptions.add(RxTextView.afterTextChangeEvents(raceSpinner.getEditText())
.observeOn(Schedulers.io())
Expand Down Expand Up @@ -333,8 +333,8 @@ public void onResume() {
@Override
public void onPause() {
super.onPause();
subscriptions.unsubscribe();
phone.removeTextChangedListener(phoneFormatter);
subscriptions.unsubscribe();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class AssistantInfoFragment extends BaseRegistrationFragment {

private PhoneNumberFormattingTextWatcher phoneFormatter;

private CompositeSubscription subscriptions = new CompositeSubscription();
private CompositeSubscription subscriptions;

@Nullable
@Override
Expand All @@ -89,6 +89,7 @@ public void onResume() {
phoneFormatter = new PhoneNumberFormattingTextWatcher();
phoneEditText.addTextChangedListener(phoneFormatter);

subscriptions = new CompositeSubscription();
subscriptions.add(RxTextView.afterTextChangeEvents(phoneEditText)
.observeOn(Schedulers.io())
.debounce(DEBOUNCE, TimeUnit.MILLISECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class AddressView extends FrameLayout {
private ArrayAdapter<CharSequence> stateAdapter;

private Address.Type type;
private CompositeSubscription subscriptions = new CompositeSubscription();
private CompositeSubscription subscriptions;
private ZipTextWatcher zipTextWatcher = new ZipTextWatcher();

public AddressView(Context context) {
Expand Down Expand Up @@ -192,6 +192,7 @@ protected void onAttachedToWindow() {
if (!isInEditMode()) {
zipEditText.addTextChangedListener(zipTextWatcher);

subscriptions = new CompositeSubscription();
subscriptions.add(Observable.combineLatest(RxTextView.afterTextChangeEvents(streetEditText),
RxTextView.afterTextChangeEvents(unitEditText),
RxTextView.afterTextChangeEvents(cityEditText),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class NameView extends FrameLayout {

private Name.Type type;

private CompositeSubscription subscriptions = new CompositeSubscription();
private CompositeSubscription subscriptions;

public NameView(Context context) {
this(context, null);
Expand Down Expand Up @@ -156,6 +156,7 @@ protected void onFinishInflate() {
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (!isInEditMode()) {
subscriptions = new CompositeSubscription();
subscriptions.add(Observable.combineLatest(RxTextView.afterTextChangeEvents(firstNameEditText),
RxTextView.afterTextChangeEvents(middleNameEditText),
RxTextView.afterTextChangeEvents(lastNameEditText),
Expand Down

0 comments on commit 30c6f11

Please sign in to comment.