|
|
@ -49,16 +49,17 @@ public class ViewCardOptional extends CardView {
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
boolean cards = prefs.getBoolean("cards", true);
|
|
|
|
boolean cards = prefs.getBoolean("cards", true);
|
|
|
|
|
|
|
|
boolean compact = prefs.getBoolean("compact", false);
|
|
|
|
if (cards) {
|
|
|
|
if (cards) {
|
|
|
|
int dp6 = Helper.dp2pixels(getContext(), 6);
|
|
|
|
int dp6 = Helper.dp2pixels(getContext(), 6);
|
|
|
|
int color = Helper.resolveColor(getContext(), R.attr.colorCardBackground);
|
|
|
|
int color = Helper.resolveColor(getContext(), R.attr.colorCardBackground);
|
|
|
|
|
|
|
|
|
|
|
|
FrameLayout.LayoutParams lparam = (FrameLayout.LayoutParams) getLayoutParams();
|
|
|
|
FrameLayout.LayoutParams lparam = (FrameLayout.LayoutParams) getLayoutParams();
|
|
|
|
lparam.setMargins(dp6, dp6, dp6, dp6);
|
|
|
|
lparam.setMargins(dp6, compact ? 0 : dp6, dp6, dp6);
|
|
|
|
setLayoutParams(lparam);
|
|
|
|
setLayoutParams(lparam);
|
|
|
|
|
|
|
|
|
|
|
|
setRadius(dp6);
|
|
|
|
setRadius(dp6);
|
|
|
|
setElevation(dp6);
|
|
|
|
setElevation(compact ? dp6 / 2f : dp6);
|
|
|
|
setCardBackgroundColor(color);
|
|
|
|
setCardBackgroundColor(color);
|
|
|
|
|
|
|
|
|
|
|
|
getChildAt(0).setPadding(dp6, dp6, dp6, dp6);
|
|
|
|
getChildAt(0).setPadding(dp6, dp6, dp6, dp6);
|
|
|
|