I have a fairly complex android app, the contents of the 'layout' folder is becoming increasingly large. I've tried to organise the individual layout xml files into sub folders e.g. layout/buttons/, layout/activity/, layout/views/ etc. This doesn't seem to work, the content of the folders in not parsed into the R. class.
Is there a way to do this?
Thanks!
First, Android supports only a linear list of files within the predefined folders under res. For example, it does not support nested folders under the layout folder (or the other folders under res).
Select layouts , right-click and select New → Folder → Res Folder. This resource folder will represent a “feature category” that you want. You can easily create any type of file/folder in Android Studio.
Access the home screen panel where the apps you want to put into a folder are located. Drag the first app and drop it on top of another and this will create a folder with both apps inside.
Layout files are stored in "res-> layout" in the Android application. When we open the resource of the application we find the layout files of the Android application. We can create layouts in the XML file or in the Java file programmatically. First, we will create a new Android Studio project named "Layouts Example".
I don't think you're going to be able to do this. I believe that it only supports certain folder names like layout-large, layout-mdpi, layout-hdpi, layout-fr, etc. You can use more than one of these modifies as well like layout-fr-hdpi-large.
This page shows all of the allowed modifiers
http://developer.android.com/guide/topics/resources/providing-resources.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With