diff --git a/app/build.gradle b/app/build.gradle index f6fedaf4d..e420d607d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,6 +20,10 @@ android { pseudoLocalesEnabled true } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } productFlavors { fdroid { @@ -34,12 +38,12 @@ allprojects { maven { url "https://maven.google.com"} } } -ext.supportLibraryVersion = '27.1.0' +ext.supportLibraryVersion = '27.0.2' ext.glideLibraryVersion = '4.6.1' ext.conscryptLibraryVersion = '1.0.1' -ext.evernoteLibraryVersion = '1.2.2' +ext.evernoteLibraryVersion = '1.2.4' ext.gsonLibraryVersion = '2.8.2' -ext.guavaLibraryVersion = '23.6-android' +ext.guavaLibraryVersion = '24.1-android' ext.photoViewLibraryVersion = '2.0.0' ext.swipebackLibraryVersion = '1.0.2' ext.ratethisappLibraryVersion = '1.2.0' diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowConversationActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowConversationActivity.java index bd6f74749..f22428e82 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowConversationActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowConversationActivity.java @@ -142,16 +142,17 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve action_refresh.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if( statuses != null) - swipeRefreshLayout.setRefreshing(true); - ( new Handler()).postDelayed(new Runnable() { - @Override - public void run() { - isRefreshed = true; - statusId = statuses.get(statuses.size()-1).getId(); - new RetrieveFeedsAsyncTask(getApplicationContext(), RetrieveFeedsAsyncTask.Type.ONESTATUS, statusId,null, false, false, ShowConversationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } - }, 1000); + if( statuses != null) { + swipeRefreshLayout.setRefreshing(true); + (new Handler()).postDelayed(new Runnable() { + @Override + public void run() { + isRefreshed = true; + statusId = statuses.get(statuses.size() - 1).getId(); + new RetrieveFeedsAsyncTask(getApplicationContext(), RetrieveFeedsAsyncTask.Type.ONESTATUS, statusId, null, false, false, ShowConversationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } + }, 1000); + } } }); action_expand.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java index 6f13abe34..826884c24 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java @@ -807,6 +807,11 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount @Override protected Void doInBackground(Void... voids) { + + if( this.fileWeakReference.get() == null) { + Toast.makeText(activityWeakReference.get(), R.string.toast_error, Toast.LENGTH_SHORT).show(); + return null; + } Bitmap takenImage = BitmapFactory.decodeFile(String.valueOf(this.fileWeakReference.get())); int size = takenImage.getByteCount(); SharedPreferences sharedpreferences = this.activityWeakReference.get().getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE); @@ -836,6 +841,8 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount @Override protected void onPostExecute(Void result) { + if( bs == null) + return; ImageButton toot_picture; LinearLayout toot_picture_container; toot_picture = this.activityWeakReference.get().findViewById(R.id.toot_picture);