mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
Scroll to item after clearing access rules
This commit is contained in:
parent
bdfc007218
commit
bd78a165b7
1 changed files with 15 additions and 0 deletions
|
@ -67,6 +67,7 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
|
||||
private Activity context;
|
||||
private DatabaseHelper dh;
|
||||
private RecyclerView rv;
|
||||
private boolean wifi;
|
||||
private boolean telephony;
|
||||
private boolean filter;
|
||||
|
@ -256,6 +257,18 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
rv = recyclerView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
|
||||
super.onDetachedFromRecyclerView(recyclerView);
|
||||
rv = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, final int position) {
|
||||
// Get rule
|
||||
|
@ -620,6 +633,8 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
@Override
|
||||
public void onSure() {
|
||||
dh.clearAccess(rule.info.applicationInfo.uid);
|
||||
if (rv != null)
|
||||
rv.scrollToPosition(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue