Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8817437
Added dismissAfterConfirm flag.
jd-alexander Aug 20, 2019
ef150d1
Merge pull request #10414 from jd-alexander/fullscreen_dialog_confirm…
maxme Aug 21, 2019
3362f72
Made UsernameChangerFullScreenDialogFragment abstract so the function…
jd-alexander Aug 19, 2019
482d107
Updated UsernameChangerFullScreenDialogFragment to utilize the Androi…
jd-alexander Aug 19, 2019
e9c1cdb
Created test for UsernameChangerFullScreenDialogFragment
jd-alexander Aug 19, 2019
4f52d3a
Performed code cleanup and improvements.
jd-alexander Aug 19, 2019
e2544f4
Fixed ktlint error.
jd-alexander Aug 19, 2019
744c00b
Merge pull request #10409 from jd-alexander/8002_make_suggestions_fra…
maxme Aug 22, 2019
7aa29d7
Merge branch 'develop' into issue/8002-change-username
malinajirka Aug 26, 2019
ca1e8a1
Implemented change username functionality in the Account Settings Scr…
jd-alexander Aug 26, 2019
5455d51
dismiss progress on username success and set username to preference c…
jd-alexander Aug 26, 2019
9274521
Used R.string instead of string only due to lint errors. Fetch accoun…
jd-alexander Aug 26, 2019
93e165e
Save button is disabled until a new username is selected.
jd-alexander Aug 27, 2019
c354167
Added cancellation dialog that's shown when user cancels progress dia…
jd-alexander Aug 27, 2019
d586c5a
added analytics events to all the api calls.
jd-alexander Aug 27, 2019
01c8d81
Resolved syntax suggestions, typos and made other improvements to str…
jd-alexander Aug 28, 2019
deed7c3
Made fields and several methods in base class private. Created the ne…
jd-alexander Aug 29, 2019
4a1a261
Added event name for change username stats
jd-alexander Aug 29, 2019
4e33a33
Disabled the username changer test.
jd-alexander Aug 29, 2019
4b2e8b2
Made onConfirmClicked abstract in base class since it's clear both cl…
jd-alexander Aug 29, 2019
8d7fb5d
Fixed lint error where comment line was too long.
jd-alexander Aug 29, 2019
15e56ff
Utilize the updated username for bundles and account refreshes.
jd-alexander Aug 29, 2019
4c23ba4
simplified bundle creation with kotlin's apply scoping function.
jd-alexander Aug 29, 2019
1332f35
Revert "Utilize the updated username for bundles and account refreshes."
jd-alexander Aug 29, 2019
f450a40
Simplified onConfirmClicked with an abstract method for the shared lo…
jd-alexander Aug 29, 2019
62c2f08
Fixed progress dialog issue and made code style fix.
jd-alexander Aug 29, 2019
acf156e
Replaced Toast with SnackBar for username changed event.
jd-alexander Aug 29, 2019
97fe60b
Revert "Added dismissAfterConfirm flag."
jd-alexander Aug 20, 2019
a3f5c51
Removed Username Changer test and the associated modifications that s…
jd-alexander Aug 30, 2019
a1b1906
Merge pull request #10436 from jd-alexander/8002_settings_username_ch…
malinajirka Aug 30, 2019
8827832
Update release notes - change username
malinajirka Aug 30, 2019
02a1ba0
Add Other post type to posts and pages
planarvoid Sep 4, 2019
15d6122
Merge branch 'develop' into issue/8002-change-username
maxme Sep 9, 2019
a799078
Merge branch 'feature/add_other_post_type_to_posts_and_pages' of http…
maxme Sep 9, 2019
b008b01
Update FluxC version to 1.4.0-beta-1
maxme Sep 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated UsernameChangerFullScreenDialogFragment to utilize the Androi…
…d Injector method since it makes it easier to test.

The FragmentInjector can be replaced during tests. The older method requires modification to the TestComponents/TestModules etc. Also corrected how injections were taking place by moving injection to the subtype instead of the base type since the best practice is to inject subtypes.
  • Loading branch information
jd-alexander committed Aug 22, 2019
commit 482d1077e974338c99d9d153af60171b9a2ea0ca
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.wordpress.android.ui.accounts.LoginEpilogueActivity;
import org.wordpress.android.ui.accounts.LoginMagicLinkInterceptActivity;
import org.wordpress.android.ui.accounts.login.LoginEpilogueFragment;
import org.wordpress.android.ui.accounts.signup.BaseUsernameChangerFullScreenDialogFragment;
import org.wordpress.android.ui.accounts.signup.SignupEpilogueFragment;
import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailFragment;
import org.wordpress.android.ui.activitylog.list.ActivityLogListActivity;
Expand Down Expand Up @@ -208,8 +207,6 @@ public interface AppComponent extends AndroidInjector<WordPress> {

void inject(SignupEpilogueFragment object);

void inject(BaseUsernameChangerFullScreenDialogFragment object);

void inject(SiteCreationActivity object);

void inject(SiteCreationSegmentsFragment object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import androidx.lifecycle.LiveData;

import org.wordpress.android.ui.CommentFullScreenDialogFragment;
import org.wordpress.android.ui.accounts.signup.UsernameChangerFullScreenDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.CountryPickerDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.StatePickerDialogFragment;
import org.wordpress.android.ui.news.LocalNewsService;
Expand All @@ -18,8 +19,8 @@
import org.wordpress.android.ui.stats.refresh.lists.detail.StatsDetailFragment;
import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetColorSelectionDialogFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetDataTypeSelectionDialogFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetConfigureFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetDataTypeSelectionDialogFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.configuration.StatsWidgetSiteSelectionDialogFragment;
import org.wordpress.android.ui.stats.refresh.lists.widget.minified.StatsMinifiedWidgetConfigureFragment;
import org.wordpress.android.util.wizard.WizardManager;
Expand Down Expand Up @@ -81,8 +82,11 @@ public static NewsService provideLocalNewsService(Context context) {
@ContributesAndroidInjector
abstract CommentFullScreenDialogFragment contributecommentFullScreenDialogFragment();

abstract UsernameChangerFullScreenDialogFragment contributeUpUsernameChangerFullScreenDialogFragment();

@Provides
public static WizardManager<SiteCreationStep> provideWizardManager(SiteCreationStepsProvider stepsProvider) {
public static WizardManager<SiteCreationStep> provideWizardManager(
SiteCreationStepsProvider stepsProvider) {
return new WizardManager<>(stepsProvider.getSteps());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
Expand All @@ -28,7 +27,6 @@
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.wordpress.android.R;
import org.wordpress.android.WordPress;
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.analytics.AnalyticsTracker.Stat;
import org.wordpress.android.fluxc.Dispatcher;
Expand All @@ -48,11 +46,13 @@

import javax.inject.Inject;

import dagger.android.support.DaggerFragment;

/**
* Created so that the base suggestions functionality can become shareable as similar functionality is being used in the
* the Account settings & sign-up flow to change the username.
*/
public abstract class BaseUsernameChangerFullScreenDialogFragment extends Fragment implements
public abstract class BaseUsernameChangerFullScreenDialogFragment extends DaggerFragment implements
FullScreenDialogContent, OnUsernameSelectedListener {
private ProgressBar mProgressBar;

Expand Down Expand Up @@ -115,12 +115,6 @@ protected static Bundle newBundle(String displayName, String username) {
return bundle;
}

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((WordPress) getActivity().getApplication()).component().inject(this);
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
Expand Down