Skip to content

Commit

Permalink
#61 Try out grouping the MCC and MNC together on the cellular UI
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrowlands committed Nov 18, 2024
1 parent e8d04c0 commit 8291ef7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ private void initializeObservers()

viewModel.getServingCellProtocol().observe(viewLifecycleOwner, this::updateServingCellProtocol);

viewModel.getMcc().observe(viewLifecycleOwner, s -> binding.mcc.setText(s));
viewModel.getMnc().observe(viewLifecycleOwner, s -> binding.mnc.setText(s));
viewModel.getMcc().observe(viewLifecycleOwner, s -> binding.plmn.setText(getString(R.string.mcc_mnc_value, s, viewModel.getMnc().getValue())));
viewModel.getMnc().observe(viewLifecycleOwner, s -> binding.plmn.setText(getString(R.string.mcc_mnc_value, viewModel.getMcc().getValue(), s)));
viewModel.getAreaCode().observe(viewLifecycleOwner, s -> binding.tac.setText(s));
viewModel.getCellId().observe(viewLifecycleOwner, this::updateCellIdentity);
viewModel.getChannelNumber().observe(viewLifecycleOwner, s -> binding.earfcn.setText(s));
Expand Down
42 changes: 7 additions & 35 deletions networksurvey/src/main/res/layout/fragment_network_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,58 +245,30 @@
android:baselineAligned="false">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mcc_group"
android:id="@+id/plmn_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<TextView
android:id="@+id/mcc"
android:id="@+id/plmn"
style="@style/StandardText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintTop_toTopOf="@id/mcc_group"
app:layout_constraintBottom_toTopOf="@id/mcc_label"
app:layout_constraintTop_toTopOf="@id/plmn_group"
app:layout_constraintBottom_toTopOf="@id/plmn_label"
android:textIsSelectable="true"
tools:layout_editor_absoluteX="8dp" />

<TextView
android:id="@+id/mcc_label"
android:id="@+id/plmn_label"
style="@style/SmallLabelText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/mcc_label"
app:layout_constraintBottom_toBottomOf="@id/mcc_group" />

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mnc_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<TextView
android:id="@+id/mnc"
style="@style/StandardText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintTop_toTopOf="@id/mnc_group"
app:layout_constraintBottom_toTopOf="@id/mnc_label"
android:textIsSelectable="true"
tools:layout_editor_absoluteX="8dp" />

<TextView
android:id="@+id/mnc_label"
style="@style/SmallLabelText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/mnc_label"
app:layout_constraintBottom_toBottomOf="@id/mnc_group" />
android:text="@string/mcc_mnc_label"
app:layout_constraintBottom_toBottomOf="@id/plmn_group" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
2 changes: 2 additions & 0 deletions networksurvey/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ but work independently, so you have full control over how you handle your data.<
<!-- LTE and Common labels -->
<string name="mcc_label">MCC</string>
<string name="mnc_label">MNC</string>
<string name="mcc_mnc_label">MCC/MNC</string>
<string name="mcc_mnc_value">%1$s/%2$s</string>
<string name="tac_label">TAC</string>
<string name="cid_label">CID</string>
<string name="enb_id_label">eNB ID</string>
Expand Down

0 comments on commit 8291ef7

Please sign in to comment.