Control ViewFlipping in Android Widget - android

Here is what I have to do:
I want to create a widget which plays a short video clip. So, what I did is, to do screenshots of the movies and get a series of screenshots of it and switch the image in a certain frame rate to achieve what I want.
In here, I used ViewFlipper and a number of ImageView under it. But the problem comes.
I have no idea how to set ViewFlipper to flip through all the ImageView once and stop at the last one. I tried to set it as AutoStart true and set it back to false after a certain time (using Handler) but it doesnt work.
can anyone help?

Have you tried calling stopFlipping() on view flipper?

Related

View pager and Playing Video on android

I have a viewpager which has two views in it. On the first view I have a list of videos and on the other one I play the video.
The issue is when I play the video on the second view and if I want to go back to the first view, there is a black rectangle remaining from the video. it disappears after a few seconds.
I am using a galaxy note running ICS.
Can it be because of memory usage?
Thanks,
I solved this problem long time ago by setting background color of the videoview to some color and then making it '0' onVideoPrepared().
Well, do you "stop()" the video when you start dragging the page ?
if not, then you need to add a OnPageChangeListener to the viewpager, so when you start scrolling/dragging the page, you stop the videoview, that should fix your problem,
the more probable thing is that for optimization reasons does not want to be playing the video as dragging the page so puts a "picture" of the video while moving.

Custom Splash Screen - Android

Currently my android application shows a black screen with a loading wheel as it processes the user's request i:e as it gets content from the server. I would like to modify this screen to include an icon (image) that fades in and out continuously instead of the loading wheel. Is there any possible way to do it?
Yes, you'll use an Alpha Animation
See here
and here
and lastly here for a good tutorial on Animations with some nice code.
In order to "chain" your animations so that one starts after the other you'll use an Animation listener and start the other one from the onAnimationEnd method callback. Don't forget to put an if statement in there that checks to see if your stuff is done loading otherwise you'll end up with infinite recursion of your fade in and fade out.

Placing a background picture and then having invisible touch (Android)

I am trying to make an application for android that is based on IPAD app. I want to keep the same look to the app, but I am not a very good designer. So I was wondering if it was possible to for me to crop say the entire header and then have an invisible button or something on top of portions of it. so the design would become a little bit easier. Also if that is possible how would I get the what ever the event item is going to be to overlap with a portion of the image if it has stranger orientation. (I think I could fake this by just moving it closest orientation and extending the size untill it fits, but it would be nice to find a better way.)
How would I go about that?
I tried making the button invisible, but that did not seem to work.
Thanks in advance
I got lost on your description. But if you want to make a button invisible, calling setVisibility(View.INVISIBLE); will not work, because it will not receive click events. You may want to set its color to transparent instead. try using:
button.setBackgroundColor(Color.TRANSPARENT);

Getting blank screen when switching between activities

I am working on an app , where I am switching between two activities. When control is inside onStart of second activity , there is screen drawing and processing logic being handled.Because of this , when switching between the two activities happens, there is a blank screen that comes up.
Along with this , i also need to render a live video feed in background of my activities/app
What could be the best way to deal with this?
TIA
If you're getting a blank screen it could be because your activity is setting a new contentview but it hasn't been processed properly. Does it ever load completely? If it's just that it's black at the beginning and then renders. Try setting the contentview at the end of your switching in onCreate. This will make it remain on the first activity and avoiding switching views on till everything is loaded.
With regards your second question. Is the live video feed from the Camera?
If it is, set the camera view in the background, make a transparent LinearLayout (or whatever your layout is) over it and then put your various views there.
Your question doesn't have enough specific information to get an accurate idea as to what you're talking about, if my answer doesn't address your problem please respond with elaboration and some code! :-)

Changing an imageView in an Android Widget onclick

I have a very simple widget that has a background image of a speech bubble and an imageView that contains a character standing next to it (as if he is saying something).
On top of the speech bubble i have a textView in which i show some text.
Basically all i want to do is so that when the user clicks on the character the image changes to show an animation of the character.
I did a simple app that animates an imageView (using the animation-list xml) when the image is clicked and that worked fine. So i was wondering if i could achieve the same thing with this widget.
I have seen some examples where by you can click on a widget (be it a button, image, whatever) and you can then load a config layout however i simply cant figure out and i cant find anywhere if what i want can be done.
So basically what i need to know is:
1. can a widget have an animated imageView
2. What do i need to do so that when the imageView is clicked it loads the animation?
Can anyone point me in the right direction please?
Thanks in advance guys!!
Have you tried to use LayoutAnimation? See the related question here:
Android Widgets: Animations on RemoteViews ?

Categories

Resources