Skip to content
Snippets Groups Projects
Commit e78e62d9 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

rename some classes to Jami

Change-Id: Ie0c877642374df1ee8cf756ef9e89108b5865544
parent 77cfcae7
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ public class HomeAccountCreationFragment extends BaseSupportFragment<HomeAccount
@Override
public void goToAccountCreation() {
AccountCreationModelImpl ringAccountViewModel = new AccountCreationModelImpl();
Fragment fragment = RingAccountCreationFragment.newInstance(ringAccountViewModel);
Fragment fragment = JamiAccountCreationFragment.newInstance(ringAccountViewModel);
replaceFragmentWithSlide(fragment, R.id.wizard_container);
}
......
......@@ -50,8 +50,8 @@ import cx.ring.mvp.AccountCreationModel;
import cx.ring.mvp.BaseSupportFragment;
import cx.ring.utils.RegisteredNameFilter;
public class RingAccountCreationFragment extends BaseSupportFragment<RingAccountCreationPresenter>
implements RingAccountCreationView {
public class JamiAccountCreationFragment extends BaseSupportFragment<JamiAccountCreationPresenter>
implements JamiAccountCreationView {
@BindView(R.id.switch_ring_username)
protected Switch mUsernameSwitch;
......@@ -91,8 +91,8 @@ public class RingAccountCreationFragment extends BaseSupportFragment<RingAccount
private AccountCreationModel model;
public static RingAccountCreationFragment newInstance(AccountCreationModelImpl ringAccountViewModel) {
RingAccountCreationFragment fragment = new RingAccountCreationFragment();
public static JamiAccountCreationFragment newInstance(AccountCreationModelImpl ringAccountViewModel) {
JamiAccountCreationFragment fragment = new JamiAccountCreationFragment();
fragment.model = ringAccountViewModel;
return fragment;
}
......
......@@ -27,7 +27,7 @@ import cx.ring.account.HomeAccountCreationFragment;
import cx.ring.account.JamiAccountConnectFragment;
import cx.ring.account.ProfileCreationFragment;
import cx.ring.account.RegisterNameDialog;
import cx.ring.account.RingAccountCreationFragment;
import cx.ring.account.JamiAccountCreationFragment;
import cx.ring.account.RingAccountSummaryFragment;
import cx.ring.account.RingLinkAccountFragment;
import cx.ring.application.JamiApplication;
......@@ -75,7 +75,7 @@ import cx.ring.tv.account.TVAccountWizard;
import cx.ring.tv.account.TVHomeAccountCreationFragment;
import cx.ring.tv.account.TVProfileCreationFragment;
import cx.ring.tv.account.TVProfileEditingFragment;
import cx.ring.tv.account.TVRingAccountCreationFragment;
import cx.ring.tv.account.TVJamiAccountCreationFragment;
import cx.ring.tv.account.TVRingLinkAccountFragment;
import cx.ring.tv.account.TVSettingsFragment;
import cx.ring.tv.account.TVShareFragment;
......@@ -119,7 +119,7 @@ public interface JamiInjectionComponent {
void inject(ConversationSelectionActivity fragment);
void inject(RingAccountCreationFragment fragment);
void inject(JamiAccountCreationFragment fragment);
void inject(MediaPreferenceFragment fragment);
......@@ -198,7 +198,7 @@ public interface JamiInjectionComponent {
void inject(TVProfileCreationFragment fragment);
void inject(TVRingAccountCreationFragment fragment);
void inject(TVJamiAccountCreationFragment fragment);
void inject(TVRingLinkAccountFragment fragment);
......
......@@ -35,7 +35,7 @@ import androidx.fragment.app.Fragment;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cx.ring.R;
import cx.ring.account.RingAccountCreationFragment;
import cx.ring.account.JamiAccountCreationFragment;
import cx.ring.application.JamiApplication;
import cx.ring.dependencyinjection.JamiInjectionComponent;
import cx.ring.model.Error;
......@@ -118,16 +118,16 @@ public abstract class BaseSupportFragment<T extends RootPresenter> extends Fragm
.beginTransaction()
.setCustomAnimations(R.anim.slide_in_right,
R.anim.slide_out_left, R.anim.slide_in_left, R.anim.slide_out_right)
.replace(content, fragment, RingAccountCreationFragment.TAG)
.addToBackStack(RingAccountCreationFragment.TAG)
.replace(content, fragment, JamiAccountCreationFragment.TAG)
.addToBackStack(JamiAccountCreationFragment.TAG)
.commit();
}
protected void replaceFragment(Fragment fragment, @IdRes int content) {
getFragmentManager()
.beginTransaction()
.replace(content, fragment, RingAccountCreationFragment.TAG)
.addToBackStack(RingAccountCreationFragment.TAG)
.replace(content, fragment, JamiAccountCreationFragment.TAG)
.addToBackStack(JamiAccountCreationFragment.TAG)
.commit();
}
}
......@@ -51,7 +51,7 @@ public class TVHomeAccountCreationFragment
public void goToAccountCreation() {
AccountCreationModelImpl ringAccountViewModel = new AccountCreationModelImpl();
ringAccountViewModel.setLink(false);
GuidedStepSupportFragment.add(getFragmentManager(), TVRingAccountCreationFragment.newInstance(ringAccountViewModel));
GuidedStepSupportFragment.add(getFragmentManager(), TVJamiAccountCreationFragment.newInstance(ringAccountViewModel));
}
@Override
......
......@@ -33,18 +33,18 @@ import java.util.List;
import cx.ring.R;
import cx.ring.account.AccountCreationModelImpl;
import cx.ring.account.RingAccountCreationPresenter;
import cx.ring.account.RingAccountCreationView;
import cx.ring.account.JamiAccountCreationPresenter;
import cx.ring.account.JamiAccountCreationView;
import cx.ring.application.JamiApplication;
import cx.ring.mvp.AccountCreationModel;
import cx.ring.utils.Log;
import cx.ring.utils.StringUtils;
public class TVRingAccountCreationFragment
extends RingGuidedStepFragment<RingAccountCreationPresenter>
implements RingAccountCreationView {
public class TVJamiAccountCreationFragment
extends RingGuidedStepFragment<JamiAccountCreationPresenter>
implements JamiAccountCreationView {
private static final String TAG = TVRingAccountCreationFragment.class.getSimpleName();
private static final String TAG = TVJamiAccountCreationFragment.class.getSimpleName();
private static final int USERNAME = 0;
private static final int PASSWORD = 1;
private static final int PASSWORD_CONFIRMATION = 2;
......@@ -73,11 +73,11 @@ public class TVRingAccountCreationFragment
}
};
public TVRingAccountCreationFragment() {
public TVJamiAccountCreationFragment() {
}
public static TVRingAccountCreationFragment newInstance(AccountCreationModelImpl ringAccountViewModel) {
TVRingAccountCreationFragment fragment = new TVRingAccountCreationFragment();
public static TVJamiAccountCreationFragment newInstance(AccountCreationModelImpl ringAccountViewModel) {
TVJamiAccountCreationFragment fragment = new TVJamiAccountCreationFragment();
fragment.model = ringAccountViewModel;
return fragment;
}
......
......@@ -31,9 +31,9 @@ import cx.ring.services.AccountService;
import io.reactivex.Scheduler;
import io.reactivex.subjects.PublishSubject;
public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreationView> {
public class JamiAccountCreationPresenter extends RootPresenter<JamiAccountCreationView> {
public static final String TAG = RingAccountCreationPresenter.class.getSimpleName();
public static final String TAG = JamiAccountCreationPresenter.class.getSimpleName();
private static final int PASSWORD_MIN_LENGTH = 6;
private static final long TYPING_DELAY = 350L;
private final PublishSubject<String> contactQuery = PublishSubject.create();
......@@ -50,12 +50,12 @@ public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreat
private String mPasswordConfirm = "";
@Inject
public RingAccountCreationPresenter(AccountService accountService) {
public JamiAccountCreationPresenter(AccountService accountService) {
this.mAccountService = accountService;
}
@Override
public void bindView(RingAccountCreationView view) {
public void bindView(JamiAccountCreationView view) {
super.bindView(view);
mCompositeDisposable.add(contactQuery
.debounce(TYPING_DELAY, TimeUnit.MILLISECONDS)
......@@ -79,14 +79,15 @@ public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreat
* @param userName
*/
public void userNameChanged(String userName) {
if (mAccountCreationModel != null)
mAccountCreationModel.setUsername(userName);
contactQuery.onNext(userName);
isRingUserNameCorrect = false;
RingAccountCreationView view = getView();
if (startUsernameAvailabitlityProgressBarAnimation) {
view.updateUsernameAvailability(RingAccountCreationView.
UsernameAvailabilityStatus.LOADING);
JamiAccountCreationView view = getView();
if (view != null)
view.updateUsernameAvailability(JamiAccountCreationView.UsernameAvailabilityStatus.LOADING);
startUsernameAvailabitlityProgressBarAnimation = false;
}
}
......@@ -135,7 +136,7 @@ public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreat
public void createAccount() {
if (isInputValid()) {
RingAccountCreationView view = getView();
JamiAccountCreationView view = getView();
view.enableNextButton(false);
view.goToAccountCreation(mAccountCreationModel);
}
......@@ -151,12 +152,12 @@ public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreat
boolean valid = isInputValid();
getView().enableNextButton(valid);
if(valid && isRingUserNameCorrect)
getView().updateUsernameAvailability(RingAccountCreationView.
getView().updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.AVAILABLE);
}
private void handleBlockchainResult(String name, String address, int state) {
RingAccountCreationView view = getView();
JamiAccountCreationView view = getView();
//Once we get the result, we can show the loading animation again when the user types
startUsernameAvailabitlityProgressBarAnimation = true;
if (view == null) {
......@@ -164,33 +165,33 @@ public class RingAccountCreationPresenter extends RootPresenter<RingAccountCreat
}
if (name == null || name.isEmpty()) {
view.updateUsernameAvailability(RingAccountCreationView.
view.updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.RESET);
isRingUserNameCorrect = false;
} else {
switch (state) {
case 0:
// on found
view.updateUsernameAvailability(RingAccountCreationView.
view.updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.ERROR_USERNAME_TAKEN);
isRingUserNameCorrect = false;
break;
case 1:
// invalid name
view.updateUsernameAvailability(RingAccountCreationView.
view.updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.ERROR_USERNAME_INVALID);
isRingUserNameCorrect = false;
break;
case 2:
// available
view.updateUsernameAvailability(RingAccountCreationView.
view.updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.AVAILABLE);
mAccountCreationModel.setUsername(name);
isRingUserNameCorrect = true;
break;
default:
// on error
view.updateUsernameAvailability(RingAccountCreationView.
view.updateUsernameAvailability(JamiAccountCreationView.
UsernameAvailabilityStatus.ERROR);
isRingUserNameCorrect = false;
break;
......
......@@ -21,7 +21,7 @@ package cx.ring.account;
import cx.ring.mvp.AccountCreationModel;
public interface RingAccountCreationView {
public interface JamiAccountCreationView {
enum UsernameAvailabilityStatus {
ERROR_USERNAME_TAKEN,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment