Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
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

This file was deleted.

2 changes: 0 additions & 2 deletions WordPress/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
tools:replace="android:name,android:supportsRtl"
android:name=".WordPressDebug"
android:supportsRtl="true">
<activity
android:name="androidx.fragment.app.FragmentActivity"/>
</application>

<!--
Expand Down
7 changes: 0 additions & 7 deletions WordPress/src/main/java/org/wordpress/android/WordPress.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.webkit.WebSettings;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Lifecycle;
Expand Down Expand Up @@ -736,12 +735,6 @@ public AndroidInjector<Service> serviceInjector() {
return mSupportFragmentInjector;
}

@VisibleForTesting
public void setSupportFragmentInjector(
DispatchingAndroidInjector<Fragment> supportFragmentInjector) {
mSupportFragmentInjector = supportFragmentInjector;
}

@OnLifecycleEvent(Lifecycle.Event.ON_START)
void onAppComesFromBackground() {
mApplicationLifecycleMonitor.onAppComesFromBackground();
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.SettingsUsernameChangerFragment;
import org.wordpress.android.ui.accounts.signup.UsernameChangerFullScreenDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.CountryPickerDialogFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment.StatePickerDialogFragment;
Expand Down Expand Up @@ -83,7 +84,10 @@ public static NewsService provideLocalNewsService(Context context) {
abstract CommentFullScreenDialogFragment contributecommentFullScreenDialogFragment();

@ContributesAndroidInjector
abstract UsernameChangerFullScreenDialogFragment contributeUpUsernameChangerFullScreenDialogFragment();
abstract UsernameChangerFullScreenDialogFragment contributeUsernameChangerFullScreenDialogFragment();

@ContributesAndroidInjector
abstract SettingsUsernameChangerFragment contributeSettingsUsernameChangerFragment();

@Provides
public static WizardManager<SiteCreationStep> provideWizardManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ public class FullScreenDialogFragment extends DialogFragment {
private OnConfirmListener mOnConfirmListener;
private OnDismissListener mOnDismissListener;
private String mAction;
private MenuItem mActionItem;
private String mSubtitle;
private String mTitle;
private Toolbar mToolbar;
private boolean mHideActivityBar;
private boolean mDismissAfterConfirm;
private int mToolbarColor;

private static final String ARG_ACTION = "ARG_ACTION";
private static final String ARG_HIDE_ACTIVITY_BAR = "ARG_HIDE_ACTIVITY_BAR";
private static final String ARG_DISMISS_AFTER_CONFIRM = "ARG_DISMISS_AFTER_CONFIRM";
private static final String ARG_SUBTITLE = "ARG_SUBTITLE";
private static final String ARG_TITLE = "ARG_TITLE";
private static final String ARG_TOOLBAR_COLOR = "ARG_TOOLBAR_COLOR";
Expand All @@ -72,6 +71,8 @@ public interface FullScreenDialogController {
void confirm(@Nullable Bundle result);

void dismiss();

void setActionEnabled(boolean enabled);
}

public interface OnConfirmListener {
Expand All @@ -89,7 +90,6 @@ protected static FullScreenDialogFragment newInstance(Builder builder) {
dialog.setOnConfirmListener(builder.mOnConfirmListener);
dialog.setOnDismissListener(builder.mOnDismissListener);
dialog.setHideActivityBar(builder.mHideActivityBar);
dialog.setDismissAfterConfirm(builder.mDismissAfterConfirm);
return dialog;
}

Expand All @@ -100,7 +100,6 @@ private static Bundle setArguments(Builder builder) {
bundle.putString(ARG_SUBTITLE, builder.mSubtitle);
bundle.putInt(ARG_TOOLBAR_COLOR, builder.mToolbarColor);
bundle.putBoolean(ARG_HIDE_ACTIVITY_BAR, builder.mHideActivityBar);
bundle.putBoolean(ARG_DISMISS_AFTER_CONFIRM, builder.mDismissAfterConfirm);
return bundle;
}

Expand All @@ -112,7 +111,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
getChildFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.full_screen_dialog_fragment_none, 0, 0,
R.anim.full_screen_dialog_fragment_none)
R.anim.full_screen_dialog_fragment_none)
.add(R.id.full_screen_dialog_fragment_content, mFragment)
.commitNow();
}
Expand All @@ -136,6 +135,12 @@ public void confirm(@Nullable Bundle result) {
public void dismiss() {
FullScreenDialogFragment.this.dismiss();
}

@Override public void setActionEnabled(boolean enabled) {
if (mActionItem != null) {
mActionItem.setEnabled(enabled);
}
}
};
}

Expand Down Expand Up @@ -202,7 +207,7 @@ public void show(FragmentManager manager, String tag) {
public int show(FragmentTransaction transaction, String tag) {
initBuilderArguments();
transaction.setCustomAnimations(R.anim.full_screen_dialog_fragment_slide_up, 0, 0,
R.anim.full_screen_dialog_fragment_slide_down);
R.anim.full_screen_dialog_fragment_slide_down);
return transaction.add(android.R.id.content, this, tag).addToBackStack(null).commit();
}

Expand All @@ -211,9 +216,7 @@ protected void confirm(Bundle result) {
mOnConfirmListener.onConfirm(result);
}

if (mDismissAfterConfirm) {
dismiss();
}
dismiss();
}

/**
Expand Down Expand Up @@ -250,7 +253,6 @@ private void initBuilderArguments() {
mSubtitle = bundle.getString(ARG_SUBTITLE);
mToolbarColor = bundle.getInt(ARG_TOOLBAR_COLOR);
mHideActivityBar = bundle.getBoolean(ARG_HIDE_ACTIVITY_BAR);
mDismissAfterConfirm = bundle.getBoolean(ARG_DISMISS_AFTER_CONFIRM);
}

/**
Expand All @@ -275,9 +277,9 @@ public void onClick(View view) {

if (!mAction.isEmpty()) {
Menu menu = mToolbar.getMenu();
MenuItem action = menu.add(0, ID_ACTION, 0, this.mAction);
action.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
action.setOnMenuItemClickListener(
mActionItem = menu.add(0, ID_ACTION, 0, this.mAction);
mActionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
mActionItem.setOnMenuItemClickListener(
new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Expand Down Expand Up @@ -373,15 +375,6 @@ public void setSubtitle(@StringRes int textId) {
}
}

/**
* Set flag to dismiss fragment after confirm action is clicked.
*
* @param dismissAfterConfirm boolean to dismiss after confirm click.
*/
public void setDismissAfterConfirm(boolean dismissAfterConfirm) {
mDismissAfterConfirm = dismissAfterConfirm;
}

/**
* Set theme background for {@link FullScreenDialogFragment} view.
*
Expand Down Expand Up @@ -428,7 +421,6 @@ public static class Builder {
String mSubtitle = "";
String mTitle = "";
boolean mHideActivityBar = false;
boolean mDismissAfterConfirm = true;
int mToolbarColor = R.color.primary;

/**
Expand Down Expand Up @@ -472,11 +464,11 @@ public Builder setAction(@StringRes int textId) {
/**
* Set {@link Fragment} to be added as dialog, which must implement {@link FullScreenDialogContent}.
*
* @param contentClass Fragment class to be instantiated
* @param contentClass Fragment class to be instantiated
* @param contentArguments arguments to be added to Fragment
* @return {@link Builder} object to allow for chaining of calls to set methods
* @throws IllegalArgumentException if content class does not implement
* {@link FullScreenDialogContent} interface
* {@link FullScreenDialogContent} interface
*/
public Builder setContent(Class<? extends Fragment> contentClass, @Nullable Bundle contentArguments) {
if (!FullScreenDialogContent.class.isAssignableFrom(contentClass)) {
Expand All @@ -500,17 +492,6 @@ public Builder setHideActivityBar(boolean hide) {
return this;
}

/**
* Set flag to dismiss the fragment after confirm action is clicked.
*
* @param dismiss boolean to dismiss the fragment after confirm click.
* @return {@link Builder} object to allow for chaining of calls to set methods
*/
public Builder setDismissAferConfirm(boolean dismiss) {
this.mDismissAfterConfirm = dismiss;
return this;
}

/**
* Set {@link FullScreenDialogFragment} subtitle text.
*
Expand Down
Loading