Change profile preference screen to use toolbar.
This commit is contained in:
parent
5221b6fb43
commit
e3878ffde7
5 changed files with 12 additions and 6 deletions
|
@ -19,7 +19,7 @@ public class EditProfileActivity extends BaseActionBarActivity implements EditPr
|
|||
public static final String EXCLUDE_SYSTEM = "exclude_system";
|
||||
public static final String DISPLAY_USERNAME = "display_username";
|
||||
public static final String NEXT_BUTTON_TEXT = "next_button_text";
|
||||
public static final String SHOW_BACK_ARROW = "show_back_arrow";
|
||||
public static final String SHOW_TOOLBAR = "show_back_arrow";
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicRegistrationTheme();
|
||||
|
||||
|
|
|
@ -53,13 +53,14 @@ import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.DISPL
|
|||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.EXCLUDE_SYSTEM;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_BUTTON_TEXT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_INTENT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.SHOW_BACK_ARROW;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.SHOW_TOOLBAR;
|
||||
|
||||
public class EditProfileFragment extends Fragment {
|
||||
|
||||
private static final String TAG = Log.tag(EditProfileFragment.class);
|
||||
|
||||
private Toolbar toolbar;
|
||||
private View title;
|
||||
private ImageView avatar;
|
||||
private CircularProgressButton finishButton;
|
||||
private EditText givenName;
|
||||
|
@ -191,6 +192,7 @@ public class EditProfileFragment extends Fragment {
|
|||
Bundle arguments = requireArguments();
|
||||
|
||||
this.toolbar = view.findViewById(R.id.toolbar);
|
||||
this.title = view.findViewById(R.id.title);
|
||||
this.avatar = view.findViewById(R.id.avatar);
|
||||
this.givenName = view.findViewById(R.id.given_name);
|
||||
this.familyName = view.findViewById(R.id.family_name);
|
||||
|
@ -236,9 +238,10 @@ public class EditProfileFragment extends Fragment {
|
|||
Navigation.findNavController(v).navigate(action);
|
||||
});
|
||||
|
||||
if (arguments.getBoolean(SHOW_BACK_ARROW, true)) {
|
||||
if (arguments.getBoolean(SHOW_TOOLBAR, true)) {
|
||||
this.toolbar.setVisibility(View.VISIBLE);
|
||||
this.toolbar.setNavigationOnClickListener(v -> requireActivity().finish());
|
||||
this.title.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public final class RegistrationCompleteFragment extends BaseRegistrationFragment
|
|||
if (!isReregister()) {
|
||||
Intent setProfileNameIntent = getRoutedIntent(activity, EditProfileActivity.class, new Intent(activity, MainActivity.class));
|
||||
|
||||
setProfileNameIntent.putExtra(EditProfileActivity.SHOW_BACK_ARROW, false);
|
||||
setProfileNameIntent.putExtra(EditProfileActivity.SHOW_TOOLBAR, false);
|
||||
|
||||
activity.startActivity(setProfileNameIntent);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navigationIcon="@drawable/ic_arrow_left_24" />
|
||||
app:navigationIcon="@drawable/ic_arrow_left_24"
|
||||
app:title="@string/CreateProfileActivity__profile" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
@ -58,7 +59,8 @@
|
|||
android:tint="@color/core_grey_05"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
app:layout_goneMarginTop="?attr/actionBarSize" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar_placeholder"
|
||||
|
|
|
@ -312,6 +312,7 @@
|
|||
<string name="ConversationTitleView_verified">Verified</string>
|
||||
|
||||
<!-- CreateProfileActivity -->
|
||||
<string name="CreateProfileActivity__profile">Profile</string>
|
||||
<string name="CreateProfileActivity_error_setting_profile_photo">Error setting profile photo</string>
|
||||
<string name="CreateProfileActivity_problem_setting_profile">Problem setting profile</string>
|
||||
<string name="CreateProfileActivity_profile_photo">Profile photo</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue