mirror of https://github.com/M66B/FairEmail.git
Added padding option for tabular view
This commit is contained in:
parent
6ec556046d
commit
50ab0d0450
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
### Next version
|
||||||
|
|
||||||
|
* Added padding option for tabular view
|
||||||
|
|
||||||
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
||||||
|
|
||||||
### 1.1873 - 2022-04-09
|
### 1.1873 - 2022-04-09
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
### Next version
|
||||||
|
|
||||||
|
* Added padding option for tabular view
|
||||||
|
|
||||||
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
||||||
|
|
||||||
### 1.1873 - 2022-04-09
|
### 1.1873 - 2022-04-09
|
||||||
|
|
|
@ -603,6 +603,10 @@ public class ApplicationEx extends Application
|
||||||
} else if (version < 1855) {
|
} else if (version < 1855) {
|
||||||
if (!prefs.contains("preview_lines"))
|
if (!prefs.contains("preview_lines"))
|
||||||
editor.putInt("preview_lines", 2);
|
editor.putInt("preview_lines", 2);
|
||||||
|
} else if (version < 1874) {
|
||||||
|
boolean cards = prefs.getBoolean("cards", true);
|
||||||
|
if (!cards)
|
||||||
|
editor.remove("view_padding");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)
|
||||||
|
|
|
@ -4752,7 +4752,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
||||||
boolean compact = prefs.getBoolean("compact", false);
|
boolean compact = prefs.getBoolean("compact", false);
|
||||||
int zoom = prefs.getInt("view_zoom", compact ? 0 : 1);
|
int zoom = prefs.getInt("view_zoom", compact ? 0 : 1);
|
||||||
int padding = prefs.getInt("view_padding", compact ? 0 : 1);
|
int padding = prefs.getInt("view_padding", compact || !cards ? 0 : 1);
|
||||||
boolean quick_filter = prefs.getBoolean("quick_filter", false);
|
boolean quick_filter = prefs.getBoolean("quick_filter", false);
|
||||||
|
|
||||||
boolean folder =
|
boolean folder =
|
||||||
|
@ -4862,7 +4862,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom), false);
|
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom), false);
|
||||||
|
|
||||||
menu.findItem(R.id.menu_padding).setTitle(ssbPadding);
|
menu.findItem(R.id.menu_padding).setTitle(ssbPadding);
|
||||||
menu.findItem(R.id.menu_padding).setVisible(cards);
|
|
||||||
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_padding), false);
|
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_padding), false);
|
||||||
|
|
||||||
menu.findItem(R.id.menu_theme).setVisible(viewType == AdapterMessage.ViewType.UNIFIED);
|
menu.findItem(R.id.menu_theme).setVisible(viewType == AdapterMessage.ViewType.UNIFIED);
|
||||||
|
@ -5286,7 +5285,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
private void onMenuPadding() {
|
private void onMenuPadding() {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
boolean compact = prefs.getBoolean("compact", false);
|
boolean compact = prefs.getBoolean("compact", false);
|
||||||
int padding = prefs.getInt("view_padding", compact ? 0 : 1);
|
int padding = prefs.getInt("view_padding", compact || !cards ? 0 : 1);
|
||||||
padding = ++padding % 3;
|
padding = ++padding % 3;
|
||||||
prefs.edit().putInt("view_padding", padding).apply();
|
prefs.edit().putInt("view_padding", padding).apply();
|
||||||
clearMeasurements();
|
clearMeasurements();
|
||||||
|
@ -5300,7 +5299,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
prefs.edit().putBoolean("compact", compact).apply();
|
prefs.edit().putBoolean("compact", compact).apply();
|
||||||
|
|
||||||
int zoom = (compact ? 0 : 1);
|
int zoom = (compact ? 0 : 1);
|
||||||
int padding = (compact ? 0 : 1);
|
int padding = (compact || !cards ? 0 : 1);
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
.putInt("view_zoom", zoom)
|
.putInt("view_zoom", zoom)
|
||||||
.putInt("view_padding", padding)
|
.putInt("view_padding", padding)
|
||||||
|
|
|
@ -381,7 +381,10 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||||
swCards.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swCards.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
prefs.edit().putBoolean("cards", checked).apply();
|
prefs.edit()
|
||||||
|
.putBoolean("cards", checked)
|
||||||
|
.remove("view_padding")
|
||||||
|
.apply();
|
||||||
swBeige.setEnabled(checked);
|
swBeige.setEnabled(checked);
|
||||||
swTabularBackground.setEnabled(!checked);
|
swTabularBackground.setEnabled(!checked);
|
||||||
swShadow.setEnabled(checked);
|
swShadow.setEnabled(checked);
|
||||||
|
|
|
@ -57,9 +57,9 @@ public class ViewCardOptional extends CardView {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
cards = prefs.getBoolean("cards", true);
|
cards = prefs.getBoolean("cards", true);
|
||||||
compact = prefs.getBoolean("compact", false);
|
compact = prefs.getBoolean("compact", false);
|
||||||
padding = prefs.getInt("view_padding", compact ? 0 : 1);
|
padding = prefs.getInt("view_padding", compact || !cards ? 0 : 1);
|
||||||
|
|
||||||
margin = Helper.dp2pixels(context, (padding + 1) * 3);
|
margin = Helper.dp2pixels(context, (padding + (cards ? 1 : 0)) * 3);
|
||||||
|
|
||||||
setRadius(cards ? margin : 0);
|
setRadius(cards ? margin : 0);
|
||||||
setCardElevation(0);
|
setCardElevation(0);
|
||||||
|
@ -72,9 +72,10 @@ public class ViewCardOptional extends CardView {
|
||||||
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) getLayoutParams();
|
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) getLayoutParams();
|
||||||
lparam.setMargins(margin, margin, margin, margin);
|
lparam.setMargins(margin, margin, margin, margin);
|
||||||
setLayoutParams(lparam);
|
setLayoutParams(lparam);
|
||||||
setContentPadding(margin, margin, margin, margin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setContentPadding(margin, margin, margin, margin);
|
||||||
|
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
### Next version
|
||||||
|
|
||||||
|
* Added padding option for tabular view
|
||||||
|
|
||||||
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
### [Gobivenator](https://en.wikipedia.org/wiki/Gobivenator)
|
||||||
|
|
||||||
### 1.1873 - 2022-04-09
|
### 1.1873 - 2022-04-09
|
||||||
|
|
Loading…
Reference in New Issue