Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.40'
classpath 'com.novoda:bintray-release:0.8.1'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50'
classpath 'com.novoda:bintray-release:0.9.1'
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 27 11:32:18 CST 2018
#Tue Oct 29 13:40:36 ICT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
16 changes: 11 additions & 5 deletions matisse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,28 @@ android {
lintOptions {
abortOnError true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

ext.supportLibVersion = '28.0.0'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:support-v4:${supportLibVersion}"
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:support-annotations:${supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
implementation 'com.github.yalantis:ucrop:2.2.3-native'
implementation 'info.androidhive:imagefilters:1.0.7'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.github.bumptech.glide:glide:4.10.0'
compileOnly 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.MasayukiSuda:Mp4Composer-android:v0.3.3'
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
}

// jcenter configuration for novoda's bintray-release
Expand Down
1 change: 1 addition & 0 deletions matisse/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
<activity android:name="com.zhihu.matisse.ui.FilterActivity"/>
<activity android:name="com.zhihu.matisse.internal.ui.AlbumPreviewActivity"/>
<activity android:name="com.zhihu.matisse.internal.ui.SelectedPreviewActivity"/>
<activity android:name=".ui.VideoEditorActivity" />
</application>
</manifest>
5 changes: 3 additions & 2 deletions matisse/src/main/java/com/zhihu/matisse/Matisse.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.zhihu.matisse.ui.MatisseActivity;

Expand Down
3 changes: 2 additions & 1 deletion matisse/src/main/java/com/zhihu/matisse/MimeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import android.content.ContentResolver;
import android.net.Uri;
import android.text.TextUtils;
import android.support.v4.util.ArraySet;
import android.webkit.MimeTypeMap;

import androidx.collection.ArraySet;

import com.zhihu.matisse.internal.utils.PhotoMetadataUtils;

import java.util.Arrays;
Expand Down
31 changes: 24 additions & 7 deletions matisse/src/main/java/com/zhihu/matisse/SelectionCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.annotation.StyleRes;
import android.support.v4.app.Fragment;

import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StyleRes;
import androidx.fragment.app.Fragment;

import com.zhihu.matisse.engine.ImageEngine;
import com.zhihu.matisse.filter.Filter;
Expand Down Expand Up @@ -257,9 +258,20 @@ public SelectionCreator filterEnable(boolean enable) {
return this;
}

/**
* Enable/disable the trim Video.
*
* @param enable is enable. Default value is true
* @return {@link SelectionCreator} for fluent API.
*/
public SelectionCreator trimVideoEnable(boolean enable) {
mSelectionSpec.hasTrimVideo = enable;
return this;
}

/**
* Capture strategy provided for the location to save photos including internal and external
* storage and also a authority for {@link android.support.v4.content.FileProvider}.
* storage and also a authority for {@link androidx.core.content.FileProvider}.
*
* @param captureStrategy {@link CaptureStrategy}, needed only when capturing is enabled.
* @return {@link SelectionCreator} for fluent API.
Expand Down Expand Up @@ -365,6 +377,11 @@ public SelectionCreator setOnCheckedListener(@Nullable OnCheckedListener listene
return this;
}

// public SelectionCreator showPreview(boolean showPreview) {
// mSelectionSpec.showPreview = showPreview;
// return this;
// }

/**
* Start to select media and wait for result.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import android.support.annotation.Nullable;

import androidx.annotation.Nullable;

import com.zhihu.matisse.R;
import com.zhihu.matisse.internal.loader.AlbumLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
package com.zhihu.matisse.internal.entity;

import android.content.Context;
import android.support.annotation.IntDef;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;

import androidx.annotation.IntDef;
import androidx.fragment.app.FragmentActivity;

import com.zhihu.matisse.internal.ui.widget.IncapableDialog;

import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import android.support.annotation.Nullable;

import androidx.annotation.Nullable;

import com.zhihu.matisse.MimeType;

Expand All @@ -43,8 +44,7 @@ public Item[] newArray(int size) {
public static final String ITEM_DISPLAY_NAME_CAPTURE = "Capture";
public final long id;
public final String mimeType;
public final Uri uri;
public Uri uriCrop;
public Uri uri;
public final long size;
public final long duration; // only for video, in ms

Expand All @@ -61,7 +61,6 @@ private Item(long id, String mimeType, long size, long duration) {
contentUri = MediaStore.Files.getContentUri("external");
}
this.uri = ContentUris.withAppendedId(contentUri, id);
this.uriCrop = null;
this.size = size;
this.duration = duration;
}
Expand All @@ -72,7 +71,6 @@ private Item(Parcel source) {
uri = source.readParcelable(Uri.class.getClassLoader());
size = source.readLong();
duration = source.readLong();
uriCrop = source.readParcelable(Uri.class.getClassLoader());
}

public static Item valueOf(Cursor cursor) {
Expand All @@ -92,7 +90,6 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(id);
dest.writeString(mimeType);
dest.writeParcelable(uri, 0);
dest.writeParcelable(uriCrop, 0);
dest.writeLong(size);
dest.writeLong(duration);
}
Expand Down Expand Up @@ -127,10 +124,10 @@ public boolean equals(Object obj) {
return id == other.id
&& (mimeType != null && mimeType.equals(other.mimeType)
|| (mimeType == null && other.mimeType == null))
&& (uri != null && uri.equals(other.uri)
/*&& (uri != null && uri.equals(other.uri)
|| (uri == null && other.uri == null))
&& size == other.size
&& duration == other.duration;
&& duration == other.duration*/;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
package com.zhihu.matisse.internal.entity;

import android.content.pm.ActivityInfo;
import android.support.annotation.StyleRes;

import androidx.annotation.StyleRes;

import com.zhihu.matisse.MimeType;
import com.zhihu.matisse.R;
Expand Down Expand Up @@ -56,6 +57,8 @@ public final class SelectionSpec {
public int originalMaxSize;
public int cropMaxSize;
public boolean hasFilter;
public boolean hasTrimVideo;
public boolean showPreview;
public OnCheckedListener onCheckedListener;

private SelectionSpec() {
Expand Down Expand Up @@ -94,6 +97,8 @@ private void reset() {
originalMaxSize = Integer.MAX_VALUE;
cropMaxSize = 4000;
hasFilter = true;
hasTrimVideo = true;
showPreview = false;
}

public boolean singleSelectionModeEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import android.database.MergeCursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;

import androidx.loader.content.CursorLoader;

import com.zhihu.matisse.internal.entity.Album;
import com.zhihu.matisse.internal.entity.SelectionSpec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import android.database.MergeCursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;

import androidx.loader.content.CursorLoader;

import com.zhihu.matisse.internal.entity.Album;
import com.zhihu.matisse.internal.entity.Item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;

import androidx.fragment.app.FragmentActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;

import com.zhihu.matisse.internal.loader.AlbumLoader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;

import com.zhihu.matisse.internal.entity.Album;
import com.zhihu.matisse.internal.loader.AlbumMediaLoader;
Expand Down
Loading