mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
move 'password and account' to advanced, together with folder settings
This commit is contained in:
@@ -82,19 +82,6 @@
|
||||
android:text="@string/pref_who_can_see_profile_explain"
|
||||
android:textColor="@color/gray50" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password_account_settings_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/pref_password_and_account_settings"
|
||||
android:textColor="@color/delta_accent"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.MediaKeyboard
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/emoji_drawer"
|
||||
|
||||
@@ -82,7 +82,10 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_password_and_account_settings">
|
||||
<PreferenceCategory android:title="@string/manual_account_setup_option">
|
||||
|
||||
<Preference android:key="password_account_settings_button"
|
||||
android:title="@string/pref_password_and_account_settings"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
import org.thoughtcrime.securesms.profiles.ProfileMediaConstraints;
|
||||
import org.thoughtcrime.securesms.scribbles.ScribbleActivity;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.ScreenLockUtil;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -162,18 +161,9 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
|
||||
case Crop.REQUEST_CROP:
|
||||
setAvatarView(Crop.getOutput(data));
|
||||
break;
|
||||
|
||||
case ScreenLockUtil.REQUEST_CODE_CONFIRM_CREDENTIALS:
|
||||
openRegistrationActivity();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void openRegistrationActivity() {
|
||||
Intent intent = new Intent(this, RegistrationActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void setAvatarView(Uri output) {
|
||||
final ProfileMediaConstraints constraints = new ProfileMediaConstraints();
|
||||
GlideApp.with(this)
|
||||
@@ -208,7 +198,6 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
|
||||
}
|
||||
|
||||
private void initializeResources() {
|
||||
TextView passwordAccountSettings = ViewUtil.findById(this, R.id.password_account_settings_button);
|
||||
TextView loginSuccessText = ViewUtil.findById(this, R.id.login_success_text);
|
||||
this.avatar = ViewUtil.findById(this, R.id.avatar);
|
||||
this.name = ViewUtil.findById(this, R.id.name_text);
|
||||
@@ -216,19 +205,11 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
|
||||
this.container = ViewUtil.findById(this, R.id.container);
|
||||
this.statusView = ViewUtil.findById(this, R.id.status_text);
|
||||
|
||||
passwordAccountSettings.setOnClickListener(view -> {
|
||||
boolean result = ScreenLockUtil.applyScreenLock(this, getString(R.string.pref_password_and_account_settings), getString(R.string.enter_system_secret_to_continue), ScreenLockUtil.REQUEST_CODE_CONFIRM_CREDENTIALS);
|
||||
if (!result) {
|
||||
openRegistrationActivity();
|
||||
}
|
||||
});
|
||||
|
||||
if (fromWelcome) {
|
||||
String addr = DcHelper.get(this, "addr");
|
||||
loginSuccessText.setText(R.string.set_name_and_avatar_explain);
|
||||
ViewUtil.findById(this, R.id.status_text_layout).setVisibility(View.GONE);
|
||||
ViewUtil.findById(this, R.id.information_label).setVisibility(View.GONE);
|
||||
passwordAccountSettings.setVisibility(View.GONE);
|
||||
} else {
|
||||
loginSuccessText.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
||||
import org.thoughtcrime.securesms.ConversationActivity;
|
||||
import org.thoughtcrime.securesms.LogViewActivity;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.RegistrationActivity;
|
||||
import org.thoughtcrime.securesms.connect.DcEventCenter;
|
||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.mms.AttachmentManager;
|
||||
@@ -197,6 +198,15 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
|
||||
return true;
|
||||
}));
|
||||
|
||||
Preference passwordAndAccount = this.findPreference("password_account_settings_button");
|
||||
passwordAndAccount.setOnPreferenceClickListener(((preference) -> {
|
||||
boolean result = ScreenLockUtil.applyScreenLock(getActivity(), getString(R.string.pref_password_and_account_settings), getString(R.string.enter_system_secret_to_continue), REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT);
|
||||
if (!result) {
|
||||
openRegistrationActivity();
|
||||
}
|
||||
return true;
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -241,6 +251,8 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (requestCode == REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT) {
|
||||
openRegistrationActivity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,6 +330,11 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
private void openRegistrationActivity() {
|
||||
Intent intent = new Intent(getActivity(), RegistrationActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
* Autocrypt
|
||||
**********************************************************************************************/
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Map;
|
||||
public abstract class ListSummaryPreferenceFragment extends CorrectedPreferenceFragment implements DcEventCenter.DcEventDelegate {
|
||||
protected static final int REQUEST_CODE_CONFIRM_CREDENTIALS_BACKUP = ScreenLockUtil.REQUEST_CODE_CONFIRM_CREDENTIALS + 1;
|
||||
protected static final int REQUEST_CODE_CONFIRM_CREDENTIALS_KEYS = REQUEST_CODE_CONFIRM_CREDENTIALS_BACKUP + 1;
|
||||
protected static final int REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT = REQUEST_CODE_CONFIRM_CREDENTIALS_KEYS + 1;
|
||||
protected DcContext dcContext;
|
||||
private NotificationController notificationController;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user