浏览代码

reduce lint errors

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 4 年之前
父节点
当前提交
51b1f988ea

+ 15 - 3
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -66,6 +66,9 @@ import androidx.work.Data;
 import androidx.work.OneTimeWorkRequest;
 import androidx.work.WorkInfo;
 import androidx.work.WorkManager;
+
+import org.jetbrains.annotations.NotNull;
+
 import autodagger.AutoInjector;
 import butterknife.BindView;
 import butterknife.ButterKnife;
@@ -305,6 +308,7 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
         popupMenu.show();
     }
 
+    @SuppressLint("LongLogTag")
     private void downloadFileToCache(String baseUrl,
                                      String userId,
                                      String attachmentFolder,
@@ -320,7 +324,8 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
         try {
             for (WorkInfo workInfo : workers.get()) {
                 if (workInfo.getState() == WorkInfo.State.RUNNING || workInfo.getState() == WorkInfo.State.ENQUEUED) {
-                    Log.d("Download", "Download worker for " + fileId + " is already running or scheduled");
+                    Log.d(TAG, "Download worker for " + fileId + " is already running or " +
+                            "scheduled");
                     return;
                 }
             }
@@ -377,6 +382,9 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
                 messageText.setText(fileName);
                 progressBar.setVisibility(View.GONE);
                 break;
+            default:
+                Log.e(TAG, "workInfo state not handled");
+                break;
         }
     }
 
@@ -422,12 +430,16 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
                     }
 
                     @Override
-                    public void onSuccess(ReadFilesystemOperation readFilesystemOperation) {
+                    public void onSuccess(@NotNull ReadFilesystemOperation readFilesystemOperation) {
                         DavResponse davResponse = readFilesystemOperation.readRemotePath();
                         if (davResponse.data != null) {
                             List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;
                             if (!browserFileList.isEmpty()) {
-                                new Handler(context.getMainLooper()).post(() -> image.getHierarchy().setPlaceholderImage(context.getDrawable(DrawableUtils.INSTANCE.getDrawableResourceIdForMimeType(browserFileList.get(0).mimeType))));
+                                new Handler(context.getMainLooper()).post(() -> {
+                                    int resourceId = DrawableUtils.INSTANCE.getDrawableResourceIdForMimeType(browserFileList.get(0).mimeType);
+                                    Drawable drawable = ContextCompat.getDrawable(context, resourceId);
+                                    image.getHierarchy().setPlaceholderImage(drawable);
+                                });
                             }
                         }
                     }

+ 0 - 27
app/src/main/res/drawable/ic_file_icon_black_24h.xml

@@ -1,27 +0,0 @@
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<vector android:autoMirrored="true" android:height="24dp"
-    android:viewportHeight="24" android:viewportWidth="24"
-    android:width="20.57dp" xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:fillColor="#000000" android:fillType="nonZero"
-        android:pathData="M0.8571,0C0.3771,0 0,0.3771 0,0.8571L0,23.1429C0,23.6229 0.3771,24 0.8571,24L19.7143,24C20.1943,24 20.5714,23.6229 20.5714,23.1429L20.5714,5.1429L15.4286,0L0.8571,0ZM3.4286,3.4286L13.7143,3.4286L13.7143,5.1429L3.4286,5.1429L3.4286,3.4286ZM3.4286,8.5714L12,8.5714L12,10.2857L3.4286,10.2857L3.4286,8.5714ZM3.4286,13.7143L17.1429,13.7143L17.1429,15.4286L3.4286,15.4286L3.4286,13.7143ZM3.4286,18.8571L10.2857,18.8571L10.2857,20.5714L3.4286,20.5714L3.4286,18.8571Z"
-        android:strokeColor="#00000000" android:strokeWidth="1"/>
-</vector>

+ 0 - 47
app/src/main/res/drawable/ic_mimetype_application.xml

@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="16dp"
-    android:height="16dp"
-    android:viewportWidth="16"
-    android:viewportHeight="16">
-
-    <path
-        android:fillColor="#969696"
-        android:pathData="M6.94,0.5 C6.7,0.5,6.5,0.7,6.5,0.94 L6.5,2.2 C6,2.34,5.45,2.55,4.97,2.85
-L4.06,1.94 C3.9,1.76,3.6,1.75,3.44,1.94 L1.94,3.44 C1.76,3.61,1.76,3.9,1.94,4.06
-L2.85,4.97 C2.566,5.45,2.35,5.97,2.2,6.5 L0.94,6.5 C0.7,6.5,0.5,6.7,0.5,6.94
-L0.5,9.06 C0.5,9.31,0.69,9.5,0.94,9.5 L2.2,9.5 C2.34,10.04,2.56,10.55,2.85,11.03
-L1.94,11.94 C1.76,12.11,1.76,12.39,1.94,12.56 L3.44,14.06
-C3.62,14.24,3.9,14.24,4.06,14.06 L4.97,13.15 C5.45,13.435,5.97,13.65,6.5,13.8
-L6.5,15.06 C6.5,15.31,6.7,15.5,6.94,15.5 L9.06,15.5
-C9.3,15.5,9.51,15.3,9.5,15.06 L9.5,13.8 C10.04,13.66,10.55,13.44,11.03,13.15
-L11.94,14.06 C12.11,14.24,12.39,14.24,12.56,14.06 L14.06,12.56
-C14.24,12.39,14.24,12.11,14.06,11.94 L13.15,11.03
-C13.44,10.55,13.65,10.03,13.8,9.5 L15.06,9.5 C15.3,9.5,15.51,9.3,15.5,9.06
-L15.5,6.94 C15.5,6.7,15.3,6.5,15.06,6.5 L13.8,6.5
-C13.66,5.96,13.44,5.45,13.15,4.97 L14.06,4.06 C14.24,3.89,14.24,3.61,14.06,3.44
-L12.56,1.94 C12.39,1.76,12.11,1.76,11.94,1.94 L11.03,2.85
-C10.55,2.56,10.03,2.35,9.5,2.2 L9.5,0.94 C9.5,0.7,9.3,0.5,9.06,0.5 L6.94,0.5 Z
-M8,4.5 A3.5,3.5,0,0,1,11.5,8 A3.5,3.5,0,0,1,8,11.5 A3.5,3.5,0,0,1,4.5,8
-A3.5,3.5,0,0,1,8,4.5 Z" />
-</vector>

+ 0 - 33
app/src/main/res/drawable/ic_mimetype_folder_drag_accept.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="16dp"
-    android:height="16dp"
-    android:viewportWidth="16"
-    android:viewportHeight="16">
-
-    <path
-        android:fillColor="#0082c9"
-        android:pathData="M1.46,2 C1.21,2,1,2.21,1,2.46 L1,13.54 C1,13.798,1.202,14,1.46,14 L14.54,14
-C14.798,14,15,13.798,15,13.54 L15,4.462 C15,4.212,14.79,3.999,14.54,3.999
-L8,3.999 L6,2 L1.46,2 Z M2,5 L14,5 L14,13 L2,13 L2,5 Z" />
-</vector>

+ 0 - 40
app/src/main/res/drawable/ic_mimetype_folder_encrypted.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="16dp"
-    android:height="16dp"
-    android:viewportWidth="16"
-    android:viewportHeight="16">
-
-    <path
-        android:fillColor="#0082c9"
-        android:fillType="evenOdd"
-        android:pathData="M1.4609,2 C1.2109,2,1,2.2109,1,2.4609 L1,13.5389
-C1,13.7969,1.2029,13.9999,1.4609,13.9999 L14.5389,13.9999
-C14.7969,13.9999,14.9999,13.7969,14.9999,13.5389 L14.9999,4.4628
-C14.9999,4.2128,14.7889,3.9979,14.5389,3.9979 L7.9999,3.9979 L5.9999,1.9999
-L1.4608,1.9999 Z M8,5.8008 C8.8836,5.8008,9.5996,6.5167,9.5996,7.4004
-L9.5996,8.1992 L10,8.1992 L10,11 L6,11 L6,8.1992 L6.4004,8.1992 L6.4004,7.4004
-C6.4004,6.5167,7.1164,5.8008,8,5.8008 Z M8,6.5996
-C7.5581,6.5996,7.1992,6.9585,7.1992,7.4004 L7.1992,8.1992 L8.8008,8.1992
-L8.8008,7.4004 C8.8008,6.9585,8.4419,6.5996,8,6.5996 Z" />
-</vector>

+ 0 - 39
app/src/main/res/drawable/ic_mimetype_folder_external.xml

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Nextcloud Talk application
-  ~
-  ~ @author Mario Danic
-  ~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
-  ~
-  ~ This program is free software: you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="16dp"
-    android:height="16dp"
-    android:viewportWidth="16"
-    android:viewportHeight="16">
-
-    <path
-        android:fillColor="#0082c9"
-        android:fillType="evenOdd"
-        android:pathData="M1.46,2 C1.21,2,1,2.21,1,2.46 L1,13.54 C1,13.798,1.202,14,1.46,14 L14.54,14
-C14.798,14,15,13.798,15,13.54 L15,4.462 C15,4.212,14.79,3.999,14.54,3.999
-L8,3.999 L6,2 L1.46,2 Z M7.977,5.793 L11.547,5.793 L11.547,9.178 L10.355,8.05
-L8.57,9.743 L7.38,8.613 L9.166,6.923 L7.976,5.793 Z M5.597,6.357 L7.38,6.357
-L7.977,6.922 L5.597,6.922 L5.597,11.436 L10.355,11.436 L10.355,9.178
-L10.951,9.742 L10.951,11.436 C10.951,11.748,10.686,12,10.356,12 L5.596,12
-C5.266,12,5.001,11.748,5.001,11.436 L5.001,6.922
-C5.001,6.609,5.267,6.357,5.597,6.357 Z" />
-</vector>

+ 0 - 1
app/src/main/res/layout/activity_full_screen_text.xml

@@ -23,7 +23,6 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@android:color/white"
     android:fitsSystemWindows="true"
     tools:context=".activities.FullScreenTextViewerActivity">