I can in the new android, I found it very trouble, android development each activty will need to create a layout file, and then also need if use listview, or RecyclerView, each item also need to create a layout file, so a activty will come up with four files, very bad management, is also not good maintenance after..
I directly use oc to develop ios is very convenient, a file and a m h, other code can be achieved, can also be very good integration, and how to inherit the android? So many XML documents, each is different,,,,
Poking fun at points, mainly just couldn't inherit to inherit...
CodePudding user response:
Can write a general in the parent class of feature extraction, and such as RecyclerView adapter is to encapsulate the universal adapter single layout or layout, and write BaseActivity BaseFragment, BaseViewModel, BaseDialogFragment
As to the XML file can extract some with more components include in an XML file by introducing such as toolbar and search component and RecyclerView
CodePudding user response:
reference 1st floor ha ha bug reply: can write a general in the parent class of feature extraction, and such as RecyclerView adapter is to encapsulate the universal adapter single layout or layout, and write BaseActivity BaseFragment, BaseViewModel, BaseDialogFragment As to the XML file can extract some with more components include in an XML file by introducing such as toolbar and search component and RecyclerView I saw under the include such unless the depth of the packaging, simple XML layout, don't have much advantage of reusable, CodePudding user response:
You really, don't say, you can reuse the Activity of the layout, but each item with a different layout, this is also a drawback CodePudding user response:
You can also use code but it wasn't intuitive layout is not convenient CodePudding user response:
Android is this CodePudding user response:
That is the essence of design patterns, MVP logic separation, Google is interested in this View, and XML files just like what you said, is an abstract View, realizing logic and the Java file is the concrete action, of course, if you like, you can also customize by means of a custom View attributes, in the XML file of the Item in the configuration process, so it is missing a file, but the disadvantages is that you need to Override RecycelView, and some custom attributes defined in the attrs file to implement the whole configuration process, and the benefit is in demand under the condition of relatively unchanged, you can reuse the custom View, and relatively simplify the configuration process CodePudding user response:
From Google and the future trends, this will be more and more normalized by means of XML to configure, the valley is also a shift to the MVVM design pattern CodePudding user response:
Just for layout file name will be wasted 1/3 time CodePudding user response:
refer to the eighth floor qiuyan81 response: just for layout file name will be wasted 1/3 time What development tools do you use CodePudding user response:
I think there is only a matter of habit let you spin, I prefer the layout of the android, I write ios also more likely to use storyboard, rather than by hand, android can actually use pure code layout, as long as you are willing, you can even in a class to complete the entire app, see the setContentView this method, in addition to a layout id, can also be introduced to a View, CodePudding user response:
Seem to do animation, a detail a few picture, also there is no way, but do much, skilled, to develop quickly, although some trival, but does not burn, nor complicated, for many people, is suitable for, CodePudding user response:
Just begin to do, it is quite tedious, but you have to learn to encapsulate, improve the reusability and efficiency is up CodePudding user response:
CodePudding user response:
refer to the eighth floor qiuyan81 response: just for layout file name will be wasted 1/3 time V v will go ha ha CodePudding user response:
CodePudding user response:
That's because you haven't worked in web development, otherwise don't bother CodePudding user response:
I made a small program with the style sheet, there are pages, js, but not so messy. CodePudding user response:
Design patterns in this way, convenient to split the different business, and layout have real-time preview effect, is far better than you finish to see the effect, You can also try setConverView (new XXXX), then use the code to add the related view, think is terrible, CodePudding user response:
CodePudding user response:
Commonly used directly in system layout, special to the custom, believe complex is encapsulated as controls, with line like EditText directly