Android - Animate View to Wrap Screen - android

I'm trying to make a View (in this case an ImageView) slide off one side of the screen and simultaneously reappear on the other. However, most of the search results I have found include Samsungs news about launching devices with wraparound screens for 2014, or this same task on other devices (such as Make Image Wrap Around Screen Edge? - iPhone Obj-C). Is this currently not possible in Android?
I've tried doing this with two animations on the same view, but I haven't had much success. Chaining the animations resulted in only the latter animation being performed, and performing them simultaneously caused them to negate each other. I have also looked into the various Interpolators, but I haven't achieved this effect. Any suggestions?

Related

How to do an infinite horizontal sliding scroll of images on Android using Delphi XE 5?

We want to show in an Android app a list of images in the similar manner with many gallery apps: horizontal sliding by using a gesture to show the next/previous image.
Also the image viewer should support zoom/pinch (besides other features).
Images can came from a database or from a directory and can be as much as 200-300.
The question is: Which is the best way to implement the slide-show part from the environment described above?
Through animations of a two TImage? There exist a specialized component for this? By using Horizontal Scroll box?
Stick 10 TRectangle objects in a THorzScrollBox. It could be more or less than 10 depending on the memory that the device has. Align them all to alTop. Load the images for display in TRectangle.Fill.Bitmap.Bitmap.
When the user scrolls down and is near the bottom of the ten, move the top rectangle to the bottom of the chain and load the newest image from your list into the new bottom one.
When the user scrolls up and is near the top of the ten, move the bottom rectangle to the top of the chain and load the newest image from your list into the new top one.
The reason behind doing it this way is that TRectangle is a really light image display container and you are recycling the TRectangle objects instead of deleting and creating them all the time.
It is possible that you will experience a display pop when you move the next TRectangle object to the top of the chain or when you move it to the bottom of the chain. You will have to create code to take care of this either by setting the position on THorzScrollBox or decreasing and increasing the height of the TRectangle as it leaves or enters the view until it is full size.
If you have installed samples with your Delphi instalation then you can find several examples of how to do this in:
Samples\FireMonkey\Fireflow
Samples\FireMonkey\MetropolisUIFlipViewDemo
Maybe there are even more of them. I haven't checked every sample so far.

How did they make such layout - which elements they used?

At the moment, I am using Euro 2012 app and it has some interesting layout parts. If you go to matches->knockout screen, you'll see 3 screens like this.
If you slide left or right, you move between them not like between one activity to another, but just like all these elements are laid on one big canvas and you slide each screen into focus. Even thou, if you slide left/right, the screen cannot be stopped in the way that half of each image is visible, so I guess it's not a big canvas. Somehow you can slide screen like one big image, and yet it always lock perfectly as if they used 3 activities for this.
How did the do this?
It's a ViewPager, available in Android support package and described in their blog.
The designing is not so much difficult, As i think to draw that boxes showing quarterfinals, semifinals.
They having layout( we can do by placing image in background also).
The major role played by FrameLayout which shows you that effect(emphasis), the flages are fetch from url as matches are decided(not essentially images only names are sufficient as flags came inside app and gets applied as updated).
After your click i think the start image gets change it's just replacing that image with new one.
As you said they are not on single canvas (but if they did customization of heir Viewpager that it's not stopping in between activities), but i think it's on single canvas.
If your taking about quickness of loading and all it's up to you as much code and processing you optimized it gives you smooth feel and fast processing.
We can appreciate the work but we can not say it's too much difficult as i think it's quit easy...
Hope this explanation helps you to understand ....

Scrollable list of buttons and images slowdown

I need to implement a list of images and buttons. I have 6 images serving as separators and a total 14 buttons with custom background. The list has a full screen (800×600) background, the separator images are 800×30 pixels and the buttons have similar size as well (all buttons have the same background image). On top of this, I need a custom scroll indicator: two blinking arrows on top and bottom. The arrows should be shown or hidden according to the scroll position.
I have some other GUI elements including a GLSurfaceView hidden using View.GONE as the list is shown on top of those.
The problem is, that this setup runs too slow on relatively powerful handsets such as the Galaxy Nexus or the Desire HD.
I tried two different approaches:
Using a ListView based on this tutorial: http://android.amberfog.com/?p=296
Put all buttons and images into one LinearLayout and use that as a child of a ScrollView. To hide and show the the blinking arrows I determine scroll position by overriding onScrollChanged (Synchronise ScrollView scroll positions - android)
Both implementation runs slow depending on the actual handset. The ScrollView implementation is usually faster but it has noticable lags on a Desire or the Galaxy Nexus while the ListView implementation is slow on the Desire HD.
Which is the best way to implement such list? Could you suggest me some guidelines how to make the implementation fast and device independent? I believe having about 20 images and buttons in a list shouldn't be a problem for these handsets.
Ok, it seems that the problem was the following:
I had a GLSurfaceView in the same activity and the list appeared above it. This was too much for the UI thread, although the list totally overlapped the GLSurfaceView and the rendering was paused when the list appeared.
I moved the list to a different activity and now it has an acceptable speed. But switching to the list is slower and when I close the list, I have to reload the surfaceview, but that is ok.

implementing curtain transition of imageviews in android

I want to implement the curtain animation like in ios in my application.For this i have taken a framelayout and added two linear layout and in the top most linear layout i have put two imageviews and i am applying translate up and down to the imageviews.
It is working ,but the problem is that it is not smooth as compared to the ios.Does anybody have any better solution for smooth transition of the image views?
The smoothness of the transition will be dependent mostly on the device and it's computing power. Have you tried your app on an actual device, or just the emulator. It might just be running slow on the emulator.
Also, perhaps its the loading of the images that are causing things to be slow. Have you tried caching them in memory?

Android TranslateAnimation after scrollTo() = undrawn view

This might be a "duh" question but I'm going to go ahead and ask it anyway.
I have an oversized (bigger than the screen) RelativeLayout, and I'm using swipes to start a TranslateAnimation from viewing one part of the layout to another. Say for instance the layout is two screen wide and two screens tall. After the nice animation to shift the screen, I was using View.scrollTo() to set the new position. This works fine going from the first screen (top left at 0,0) to one of the others. When I swipe to animate back to the first screen though, because the View.scrollTo() invalidated that part of the layout (I assume), that part of the layout is all black as I animate through it. I tried a couple things to get it to redraw itself after the scrollTo() but haven't had any luck, so I figured I'd ask here.
thanks!
joe d
I can't help with your specific problem since I've never tried working with a layout bigger than the screen, but there might be another way to achieve what you're trying to do. If you simply want to be able to finger-swipe from one View to another, without ever displaying part of one screen and part of another (i.e. you aren't smoothly panning around a large View but rather just jumping from one distinct section of the layout to another), then these tutorials might help, here and here. They show you how to use touch events and the ViewFlipper widget to change between Views using animations.

Categories

Resources