Monday, May 3, 2010

[android-developers] Re: Prescale Background Example / Speeding up WebViews

Anybody using this approach?

R

On Apr 29, 1:35 pm, Rich <miser...@gmail.com> wrote:
> The groups site buried this before it was visible yesterday, I'm gonna
> bump it again and hope Romain sees it..
>
> If it's worth mentioning during a Google I/O talk, probably worth
> having some confirmed example code on the web then, right? :)
>
> Rich
>
> On Apr 28, 5:20 pm, Rich <miser...@gmail.com> wrote:
>
>
>
>
>
> > I've created a custom ViewGroup (based off of the Launcher) that
> > allows paging scrolls between some WebViews. Problem is that it
> > doesn't scroll as smoothly as I want it to. I've been following Romain
> > Guy's 2008 advice, but I don't see any massive improvements. Is it
> > because I am using WebViews, or am I just doing the prescaling wrong?
> > This is my code:
>
> >                  Bitmap originalImage =
> > BitmapFactory.decodeResource(getResources(), R.drawable.redbg);
>
> >                  originalImage = Bitmap.createScaledBitmap(
> >                              originalImage,          // bitmap to resize
> >                              ((WindowManager)
> > getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth(),        //
> > new width
> >                              ((WindowManager)
> > getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getHeight(),       //
> > new height
> >                              true);                  // bilinear filtering
>
> >                  getWindow().setBackgroundDrawable(new
> > BitmapDrawable(originalImage));
>
> > called from onCreate. Is the right?
>
> > If not, what can I do to fix it? If not, what else can I do to speed
> > up the scrolling?
>
> > Thanks so much!
> > Rich
>
> > --
> > 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 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

No comments:

Post a Comment