2020-04-26 15:36:33 +02:00
|
|
|
package org.mian.gitnex.activities;
|
|
|
|
|
2021-08-02 18:59:30 +02:00
|
|
|
import android.app.Dialog;
|
|
|
|
import android.app.TimePickerDialog;
|
2020-04-26 15:36:33 +02:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.LinearLayout;
|
2021-08-02 18:59:30 +02:00
|
|
|
import android.widget.TimePicker;
|
2022-02-09 21:06:13 +01:00
|
|
|
import androidx.annotation.NonNull;
|
2021-08-02 18:59:30 +02:00
|
|
|
import androidx.fragment.app.DialogFragment;
|
2022-08-07 21:34:02 +02:00
|
|
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
2020-04-26 15:36:33 +02:00
|
|
|
import org.mian.gitnex.R;
|
2021-01-26 16:10:31 +01:00
|
|
|
import org.mian.gitnex.databinding.ActivitySettingsAppearanceBinding;
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
import org.mian.gitnex.fragments.SettingsFragment;
|
2022-04-25 07:42:52 +02:00
|
|
|
import org.mian.gitnex.helpers.AppUtil;
|
|
|
|
import org.mian.gitnex.helpers.FontsOverride;
|
2021-08-02 18:59:30 +02:00
|
|
|
import org.mian.gitnex.helpers.TinyDB;
|
2020-04-26 15:36:33 +02:00
|
|
|
import org.mian.gitnex.helpers.Toasty;
|
|
|
|
|
|
|
|
/**
|
2022-07-29 14:08:44 +02:00
|
|
|
* @author M M Arif
|
2020-04-26 15:36:33 +02:00
|
|
|
*/
|
|
|
|
public class SettingsAppearanceActivity extends BaseActivity {
|
|
|
|
|
2021-06-05 16:07:05 +02:00
|
|
|
private static String[] customFontList;
|
2020-04-26 15:36:33 +02:00
|
|
|
private static int customFontSelectedChoice = 0;
|
2021-06-05 16:07:05 +02:00
|
|
|
private static String[] themeList;
|
2020-04-26 15:36:33 +02:00
|
|
|
private static int themeSelectedChoice = 0;
|
2022-08-15 16:26:02 +02:00
|
|
|
private View.OnClickListener onClickListener;
|
2020-04-26 15:36:33 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
ActivitySettingsAppearanceBinding activitySettingsAppearanceBinding =
|
|
|
|
ActivitySettingsAppearanceBinding.inflate(getLayoutInflater());
|
2021-01-26 18:43:25 +01:00
|
|
|
setContentView(activitySettingsAppearanceBinding.getRoot());
|
2020-04-26 15:36:33 +02:00
|
|
|
|
2021-01-26 16:10:31 +01:00
|
|
|
ImageView closeActivity = activitySettingsAppearanceBinding.close;
|
2020-04-26 15:36:33 +02:00
|
|
|
|
2021-01-26 16:10:31 +01:00
|
|
|
LinearLayout customFontFrame = activitySettingsAppearanceBinding.customFontFrame;
|
|
|
|
LinearLayout themeFrame = activitySettingsAppearanceBinding.themeSelectionFrame;
|
2022-09-21 07:43:00 +02:00
|
|
|
LinearLayout lightTimeFrame =
|
|
|
|
activitySettingsAppearanceBinding.lightThemeTimeSelectionFrame;
|
2021-08-02 18:59:30 +02:00
|
|
|
LinearLayout darkTimeFrame = activitySettingsAppearanceBinding.darkThemeTimeSelectionFrame;
|
2021-01-26 16:10:31 +01:00
|
|
|
|
2021-06-05 16:07:05 +02:00
|
|
|
customFontList = getResources().getStringArray(R.array.fonts);
|
|
|
|
themeList = getResources().getStringArray(R.array.themes);
|
|
|
|
|
2020-04-26 15:36:33 +02:00
|
|
|
initCloseListener();
|
|
|
|
closeActivity.setOnClickListener(onClickListener);
|
|
|
|
|
2021-08-02 18:59:30 +02:00
|
|
|
String lightMinute = String.valueOf(tinyDB.getInt("lightThemeTimeMinute"));
|
|
|
|
String lightHour = String.valueOf(tinyDB.getInt("lightThemeTimeHour"));
|
2022-09-21 07:43:00 +02:00
|
|
|
if (lightMinute.length() == 1) {
|
2022-08-15 16:26:02 +02:00
|
|
|
lightMinute = "0" + lightMinute;
|
|
|
|
}
|
2022-09-21 07:43:00 +02:00
|
|
|
if (lightHour.length() == 1) {
|
2022-08-15 16:26:02 +02:00
|
|
|
lightHour = "0" + lightHour;
|
|
|
|
}
|
2021-08-02 18:59:30 +02:00
|
|
|
|
|
|
|
String darkMinute = String.valueOf(tinyDB.getInt("darkThemeTimeMinute"));
|
|
|
|
String darkHour = String.valueOf(tinyDB.getInt("darkThemeTimeHour"));
|
2022-09-21 07:43:00 +02:00
|
|
|
if (darkMinute.length() == 1) {
|
2022-08-15 16:26:02 +02:00
|
|
|
darkMinute = "0" + darkMinute;
|
|
|
|
}
|
2022-09-21 07:43:00 +02:00
|
|
|
if (darkHour.length() == 1) {
|
2022-08-15 16:26:02 +02:00
|
|
|
darkHour = "0" + darkHour;
|
|
|
|
}
|
2021-08-02 18:59:30 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
customFontSelectedChoice = tinyDB.getInt("customFontId", 1);
|
2022-03-27 20:47:08 +02:00
|
|
|
themeSelectedChoice = tinyDB.getInt("themeId", 6); // use system theme as default
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
activitySettingsAppearanceBinding.lightThemeSelectedTime.setText(
|
|
|
|
ctx.getResources()
|
|
|
|
.getString(R.string.settingsThemeTimeSelectedHint, lightHour, lightMinute));
|
|
|
|
activitySettingsAppearanceBinding.darkThemeSelectedTime.setText(
|
|
|
|
ctx.getResources()
|
|
|
|
.getString(R.string.settingsThemeTimeSelectedHint, darkHour, darkMinute));
|
|
|
|
activitySettingsAppearanceBinding.customFontSelected.setText(
|
|
|
|
customFontList[customFontSelectedChoice]);
|
2022-03-27 20:47:08 +02:00
|
|
|
activitySettingsAppearanceBinding.themeSelected.setText(themeList[themeSelectedChoice]);
|
2021-08-02 18:59:30 +02:00
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
if (themeList[themeSelectedChoice].startsWith("Auto")) {
|
2021-08-02 18:59:30 +02:00
|
|
|
darkTimeFrame.setVisibility(View.VISIBLE);
|
|
|
|
lightTimeFrame.setVisibility(View.VISIBLE);
|
2022-09-21 07:43:00 +02:00
|
|
|
} else {
|
2021-08-02 18:59:30 +02:00
|
|
|
darkTimeFrame.setVisibility(View.GONE);
|
|
|
|
lightTimeFrame.setVisibility(View.GONE);
|
2020-04-26 15:36:33 +02:00
|
|
|
}
|
|
|
|
|
2023-01-19 12:55:19 +01:00
|
|
|
activitySettingsAppearanceBinding.switchCounterBadge.setChecked(
|
|
|
|
tinyDB.getBoolean("enableCounterBadges", true));
|
2020-04-26 15:36:33 +02:00
|
|
|
|
|
|
|
// counter badge switcher
|
2023-01-19 12:55:19 +01:00
|
|
|
activitySettingsAppearanceBinding.switchCounterBadge.setOnCheckedChangeListener(
|
2022-09-21 07:43:00 +02:00
|
|
|
(buttonView, isChecked) -> {
|
|
|
|
tinyDB.putBoolean("enableCounterBadges", isChecked);
|
|
|
|
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
|
|
|
|
});
|
|
|
|
activitySettingsAppearanceBinding.counterBadgeFrame.setOnClickListener(
|
2023-01-19 12:55:19 +01:00
|
|
|
v ->
|
|
|
|
activitySettingsAppearanceBinding.switchCounterBadge.setChecked(
|
|
|
|
!activitySettingsAppearanceBinding.switchCounterBadge.isChecked()));
|
2020-04-26 15:36:33 +02:00
|
|
|
|
2022-03-28 19:57:47 +02:00
|
|
|
// show labels in lists(issues, pr) - default is color dots
|
2022-09-21 07:43:00 +02:00
|
|
|
activitySettingsAppearanceBinding.switchLabelsInListBadge.setChecked(
|
|
|
|
tinyDB.getBoolean("showLabelsInList", false));
|
2022-03-28 19:57:47 +02:00
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
activitySettingsAppearanceBinding.switchLabelsInListBadge.setOnCheckedChangeListener(
|
|
|
|
(buttonView, isChecked) -> {
|
|
|
|
tinyDB.putBoolean("showLabelsInList", isChecked);
|
|
|
|
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
|
|
|
|
});
|
2022-08-15 16:26:02 +02:00
|
|
|
activitySettingsAppearanceBinding.labelsInListFrame.setOnClickListener(
|
2022-09-21 07:43:00 +02:00
|
|
|
v ->
|
|
|
|
activitySettingsAppearanceBinding.switchLabelsInListBadge.setChecked(
|
|
|
|
!activitySettingsAppearanceBinding.switchLabelsInListBadge
|
|
|
|
.isChecked()));
|
2022-03-28 19:57:47 +02:00
|
|
|
|
2020-04-26 15:36:33 +02:00
|
|
|
// theme selection dialog
|
2022-09-21 07:43:00 +02:00
|
|
|
themeFrame.setOnClickListener(
|
|
|
|
view -> {
|
|
|
|
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
|
|
|
new MaterialAlertDialogBuilder(ctx)
|
|
|
|
.setTitle(R.string.themeSelectorDialogTitle)
|
|
|
|
.setSingleChoiceItems(
|
|
|
|
themeList,
|
|
|
|
themeSelectedChoice,
|
|
|
|
(dialogInterfaceTheme, i) -> {
|
|
|
|
themeSelectedChoice = i;
|
|
|
|
activitySettingsAppearanceBinding.themeSelected
|
|
|
|
.setText(themeList[i]);
|
|
|
|
tinyDB.putInt("themeId", i);
|
|
|
|
|
|
|
|
SettingsFragment.refreshParent = true;
|
|
|
|
this.recreate();
|
|
|
|
this.overridePendingTransition(0, 0);
|
|
|
|
dialogInterfaceTheme.dismiss();
|
|
|
|
Toasty.success(
|
|
|
|
appCtx,
|
|
|
|
getResources()
|
|
|
|
.getString(R.string.settingsSave));
|
|
|
|
});
|
|
|
|
|
|
|
|
materialAlertDialogBuilder.create().show();
|
2022-08-07 21:34:02 +02:00
|
|
|
});
|
2020-04-26 15:36:33 +02:00
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
lightTimeFrame.setOnClickListener(
|
|
|
|
view -> {
|
|
|
|
LightTimePicker timePicker = new LightTimePicker();
|
|
|
|
timePicker.show(getSupportFragmentManager(), "timePicker");
|
|
|
|
});
|
2021-08-02 18:59:30 +02:00
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
darkTimeFrame.setOnClickListener(
|
|
|
|
view -> {
|
|
|
|
DarkTimePicker timePicker = new DarkTimePicker();
|
|
|
|
timePicker.show(getSupportFragmentManager(), "timePicker");
|
|
|
|
});
|
2021-08-02 18:59:30 +02:00
|
|
|
|
2020-04-26 15:36:33 +02:00
|
|
|
// custom font dialog
|
2022-09-21 07:43:00 +02:00
|
|
|
customFontFrame.setOnClickListener(
|
|
|
|
view -> {
|
|
|
|
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
|
|
|
new MaterialAlertDialogBuilder(ctx)
|
|
|
|
.setTitle(R.string.settingsCustomFontSelectorDialogTitle)
|
|
|
|
.setCancelable(customFontSelectedChoice != -1)
|
|
|
|
.setSingleChoiceItems(
|
|
|
|
customFontList,
|
|
|
|
customFontSelectedChoice,
|
|
|
|
(dialogInterfaceCustomFont, i) -> {
|
|
|
|
customFontSelectedChoice = i;
|
|
|
|
activitySettingsAppearanceBinding.customFontSelected
|
|
|
|
.setText(customFontList[i]);
|
|
|
|
tinyDB.putInt("customFontId", i);
|
|
|
|
AppUtil.typeface = null; // reset typeface
|
|
|
|
FontsOverride.setDefaultFont(this);
|
|
|
|
|
|
|
|
SettingsFragment.refreshParent = true;
|
|
|
|
this.recreate();
|
|
|
|
this.overridePendingTransition(0, 0);
|
|
|
|
dialogInterfaceCustomFont.dismiss();
|
|
|
|
Toasty.success(
|
|
|
|
appCtx,
|
|
|
|
appCtx.getResources()
|
|
|
|
.getString(R.string.settingsSave));
|
|
|
|
});
|
|
|
|
|
|
|
|
materialAlertDialogBuilder.create().show();
|
2022-08-07 21:34:02 +02:00
|
|
|
});
|
2020-04-26 15:36:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private void initCloseListener() {
|
2020-08-06 17:16:51 +02:00
|
|
|
onClickListener = view -> finish();
|
2020-04-26 15:36:33 +02:00
|
|
|
}
|
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
public static class LightTimePicker extends DialogFragment
|
|
|
|
implements TimePickerDialog.OnTimeSetListener {
|
2021-08-02 18:59:30 +02:00
|
|
|
|
|
|
|
TinyDB db = TinyDB.getInstance(getContext());
|
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
@NonNull @Override
|
2021-08-02 18:59:30 +02:00
|
|
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
|
|
|
int hour = db.getInt("lightThemeTimeHour");
|
|
|
|
int minute = db.getInt("lightThemeTimeMinute");
|
|
|
|
|
|
|
|
return new TimePickerDialog(getActivity(), this, hour, minute, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
|
|
|
db.putInt("lightThemeTimeHour", hourOfDay);
|
|
|
|
db.putInt("lightThemeTimeMinute", minute);
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
SettingsFragment.refreshParent = true;
|
2021-08-02 18:59:30 +02:00
|
|
|
requireActivity().overridePendingTransition(0, 0);
|
|
|
|
this.dismiss();
|
2022-09-21 07:43:00 +02:00
|
|
|
Toasty.success(
|
|
|
|
requireActivity().getApplicationContext(),
|
|
|
|
requireContext().getResources().getString(R.string.settingsSave));
|
2021-08-02 18:59:30 +02:00
|
|
|
requireActivity().recreate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
public static class DarkTimePicker extends DialogFragment
|
|
|
|
implements TimePickerDialog.OnTimeSetListener {
|
2021-08-02 18:59:30 +02:00
|
|
|
|
|
|
|
TinyDB db = TinyDB.getInstance(getContext());
|
|
|
|
|
2022-09-21 07:43:00 +02:00
|
|
|
@NonNull @Override
|
2021-08-02 18:59:30 +02:00
|
|
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
|
|
|
int hour = db.getInt("darkThemeTimeHour");
|
|
|
|
int minute = db.getInt("darkThemeTimeMinute");
|
|
|
|
|
|
|
|
return new TimePickerDialog(getActivity(), this, hour, minute, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
|
|
|
db.putInt("darkThemeTimeHour", hourOfDay);
|
|
|
|
db.putInt("darkThemeTimeMinute", minute);
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
SettingsFragment.refreshParent = true;
|
2021-08-02 18:59:30 +02:00
|
|
|
requireActivity().overridePendingTransition(0, 0);
|
|
|
|
this.dismiss();
|
2022-09-21 07:43:00 +02:00
|
|
|
Toasty.success(
|
|
|
|
requireActivity().getApplicationContext(),
|
|
|
|
requireContext().getResources().getString(R.string.settingsSave));
|
2021-08-02 18:59:30 +02:00
|
|
|
requireActivity().recreate();
|
|
|
|
}
|
|
|
|
}
|
2020-04-26 15:36:33 +02:00
|
|
|
}
|