Browse Source

More up libs

pull/63/head
Ezerous 6 years ago
parent
commit
5a5c9a7cfe
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 12
      app/build.gradle
  2. 5
      app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java
  3. 12
      app/src/main/java/gr/thmmy/mthmmy/utils/TakePhoto.java

12
app/build.gradle

@ -61,14 +61,15 @@ tasks.whenTaskAdded { task ->
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
implementation 'androidx.preference:preference:1.1.0-beta01' implementation 'androidx.preference:preference:1.1.0-beta01'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0' implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.exifinterface:exifinterface:1.1.0-alpha01'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0' implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-messaging:19.0.1' implementation 'com.google.firebase:firebase-messaging:19.0.1'
@ -78,8 +79,8 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'org.jsoup:jsoup:1.10.3' //TODO: Warning: upgrading from 1.10.3 will break stuff! implementation 'org.jsoup:jsoup:1.10.3' //TODO: Warning: upgrading from 1.10.3 will break stuff!
implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1' implementation 'com.github.franmontiel:PersistentCookieJar:1.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' implementation 'com.github.PhilJay:MPAndroidChart:3.0.3'
implementation 'com.mikepenz:materialdrawer:6.1.1' implementation 'com.mikepenz:materialdrawer:6.1.1'
implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar' implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar'
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar' implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
@ -90,7 +91,8 @@ dependencies {
implementation 'ru.noties:markwon:2.0.2' implementation 'ru.noties:markwon:2.0.2'
implementation 'net.gotev:uploadservice:3.5.2' implementation 'net.gotev:uploadservice:3.5.2'
implementation 'net.gotev:uploadservice-okhttp:3.5.2' implementation 'net.gotev:uploadservice-okhttp:3.5.2'
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.5' //Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.5'
//Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'

5
app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java

@ -261,10 +261,9 @@ public class NotificationService extends FirebaseMessagingService {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// Since Android Oreo notification channel is needed. // Since Android Oreo notification channel is needed.
if (buildVersion >= Build.VERSION_CODES.O){ if (buildVersion >= Build.VERSION_CODES.O && notificationManager.getNotificationChannel(CHANNEL_ID) == null)
if (notificationManager.getNotificationChannel(CHANNEL_ID) == null)
notificationManager.createNotificationChannel(new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH)); notificationManager.createNotificationChannel(new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH));
}
notificationManager.notify(NEW_POST_TAG, notificationId, notificationBuilder.build()); notificationManager.notify(NEW_POST_TAG, notificationId, notificationBuilder.build());

12
app/src/main/java/gr/thmmy/mthmmy/utils/TakePhoto.java

@ -10,7 +10,6 @@ import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.media.ExifInterface;
import android.net.Uri; import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import android.provider.MediaStore; import android.provider.MediaStore;
@ -19,6 +18,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import androidx.exifinterface.media.ExifInterface;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -86,12 +86,10 @@ public class TakePhoto {
File imageFolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + File imageFolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) +
File.separator + "mTHMMY"); File.separator + "mTHMMY");
if (!imageFolder.exists()) { if (!imageFolder.exists()&&!imageFolder.mkdirs()) {
if (!imageFolder.mkdirs()) { Timber.w("Photos folder build returned false in %s", TakePhoto.class.getSimpleName());
Timber.w("Photos folder build returned false in %s", TakePhoto.class.getSimpleName()); Toast.makeText(context, "Couldn't create photos directory", Toast.LENGTH_SHORT).show();
Toast.makeText(context, "Couldn't create photos directory", Toast.LENGTH_SHORT).show(); return null;
return null;
}
} }
return new File(imageFolder, imageFileName); return new File(imageFolder, imageFileName);

Loading…
Cancel
Save