codacy: Avoid using Literals in Conditional Statements

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2019-08-23 09:16:44 +02:00
parent c0b76e33ec
commit 783e28365d
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 3 additions and 2 deletions

View file

@ -83,6 +83,7 @@ public class FileDataStorageManager {
private static final String EXCEPTION_MSG = "Exception in batch of operations ";
public static final int ROOT_PARENT_ID = 0;
public static final String NULL_STRING = "null";
private ContentResolver contentResolver;
private ContentProviderClient contentProviderClient;
@ -1001,7 +1002,7 @@ public class FileDataStorageManager {
String sharees = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_SHAREES));
if (sharees == null || "null".equals(sharees) || sharees.isEmpty()) {
if (sharees == null || NULL_STRING.equals(sharees) || sharees.isEmpty()) {
file.setSharees(new ArrayList<>());
} else {
try {

View file

@ -636,7 +636,7 @@ public final class ThemeUtils {
public static void setEditTextCursorColor(EditText editText, int color) {
try {
// Get the cursor resource id
if (Build.VERSION.SDK_INT >= 28) {//set differently in Android P (API 28)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//set differently in Android P (API 28)
Field field = TextView.class.getDeclaredField("mCursorDrawableRes");
field.setAccessible(true);
int drawableResId = field.getInt(editText);