From 232f294917942f3405ba9285cb9d833325de3fbc Mon Sep 17 00:00:00 2001 From: Aaron Huttner Date: Sat, 27 Aug 2016 19:04:37 -0400 Subject: [PATCH] fix composite subscription bug version bump --- app/build.gradle | 2 +- .../grommet/ui/registration/AdditionalInfoFragment.java | 6 +++--- .../grommet/ui/registration/AssistantInfoFragment.java | 3 ++- .../java/com/rockthevote/grommet/ui/views/AddressView.java | 3 ++- .../java/com/rockthevote/grommet/ui/views/NameView.java | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1994d227..b0081904 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/java/com/rockthevote/grommet/ui/registration/AdditionalInfoFragment.java b/app/src/main/java/com/rockthevote/grommet/ui/registration/AdditionalInfoFragment.java index 6bc70da1..3c4c02f4 100644 --- a/app/src/main/java/com/rockthevote/grommet/ui/registration/AdditionalInfoFragment.java +++ b/app/src/main/java/com/rockthevote/grommet/ui/registration/AdditionalInfoFragment.java @@ -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 raceEnumAdapter; private EnumAdapter partyEnumAdapter; @@ -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()) @@ -333,8 +333,8 @@ public void onResume() { @Override public void onPause() { super.onPause(); - subscriptions.unsubscribe(); phone.removeTextChangedListener(phoneFormatter); + subscriptions.unsubscribe(); } /** diff --git a/app/src/main/java/com/rockthevote/grommet/ui/registration/AssistantInfoFragment.java b/app/src/main/java/com/rockthevote/grommet/ui/registration/AssistantInfoFragment.java index 4bcf9cb5..4601bc97 100644 --- a/app/src/main/java/com/rockthevote/grommet/ui/registration/AssistantInfoFragment.java +++ b/app/src/main/java/com/rockthevote/grommet/ui/registration/AssistantInfoFragment.java @@ -64,7 +64,7 @@ public class AssistantInfoFragment extends BaseRegistrationFragment { private PhoneNumberFormattingTextWatcher phoneFormatter; - private CompositeSubscription subscriptions = new CompositeSubscription(); + private CompositeSubscription subscriptions; @Nullable @Override @@ -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) diff --git a/app/src/main/java/com/rockthevote/grommet/ui/views/AddressView.java b/app/src/main/java/com/rockthevote/grommet/ui/views/AddressView.java index 6483c783..81f844f2 100644 --- a/app/src/main/java/com/rockthevote/grommet/ui/views/AddressView.java +++ b/app/src/main/java/com/rockthevote/grommet/ui/views/AddressView.java @@ -81,7 +81,7 @@ public class AddressView extends FrameLayout { private ArrayAdapter stateAdapter; private Address.Type type; - private CompositeSubscription subscriptions = new CompositeSubscription(); + private CompositeSubscription subscriptions; private ZipTextWatcher zipTextWatcher = new ZipTextWatcher(); public AddressView(Context context) { @@ -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), diff --git a/app/src/main/java/com/rockthevote/grommet/ui/views/NameView.java b/app/src/main/java/com/rockthevote/grommet/ui/views/NameView.java index 8b3916ff..c74cb506 100644 --- a/app/src/main/java/com/rockthevote/grommet/ui/views/NameView.java +++ b/app/src/main/java/com/rockthevote/grommet/ui/views/NameView.java @@ -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); @@ -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),