Create a view carousel - android

I'd like to create something like a carousel with views. A continuum queue with an indetermined amount of the same type of view (just like a list), but when swiping left/right, (or up/down) it would move to the next/previous view (I could be cool if it did that with an animation, too). Plus, I also need to move though it by buttons. For example, "move to view 20".
Could you give me an advice on what to use for my purpose? Thanks in advance
Edit: By the way, grey big thing in the picture represents the current view, while the other thinner rectangles are the preceding and following view.

Please take a look on this answer Android page control like book?
You can make gaps between pages with setting margins or padding.

Related

Extend View on single side touch of GridView item Height and Width

I need Help to extend layout ontouchlistener. Like Android Studio, where we can expand logcat(Android Monitor) view increase and decrease with point on it. I want same on app, If I expand height of view then below layout should decrease in size and when I touch to above and below view should increase in size, same as right to left and left to right view on run time. Please give your suggestions.
What exactly i want is like this. Kindly please check this link and let me know if it is possible then how ? Else suggest me that how to do this type of UI in android
I have not much more knowledge about this kind of view creation and resize that view. But If you want to resize any view in single screen as per that video then you have create custom view extend with LinearLayout. Please check this project that help you that how to resize the view?
For drag from one position to another position read this tutorial. With LinearLayout use this lib
If you want to Supporting Multiple Screens please refer this Google developer documentation.

make main view of app larger than the phone's screen

working on an app and The way I want to set it up is different than what I have ever done before. I want the main activity when launched into the app to exceed past the boundaries of the physical phone screen, and for the user to be able to swipe out to parts of the app that they can't originally see.
I am not sure what the terminology is or what methods or classes etc to use. Any info that could point me in the right direction would be great! Thanks!
Just some clarification:
I think what I'm trying to say is the second thing you talked about. Imagine if you place a iPhone for example in the middle of a piece of computer paper. What I want to achieve is to have the whole view the size of the paper, but only be able to see the size of the iPhone's screen at a time. So you can go up a little bit and see what was above the screen, or left or right
If you want more screens and be able to switch between them, use ViewPager.
If you want one large view bigger than screen, you can either combine ScrollView for vertical scrolling and HorizontalScrollView for horizontal scrolling, or make some custom View, which will be able to scroll (you have to implement it on your own) in both direction.
If you want to have just some views outside of the screen and bring them to visible area on some event, you can use RelativeLayout and set to its views proper margin.
If you want something else, add more information, how it should look and act like.

How to cross-fadeing image in Android

Basically, I have images that I'd like to to update them sequentially into the same view to create custom ProgressBar.
I found Tumblr to do just that with their ProgressBar(ImageView?).
Here I put the animation side-by-side to show how the image actually cross-fade from Aa into a camera.
Exactly what I wanted:
Cross-fading effect
Indeterminate
Use the same view (I dumped view hierarchy to check)
Animation during transition (The image actually pop a little when spinning and cross-fading into the next image)
So far I have tried:
1. Frame Animation,
this allows for unlimited item(s) with definable durtion. However, it
doesn't cross-fade the image and there's no way to listen to the
transition's event to apply other animation, etc.
2. Transition Drawable, this allows cross-fading between EXACTLY two drawables. So this doesn't allow for the number of items and interminate duration as well.
I also came across CrossFadeDrawable by Romain Guy just now but it looks like it's only coded to support only two Drawable.
Right now I am not very sure if I'm approaching in the right direction or is there something I need to learn in order to do this kid of effect?
I'm not sure if you are approaching this direction but isn't this what you are looking for:
http://www.youtube.com/watch?v=atH3o2uh_94

HorizontalScrollView - need to scroll by width of the images

I have a HorizontalScrollView that consists of Images (Icons). I need to scroll the view in "blocks" the width of the icons, so as to never have a "piece" of the icon on the screen. I need more, but this question will give me all the other answers I need.
Does anyone have a code example to point me to for this?
Thank You in advance.
JS
You can either use a Gallery or create your own custom View that does this (maybe extend HorizontalScrollView).
I accomplished this in two parts.
I dynamically add the buttons from resource files and account for spacing on the left, right, and between.
I modified HorizontalScrollView to simply scroll to one of X positions (whichever is closer to the currently stopped position).
Again, thanks for reading.
JS

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