Saturday, February 26, 2011

[android-developers] Re: bitmap drawable resource gravity ignored in layer list?

I was going to go that route but SeekBar does 99% of what I need. You
guys did most of the work, keeping the moving part horizontally
stable, animations, etc. I literally had to add 6 lines of code to
get what I needed logically and then add some style.

I should have made the question clearer. The meat of the question is
about layer-lists with bitmaps. Which would be the same if I just
wanted to style a horizontal progress bar with an image.

So is it expected that the gravity attribute be ignored or do I need
to specify something elsewhere to not have the images repeating?

Thanks,
Nick

On Feb 26, 6:38 pm, Dianne Hackborn <hack...@android.com> wrote:
> The seek bar is not a slide to unlock UI.  Honestly, write your own custom
> view for this.
>
>
>
>
>
>
>
>
>
> On Sat, Feb 26, 2011 at 10:38 AM, nkijak <nki...@gmail.com> wrote:
> > I'm trying to build a seek bar with text in/"under" it to make
> > something akin to the "slide to unlock" bar on the iPhone.  I figured
> > I'd change the style of the seek bar and added:
> > <layer-list>
> > ...
> > <item android:id="@android:id/background">
> >        <layer-list>
> >                <item>
> >                        <shape>
> >                            <corners android:radius="10dip" />
> >                            <gradient
> >                                    android:startColor="#88747674"
> >                                    android:centerColor="#885a5d5a"
> >                                    android:centerY="0.25"
> >                                    android:endColor="#889d9e9d"
> >                                    android:angle="270"
> >                            />
> >                        </shape>
> >                </item>
> >                <item>
> >                        <bitmap
> > android:src="@drawable/slide_to_finish_label"
> > android:gravity="fill_horizontal"/>
> >                </item>
> >        </layer-list>
> >    </item>
> > ...
> > </layer-list>
>
> > slide_to_finish_label is a 9-patch PNG.  The default tile mode is
> > listed as none.  When I use this nested layer-list as the background
> > of my app it works as I expect.  My bitmap shows up stretched side to
> > side but not up and down.  When I use this as the style for the seek
> > bar the bitmap shows up not stretched and repeating.
>
> > Changing the gravity attribute has no affect on the repeating.  I
> > thought it might have something to do with the nesting of the layer
> > list, like that the item in the parent-list is being repeated.  The
> > guide on Drawable Resources seemingly warns on this issue and suggests
> > using a bitmap to control stretching and repeating but even when I
> > reduce the item to just a bitmap (not a nested layer-list) gravity
> > still has no affect.
>
> > --
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

--
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


Real Estate