TransitionDrawable with different sized bitmaps

by Brill Pappin » Fri, 20 May 2011 04:20:29 GMT


Sponsored Links
 I'm using a TransitionDrawable to draw a series of bitmaps in an ImageView.
Every time my scheduled handler ticks over, i replace the bitmaps.

I'm finding that if they are not the same size, the draw splits the 
difference for the second bitmap using the first bitmap (at least I think 
thats whats going on).

I was thinking that I might use two bitmaps there were the same size as a 
base, then draw my actual jpeg's onto those so the TransitionDrawable 
doesn't try and scale them.

Is there a better way to do this?

-- 



Re: TransitionDrawable with different sized bitmaps

by Brill Pappin » Fri, 20 May 2011 12:24:42 GMT


 An update to this problem.
It seems the issue is related to ImageView's automatic scaling somehow.
it *looks* as if the TransitionDrawable needs both images to be the same 
size... or maybe ImageView does it.
The symptom is that it divides the difference in width between the to images 
(i.e. an image in landscape and one in portrait so you get one squashed and 
one stretched).


-- 


Sponsored Links


Re: Re: TransitionDrawable with different sized bitmaps

by Dianne Hackborn » Fri, 20 May 2011 12:36:58 GMT


 The images need to be the same.  Generally widgets don't like nor have a way
to deal with drawable dimensions changing out from under them.







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

-- 



Re: Re: TransitionDrawable with different sized bitmaps

by Brill Pappin » Fri, 20 May 2011 12:46:47 GMT


 The funny thing is how its actually handling it. Both parts of the 
transition are getting scaled.

What i'm doing is cycling through images from the MediaResolver (like camera 
shots) and crossfading between them.
Do you have any suggestions for other ways to do that?

At the moment I'm playing around with creating a "template" bitmap that is 
used to draw everything onto, then give it to the ImageView, but I'm not 
feeling all that good about the solution so far.

-- 



Re: Re: TransitionDrawable with different sized bitmaps

by Dianne Hackborn » Fri, 20 May 2011 15:10:21 GMT


 You could write your own Drawable that keeps its size consistent across the
images and does whatever transition you want.  Or use a ViewFlipper to swap
between ImageViews.







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

-- 



Other Threads

1. Please help me find documentation on actions for the manifest file

Hi,

      This has been killing me.  I finally found examples around the
net for things I wanted to experiment with.  I had to go searching cuz
I could find this information anywhere in the API Docs.

      Two things specifically that I'm interested in are:

      1) For listening for broadcast SMS messages through a broadcast
receiver, I see that you have to defined the action, for the intent in
the broadcast receiver element as:

        <receiver android:name=".<myClassName>">
            <intent-filter>
                <action android:name=
                    "android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>

        First, where is that name
android.provider.Telephony.SMS_RECEIVED defined?  How am I supposed to
track that down in the API Doc?  There is no
android.provider.Telephony class or package.

        Second, in the code for receiving the actual broadcast, I see
you need to do something like this to get the message(s).

        Object[] pdus = (Object[]) bundle.get("pdus");

        Where is it defined that the extra name in the bundle is
"pdus" for SMS messages.

     2) OK, similar thing for receiving GMail and Exchange email
delivery notifications.

         First, is there a way to get them via a broadcast receiver?

         I see code floating around that you need to do something like
this instead:

contentResolver.registerContentObserver(Uri.parse("content://gmail-
ls"), true, gmailObserver);

Cursor conversations = _contetResolver.query(
                                        Uri.parse("content://gmail-ls/
conversations/"
                                                        +
YourEmailAddress, null, null, null, null);


And the actual conversation messages will be:
Cursor messages = _contetResolver.query(Uri
                                                                .parse
("content://gmail-ls/conversations/"
 
+ YourEmailAddress + "/"
 
+ String.valueOf(conversationId)
 
+ "/messages"), null, null, null, null);

          If this is how you have to do it, then that's fine.  But
where is this documented so that I could have figured this out myself?

    Thanks,
    Joe


-- 

2. General Android Bug

Hi, im a HTC Hero user, with android 1.5, and i'm from Spain.

I wanted to report a general software bug, which is a little annoying.
I'ts referred to the "Time". There's an option to set time
automatically, so my device detects where am I and configures the
local time, so i don't need to change it manually.

I travel a lot, but currently i live in Canary Islands, which belong
to Spain but they don't share the same local time.

Spain is GMT +1, while Canary Islands is GMT +0, i mean, they share
local time with London.

The bug is that my device (and all the android devices that my friends
got) puts Canary Islands as GMT +1.

When I was in London, it did good, GMT +0. When I was in Spain, it did
good, GMT +1, but when i am in Canary Islands, it says GMT +1, and
it's GMT +0.

Also when I'm in London, Spain, Germany, etc. and I want to see what
time is it in Canary Islands, it says the same as Spain, GMT +1, while
London keeps staying at GMT +0.

It seems that Google configured Canary Islands as GMT +1, while it's
GMT +0

Hope that i explained it all with detail. Sorry for my bad english :)

Thank you for reading this mail, and keep this up ! Its the first time
i LOVE mobile phones ^^

-- 

3. Seek advice about the problem with the help of android application connects HttpServer

4. minSdkVersion and file editing

5. Android 2.0

6. any good tutorial for database stuff

7. List view with textviews and imageview, best practices