diff --git a/README.md b/README.md index 21650ea..5abdd60 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Fast,efficiently,low memory selector of album,extract from [Telegram](https: ###Gradle ``` dependencies { - compile 'com.library.tangxiaolv:telegramgallery:1.0.2' + compile 'com.library.tangxiaolv:telegramgallery:1.0.3' } ``` diff --git a/README_CN.md b/README_CN.md index 6ef6304..0cf0287 100644 --- a/README_CN.md +++ b/README_CN.md @@ -9,7 +9,7 @@ ###Gradle ``` dependencies { - compile 'com.library.tangxiaolv:telegramgallery:1.0.2' + compile 'com.library.tangxiaolv:telegramgallery:1.0.3' } ``` diff --git a/app/build.gradle b/app/build.gradle index 46183df..4ed3236 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,5 +22,4 @@ android { dependencies { compile 'com.android.support:appcompat-v7:23.3.0' compile project(':telegramgallery') -// compile 'com.library.tangxiaolv:telegramgallery:1.0.2' } diff --git a/build.gradle b/build.gradle index 7a0d4b5..f361d10 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' // NOTE: Do not place your application dependencies here; they belong diff --git a/telegramgallery/build.gradle b/telegramgallery/build.gradle index 9a2f120..af77751 100644 --- a/telegramgallery/build.gradle +++ b/telegramgallery/build.gradle @@ -1,23 +1,23 @@ apply plugin: 'com.android.library' apply plugin: 'com.jfrog.bintray' tasks.withType(Javadoc) { - enabled = false //禁用生成javadoc的任务 + enabled = false //Disable the task of 'generating javadoc' options.encoding = "UTF-8" } ext { bintrayRepo = 'maven' - bintrayName = 'telegramgallery' //maven 仓库中的包名 + bintrayName = 'telegramgallery' //maven package name publishedGroupId = 'com.library.tangxiaolv' libraryName = 'telegramgallery' - artifact = 'telegramgallery'//必须跟Model名一样 + artifact = 'telegramgallery'//Must be the same as the Model name libraryDescription = 'android Gallery from Telegram' siteUrl = 'https://github.com/TangXiaoLv/TelegramGallery' gitUrl = 'https://github.com/TangXiaoLv/TelegramGallery.git' - libraryVersion = '1.0.2' + libraryVersion = '1.0.3' developerId = 'tangxiaolv' developerName = 'Tang XiaoLv' diff --git a/telegramgallery/src/main/java/com/tangxiaolv/telegramgallery/Utils/MediaController.java b/telegramgallery/src/main/java/com/tangxiaolv/telegramgallery/Utils/MediaController.java index 1663502..34bc74a 100644 --- a/telegramgallery/src/main/java/com/tangxiaolv/telegramgallery/Utils/MediaController.java +++ b/telegramgallery/src/main/java/com/tangxiaolv/telegramgallery/Utils/MediaController.java @@ -17,6 +17,7 @@ import android.os.Build; import android.os.Environment; import android.provider.MediaStore; +import android.util.SparseArray; import com.tangxiaolv.telegramgallery.Gallery; import com.tangxiaolv.telegramgallery.R; @@ -29,6 +30,8 @@ import java.util.ArrayList; import java.util.HashMap; +import static android.R.attr.orientation; + public class MediaController implements NotificationCenter.NotificationCenterDelegate { public static int[] readArgs = new int[3]; private boolean saveToGallery = true; @@ -64,8 +67,9 @@ public AudioBuffer(int capacity) { MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_TAKEN, - MediaStore.Images.Media.ORIENTATION - // MediaStore.Files.FileColumns.MIME_TYPE + MediaStore.Images.Media.ORIENTATION, + MediaStore.Images.Media.SIZE + // MediaStore.Images.Media.MIME_TYPE }; private static final String[] projectionVideo = { @@ -529,7 +533,7 @@ public static void loadGalleryPhotosAlbums(final int guid, final String[] filter public void run() { final ArrayList albumsSorted = new ArrayList<>(); final ArrayList videoAlbumsSorted = new ArrayList<>(); - HashMap albums = new HashMap<>(); + SparseArray albums = new SparseArray<>(); AlbumEntry allPhotosAlbum = null; String cameraFolder = Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) @@ -572,6 +576,8 @@ public void run() { .getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); int orientationColumn = cursor .getColumnIndex(MediaStore.Images.Media.ORIENTATION); + int imageSize = cursor + .getColumnIndex(MediaStore.Files.FileColumns.SIZE); // int mimeTypeColumn = // cursor.getColumnIndex(MediaStore.Files.FileColumns.MIME_TYPE); @@ -582,9 +588,10 @@ public void run() { String path = cursor.getString(dataColumn); long dateTaken = cursor.getLong(dateColumn); int orientation = cursor.getInt(orientationColumn); + int size = cursor.getInt(imageSize); // String mimeType = cursor.getString(mimeTypeColumn); - if (path == null || path.length() == 0) { + if (path == null || path.length() == 0 || size == 0) { continue; } diff --git a/telegramgallery/src/main/res/values/strings.xml b/telegramgallery/src/main/res/values/strings.xml index 554db60..a48bbaf 100644 --- a/telegramgallery/src/main/res/values/strings.xml +++ b/telegramgallery/src/main/res/values/strings.xml @@ -28,7 +28,7 @@ WEB SEARCH You can select up to %d pictures - Accept + Done Cancel Preview Failed to read an album, please check permissions