update USB-OTG status every time the user switches to Nearby
The USB-OTG device can be plugged and unplugged anytime, so the Nearby view should be updated each time the user switches to this screen. Registered callbacks should handle updating the USB-OTG status while the Nearby view is active.
This commit is contained in:
parent
bd45f0fdc5
commit
6fd7970ca5
@ -21,14 +21,14 @@
|
|||||||
|
|
||||||
package org.fdroid.fdroid.views.main;
|
package org.fdroid.fdroid.views.main;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import android.util.SparseIntArray;
|
import android.util.SparseIntArray;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.PopupMenu;
|
import android.widget.PopupMenu;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,6 +76,8 @@ class MainViewAdapter extends RecyclerView.Adapter<MainViewController> {
|
|||||||
long viewType = getItemId(holder.getAdapterPosition());
|
long viewType = getItemId(holder.getAdapterPosition());
|
||||||
if (viewType == R.id.updates) {
|
if (viewType == R.id.updates) {
|
||||||
holder.bindUpdates();
|
holder.bindUpdates();
|
||||||
|
} else if (viewType == R.id.nearby) {
|
||||||
|
NearbyViewBinder.updateUsbOtg(activity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user