Some fixes with Peertube
This commit is contained in:
parent
6c20904a8b
commit
aa07a91fa9
|
@ -710,6 +710,28 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
manageTimelineList(false);
|
manageTimelineList(false);
|
||||||
tabLayout.setVisibility(View.GONE);
|
tabLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
}else if ( social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
||||||
|
DisplayStatusFragment statusFragment;
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
statusFragment = new DisplayStatusFragment();
|
||||||
|
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE);
|
||||||
|
bundle.putString("remote_instance", instance);
|
||||||
|
bundle.putString("instanceType", "PEERTUBE");
|
||||||
|
bundle.putString("search_peertube", query);
|
||||||
|
statusFragment.setArguments(bundle);
|
||||||
|
String fragmentTag = "REMOTE_INSTANCE";
|
||||||
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
fragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.main_app_container, statusFragment, fragmentTag).commit();
|
||||||
|
if( main_app_container.getVisibility() == View.GONE){
|
||||||
|
|
||||||
|
main_app_container.setVisibility(View.VISIBLE);
|
||||||
|
toolbarTitle.setVisibility(View.VISIBLE);
|
||||||
|
delete_instance.setVisibility(View.VISIBLE);
|
||||||
|
viewPager.setVisibility(View.GONE);
|
||||||
|
manageTimelineList(false);
|
||||||
|
tabLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
if( social != UpdateAccountInfoAsyncTask.SOCIAL.GNU) {
|
if( social != UpdateAccountInfoAsyncTask.SOCIAL.GNU) {
|
||||||
boolean isAccount = false;
|
boolean isAccount = false;
|
||||||
|
|
|
@ -1690,6 +1690,7 @@ public class API {
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
params.put("search", query);
|
params.put("search", query);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Peertube> peertubes = new ArrayList<>();
|
List<Peertube> peertubes = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
HttpsConnection httpsConnection = new HttpsConnection(context, this.instance);
|
HttpsConnection httpsConnection = new HttpsConnection(context, this.instance);
|
||||||
|
|
|
@ -340,21 +340,26 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
else
|
else {
|
||||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
if( peertubes.size() > 0) {
|
if (peertubes.size() > 0) {
|
||||||
int size = peertubes.size();
|
int size = peertubes.size();
|
||||||
isSwipped = true;
|
isSwipped = true;
|
||||||
peertubes.clear();
|
peertubes.clear();
|
||||||
peertubes = new ArrayList<>();
|
peertubes = new ArrayList<>();
|
||||||
max_id = "0";
|
max_id = "0";
|
||||||
peertubeAdapater.notifyItemRangeRemoved(0, size);
|
peertubeAdapater.notifyItemRangeRemoved(0, size);
|
||||||
asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, "0", DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
if (search_peertube == null) { //Not a Peertube search
|
||||||
|
asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, "0", DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
} else {
|
||||||
|
asyncTask = new RetrievePeertubeSearchAsyncTask(context, remoteInstance, search_peertube, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||||
switch (theme){
|
switch (theme){
|
||||||
|
|
Loading…
Reference in New Issue