Loading external layout files

jdonth

Member
Licensed User
Longtime User
Is there a way to load a layout file from an external source?

For example, if I was to store a layout file on a web server, how could I retrieve the file via HTTP and use something like LoadLayout to use the layout?

~Joe Donth
 
Is it possible to copy NEW layout files on top of the existing layout files within the "assets" folder prior to run time ???

I also use Eclipse and I bought the Basic4Android because I find it simplifies and speeds up my design time. I love it..

I do have a problem with the binary layout.BAL files..

I "NEED" to edit the layout files manually with a simple text editor.
The designer works great, but I need to modify the layout code directly..

Is there a way to load in standard XML layout files, as is done normally.

Such as...


<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
<TextView/>


</LinearLayout>
 
Upvote 0
Edit layout files manually

I just bought B4A and it's a great, I love it, but I also ran right away into the situation when I needed to edit the layout file manually.

Simple example: I copied the layout file from another project into the new one. It has about 30 buttons of the same size. All of them too small for the new project and I need to re-size them all at once (going to each button's options and do it manually is just crazy).
I understand I can re-size or change them using Designer's window script, but it only works/shows when you run the script (F5). When you get back to the properties window (stop the script) it's back to the small (original) size and colors on the device/emulator and that's just too small and ugly to work with in my case.

If I could open the layout file (in a text editor) and run a search & replace and change all those buttons' size (or any attributes) all at ones that would be great. Same about colors and any other attributes. A possibility of doing them at the run time or from the script sure helps a bit, but not enough in my case as while previewing it you cannot edit the elements and when you are back to editing, they are too small.

So I ended up going to all buttons options and changing them and repositioning manually, so I don't have to run scripts and change them dynamically all the time to see how my layout changes looks.
 
Upvote 0
I agree with this. I can think of at least three reasons for editing an XML layout file:
1. For copying layouts back and forth between B4A and Eclipse. It's would be handy to create a prototype in B4A then just pop the layout into Java/Eclipse when I need advanced functions.
2. For making wholesale changes to the layout, such as moving 30 buttons left by 5 pixels.
3. For setting parameters that aren't in the B4A Designer. I'm currently loading up my code with List and Edit colors.
 
Upvote 0
Back
Top