some fixes
This commit is contained in:
parent
b2b08cc02d
commit
60022ff22e
|
@ -30,7 +30,6 @@ import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
@ -410,12 +409,18 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
||||||
pbar_inf.setIndeterminate(false);
|
pbar_inf.setIndeterminate(false);
|
||||||
pbar_inf.setScaleY(3f);
|
pbar_inf.setScaleY(3f);
|
||||||
File file = new File(getCacheDir() + "/" + Helper.md5(url)+".mp4");
|
File file = new File(getCacheDir() + "/" + Helper.md5(url)+".mp4");
|
||||||
|
try {
|
||||||
|
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
|
||||||
|
} catch (KeyManagementException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
if(file.exists()) {
|
if(file.exists()) {
|
||||||
Uri uri = Uri.parse(file.getAbsolutePath());
|
Uri uri = Uri.parse(file.getAbsolutePath());
|
||||||
videoView.setVisibility(View.VISIBLE);
|
videoView.setVisibility(View.VISIBLE);
|
||||||
Log.v(Helper.TAG,"uri 2: " + uri);
|
|
||||||
videoView.setVideoURI(uri);
|
videoView.setVideoURI(uri);
|
||||||
videoView.seekTo(0);
|
|
||||||
videoView.start();
|
videoView.start();
|
||||||
MediaController mc = new MediaController(MediaActivity.this);
|
MediaController mc = new MediaController(MediaActivity.this);
|
||||||
videoView.setMediaController(mc);
|
videoView.setMediaController(mc);
|
||||||
|
@ -432,14 +437,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
||||||
}else{
|
}else{
|
||||||
videoView.setVisibility(View.VISIBLE);
|
videoView.setVisibility(View.VISIBLE);
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
try {
|
|
||||||
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Log.v(Helper.TAG,"uri 1: " + uri);
|
|
||||||
videoView.setVideoURI(uri);
|
videoView.setVideoURI(uri);
|
||||||
videoView.start();
|
videoView.start();
|
||||||
MediaController mc = new MediaController(MediaActivity.this);
|
MediaController mc = new MediaController(MediaActivity.this);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.net.Socket;
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLEngine;
|
||||||
import javax.net.ssl.SSLSocket;
|
import javax.net.ssl.SSLSocket;
|
||||||
import javax.net.ssl.SSLSocketFactory;
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
|
||||||
|
@ -30,6 +31,11 @@ public class TLSSocketFactory extends SSLSocketFactory {
|
||||||
public SSLContext getSSLContext(){
|
public SSLContext getSSLContext(){
|
||||||
return this.context;
|
return this.context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SSLEngine getSSLEngine(){
|
||||||
|
return this.context.createSSLEngine();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getDefaultCipherSuites() {
|
public String[] getDefaultCipherSuites() {
|
||||||
return sSLSocketFactory.getDefaultCipherSuites();
|
return sSLSocketFactory.getDefaultCipherSuites();
|
||||||
|
|
|
@ -20,7 +20,6 @@ import android.graphics.Canvas;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v4.content.res.ResourcesCompat;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
private List<String> mutedAccount;
|
private List<String> mutedAccount;
|
||||||
private String instanceType;
|
private String instanceType;
|
||||||
private String search_peertube, remote_channel_name;
|
private String search_peertube, remote_channel_name;
|
||||||
private boolean isFetchingMore;
|
|
||||||
|
|
||||||
public DisplayStatusFragment(){
|
public DisplayStatusFragment(){
|
||||||
}
|
}
|
||||||
|
@ -113,7 +112,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
firstTootsLoaded = true;
|
firstTootsLoaded = true;
|
||||||
showPinned = false;
|
showPinned = false;
|
||||||
showReply = false;
|
showReply = false;
|
||||||
isFetchingMore = false;
|
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
type = (RetrieveFeedsAsyncTask.Type) bundle.get("type");
|
type = (RetrieveFeedsAsyncTask.Type) bundle.get("type");
|
||||||
targetedId = bundle.getString("targetedId", null);
|
targetedId = bundle.getString("targetedId", null);
|
||||||
|
@ -463,11 +461,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
if( tmpStatuses.size() < 3) //If new toots are only two
|
if( tmpStatuses.size() < 3) //If new toots are only two
|
||||||
lv_status.scrollToPosition(0);
|
lv_status.scrollToPosition(0);
|
||||||
else {
|
else {
|
||||||
if(isFetchingMore)
|
lv_status.scrollToPosition(position + tmpStatuses.size());
|
||||||
lv_status.scrollToPosition(position);
|
|
||||||
else
|
|
||||||
lv_status.scrollToPosition(position + tmpStatuses.size());
|
|
||||||
isFetchingMore = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +485,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
}
|
}
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
firstLoad = false;
|
firstLoad = false;
|
||||||
isFetchingMore = false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -734,7 +727,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fetchMore(String max_id){
|
public void fetchMore(String max_id){
|
||||||
isFetchingMore = true;
|
|
||||||
asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue