media in notifications
This commit is contained in:
parent
796f52b7be
commit
2513a2f305
|
@ -41,6 +41,7 @@
|
|||
android:required="false" />
|
||||
<application
|
||||
android:name="app.fedilab.android.activities.MainApplication"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:allowBackup="false"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher_bubbles"
|
||||
|
|
|
@ -158,7 +158,15 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
int position = mPager.getCurrentItem();
|
||||
Attachment attachment = attachments.get(position);
|
||||
if( attachment.getType().compareTo("image") == 0 ){
|
||||
Helper.manageMove(SlideMediaActivity.this, attachment.getUrl(), false);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (ContextCompat.checkSelfPermission(SlideMediaActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(SlideMediaActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(SlideMediaActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE);
|
||||
} else {
|
||||
Helper.manageMove(SlideMediaActivity.this, attachment.getUrl(), false);
|
||||
}
|
||||
} else {
|
||||
Helper.manageMove(SlideMediaActivity.this, attachment.getUrl(), false);
|
||||
}
|
||||
}else {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (ContextCompat.checkSelfPermission(SlideMediaActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(SlideMediaActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
|
|
@ -202,7 +202,8 @@ public class HttpsConnection {
|
|||
|
||||
.url(httpBuider.build())
|
||||
.build();
|
||||
try (Response httpresponse = client.newCall(requesthttp).execute()) {
|
||||
try {
|
||||
Response httpresponse = client.newCall(requesthttp).execute();
|
||||
assert httpresponse.body() != null;
|
||||
String response = httpresponse.body().string();
|
||||
int code = httpresponse.code();
|
||||
|
@ -213,7 +214,8 @@ public class HttpsConnection {
|
|||
} else {
|
||||
throw new HttpsConnectionException(code, error);
|
||||
}
|
||||
} finally {
|
||||
} catch (Exception ignored){}
|
||||
finally {
|
||||
if (!cache.isClosed()) {
|
||||
try {
|
||||
cache.close();
|
||||
|
@ -222,6 +224,7 @@ public class HttpsConnection {
|
|||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}else{
|
||||
|
||||
if (proxy != null)
|
||||
|
|
|
@ -145,6 +145,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
@Override
|
||||
@NonNull
|
||||
public List<String> getPreloadItems(int position) {
|
||||
if( statuses == null || statuses.size() == 0){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Status status = statuses.get(position);
|
||||
if (status.getMedia_attachments() == null || status.getMedia_attachments().size() ==0) {
|
||||
return Collections.emptyList();
|
||||
|
|
Loading…
Reference in New Issue