/*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
import android.content.res.Configuration;
import android.view.WindowManager;
+import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
+ public static String emptyIsNull(String str) {
+ return "".equals(str) ? null : str;
+ }
+ public static String nullIsEmpty(String str) {
+ return (str == null) ? "" : str;
+ }
+ public static boolean equalStrings(String u, CharSequence text) {
+ return nullIsEmpty(u).equals(text.toString());
+ }
+ public static boolean equalStrings(String a, String b) {
+ return nullIsEmpty(a).equals(nullIsEmpty(b));
+ }
+ public static String trim(@Nullable String string) {
+ if (string == null)
+ return null;
+
+ return string.trim();
+ }
}