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. Where to report app update problems?

I'm not sure if this is a Market problem or a developer problem...it
isn't a coding issue per se...I just don't know where to report it.

I can't update my app.  I go my market publisher webpage and see a
list of my apps.  I click on one of them to update it.  It's a free
app btw.  All I want to do is change the 512px icon, so I upload a new
one and click Save at the bottom.  Instead of returning to the
publisher page it jumps to the top of the same page, presumably
flagging a problem.  I scroll down to find the problem and see that
many countries now say "Invalid price" in red writing with a red box
(those messages weren't there before I clicked Save)...BUT IT'S A FREE
APP!!!  and to make matters worse, the United States is one of those
countries (I'm in the U.S.)!!!

Anyway, here's what I've tried:
- Unchecking availability in the troublesome countries, including the
United States (Save still won't work)
- Unchecking "All Countries" (Save still won't work)
- Backing out to the publisher page, reentering the app edit page and
just clicking Save without changing anything at all...still won't
work.

What on Earth am I going to do about this?  I'm feeling rather
desperate at the moment.  I realize there is a market forum but
(http://www.google.com/support/forum/p/Android+Market) but I have
never figured out how to get that forum to distinguish between user
and developer problems, so developer problems get rather lost in the
mix...unless I'm missing something.

I realize the main "help" on this might be pointing me to a more
proper forum for it.  If so, I appreciate that.

Thank you.

-- 

2. need help with DatePickerDialog

I have this fields:
        private EditText datum;
        private int mYear;
        private int mDay;
        private int mMonth;
        private final Context context= this;

and theese listeners:

OnClickListener ocl = new OnClickListener() {

                        @Override
                        public void onClick(View v) {
                                DatePickerDialog.OnDateSetListener callBack = 
new
DatePickerDialog.OnDateSetListener(){

                                        @Override
                                        public void onDateSet(DatePicker view, 
int year,
                                                        int monthOfYear, int 
dayOfMonth) {
                                                // TODO Auto-generated method 
stub
                                                
mYear=year;mMonth=monthOfYear;mDay=dayOfMonth;
                                        }

                                };
                                DatePickerDialog dpd = new 
DatePickerDialog(context, callBack,
mYear, mMonth, mDay);
                                dpd.show();
                                
datum.setText(Integer.toString(mDay)+"."+Integer.toString(mMonth)
+"."+Integer.toString(mYear));
                        }
                };
datum.setOnClickListener(ocl);


I dont know what is wrong but when I clicked on my datum: EditText so
my app force close.  help me pls to find a mistake.
thank you very much

Richard Smela

-- 

3. Call Intervention

4. Debugger Disconnected when calling External Intent???

5. OTG on Nexus S

6. Can registerReciver(null,Intent) provide latest broadcast value

7. Silent Installation for Android