parent
f6fb7f6ea2
commit
3f93a17184
|
|
@ -58,6 +58,7 @@ import android.widget.Toast;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
|
|
@ -614,6 +615,22 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
|||
}
|
||||
}
|
||||
|
||||
public SearchView.OnQueryTextListener getSearchListener() {
|
||||
return new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
refresh(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
refresh(false);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
if (!refreshing && activity.binding.masterSwitch.isChecked() && checkedList.isEmpty()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
|
|
|
|||
|
|
@ -86,19 +86,7 @@ public class AppListActivity extends BaseActivity {
|
|||
RecyclerViewKt.fixEdgeEffect(binding.recyclerView, false, true);
|
||||
binding.swipeRefreshLayout.setOnRefreshListener(() -> scopeAdapter.refresh(true));
|
||||
|
||||
searchListener = new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
scopeAdapter.getFilter().filter(query);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
scopeAdapter.getFilter().filter(newText);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
searchListener = scopeAdapter.getSearchListener();
|
||||
|
||||
backupLauncher = registerForActivityResult(new ActivityResultContracts.CreateDocument(),
|
||||
uri -> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue