Add edit profile in main settings
This commit is contained in:
parent
13d8876626
commit
94c3dbcf25
|
@ -1064,11 +1064,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public void redrawPinned(List<MastodonList> mastodonLists) {
|
||||
int currentItem = binding.viewPager.getCurrentItem();
|
||||
new ViewModelProvider(BaseMainActivity.this).get(TopBarVM.class).getDBPinned()
|
||||
|
|
|
@ -16,6 +16,7 @@ package app.fedilab.android.activities;
|
|||
|
||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
@ -62,6 +63,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
}
|
||||
canGoBack = false;
|
||||
|
||||
binding.setAccount.setOnClickListener(v -> displaySettings(SettingsEnum.ACCOUNT));
|
||||
binding.setTimelines.setOnClickListener(v -> displaySettings(SettingsEnum.TIMELINES));
|
||||
binding.setNotifications.setOnClickListener(v -> displaySettings(SettingsEnum.NOTIFICATIONS));
|
||||
binding.setInterface.setOnClickListener(v -> displaySettings(SettingsEnum.INTERFACE));
|
||||
|
@ -79,6 +81,10 @@ public class SettingsActivity extends BaseActivity {
|
|||
|
||||
public void displaySettings(SettingsEnum settingsEnum) {
|
||||
|
||||
if (settingsEnum == SettingsEnum.ACCOUNT) {
|
||||
Intent intent = new Intent(SettingsActivity.this, EditProfileActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
FragmentTransaction fragmentTransaction =
|
||||
|
@ -135,6 +141,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
fragmentTransaction.commit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -168,6 +175,8 @@ public class SettingsActivity extends BaseActivity {
|
|||
|
||||
|
||||
public enum SettingsEnum {
|
||||
@SerializedName("ACCOUNT")
|
||||
ACCOUNT("ACCOUNT"),
|
||||
@SerializedName("TIMELINES")
|
||||
TIMELINES("TIMELINES"),
|
||||
@SerializedName("NOTIFICATIONS")
|
||||
|
|
|
@ -16,12 +16,27 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/set_account"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp"
|
||||
android:text="@string/account"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
app:icon="@drawable/ic_baseline_navigate_next_24"
|
||||
app:iconGravity="end"
|
||||
app:iconTint="@color/cyanea_accent_dark_reference"
|
||||
app:strokeColor="@color/cyanea_accent_dark_reference" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/set_timelines"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/settings_category_label_timelines"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/cyanea_accent_dark_reference"
|
||||
|
|
Loading…
Reference in New Issue