1
0
Fork 0

For #6198: Update copy and position of pair QR code scan message.

master
mcarare 2020-05-25 14:42:10 +03:00 committed by Jonathan Almeida
parent 44d9dc9237
commit 6e325d6242
3 changed files with 8 additions and 28 deletions

View File

@ -12,11 +12,9 @@ import android.os.Vibrator
import android.view.View import android.view.View
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.core.text.HtmlCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.navigation.fragment.NavHostFragment.findNavController import androidx.navigation.fragment.NavHostFragment.findNavController
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import kotlinx.android.synthetic.main.fragment_pair.*
import mozilla.components.feature.qr.QrFeature import mozilla.components.feature.qr.QrFeature
import mozilla.components.support.base.feature.UserInteractionHandler import mozilla.components.support.base.feature.UserInteractionHandler
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
@ -31,11 +29,6 @@ class PairFragment : Fragment(R.layout.fragment_pair), UserInteractionHandler {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
pairInstructions.text = HtmlCompat.fromHtml(
getString(R.string.pair_instructions),
HtmlCompat.FROM_HTML_MODE_LEGACY
)
qrFeature.set( qrFeature.set(
QrFeature( QrFeature(
requireContext(), requireContext(),
@ -64,7 +57,8 @@ class PairFragment : Fragment(R.layout.fragment_pair), UserInteractionHandler {
R.id.turnOnSyncFragment, R.id.turnOnSyncFragment,
false false
) )
}), },
scanMessage = R.string.pair_instructions_2),
owner = this, owner = this,
view = view view = view
) )

View File

@ -1,23 +1,9 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pair_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="horizontal">
<RelativeLayout </LinearLayout>
android:id="@+id/pair_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/pairInstructions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#8000"
android:gravity="center"
android:text="@string/pair_instructions"
android:textColor="@color/photonWhite"
android:textSize="20sp" />
</RelativeLayout>

View File

@ -365,7 +365,7 @@
<!-- Pairing Feature strings --> <!-- Pairing Feature strings -->
<!-- Instructions on how to access pairing --> <!-- Instructions on how to access pairing -->
<string name="pair_instructions"><![CDATA[Visit <b>firefox.com/pair</b> in Firefox on your computer to get your QR code.]]></string> <string name="pair_instructions_2"><![CDATA[Scan the QR code shown at <b>firefox.com/pair</b>]]></string>
<!-- Button to open camera for pairing --> <!-- Button to open camera for pairing -->
<string name="pair_open_camera">Open Camera</string> <string name="pair_open_camera">Open Camera</string>
<!-- Button to cancel pairing --> <!-- Button to cancel pairing -->