am a2d65108: Merge "Latest UX asset drop." into klp-dev
* commit 'a2d65108dd32a0836fe08f0c72efdd5c727dad44': Latest UX asset drop.
BIN
packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic.png
Normal file
|
After Width: | Height: | Size: 799 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 3.2 KiB |
BIN
packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
packages/DocumentsUI/res/drawable-hdpi/ic_popout.png
Normal file
|
After Width: | Height: | Size: 836 B |
BIN
packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic.png
Normal file
|
After Width: | Height: | Size: 683 B |
|
Before Width: | Height: | Size: 819 B After Width: | Height: | Size: 866 B |
BIN
packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png
Normal file
|
After Width: | Height: | Size: 891 B |
BIN
packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
packages/DocumentsUI/res/drawable-mdpi/ic_popout.png
Normal file
|
After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic.png
Normal file
|
After Width: | Height: | Size: 940 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 3.3 KiB |
BIN
packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png
Normal file
|
After Width: | Height: | Size: 230 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 973 B After Width: | Height: | Size: 3.4 KiB |
BIN
packages/DocumentsUI/res/drawable-xhdpi/ic_popout.png
Normal file
|
After Width: | Height: | Size: 970 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic.png
Normal file
|
After Width: | Height: | Size: 589 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_folder.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_overflow.png
Normal file
|
After Width: | Height: | Size: 320 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
packages/DocumentsUI/res/drawable-xxhdpi/ic_popout.png
Normal file
|
After Width: | Height: | Size: 568 B |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<style name="Theme" parent="@android:style/Theme.Holo.Light">
|
<style name="Theme" parent="@android:style/Theme.Holo.Light">
|
||||||
|
<item name="android:actionOverflowButtonStyle">@style/DarkerOverflow</item>
|
||||||
<item name="android:windowBackground">@*android:drawable/dialog_full_holo_light</item>
|
<item name="android:windowBackground">@*android:drawable/dialog_full_holo_light</item>
|
||||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||||
<item name="android:windowIsTranslucent">true</item>
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
|||||||
@@ -29,5 +29,12 @@
|
|||||||
|
|
||||||
<!-- Normally just a redirection, but this is used to make ourselves a
|
<!-- Normally just a redirection, but this is used to make ourselves a
|
||||||
dialog on large tablets -->
|
dialog on large tablets -->
|
||||||
<style name="Theme" parent="@android:style/Theme.Holo.Light" />
|
<style name="Theme" parent="@android:style/Theme.Holo.Light">
|
||||||
|
<item name="android:actionOverflowButtonStyle">@style/DarkerOverflow</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="DarkerOverflow" parent="@android:style/Widget.Holo.Light.ActionButton.Overflow">
|
||||||
|
<item name="android:src">@drawable/ic_menu_overflow</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -781,7 +781,8 @@ public class DirectoryFragment extends Fragment {
|
|||||||
iconMime.setImageDrawable(
|
iconMime.setImageDrawable(
|
||||||
IconUtils.loadPackageIcon(context, docAuthority, docIcon));
|
IconUtils.loadPackageIcon(context, docAuthority, docIcon));
|
||||||
} else {
|
} else {
|
||||||
iconMime.setImageDrawable(IconUtils.loadMimeIcon(context, docMimeType));
|
iconMime.setImageDrawable(IconUtils.loadMimeIcon(
|
||||||
|
context, docMimeType, docAuthority, docId, state.derivedMode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.content.pm.ProviderInfo;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.provider.DocumentsContract.Document;
|
import android.provider.DocumentsContract.Document;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.android.collect.Maps;
|
import com.google.android.collect.Maps;
|
||||||
|
|
||||||
@@ -206,6 +207,27 @@ public class IconUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Drawable loadMimeIcon(
|
||||||
|
Context context, String mimeType, String authority, String docId, int mode) {
|
||||||
|
final Resources res = context.getResources();
|
||||||
|
|
||||||
|
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
|
||||||
|
// TODO: eventually move these hacky assets into that package
|
||||||
|
if ("com.android.providers.media.documents".equals(authority)
|
||||||
|
&& docId.startsWith("album")) {
|
||||||
|
return res.getDrawable(R.drawable.ic_doc_album);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode == DocumentsActivity.State.MODE_GRID) {
|
||||||
|
return res.getDrawable(R.drawable.ic_grid_folder);
|
||||||
|
} else {
|
||||||
|
return res.getDrawable(R.drawable.ic_root_folder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadMimeIcon(context, mimeType);
|
||||||
|
}
|
||||||
|
|
||||||
public static Drawable loadMimeIcon(Context context, String mimeType) {
|
public static Drawable loadMimeIcon(Context context, String mimeType) {
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
|
|
||||||
@@ -236,8 +258,7 @@ public class IconUtils {
|
|||||||
} else if ("video".equals(typeOnly)) {
|
} else if ("video".equals(typeOnly)) {
|
||||||
return res.getDrawable(R.drawable.ic_doc_video);
|
return res.getDrawable(R.drawable.ic_doc_video);
|
||||||
} else {
|
} else {
|
||||||
// TODO: generic icon?
|
return res.getDrawable(R.drawable.ic_doc_generic);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ public class MimePredicate implements Predicate<DocumentInfo> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean mimeMatches(String filter, String test) {
|
public static boolean mimeMatches(String filter, String test) {
|
||||||
if (filter == null || "*/*".equals(filter)) {
|
if (test == null) {
|
||||||
return true;
|
|
||||||
} else if (test == null) {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else if (filter == null || "*/*".equals(filter)) {
|
||||||
|
return true;
|
||||||
} else if (filter.equals(test)) {
|
} else if (filter.equals(test)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (filter.endsWith("/*")) {
|
} else if (filter.endsWith("/*")) {
|
||||||
|
|||||||