Removed all com.android.internal.* references in code.
Moved reference to internal Android resource depedencies to drawable.xml.
Bug: 34888290
Change-Id: I906e58579bab97438201bf8abab24f94e2640b2c
diff --git a/res/drawable-hdpi/ic_grid_folder_alpha.png b/res/drawable-hdpi/ic_grid_folder_alpha.png
deleted file mode 100644
index 874fde7..0000000
--- a/res/drawable-hdpi/ic_grid_folder_alpha.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_grid_folder_alpha.png b/res/drawable-mdpi/ic_grid_folder_alpha.png
deleted file mode 100644
index 44e0e37..0000000
--- a/res/drawable-mdpi/ic_grid_folder_alpha.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_grid_folder_alpha.png b/res/drawable-xhdpi/ic_grid_folder_alpha.png
deleted file mode 100644
index 1a4e7c4..0000000
--- a/res/drawable-xhdpi/ic_grid_folder_alpha.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_grid_folder_alpha.png b/res/drawable-xxhdpi/ic_grid_folder_alpha.png
deleted file mode 100644
index d7b2bfb..0000000
--- a/res/drawable-xxhdpi/ic_grid_folder_alpha.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_grid_folder_alpha.png b/res/drawable-xxxhdpi/ic_grid_folder_alpha.png
deleted file mode 100644
index ca6be0e..0000000
--- a/res/drawable-xxxhdpi/ic_grid_folder_alpha.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/ic_doc_audio.xml b/res/drawable/ic_doc_audio.xml
new file mode 100644
index 0000000..341a919
--- /dev/null
+++ b/res/drawable/ic_doc_audio.xml
@@ -0,0 +1,24 @@
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFDB4437"
+ android:pathData="M19 3H5c-1.1 0,-2 .9,-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2,-.9 2,-2V5c0,-1.1,-.9,-2,-2,-2zM7.2 18c-.66 0,-1.2,-.54,-1.2,-1.2V12c0,-3.31 2.69,-6 6,-6s6 2.69 6 6v4.8c0 .66,-.54 1.2,-1.2 1.2H14v-4h2v-2c0,-2.21,-1.79,-4,-4,-4s-4 1.79,-4 4v2h2v4H7.2z"/>
+</vector>
diff --git a/res/drawable/ic_doc_generic.xml b/res/drawable/ic_doc_generic.xml
new file mode 100644
index 0000000..a4fd77a
--- /dev/null
+++ b/res/drawable/ic_doc_generic.xml
@@ -0,0 +1,24 @@
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF737373"
+ android:pathData="M6 2c-1.1 0,-1.99.9,-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2,-.9 2,-2V8l-6,-6H6zm7 7V3.5L18.5 9H13z"/>
+</vector>
diff --git a/res/drawable/ic_doc_image.xml b/res/drawable/ic_doc_image.xml
new file mode 100644
index 0000000..1262563
--- /dev/null
+++ b/res/drawable/ic_doc_image.xml
@@ -0,0 +1,24 @@
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFDB4437"
+ android:pathData="M21 19V5c0,-1.1,-.9,-2,-2,-2H5c-1.1 0,-2 .9,-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2,-.9 2,-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5,-4.5z"/>
+</vector>
diff --git a/res/drawable/ic_doc_video.xml b/res/drawable/ic_doc_video.xml
new file mode 100644
index 0000000..4944232
--- /dev/null
+++ b/res/drawable/ic_doc_video.xml
@@ -0,0 +1,24 @@
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFDB4437"
+ android:pathData="M18 4l2 4h-3l-2,-4h-2l2 4h-3l-2,-4H8l2 4H7L5 4H4c-1.1 0,-1.99.9,-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2,-.9 2,-2V4h-4z"/>
+</vector>
diff --git a/res/drawable/ic_grid_folder.xml b/res/drawable/ic_grid_folder.xml
deleted file mode 100644
index 0c87869..0000000
--- a/res/drawable/ic_grid_folder.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_grid_folder_alpha"
- android:tint="?android:attr/colorControlNormal" />
diff --git a/res/values-v24/drawable.xml b/res/values-v24/drawable.xml
new file mode 100644
index 0000000..68ba75b
--- /dev/null
+++ b/res/values-v24/drawable.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <item name="image_root_icon" type="drawable">@drawable/ic_doc_image</item>
+ <item name="video_root_icon" type="drawable">@drawable/ic_doc_video</item>
+ <item name="audio_root_icon" type="drawable">@drawable/ic_doc_audio</item>
+ <item name="generic_doc_icon" type="drawable">@drawable/ic_doc_generic</item>
+</resources>
diff --git a/res/values/drawables.xml b/res/values/drawables.xml
index 2d2acbb..1ea830f 100644
--- a/res/values/drawables.xml
+++ b/res/values/drawables.xml
@@ -18,4 +18,8 @@
<item name="app_icon" type="drawable">@mipmap/ic_app_icon</item>
<item name="files_icon" type="drawable">@mipmap/ic_app_icon</item>
<item name="picker_icon" type="drawable">@drawable/ic_doc_text</item>
+ <item name="image_root_icon" type="drawable">@*android:drawable/ic_doc_image</item>
+ <item name="video_root_icon" type="drawable">@*android:drawable/ic_doc_video</item>
+ <item name="audio_root_icon" type="drawable">@*android:drawable/ic_doc_audio</item>
+ <item name="generic_doc_icon" type="drawable">@*android:drawable/ic_doc_generic</item>
</resources>
diff --git a/src/com/android/documentsui/DropBadgeView.java b/src/com/android/documentsui/DropBadgeView.java
index 6d18af0..4bf3f74 100644
--- a/src/com/android/documentsui/DropBadgeView.java
+++ b/src/com/android/documentsui/DropBadgeView.java
@@ -45,7 +45,7 @@
Drawable okBadge = context.getResources().getDrawable(R.drawable.drop_badge_states, null);
Drawable defaultIcon = context.getResources()
- .getDrawable(com.android.internal.R.drawable.ic_doc_generic, null);
+ .getDrawable(R.drawable.ic_doc_generic, null);
Drawable[] list = {defaultIcon, okBadge};
mBackground = new LayerDrawable(list);
diff --git a/src/com/android/documentsui/IconUtils.java b/src/com/android/documentsui/IconUtils.java
index 5a87f87..7b6678d 100644
--- a/src/com/android/documentsui/IconUtils.java
+++ b/src/com/android/documentsui/IconUtils.java
@@ -23,8 +23,6 @@
import android.provider.DocumentsContract.Document;
import android.util.TypedValue;
-import com.android.documentsui.base.State;
-
public class IconUtils {
public static Drawable loadPackageIcon(Context context, String authority, int icon) {
if (icon != 0) {
@@ -44,11 +42,7 @@
public static Drawable loadMimeIcon(
Context context, String mimeType, String authority, String docId, int mode) {
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
- if (mode == State.MODE_GRID) {
- return context.getDrawable(R.drawable.ic_grid_folder);
- } else {
- return context.getDrawable(com.android.internal.R.drawable.ic_doc_folder);
- }
+ return context.getDrawable(R.drawable.ic_doc_folder);
}
return loadMimeIcon(context, mimeType);
diff --git a/src/com/android/documentsui/base/RootInfo.java b/src/com/android/documentsui/base/RootInfo.java
index 2d68161..64677e5 100644
--- a/src/com/android/documentsui/base/RootInfo.java
+++ b/src/com/android/documentsui/base/RootInfo.java
@@ -220,13 +220,13 @@
derivedIcon = R.drawable.ic_root_download;
} else if (isImages()) {
derivedType = TYPE_IMAGES;
- derivedIcon = com.android.internal.R.drawable.ic_doc_image;
+ derivedIcon = R.drawable.image_root_icon;
} else if (isVideos()) {
derivedType = TYPE_VIDEO;
- derivedIcon = com.android.internal.R.drawable.ic_doc_video;
+ derivedIcon = R.drawable.video_root_icon;
} else if (isAudio()) {
derivedType = TYPE_AUDIO;
- derivedIcon = com.android.internal.R.drawable.ic_doc_audio;
+ derivedIcon = R.drawable.audio_root_icon;
} else if (isRecents()) {
derivedType = TYPE_RECENTS;
} else {
diff --git a/src/com/android/documentsui/dirlist/DirectoryFragment.java b/src/com/android/documentsui/dirlist/DirectoryFragment.java
index 34e65c3..d032afb 100644
--- a/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -335,7 +335,7 @@
mState,
this::getModelId,
mRecView::findChildViewUnder,
- getContext().getDrawable(com.android.internal.R.drawable.ic_doc_generic),
+ getContext().getDrawable(R.drawable.ic_doc_generic),
mActivity.getShadowBuilder())
: DragStartListener.DUMMY;