mirror of
https://github.com/screentinker/screentinker.git
synced 2026-06-17 03:32:32 -06:00
fix(android): stop pairing-code glyph clip + remove duplicate instruction
- The code's bottom was still clipped: the autosize TextView used wrap_content height, which clips glyph bottoms. Give it a fixed 96dp box (autosize 24-64sp, gravity center) so the text is centered inside a bounded box and never clipped. - The "Enter this code…" line appeared twice (static label + statusText). Clear statusText when paired so it shows only once, with the code.
This commit is contained in:
parent
86340caf9d
commit
60cda97b1d
|
|
@ -143,7 +143,9 @@ class ProvisioningActivity : AppCompatActivity() {
|
||||||
connectBtn.visibility = View.GONE
|
connectBtn.visibility = View.GONE
|
||||||
pairingSection.visibility = View.VISIBLE
|
pairingSection.visibility = View.VISIBLE
|
||||||
pairingCodeText.text = wsService?.getPairingCode() ?: "------"
|
pairingCodeText.text = wsService?.getPairingCode() ?: "------"
|
||||||
statusText.text = "Enter this code in the dashboard to pair this display"
|
// The instruction is shown once, inside the pairing section; don't
|
||||||
|
// duplicate it in statusText.
|
||||||
|
statusText.text = ""
|
||||||
connectBtn.isEnabled = false
|
connectBtn.isEnabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,13 +102,14 @@
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_marginBottom="12dp" />
|
android:layout_marginBottom="12dp" />
|
||||||
|
|
||||||
<!-- Auto-sizes between 24sp and 56sp to fit the width on a single line.
|
<!-- FIXED-height box: autosize fits the text inside the bounded box and
|
||||||
Capped at 56sp (not 96sp) + vertical padding so tall digits are
|
gravity center vertically centers it, so the digits are never
|
||||||
never clipped, and the whole block stays on screen on short phones. -->
|
clipped (the earlier wrap_content height clipped the glyph bottoms).
|
||||||
|
24-64sp fills the width on phones/TVs/sticks. -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pairingCodeText"
|
android:id="@+id/pairingCodeText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="96dp"
|
||||||
android:text="------"
|
android:text="------"
|
||||||
android:textColor="#3B82F6"
|
android:textColor="#3B82F6"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
@ -116,12 +117,9 @@
|
||||||
android:letterSpacing="0.3"
|
android:letterSpacing="0.3"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingTop="4dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:includeFontPadding="true"
|
|
||||||
app:autoSizeTextType="uniform"
|
app:autoSizeTextType="uniform"
|
||||||
app:autoSizeMinTextSize="24sp"
|
app:autoSizeMinTextSize="24sp"
|
||||||
app:autoSizeMaxTextSize="56sp"
|
app:autoSizeMaxTextSize="64sp"
|
||||||
app:autoSizeStepGranularity="2sp" />
|
app:autoSizeStepGranularity="2sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue