Skip to content

Commit

Permalink
Fixed layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Corwin-Kh committed Oct 14, 2024
1 parent 9940f1b commit 5b1599b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
32 changes: 8 additions & 24 deletions OsmAnd/res/layout/fragment_obd_devices_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,42 +76,26 @@
android:id="@+id/titleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding"
android:text="@string/connect_obd_instructions_title"
android:textSize="16sp"
android:layout_marginBottom="@dimen/content_padding"/>
android:textSize="16sp" />

<TextView
android:id="@+id/howToConnectText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding_half"
android:text="@string/obd_how_to_connect"
android:textStyle="bold"
android:textSize="16sp"
android:layout_marginBottom="@dimen/content_padding_half"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect_obd_instructions_step1"
android:layout_marginBottom="@dimen/content_padding_half"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect_obd_instructions_step2"
android:layout_marginBottom="@dimen/content_padding_half"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect_obd_instructions_step3"
android:layout_marginBottom="@dimen/content_padding_half"/>
android:textStyle="bold" />

<TextView
android:id="@+id/connect_instructions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect_obd_instructions_step4"
android:layout_marginBottom="@dimen/content_padding"/>
android:layout_marginStart="@dimen/content_padding_half"
android:layout_marginBottom="@dimen/content_padding_half"
android:text="@string/connect_obd_instructions_step" />

</LinearLayout>

Expand Down
4 changes: 4 additions & 0 deletions OsmAnd/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ You will be able to pair this scanner again at any time.</string>
<string name="obd_vehicle_info">Vehicle info</string>
<string name="connect_obd_instructions_title">OsmAnd supports Bluetooth connections to OBD-II scanners.</string>
<string name="obd_how_to_connect">How to connect:</string>
<string name="connect_obd_instructions_step">1. Connect the scanner to your vehicle\'s OBD-II port.\n\n
2. Turn on your vehicle\'s engine\n\n
3. Enable Bluetooth on your device\n\n
4. Tap \'%1$s\' and select your scanner from the list.</string>
<string name="connect_obd_instructions_step1">1. Connect the scanner to your vehicle\'s OBD-II port.</string>
<string name="connect_obd_instructions_step2">2. Turn on your vehicle\'s engine</string>
<string name="connect_obd_instructions_step3">3. Enable Bluetooth on your device</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ class OBDDevicesListFragment : OBDDevicesBaseFragment(),
disconnectedListAdapter = OBDDevicesAdapter(app, nightMode, this)
connectedList?.adapter = connectedListAdapter
disconnectedList?.adapter = disconnectedListAdapter
val connectInstructions = view.findViewById<TextView>(R.id.connect_instructions)
connectInstructions.text = String.format(app.getString(R.string.connect_obd_instructions_step),
app.getString(R.string.external_device_details_connect))
}

private fun setupPairSensorButton(view: View) {
val dismissButton = view.findViewById<DialogButton>(R.id.dismiss_button)
dismissButton.setButtonType(DialogButtonType.SECONDARY)
dismissButton.setTitleId(R.string.ant_plus_pair_new_sensor)
dismissButton.setTitleId(R.string.external_device_details_connect)
val layoutParams = dismissButton.layoutParams
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT
dismissButton.layoutParams = layoutParams
Expand Down

0 comments on commit 5b1599b

Please sign in to comment.