Improves previews with missing.png
This commit is contained in:
parent
f8f2ed640a
commit
82d9deff6c
|
@ -312,6 +312,8 @@ public class MediaActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
loader.setVisibility(View.GONE);
|
||||
mp.start();
|
||||
mp.setLooping(true);
|
||||
}
|
||||
});
|
||||
videoView.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -1551,7 +1551,7 @@ public class API {
|
|||
|
||||
private void get(String action, RequestParams params, AsyncHttpResponseHandler responseHandler) {
|
||||
try {
|
||||
client.setConnectTimeout(10000); //10s timeout
|
||||
client.setConnectTimeout(20000); //20s timeout
|
||||
client.setUserAgent(USER_AGENT);
|
||||
client.addHeader("Authorization", "Bearer "+prefKeyOauthTokenT);
|
||||
MastalabSSLSocketFactory mastalabSSLSocketFactory = new MastalabSSLSocketFactory(MastalabSSLSocketFactory.getKeystore());
|
||||
|
@ -1582,7 +1582,7 @@ public class API {
|
|||
|
||||
private void delete(String action, RequestParams params, AsyncHttpResponseHandler responseHandler){
|
||||
try {
|
||||
client.setConnectTimeout(10000); //10s timeout
|
||||
client.setConnectTimeout(20000); //20s timeout
|
||||
client.setUserAgent(USER_AGENT);
|
||||
client.addHeader("Authorization", "Bearer "+prefKeyOauthTokenT);
|
||||
MastalabSSLSocketFactory mastalabSSLSocketFactory = new MastalabSSLSocketFactory(MastalabSSLSocketFactory.getKeystore());
|
||||
|
@ -1597,7 +1597,7 @@ public class API {
|
|||
|
||||
private void patch(String action, RequestParams params, AsyncHttpResponseHandler responseHandler){
|
||||
try {
|
||||
client.setConnectTimeout(10000); //10s timeout
|
||||
client.setConnectTimeout(60000); //60s timeout
|
||||
client.setUserAgent(USER_AGENT);
|
||||
client.addHeader("Authorization", "Bearer "+prefKeyOauthTokenT);
|
||||
MastalabSSLSocketFactory mastalabSSLSocketFactory = new MastalabSSLSocketFactory(MastalabSSLSocketFactory.getKeystore());
|
||||
|
|
|
@ -32,6 +32,7 @@ import android.support.v7.widget.CardView;
|
|||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -206,7 +207,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
//Display a preview for accounts that have replied *if enabled and only for home timeline*
|
||||
if( type == RetrieveFeedsAsyncTask.Type.HOME ) {
|
||||
boolean showPreview = sharedpreferences.getBoolean(Helper.SET_PREVIEW_REPLIES, true);
|
||||
if ( status.getReplies().size() == 0){
|
||||
if ( !showPreview || status.getReplies() == null || status.getReplies().size() == 0){
|
||||
holder.status_replies.setVisibility(View.GONE);
|
||||
}else if(status.getReplies().size() > 0 ){
|
||||
ArrayList<String> addedPictures = new ArrayList<>();
|
||||
|
@ -216,11 +217,14 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
if( i > 4 )
|
||||
break;
|
||||
if( !addedPictures.contains(replies.getAccount().getAcct())){
|
||||
final ImageView imageView = new ImageView(context);
|
||||
ImageView imageView = new ImageView(context);
|
||||
imageView.setMaxHeight((int) Helper.convertDpToPixel(40, context));
|
||||
imageView.setMaxWidth((int) Helper.convertDpToPixel(40, context));
|
||||
imageLoader.displayImage(replies.getAccount().getAvatar(), imageView, options);
|
||||
LinearLayout.LayoutParams imParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
imParams.setMargins(10, 5, 10, 5);
|
||||
imParams.height = (int) Helper.convertDpToPixel(50, context);
|
||||
imParams.height = (int) Helper.convertDpToPixel(40, context);
|
||||
imParams.width = (int) Helper.convertDpToPixel(40, context);
|
||||
holder.status_replies_profile_pictures.addView(imageView, imParams);
|
||||
i++;
|
||||
addedPictures.add(replies.getAccount().getAcct());
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/media_video"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="gone"
|
||||
|
|
|
@ -394,6 +394,7 @@
|
|||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:id="@+id/status_replies"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
Loading…
Reference in New Issue