1
0
Fork 1

updated dependencies

updated MediaViewer (Christian Schneppe)
This commit is contained in:
Arne 2021-12-08 21:13:02 +01:00
parent 3883b5f001
commit affb909b18
3 changed files with 25 additions and 24 deletions

View file

@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.0.3'
}
}
@ -44,8 +44,8 @@ dependencies {
exclude group: 'com.google.firebase', module: 'firebase-analytics'
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
}
playstoreImplementation 'com.android.installreferrer:installreferrer:2.1'
playstoreImplementation 'com.google.gms:google-services:4.3.5'
playstoreImplementation 'com.android.installreferrer:installreferrer:2.2'
playstoreImplementation 'com.google.gms:google-services:4.3.8'
implementation 'org.sufficientlysecure:openpgp-api:10.0'
implementation('com.theartofdev.edmodo:android-image-cropper:2.8.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
@ -63,17 +63,17 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.emoji:emoji:1.1.0'
gitImplementation 'androidx.emoji:emoji-appcompat:1.1.0'
gitImplementation 'androidx.emoji:emoji-bundled:1.1.0'
implementation 'com.google.android.material:material:1.0.0' // higher versions than 1.0.0 cause strange fab design
implementation 'com.google.android.material:material:1.4.0' // higher versions than 1.0.0 cause strange fab design
implementation 'androidx.cardview:cardview:1.0.0' // for compatibility
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.12.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.12.1'
implementation 'com.google.android.exoplayer:exoplayer-core:2.15.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.0'
implementation 'pub.devrel:easypermissions:3.0.0' // version >= 3.0.0 needs android X libraries
implementation 'com.wefika:flowlayout:0.4.1'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'
@ -85,8 +85,8 @@ dependencies {
implementation 'org.osmdroid:osmdroid-android:6.1.5'
implementation 'com.leinardi.android:speed-dial:3.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.12.12' // versions > 3.12.x don't support API level < 21 anymore
implementation 'com.squareup.retrofit2:retrofit:2.6.4' //retrofit needs to stick with 2.6.x for SDK < 21 (https://github.com/square/retrofit/blob/master/CHANGELOG.md)
implementation 'com.squareup.okhttp3:okhttp:4.9.2' // versions > 3.12.x don't support API level < 21 anymore
implementation 'com.squareup.retrofit2:retrofit:2.9.0' //retrofit needs to stick with 2.6.x for SDK < 21 (https://github.com/square/retrofit/blob/master/CHANGELOG.md)
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.google.guava:guava:30.1.1-android'
implementation 'com.github.AppIntro:AppIntro:6.1.0'

View file

@ -830,7 +830,7 @@ public class FileBackend {
}
}
private static int getRotation(final InputStream inputStream) throws IOException {
public static int getRotation(final InputStream inputStream) throws IOException {
final ExifInterface exif = new ExifInterface(inputStream);
final int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
switch (orientation) {

View file

@ -7,6 +7,7 @@ import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@ -24,11 +25,12 @@ import android.webkit.MimeTypeMap;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
import com.davemorrissey.labs.subscaleview.ImageSource;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.MediaSource;
@ -38,7 +40,6 @@ import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.leinardi.android.speeddial.SpeedDialActionItem;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
@ -46,12 +47,9 @@ import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.databinding.ActivityMediaViewerBinding;
import eu.siacs.conversations.persistance.FileBackend;
import eu.siacs.conversations.utils.ExifHelper;
import eu.siacs.conversations.utils.MimeUtils;
import me.drakeet.support.toast.ToastCompat;
import static eu.siacs.conversations.persistance.FileBackend.close;
public class MediaViewerActivity extends XmppActivity implements AudioManager.OnAudioFocusChangeListener {
Integer oldOrientation;
@ -154,6 +152,9 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On
if (info.size() == 0) {
openIntent.setDataAndType(uri, "*/*");
}
if (player != null && isVideo) {
openIntent.putExtra("position", player.getCurrentPosition());
}
try {
this.startActivity(openIntent);
finish();
@ -209,15 +210,18 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On
if (isDeletableFile(mFile)) {
binding.speedDial.addActionItem(new SpeedDialActionItem.Builder(R.id.action_delete, R.drawable.ic_delete_white_24dp)
.setLabel(R.string.action_delete)
.setFabImageTintColor(ContextCompat.getColor(this, R.color.white))
.create()
);
}
binding.speedDial.addActionItem(new SpeedDialActionItem.Builder(R.id.action_open, R.drawable.ic_open_in_new_white_24dp)
.setLabel(R.string.open_with)
.setFabImageTintColor(ContextCompat.getColor(this, R.color.white))
.create()
);
binding.speedDial.addActionItem(new SpeedDialActionItem.Builder(R.id.action_share, R.drawable.ic_share_white_24dp)
.setLabel(R.string.share)
.setFabImageTintColor(ContextCompat.getColor(this, R.color.white))
.create()
);
@ -253,6 +257,7 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On
return false;
});
}
binding.speedDial.getMainFab().setSupportImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.realwhite)));
showFab();
}
@ -315,9 +320,9 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On
binding.messageVideoView.setVisibility(View.VISIBLE);
player = new SimpleExoPlayer.Builder(this).build();
player.setPlayWhenReady(true);
player.addListener(new SimpleExoPlayer.EventListener() {
player.addListener(new Player.Listener() {
@Override
public void onPlayerError(ExoPlaybackException error) {
public void onPlayerError(PlaybackException error) {
open();
}
});
@ -352,14 +357,10 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On
}
private int getRotation(Uri image) {
InputStream is = null;
try {
is = this.getContentResolver().openInputStream(image);
return ExifHelper.getOrientation(is);
} catch (FileNotFoundException e) {
try (final InputStream is = this.getContentResolver().openInputStream(image)) {
return is == null ? 0 : FileBackend.getRotation(is);
} catch (final Exception e) {
return 0;
} finally {
close(is);
}
}