More often than i like to admit, i must rename the global variable to something else to maintain a certain naming system.
Is there a possibility to build a feature that automatically replaces all global variable references when renaming the reffered global variable?
Auto glob variable rename
Moderator: Martin
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Auto glob variable rename
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Auto glob variable rename
+1 for this, even though not so critical for me. As I mostly use glovar map/list to deal with the stored variables.
This renaming should works like widget auto renaming. And it must can travel thru the glovar map/list too.
So if I use global_list[1] in certain script; then I rename to "global_listed"; the new script should be global_listed[1].
This renaming should works like widget auto renaming. And it must can travel thru the glovar map/list too.
So if I use global_list[1] in certain script; then I rename to "global_listed"; the new script should be global_listed[1].
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Auto glob variable rename
Yes maybe i should make use of maps and lists more than for just the obvious reasons.Desmanto wrote:+1 for this, even though not so critical for me. As I mostly use glovar map/list to deal with the stored variables.
This renaming should works like widget auto renaming. And it must can travel thru the glovar map/list too.
So if I use global_list[1] in certain script; then I rename to "global_listed"; the new script should be global_listed[1].
Although maps and lists can get cluttered as well since you can't rearrange the order (that i know of).
Btw what do you mean with auto widget renaming?
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Auto glob variable rename
List can be rearranged, simply tap and hold, then drag it up or down. But it can be difficult if the list contains a massive data, the row height cover the whole dialog, make it impossible to drag. For map, it can't be dragged as list do. I also want to request for the feature. But somehow when answering anuraag's question, I have made the flow to sort the glovar by querying the key as list, sort the list in debug dialog. So I put it aside first.
Widget auto renaming is what happen when you rename one of your widget. All show/hide widget action will be updated to correspond to the new name. You can try it out, just rename to something and rename back to original. I just realize something is off with the auto renaming. Although all show/hide widget got renamed, but if there are script which contain reference to modify the widget property, the name stays.
Example "Widget1". There are action show widget Widget1; and script
When we rename "Widget1" to "Battery Widget", action Show/hide will be updated to new name. But the script still stays as "Widget1". So, we should change it manually by using the search and replace them all manually. Seems the same thing will happen with glovar, thus auto renaming not yet implemented till now.
Widget auto renaming is what happen when you rename one of your widget. All show/hide widget action will be updated to correspond to the new name. You can try it out, just rename to something and rename back to original. I just realize something is off with the auto renaming. Although all show/hide widget got renamed, but if there are script which contain reference to modify the widget property, the name stays.
Example "Widget1". There are action show widget Widget1; and script
Code: Select all
setWidgetElementProperty("Widget1", "Rectangle_1", "visible", true);
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Auto glob variable rename
Rearranging confirmed!Desmanto wrote:List can be rearranged, simply tap and hold, then drag it up or down. But it can be difficult if the list contains a massive data, the row height cover the whole dialog, make it impossible to drag. For map, it can't be dragged as list do. I also want to request for the feature. But somehow when answering anuraag's question, I have made the flow to sort the glovar by querying the key as list, sort the list in debug dialog. So I put it aside first.
Widget auto renaming is what happen when you rename one of your widget. All show/hide widget action will be updated to correspond to the new name. You can try it out, just rename to something and rename back to original. I just realize something is off with the auto renaming. Although all show/hide widget got renamed, but if there are script which contain reference to modify the widget property, the name stays.
Example "Widget1". There are action show widget Widget1; and scriptWhen we rename "Widget1" to "Battery Widget", action Show/hide will be updated to new name. But the script still stays as "Widget1". So, we should change it manually by using the search and replace them all manually. Seems the same thing will happen with glovar, thus auto renaming not yet implemented till now.Code: Select all
setWidgetElementProperty("Widget1", "Rectangle_1", "visible", true);
Auto widget renaming as well
Thanks again!
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
- TheBrain1984
- Posts: 137
- Joined: 07 Aug 2013 08:17
- Location: Germany
Re: Auto glob variable rename
+1 definitely "must-have" feature. It is really pain in the ass to rename one by one global variables specially if you have them a lot.
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Auto glob variable rename
That's 1 way of putting it
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)