[android-developers] Re: Change widget dimensions on orientation change
Use layout/ and layout-land/ or layout-port/ and have different
layouts for whatever orientation you need.
Not only can you have a totally separate layout, but if you are
worried about dimensions, you can just have the same layout but change
the margins. In other words, if a regular portrait widget is 72x96,
change the top and bottom margins to get it to 72x72 in the layout
file under layout-port/.
http://developer.android.com/guide/topics/resources/index.html
-Matt
On Jul 22, 5:27 am, Kumar Bibek <coomar....@gmail.com> wrote:
> @sachin : There's no activity.
>
> My basic question was, that can you change the AppWidgetProviderInfo
> for a widget after a screen orientation change?
>
> Thanks and Regards,
> Kumar Bibek
>
> On Jul 22, 1:45 pm, <sachin.r...@wipro.com> wrote:
>
>
>
> > ==> If your widget dimention is defined in XML layout then create the
> > same file with different dimension under newly created folder
> > \res\layout-land.
>
> > It will take care of widget positioning when u rotate.
>
> > ==> If you are setting the dimension dynamatically then
>
> > 1. Put an android:configChanges entry in AndroidManifest.xml file,
> > listing the configuration changes you want to handle yourself versus
> > allowing Android to handle for you
>
> > 2. Implement onConfigurationChanged() in your Activity, which will be
> > called when one of the configuration changes you listed in
> > android:configChanges occurs
>
> > -----Original Message-----
> > From: android-developers@googlegroups.com
>
> > [mailto:android-developers@googlegroups.com] On Behalf Of Kumar Bibek
> > Sent: Thursday, July 22, 2010 12:45 PM
> > To: Android Developers
> > Subject: [android-developers] Change widget dimensions on orientation
> > change
>
> > Hi,
>
> > I thought it would be simple, but I am stuck.
>
> > I have a widget which has say, a dimension of 294*72(portrait). But when
> > the orientation is changed, I need to change this dimension of the
> > widget to another dimension which would look good on the landscape
> > orientation.
>
> > Is this possible?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home