Skip to content

Commit adffdc9

Browse files
author
Codex
committed
Allow companion status text selection
1 parent 2bd3c09 commit adffdc9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

jetkvm-companion/src/com/jetkvm/companion/MainActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ private android.view.View createSettingsView() {
143143
title.setTextColor(Color.WHITE);
144144
title.setTextSize(26);
145145
title.setGravity(Gravity.CENTER);
146+
title.setTextIsSelectable(true);
146147
root.addView(title, matchWrap());
147148

148149
TextView description = new TextView(this);
@@ -151,6 +152,7 @@ private android.view.View createSettingsView() {
151152
description.setTextSize(15);
152153
description.setGravity(Gravity.CENTER);
153154
description.setPadding(0, dp(8), 0, dp(18));
155+
description.setTextIsSelectable(true);
154156
root.addView(description, matchWrap());
155157

156158
pairingOtpPanel = new LinearLayout(this);
@@ -164,19 +166,22 @@ private android.view.View createSettingsView() {
164166
pairingOtpLabel.setTextColor(Color.rgb(203, 213, 225));
165167
pairingOtpLabel.setTextSize(14);
166168
pairingOtpLabel.setGravity(Gravity.CENTER);
169+
pairingOtpLabel.setTextIsSelectable(true);
167170
pairingOtpPanel.addView(pairingOtpLabel, tightWrap());
168171

169172
pairingOtpCode = new TextView(this);
170173
pairingOtpCode.setTextColor(Color.WHITE);
171174
pairingOtpCode.setTextSize(42);
172175
pairingOtpCode.setGravity(Gravity.CENTER);
173176
pairingOtpCode.setLetterSpacing(0.08f);
177+
pairingOtpCode.setTextIsSelectable(true);
174178
pairingOtpPanel.addView(pairingOtpCode, tightWrap());
175179

176180
pairingOtpCountdown = new TextView(this);
177181
pairingOtpCountdown.setTextColor(Color.rgb(148, 163, 184));
178182
pairingOtpCountdown.setTextSize(15);
179183
pairingOtpCountdown.setGravity(Gravity.CENTER);
184+
pairingOtpCountdown.setTextIsSelectable(true);
180185
pairingOtpPanel.addView(pairingOtpCountdown, tightWrap());
181186

182187
root.addView(pairingOtpPanel, matchWrap());
@@ -199,6 +204,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
199204
jetkvmUrlsLabel.setText("JetKVM endpoint");
200205
jetkvmUrlsLabel.setTextColor(Color.WHITE);
201206
jetkvmUrlsLabel.setTextSize(16);
207+
jetkvmUrlsLabel.setTextIsSelectable(true);
202208
root.addView(jetkvmUrlsLabel, tightWrap());
203209

204210
jetkvmUrlsInput = new EditText(this);
@@ -250,6 +256,7 @@ public void onClick(android.view.View v) {
250256
pairJetkvmState.setTextColor(Color.rgb(34, 197, 94));
251257
pairJetkvmState.setTextSize(14);
252258
pairJetkvmState.setPadding(dp(12), 0, 0, 0);
259+
pairJetkvmState.setTextIsSelectable(true);
253260
pairActionRow.addView(pairJetkvmState, new LinearLayout.LayoutParams(
254261
LinearLayout.LayoutParams.WRAP_CONTENT,
255262
LinearLayout.LayoutParams.WRAP_CONTENT
@@ -303,6 +310,7 @@ public void onClick(android.view.View v) {
303310
statusText.setTextSize(14);
304311
statusText.setGravity(Gravity.CENTER);
305312
statusText.setPadding(0, dp(16), 0, 0);
313+
statusText.setTextIsSelectable(true);
306314
root.addView(statusText, matchWrap());
307315

308316
return scroller;
@@ -449,6 +457,7 @@ private void refreshPairingControls() {
449457
empty.setText("No paired JetKVM endpoints.");
450458
empty.setTextColor(Color.rgb(148, 163, 184));
451459
empty.setTextSize(13);
460+
empty.setTextIsSelectable(true);
452461
pairingsList.addView(empty, tightWrap());
453462
}
454463
for (final CompanionService.CompanionPairing pairing : pairings) {
@@ -481,6 +490,7 @@ public void onClick(android.view.View v) {
481490
label.setSingleLine(false);
482491
label.setMaxLines(2);
483492
label.setPadding(dp(12), 0, dp(8), 0);
493+
label.setTextIsSelectable(true);
484494
row.addView(label, new LinearLayout.LayoutParams(
485495
0,
486496
LinearLayout.LayoutParams.WRAP_CONTENT,
@@ -489,6 +499,7 @@ public void onClick(android.view.View v) {
489499

490500
TextView state = new TextView(this);
491501
state.setTextSize(13);
502+
state.setTextIsSelectable(true);
492503
applyReachabilityStateText(state, pairingReachability.get(normalizeJetKvmUrl(url)));
493504
row.addView(state, buttonWrap());
494505

@@ -506,6 +517,7 @@ private void addIncomingPairingControls() {
506517
label.setText("Pairing request from " + pendingPairUrl);
507518
label.setTextColor(Color.WHITE);
508519
label.setTextSize(14);
520+
label.setTextIsSelectable(true);
509521
row.addView(label, tightWrap());
510522

511523
final EditText otpInput = new EditText(this);

0 commit comments

Comments
 (0)