From 257a00fa1ef4e93f7394584dfb2bb626a04d983c Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 10 Oct 2020 09:37:44 +0200 Subject: [PATCH] Some fixes --- .../java/app/fedilab/fedilabtube/SepiaSearchActivity.java | 2 ++ .../fedilabtube/fragment/DisplaySepiaSearchFragment.java | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/SepiaSearchActivity.java b/app/src/main/java/app/fedilab/fedilabtube/SepiaSearchActivity.java index 299f52b..b7f2768 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/SepiaSearchActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/SepiaSearchActivity.java @@ -71,6 +71,7 @@ public class SepiaSearchActivity extends AppCompatActivity { sepiaSearchVideo.setCount(String.valueOf(sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE))); sepiaSearchVideo.setDurationMin(0); sepiaSearchVideo.setDurationMax(9999999); + sepiaSearchVideo.setStart("0"); sepiaSearchVideo.setSort("-match"); if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -319,6 +320,7 @@ public class SepiaSearchActivity extends AppCompatActivity { private void makeSearch(){ hideKeyboard(SepiaSearchActivity.this); + sepiaSearchVideo.setStart("0"); if( sepia_element_one_of_tags.getTags().size() > 0 ) { sepiaSearchVideo.setTagsOneOf(sepia_element_one_of_tags.getTags()); }else{ diff --git a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplaySepiaSearchFragment.java b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplaySepiaSearchFragment.java index b21ea2c..611247c 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplaySepiaSearchFragment.java +++ b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplaySepiaSearchFragment.java @@ -59,7 +59,6 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori private boolean flag_loading; private Context context; private PeertubeAdapter peertubeAdapater; - private String max_id; private List peertubes; private RelativeLayout mainLoader, nextElementLoader, textviewNoAction; private boolean firstLoad; @@ -86,7 +85,6 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori if (bundle != null) { sepiaSearchVideo = bundle.getParcelable("sepiaSearchVideo"); } - max_id = "0"; lv_status = rootView.findViewById(R.id.lv_status); flag_loading = true; firstLoad = true; @@ -215,10 +213,8 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori return; } int previousPosition = this.peertubes.size(); - if (max_id == null) - max_id = "0"; int videoPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE); - max_id = String.valueOf(Integer.parseInt(max_id) + videoPerPage); + sepiaSearchVideo.setStart(String.valueOf(Integer.parseInt(sepiaSearchVideo.getStart())+ videoPerPage)); this.peertubes.addAll(videoData.data); //If no item were inserted previously the adapter is created if (previousPosition == 0) {