mirror of https://github.com/M66B/FairEmail.git
Small fix/improvement
This commit is contained in:
parent
42f9193179
commit
98fe4c31f6
|
@ -60,7 +60,6 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
@ -410,12 +409,10 @@ public class FragmentAccount extends FragmentBase {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) cbNotify.getLayoutParams();
|
||||
lparam.width = 0;
|
||||
lparam.height = 0;
|
||||
lparam.setMargins(0, 0, 0, 0);
|
||||
cbNotify.setLayoutParams(lparam);
|
||||
Helper.hide(cbNotify);
|
||||
Helper.hide(view.findViewById(R.id.tvNotifyPro));
|
||||
}
|
||||
|
||||
btnCheck.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
|
@ -50,6 +50,7 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.browser.customtabs.CustomTabsIntent;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
@ -281,6 +282,17 @@ public class Helper {
|
|||
}
|
||||
}
|
||||
|
||||
static void hide(View view) {
|
||||
view.setPadding(0, 0, 0, 0);
|
||||
|
||||
ViewGroup.LayoutParams lparam = view.getLayoutParams();
|
||||
lparam.width = 0;
|
||||
lparam.height = 0;
|
||||
if (lparam instanceof ConstraintLayout.LayoutParams)
|
||||
((ConstraintLayout.LayoutParams) lparam).setMargins(0, 0, 0, 0);
|
||||
view.setLayoutParams(lparam);
|
||||
}
|
||||
|
||||
static boolean isDarkTheme(Context context) {
|
||||
TypedValue tv = new TypedValue();
|
||||
context.getTheme().resolveAttribute(R.attr.themeName, tv, true);
|
||||
|
|
Loading…
Reference in New Issue