summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ben Lin <linben@google.com> 2017-02-17 11:44:45 -0800
committer Ben Lin <linben@google.com> 2017-02-22 17:32:30 -0800
commitfc84b34edff91524af63c82dcf8cc2e97ee76f75 (patch)
treee1d8b5362b50459be81bb62482e5d0a43f5e97e3
parentc046d5589c5e4b078fe23a1ba2bf4e11565dbd36 (diff)
Removed all com.android.internal.* references in code.
Moved reference to internal Android resource depedencies to drawable.xml. Bug: 34888290 Change-Id: I906e58579bab97438201bf8abab24f94e2640b2c
-rw-r--r--res/drawable-hdpi/ic_grid_folder_alpha.pngbin865 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_grid_folder_alpha.pngbin638 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_grid_folder_alpha.pngbin1066 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/ic_grid_folder_alpha.pngbin962 -> 0 bytes
-rw-r--r--res/drawable-xxxhdpi/ic_grid_folder_alpha.pngbin1320 -> 0 bytes
-rw-r--r--res/drawable/ic_doc_audio.xml24
-rw-r--r--res/drawable/ic_doc_generic.xml24
-rw-r--r--res/drawable/ic_doc_image.xml24
-rw-r--r--res/drawable/ic_doc_video.xml24
-rw-r--r--res/drawable/ic_grid_folder.xml4
-rw-r--r--res/values-v24/drawable.xml22
-rw-r--r--res/values/drawables.xml4
-rw-r--r--src/com/android/documentsui/DropBadgeView.java2
-rw-r--r--src/com/android/documentsui/IconUtils.java8
-rw-r--r--src/com/android/documentsui/base/RootInfo.java6
-rw-r--r--src/com/android/documentsui/dirlist/DirectoryFragment.java2
16 files changed, 128 insertions, 16 deletions
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 874fde798..000000000
--- 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 44e0e376e..000000000
--- 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 1a4e7c4d5..000000000
--- 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 d7b2bfb3e..000000000
--- 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 ca6be0e91..000000000
--- 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 000000000..341a91942
--- /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 000000000..a4fd77ae5
--- /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 000000000..126256365
--- /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 000000000..4944232e9
--- /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 0c8786929..000000000
--- 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 000000000..68ba75b3e
--- /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 2d2acbbc0..1ea830f17 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 6d18af0ab..4bf3f74c5 100644
--- a/src/com/android/documentsui/DropBadgeView.java
+++ b/src/com/android/documentsui/DropBadgeView.java
@@ -45,7 +45,7 @@ public final class DropBadgeView extends ImageView {
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 5a87f876b..7b6678d6b 100644
--- a/src/com/android/documentsui/IconUtils.java
+++ b/src/com/android/documentsui/IconUtils.java
@@ -23,8 +23,6 @@ import android.graphics.drawable.Drawable;
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 class IconUtils {
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 2d68161db..64677e596 100644
--- a/src/com/android/documentsui/base/RootInfo.java
+++ b/src/com/android/documentsui/base/RootInfo.java
@@ -220,13 +220,13 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> {
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 34e65c3fd..d032afbc2 100644
--- a/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -335,7 +335,7 @@ public class DirectoryFragment extends Fragment
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;