Skip to content

Commit 2e2e391

Browse files
author
AppDevForAll
committed
ADFA-4593: wire three-tier help to all native controls (conexión total)
Central registry + one-line-per-screen wiring: - TooltipWiring.wireAll(root): iterates a central R.id -> tag map (74 controls across 12 screens) and attaches the long-press tooltip to each control present in that view tree (null-safe; absent controls skipped). - TooltipTag: full tag registry (one constant per control), single source of truth. - wireAll(view) called once in each Fragment.onViewCreated (Sync, Feedback, SetupSection, About, Usage, Dashboard, Deploy) and each Activity.onCreate after setContentView (Setup, Qr, Portal, CrashReport). MainActivity switched from the 4 individual calls to wireAll(decorView). No content changes: controls without help text in the DB simply show nothing on long-press. The 4 Main tooltips (seeded in #151) still work. All 74 tags' content + translations land in the follow-up PR. dash_tunnel excluded (tunnel cleanup). No new dependencies.
1 parent f1101b9 commit 2e2e391

14 files changed

Lines changed: 238 additions & 30 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/DashboardFragment.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
110110
@Override
111111
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
112112
super.onViewCreated(view, savedInstanceState);
113+
org.iiab.controller.help.TooltipWiring.wireAll(view);
113114

114115
// Bindings
115116
txtDeviceName = view.findViewById(R.id.dash_text_device_name);

‎controller/app/src/main/java/org/iiab/controller/DeployFragment.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
195195
@Override
196196
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
197197
super.onViewCreated(view, savedInstanceState);
198+
org.iiab.controller.help.TooltipWiring.wireAll(view);
198199

199200
downloadState = new ViewModelProvider(requireActivity())
200201
.get(org.iiab.controller.install.presentation.DownloadStateViewModel.class);

‎controller/app/src/main/java/org/iiab/controller/MainActivity.java‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
package org.iiab.controller;
1111

1212
import org.iiab.controller.util.AppExecutors;
13-
import org.iiab.controller.help.TooltipCategory;
14-
import org.iiab.controller.help.TooltipTag;
15-
import org.iiab.controller.help.ViewTooltips;
1613

1714
import android.Manifest;
1815
import android.os.Bundle;
@@ -384,10 +381,7 @@ public boolean onTouch(View v, MotionEvent event) {
384381
ImageButton btnShareQr = findViewById(R.id.btn_share_qr);
385382

386383
// ADFA-4593: three-tier help — attach tier-1/2 tooltips (long-press) to native controls.
387-
ViewTooltips.attachLongPress(themeToggle, TooltipCategory.K2GO, TooltipTag.MAIN_THEME_TOGGLE);
388-
ViewTooltips.attachLongPress(btnSettings, TooltipCategory.K2GO, TooltipTag.MAIN_SETTINGS);
389-
ViewTooltips.attachLongPress(btnShareQr, TooltipCategory.K2GO, TooltipTag.MAIN_SHARE_QR);
390-
ViewTooltips.attachLongPress(versionFooter, TooltipCategory.K2GO, TooltipTag.MAIN_VERSION);
384+
org.iiab.controller.help.TooltipWiring.wireAll(getWindow().getDecorView());
391385

392386
// Listeners
393387
themeToggle.setOnClickListener(v -> toggleTheme());

‎controller/app/src/main/java/org/iiab/controller/PortalActivity.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class PortalActivity extends AppCompatActivity {
6565
protected void onCreate(Bundle savedInstanceState) {
6666
super.onCreate(savedInstanceState);
6767
setContentView(R.layout.activity_portal);
68+
org.iiab.controller.help.TooltipWiring.wireAll(getWindow().getDecorView());
6869

6970
vm = new ViewModelProvider(this).get(PortalViewModel.class);
7071

‎controller/app/src/main/java/org/iiab/controller/QrActivity.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public class QrActivity extends AppCompatActivity {
4646
@Override
4747
protected void onCreate(Bundle savedInstanceState) {
4848
super.onCreate(savedInstanceState);
49-
setContentView(R.layout.activity_qr); // Rename your dialog_qr.xml to this
49+
setContentView(R.layout.activity_qr);
50+
org.iiab.controller.help.TooltipWiring.wireAll(getWindow().getDecorView()); // Rename your dialog_qr.xml to this
5051

5152
titleText = findViewById(R.id.qr_network_title);
5253
ipText = findViewById(R.id.qr_ip_text);

‎controller/app/src/main/java/org/iiab/controller/SetupActivity.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class SetupActivity extends AppCompatActivity {
3737
protected void onCreate(Bundle savedInstanceState) {
3838
super.onCreate(savedInstanceState);
3939
setContentView(R.layout.activity_setup);
40+
org.iiab.controller.help.TooltipWiring.wireAll(getWindow().getDecorView());
4041

4142
SharedPreferences prefs = getSharedPreferences(
4243
getString(R.string.pref_file_internal), Context.MODE_PRIVATE);

‎controller/app/src/main/java/org/iiab/controller/SetupSectionFragment.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
125125
@Override
126126
public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) {
127127
super.onViewCreated(v, savedInstanceState);
128+
org.iiab.controller.help.TooltipWiring.wireAll(v);
128129

129130
TextView welcomeText = v.findViewById(R.id.setup_welcome_text);
130131
welcomeText.setText(getString(R.string.setup_welcome, getString(R.string.app_name)));

‎controller/app/src/main/java/org/iiab/controller/SyncFragment.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
103103
@Override
104104
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
105105
super.onViewCreated(view, savedInstanceState);
106+
org.iiab.controller.help.TooltipWiring.wireAll(view);
106107
// 3b-2: re-bind the rsync transfer progress after any recreation (theme toggle).
107108
org.iiab.controller.sync.presentation.SyncProgressRepository.get().state().observe(getViewLifecycleOwner(), receiveController::renderTransfer);
108109
}

‎controller/app/src/main/java/org/iiab/controller/UsageFragment.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
110110
@Override
111111
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
112112
super.onViewCreated(view, savedInstanceState);
113+
org.iiab.controller.help.TooltipWiring.wireAll(view);
113114

114115
// UI Bindings
115116
setup_dns_check = view.findViewById(R.id.setup_dns_check);

‎controller/app/src/main/java/org/iiab/controller/feedback/crash/presentation/CrashReportActivity.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class CrashReportActivity extends AppCompatActivity {
2929
protected void onCreate(Bundle savedInstanceState) {
3030
super.onCreate(savedInstanceState);
3131
setContentView(R.layout.activity_crash_report);
32+
org.iiab.controller.help.TooltipWiring.wireAll(getWindow().getDecorView());
3233

3334
CrashReportStore store = new CrashReportStore(this);
3435
String trace = store.readPending();

0 commit comments

Comments
 (0)