Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions app/src/main/java/com/openipc/pixelpilot/VideoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ private void setupVRSubMenu(PopupMenu popup) {
private void setupChannelSubMenu(PopupMenu popup) {
SubMenu chnMenu = popup.getMenu().addSubMenu("Channel");
int channelPref = getChannel(this);
chnMenu.setHeaderTitle("Current: " + channelPref);

// Create a disabled item to act as the header
MenuItem headerItem = chnMenu.add("Current: " + channelPref);
headerItem.setEnabled(false); // Makes it unclickable and grayed out like a label

String[] channels = getResources().getStringArray(R.array.channels);
for (String chnStr : channels) {
Expand All @@ -612,7 +615,10 @@ private void setupChannelSubMenu(PopupMenu popup) {
private void setupBandwidthSubMenu(PopupMenu popup) {
SubMenu bwMenu = popup.getMenu().addSubMenu("Bandwidth");
int bandwidthPref = getBandwidth(this);
bwMenu.setHeaderTitle("Current: " + bandwidthPref);

// Add a disabled item to act as the header
MenuItem headerItem = bwMenu.add("Current: " + bandwidthPref);
headerItem.setEnabled(false); // Visually looks like a header, but unclickable

String[] bws = getResources().getStringArray(R.array.bandwidths);
for (String bwStr : bws) {
Expand Down Expand Up @@ -815,7 +821,7 @@ private void showFecThresholdsDialog() {
.show();
}

void initDefaultOptions(){
void initDefaultOptions() {
SharedPreferences prefs = getSharedPreferences("general", MODE_PRIVATE);
boolean adaptiveEnabled = prefs.getBoolean("adaptive_link_enabled", true);
int adaptiveTxPower = prefs.getInt("adaptive_tx_power", 20);
Expand Down Expand Up @@ -1211,8 +1217,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
// VPN permission not granted
Log.e(TAG, "VPN permission was not granted by the user.");
}
}
else {
} else {
Log.w(TAG, "onActivityResult: unknown request code " + requestCode);
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_video.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/surfaceViewRight"/>
app:layout_constraintEnd_toStartOf="@id/surfaceViewRight"/>

<SurfaceView
android:id="@+id/surfaceViewRight"
Expand Down Expand Up @@ -74,6 +74,7 @@
android:layout_height="wrap_content"
android:text="Loading..."
android:textColor="@color/colorWhite"
android:textSize="24sp"
android:translationZ="10dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
Expand All @@ -86,6 +87,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorWhite"
android:textSize="24sp"
android:translationY="28dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down