Repository navigation
Commit 5689e60
authored
ADFA-1377 diagnostic tooltip (#323)
* refactor: use fixed tooltip tags for sidebar actions
This commit introduces a `tooltipTag` property to `SidebarActionItem`
and updates all sidebar actions to use fixed string values for their
tooltips instead of dynamically generating them based on the label.
This change simplifies the tooltip setup logic in `EditorSidebarActions`
by removing the `tooltipTag()` extension function and directly using the
new property.
* ADFA-1381 | Refactor: Move tooltipTag to ActionItem
Move the `tooltipTag` property from `SidebarActionItem` to the base `ActionItem` class. This makes the property available to all action item types.
Update various action classes to initialize `tooltipTag`.
In `EditorActionsMenu`, implement long-press listeners on action buttons to display tooltips using the `TooltipManager`.
* Refactor: Use TooltipTag for sidebar actions
This commit refactors the sidebar actions to use the newly introduced `TooltipTag` object for managing tooltip tags.
The following sidebar actions were updated:
- TerminalSidebarAction
- HelpSideBarAction
- FileTreeSidebarAction
- PreferencesSidebarAction
- CloseProjectSidebarAction
- BuildVariantsSidebarAction
A new file `idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt` was created to define the tooltip tags.
* Use constants for tooltip categories
This commit replaces hardcoded string values for tooltip categories with constants defined in the new `TooltipCategory` object. This improves code maintainability and reduces the risk of typos.
The following files were modified to use these constants:
- `app/src/main/java/com/itsaky/androidide/fragments/MainFragment.kt`
- `app/src/main/java/com/itsaky/androidide/utils/EditorSidebarActions.kt`
- `app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt`
- `app/src/main/java/com/itsaky/androidide/actions/file/ShowTooltipAction.kt`
* Refactor: Use TooltipTag for editor actions
This commit refactors the editor actions to use the `TooltipTag` constants for tooltip tags.
The following changes were made:
- Added new `TooltipTag` constants for editor toolbar actions in `idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt`.
- Updated editor actions in `app/src/main/java/com/itsaky/androidide/actions/editor/` to use the new `TooltipTag` constants.
- Updated `actions/src/main/java/com/itsaky/androidide/actions/locations/CodeActionsMenu.kt` to use the new `TooltipTag` constant.
- Added `idetooltips` project as a dependency to the `actions` module in `actions/build.gradle.kts`.
* Refactor: Use TooltipCategory constants
Updated `EditorCompletionWindow` and `EditorActionsMenu` to use constants from `TooltipCategory` for tooltip categories.
Added `CATEGORY_XML` to `TooltipCategory`.
* Refactor: Show tooltip for output tabs
This commit refactors the tooltip display logic for the output tabs in `EditorBottomSheet.kt`.
Instead of directly creating `IDETooltipItem` objects, it now:
- Uses a `tooltipTag` to identify the relevant tooltip.
- Fetches tooltip data using `TooltipManager.getTooltip`.
- Displays the tooltip using the fetched data.
- Adds error handling for tooltip display.
- Leverages coroutines and `lifecycleScope` for asynchronous operations.
* Refactor: Use TooltipTag constants for EditorBottomSheet tabs
This commit refactors the `EditorBottomSheet` to use constants from `TooltipTag` for setting tooltip tags on its tabs.
Specifically, the following changes were made:
- Added new constants to `TooltipTag.kt` for project-specific tooltips:
- `PROJECT_APP_LOGS`
- `PROJECT_IDE_LOGS`
- `PROJECT_SEARCH_RESULTS`
- `PROJECT_DIAGNOSTICS`
- Modified `EditorBottomSheet.kt` to:
- Retrieve tooltip tags using `pagerAdapter.getTooltipTag(position)`.
- Use `TooltipCategory.CATEGORY_IDE` when fetching tooltips.
- Updated `EditorBottomSheetTabAdapter.java` to:
- Add a `tooltipTag` field to the inner `Tab` class.
- Initialize `tooltipTag` in the `Tab` constructor.
- Add a `getTooltipTag(int position)` method to retrieve the tooltip tag for a given tab position.
- Assign the new `TooltipTag` constants to the respective tabs.
- Swapped tooltip tags for "Diagnostics" and "Search Results" tabs to match their functionality.
* Refactor: Show IDE tooltips on long press
- Add long press gesture recognizer to `RecyclerViewFragment` to show IDE tooltips.
- Add tooltip tag for `SearchResultFragment`.
- Remove unused Activity context from `EditorCompletionWindow`.
- Enable test code for `TooltipManager.getTooltip`.
* Merge conflcits
* ADFA-1377 | Add tooltip tag to DiagnosticsListFragment
The `fragmentTooltipTag` in `DiagnosticsListFragment.kt` was updated to use the `PROJECT_DIAGNOSTICS` constant from `TooltipTag`.
* Merge conflicts1 parent e044376 commit 5689e60
8 files changed
Lines changed: 158 additions & 77 deletions
File tree
- app/src/main/java/com/itsaky/androidide
- adapters
- fragments
- debug
- ui
- editor/src/main/java/com/itsaky/androidide/editor/ui
- idetooltips/src/main/java/com/itsaky/androidide/idetooltips
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | | - | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
232 | 242 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
| |||
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
37 | 71 | | |
38 | 72 | | |
39 | 73 | | |
| |||
56 | 90 | | |
57 | 91 | | |
58 | 92 | | |
| 93 | + | |
59 | 94 | | |
60 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
61 | 103 | | |
62 | 104 | | |
| 105 | + | |
| 106 | + | |
63 | 107 | | |
64 | 108 | | |
65 | 109 | | |
| |||
78 | 122 | | |
79 | 123 | | |
80 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
81 | 148 | | |
82 | 149 | | |
83 | 150 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 43 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
123 | 154 | | |
124 | 155 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
0 commit comments