Skip to content

Commit c69cdd8

Browse files
authored
Show current channel and bandwidth on tablets (#88)
* Show current channel and bandwidth on tablets * Make message size larger
1 parent 22c02c2 commit c69cdd8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

app/src/main/java/com/openipc/pixelpilot/VideoActivity.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,10 @@ private void setupVRSubMenu(PopupMenu popup) {
595595
private void setupChannelSubMenu(PopupMenu popup) {
596596
SubMenu chnMenu = popup.getMenu().addSubMenu("Channel");
597597
int channelPref = getChannel(this);
598-
chnMenu.setHeaderTitle("Current: " + channelPref);
598+
599+
// Create a disabled item to act as the header
600+
MenuItem headerItem = chnMenu.add("Current: " + channelPref);
601+
headerItem.setEnabled(false); // Makes it unclickable and grayed out like a label
599602

600603
String[] channels = getResources().getStringArray(R.array.channels);
601604
for (String chnStr : channels) {
@@ -612,7 +615,10 @@ private void setupChannelSubMenu(PopupMenu popup) {
612615
private void setupBandwidthSubMenu(PopupMenu popup) {
613616
SubMenu bwMenu = popup.getMenu().addSubMenu("Bandwidth");
614617
int bandwidthPref = getBandwidth(this);
615-
bwMenu.setHeaderTitle("Current: " + bandwidthPref);
618+
619+
// Add a disabled item to act as the header
620+
MenuItem headerItem = bwMenu.add("Current: " + bandwidthPref);
621+
headerItem.setEnabled(false); // Visually looks like a header, but unclickable
616622

617623
String[] bws = getResources().getStringArray(R.array.bandwidths);
618624
for (String bwStr : bws) {
@@ -815,7 +821,7 @@ private void showFecThresholdsDialog() {
815821
.show();
816822
}
817823

818-
void initDefaultOptions(){
824+
void initDefaultOptions() {
819825
SharedPreferences prefs = getSharedPreferences("general", MODE_PRIVATE);
820826
boolean adaptiveEnabled = prefs.getBoolean("adaptive_link_enabled", true);
821827
int adaptiveTxPower = prefs.getInt("adaptive_tx_power", 20);
@@ -1211,8 +1217,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
12111217
// VPN permission not granted
12121218
Log.e(TAG, "VPN permission was not granted by the user.");
12131219
}
1214-
}
1215-
else {
1220+
} else {
12161221
Log.w(TAG, "onActivityResult: unknown request code " + requestCode);
12171222
}
12181223
}

app/src/main/res/layout/activity_video.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
app:layout_constraintTop_toTopOf="parent"
2424
app:layout_constraintBottom_toBottomOf="parent"
2525
app:layout_constraintStart_toStartOf="parent"
26-
app:layout_constraintEnd_toStartOf="@+id/surfaceViewRight"/>
26+
app:layout_constraintEnd_toStartOf="@id/surfaceViewRight"/>
2727

2828
<SurfaceView
2929
android:id="@+id/surfaceViewRight"
@@ -74,6 +74,7 @@
7474
android:layout_height="wrap_content"
7575
android:text="Loading..."
7676
android:textColor="@color/colorWhite"
77+
android:textSize="24sp"
7778
android:translationZ="10dp"
7879
android:visibility="visible"
7980
app:layout_constraintBottom_toBottomOf="parent"
@@ -86,6 +87,7 @@
8687
android:layout_width="wrap_content"
8788
android:layout_height="wrap_content"
8889
android:textColor="@color/colorWhite"
90+
android:textSize="24sp"
8991
android:translationY="28dp"
9092
android:visibility="gone"
9193
app:layout_constraintBottom_toBottomOf="parent"

0 commit comments

Comments
 (0)