View unanswered posts | View active topics It is currently Thu Mar 23, 2017 11:07 pm



Reply to topic  [ 15 posts ] 
 Make java.beans.Beans optional 
Author Message

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Make java.beans.Beans optional
Hello,

I'm porting MiG Layout to android platform (http://saynomoo.github.com/mig4android/). The port requires currently a modified build of MigLayout. Namely the java.beans.Beans usages has to be removed, since the android platform does not provide such class. I disabled the Beans code only in android platform, in normal jdk the Beans is still usable. I would highly appreciate if you could consider including the modification in the standard MigLayout release. The modification patch can be found in the attachment.

Thanks,
Tuomas Huhtanen


Attachments:
Make_java_beans_Beans_optional.patch.txt [4.81 KiB]
Downloaded 727 times
Mon Jun 13, 2011 11:02 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Hello Tuomas,

Thank you, I will look at the patch and include it in the next version.

Let me know when you have a working miglayout for Android and I'll link to if from the miglayout page.

Cheers,
Mikael


Mon Jun 13, 2011 11:49 pm
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Thanks Mikael.

Sure I'll drop you a note when the port is available.

Cheers,
Tuomas


Tue Jun 14, 2011 6:13 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Hello Tuomas,

I have applied the patch for v4.0.

How's it going with the port btw?

Cheers,
Mikael


Sat Aug 13, 2011 2:18 am
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Hi Mikael,

Thanks for applying the patch. I tested the version 4.0 with mig4android and it works flawlessly.

The port is basically "done", just a couple of minor things not implemented. Namely, getPixelUnitFactor, getScreenLocationX and getScreenLocationY. I guess I should also implement some android-related features, like xml-layout support, maybe some support for screen orientation change etc. Anyway, the current implementation is already solid and usable. I haven't advertised the project much yet, since the current documentation is poor and the above mentioned features unimplemented.

Thanks,
Tuomas


Sun Aug 14, 2011 10:24 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Excellent. When you feel ready email me at grev at miginfocom dot com and I'll add a link to the project on the main MigLayout page.

Cheers,
Mikael


Sun Aug 14, 2011 11:03 pm
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Hello again,

How it going with the project?

I'm starting to code a bit for Android and would sure like to have MigLayout there to play with. Is the project ready to use?

Cheers,
Mikael


Wed Nov 16, 2011 11:11 am
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Oh, that's excellent!

Unfortunately I have not had too much time to work on the project. The status is still pretty much the same as it was in the summer. It can definitely be used already, although there are a couple of issues. Most outstanding issue is the failure of laying out growing components. For example a TextView might wan't to expand down (depending of the text in the component), but I have hard time creating a proper layout for that purpose. I have an idea which might work, but it is nontrivial to implement. That's why it is still pending :) It's also possible that I'm just not grasping the innards of miglayout (or android layout process) correctly.

If you are willing to try the mig4android and have any questions, don't hesitate to ask!

Cheers,
Tuomas


Thu Nov 17, 2011 12:58 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Will it work in code and/or XML?

Cheers,
Mikael


Thu Nov 17, 2011 1:05 am
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Currently it works only from code.

Br,
Tuomas


Thu Nov 17, 2011 8:05 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Hello Tuomas,

I have just started with some Android coding and thought I'd check out mig4android.

Unfortunately I got stuck and maybe you know directly what can be the problem. When I use MigLayout with a single TextView as the View for a row in a ListView (one for every row, though I'm just using one atm) nothing is shown. It's like MigLayout gets no size or is placed outside the screen. If I just switch the name MigLayout to LinearLayout it works as expected.

Is there some thing you know I need to do to make MigLayout work like this, for example does it need to be directly located in a MigActivity? Do I need the MigActivity at all or is that just a convenience? I'm using the latest 0.9.4.

Any pointers would be appreciated though I know I haven't given you much to go on.

Cheers,
Mikael


Tue Jan 10, 2012 12:31 am
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Hello again,

miglayout.setLayoutParams(new AbsListView.LayoutParams(500, 500));

at least makes it get some size. Without that row it gets zero size. It doesn't work with AbsListView.LayoutParams.FILL_PARENT or AbsListView.LayoutParams.WRAP_CONTENT though.

I don't know enough about the Android layout system to know why this is needed for MigLayout and not for other layouts but maybe you do.

Maybe there's a fix possible in mig4android for this?

Cheers,
Mikael


Tue Jan 10, 2012 1:05 am
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Hi Mikael,

As you already figured out, you need to set up the height manually as in the little example I set up: https://github.com/saynomoo/mig4android/commit/a27705751aea68efadda41a7b8e4c6d3aa6dd6a5

I know setting the height manually isn't optimal, but that's how it should at least work.

I think we should be able to get the MigLayout work without manually setting up the height, but I haven't had enough time to look in to that problem.

Cheers,
Tuomas


Tue Jan 10, 2012 1:13 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Make java.beans.Beans optional
Thanks for the clarification.

I will create an issue on github just for the sake of tracking this and get a notification when you fix this. Hope you don't mind.

I understand fully that you have more important things to do than to fix this so I don't mean to pressure you.

Thanks for the port yet again!

Cheers,
Mikael


Tue Jan 10, 2012 1:21 am
Profile WWW

Joined: Mon Jun 13, 2011 10:43 pm
Posts: 7
Post Re: Make java.beans.Beans optional
Creating the issue is very much appreciated! :) Now that I'm on this issue, I think I already have a lead.. :)

Cheers,
Tuomas


Tue Jan 10, 2012 1:23 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.