modified welcome screen

This commit is contained in:
Christian S 2016-04-21 21:06:32 +02:00
parent f7c700880a
commit e5fef315b4
4 changed files with 6 additions and 52 deletions

View file

@ -62,13 +62,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
private AutoCompleteTextView mAccountJid;
private EditText mPassword;
private EditText mPasswordConfirm;
private CheckBox mRegisterNew;
private Button mCancelButton;
private Button mSaveButton;
private Button mDisableBatterOptimizations;
private TableLayout mMoreTable;
private LinearLayout mStats;
private RelativeLayout mBatteryOptimizations;
private TextView mServerInfoSm;
@ -174,20 +172,12 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
return;
}
final String password = mPassword.getText().toString();
final String passwordConfirm = mPasswordConfirm.getText().toString();
if (registerNewAccount) {
if (!password.equals(passwordConfirm)) {
mPasswordConfirm.setError(getString(R.string.passwords_do_not_match));
mPasswordConfirm.requestFocus();
return;
}
}
if (mAccount != null) {
mAccount.setJid(jid);
mAccount.setPort(numericPort);
mAccount.setHostname(hostname);
mAccountJid.setError(null);
mPasswordConfirm.setError(null);
mAccount.setPassword(password);
mAccount.setOption(Account.OPTION_REGISTER, registerNewAccount);
xmppConnectionService.updateAccount(mAccount);
@ -400,7 +390,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
}
this.mPassword = (EditText) findViewById(R.id.account_password);
this.mPassword.addTextChangedListener(this.mTextWatcher);
this.mPasswordConfirm = (EditText) findViewById(R.id.account_password_confirm);
this.mAvatar = (ImageView) findViewById(R.id.avater);
this.mAvatar.setOnClickListener(this.mAvatarClickListener);
this.mRegisterNew = (CheckBox) findViewById(R.id.account_register_new);
@ -447,19 +436,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
this.mSaveButton.setOnClickListener(this.mSaveButtonClickListener);
this.mCancelButton.setOnClickListener(this.mCancelButtonClickListener);
this.mMoreTable = (TableLayout) findViewById(R.id.server_info_more);
final OnCheckedChangeListener OnCheckedShowConfirmPassword = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView,
final boolean isChecked) {
if (isChecked) {
mPasswordConfirm.setVisibility(View.VISIBLE);
} else {
mPasswordConfirm.setVisibility(View.GONE);
}
updateSaveButton();
}
};
this.mRegisterNew.setOnCheckedChangeListener(OnCheckedShowConfirmPassword);
if (Config.DISALLOW_REGISTRATION_IN_UI) {
this.mRegisterNew.setVisibility(View.GONE);
}
@ -628,7 +605,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
mAccountJid.setEnabled(!Config.LOCK_SETTINGS);
mHostname.setEnabled(!Config.LOCK_SETTINGS);
mPort.setEnabled(!Config.LOCK_SETTINGS);
mPasswordConfirm.setEnabled(!Config.LOCK_SETTINGS);
mRegisterNew.setEnabled(!Config.LOCK_SETTINGS);
if (!mInitMode) {
@ -640,7 +616,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) {
this.mRegisterNew.setVisibility(View.VISIBLE);
this.mRegisterNew.setChecked(true);
this.mPasswordConfirm.setText(this.mAccount.getPassword());
} else {
this.mRegisterNew.setVisibility(View.GONE);
this.mRegisterNew.setChecked(false);

View file

@ -23,7 +23,7 @@ public class WelcomeActivity extends Activity {
startActivity(intent);
}
});
final Button useOwnProvider = (Button) findViewById(R.id.use_own_provider);
final Button useOwnProvider = (Button) findViewById(R.id.use_existing_account);
useOwnProvider.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -82,7 +82,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:inputType="textPassword"
android:inputType="text"
android:textColor="@color/black87"
android:textColorHint="@color/black54"
android:textSize="?attr/TextSizeBody" />
@ -153,27 +153,6 @@
android:text="@string/register_account"
android:textColor="@color/black87"
android:textSize="?attr/TextSizeBody" />
<TextView
android:id="@+id/account_confirm_password_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/account_settings_confirm_password"
android:textColor="@color/black87"
android:textSize="?attr/TextSizeBody"
android:visibility="gone" />
<EditText
android:id="@+id/account_password_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="@string/confirm_password"
android:inputType="textPassword"
android:textColor="@color/black87"
android:textColorHint="@color/black54"
android:textSize="?attr/TextSizeBody"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>

View file

@ -43,12 +43,12 @@ android:background="@color/grey50">
android:text="@string/create_account"
android:textColor="@color/accent"/>
<Button
android:id="@+id/use_own_provider"
android:id="@+id/use_existing_account"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/use_own_provider"
android:text="@string/use_existing_accout"
android:textColor="@color/black54"/>
</LinearLayout>
<RelativeLayout