Any way to arrange android id "@ + id /"

I am wondering if there is a way to organize my android: id widget. There are several Activies and several layouts in my application. It’s hard to keep track of all the button names and text views. My IDE will spring display a list of all R.id.xxx files from previous layouts. Is there a way to sort them, for example, with a directory or periods, that is, android: id = "@ + id / abc.efg" or android: id = "@ + id / abc / efg". They seem to structure them or embed them.

+4
source share
3 answers

The simple way I'm tracking is to change the id prefix to something else.

ex. Layout for ActivityOne may have layout identifiers as

android:id="@+activity1/textview" 

And "TestActivity" may be

 android:id="@+test/textview" 
+6
source

I try to always use some kind of convention when naming identifiers. For example, use type-type prefixes: * btn_somethig * for all buttons, * et_something * for all EditText, etc. When you are looking for a specific identifier, just fill in the component type first.

0
source

AFAIK no. I always adhere to the naming convention based on what I'm looking for. This is usually type_of_id_type_of_object_name . So the layout can be layout_relative_layout_main_panel . A view_text_view_text1 like TextView will be view_text_view_text1 or something else. However, the part is application specific.

0
source

Source: https://habr.com/ru/post/1401669/


All Articles