Swipe image in Listview - java

I want to swipe an image from left to right and right to left in an ListItem, I searched so many codes in online, none had solution for me, can anyone help me.

If I understand you correctly, you're looking for something like a ListView that swipes horizontally instead of vertically.
You want a ViewPager:
Here's an example:
http://developer.android.com/training/animation/screen-slide.html
On the adapter's instantiateItem() method (which more or less takes the place of the getView() method in the ListView adapters), simply inflate layouts that contain only your images, rather than text like is shown in the example.
http://developer.android.com/reference/android/support/v4/view/ViewPager.html

Related

How to create a grid which you can scroll both vertically and horizontally, which contains random sized elements, and works with recyclerview?

I am a beginner, and i tried to find an answer but everything i found was from 2013 and earlier. I want to create a grid which you can scroll in any direction, (as a zoomed in picture), which contains items of different sizes which are generated randomly, then i want to populate them with a recycler view. I will attach an illustration, maybe you would understand it better.As you can see, the thick outline is the phone screen and whenever you scroll the view, it generates new items which are populated by a recycler view.
I thought of using Google's FlexBox Layout for generating the items but i don't really know how to create that scrollable view. I would literally pay to get this done.
I don't think you can make RecyclerView scroll in Both way. U can Create Nested RecyclerView if that is what you are looking for.

How to make a Bottom Navigation bar with ImageView instead of Menu Items?

How can I make a working bottom navigation bar with ImageViews in a LinearLayout(Horizontal) With fragments ? instead of menu items.
if already exist then please share the source code. Please help quickly :)
Or the Question could be this :
https://github.com/qhutch/BottomSheetLayout/issues/12#issue-576279364
Oh, I found my solution not exactly but this is what I want...
I add that Bottom Navigation View in a LinearLayout(horizontal) and I delete all default Styles from BottomNavigationView. So now this is not looking like a card view. After this, I add an ImageView in the LinearLayout with a weight of a ratio of 1:3 (for 4 icons ). Now I can use effects and designs on my LinearLayout. And it is looking like how I wish. 😌
[Note: For horizontally rotated screen LinearLayout, ImageView, BottomNavigationView 's width:match-parent]

How to expand a cardView to show hidden elements in android with a dropping animation?

I am beginner in android animations and therefore, am wondering exactly how can I implement something like expand a cardView to show hidden options or elements.
For example: a post in social networking, we have a cardView holding the post info. it also has likes and comments buttons/options. When user taps on comments button the view should expand a little say certain height and show the comments and shrink back when the same button is tapped again.
I am listing my posts using RecyclerView in a Fragment using a CardView. I am looking for a soft animation along with expanding and shrinking back to original place or size.
Below is a screenshot that might help you understand what exactly I want:
How to do this? Will you please provide me a small snippet of code?
use wrap content as height of cardview and use textview inside it below title, so on click make the textview visible and invisible.
And use android:animateLayoutChanges="true" in parent layout.

Horizontal listview with OnScrollListener

I need sync scroll of 2 listViews (vertical and horizontal)
I tried several libraries for the horizontal listview, but no library implements OnScrollListener()
https://github.com/MeetMe/Android-HorizontalListView
https://github.com/sephiroth74/HorizontalVariableListView
https://github.com/dinocore1/DevsmartLib-Android
need this callback to scroll vertical list when scoll the horizontal list...
how can I do this?
Thanks!!
I did a little bit of code for this exact thing a while back. Check it out here https://github.com/slightfoot/android-tandem-scroll
Just duplicate https://github.com/slightfoot/android-tandem-scroll/blob/master/Library/src/com/demondevelopers/tandemscroll/TandemScrollView.java file and make it extend HorizontalScrollView.

Create multiple horizontal scrolling layouts within a scroll view

So I have a Scroll View which contains a relative layout. I want that relative layout to have 3 or more layouts that can be scrolled. I know how to implement that with HorizontalScrollView, but before execution, I have no idea how many elements the HorizontalScrollView is going to have. Should I use ViewPager for this? What I would like the most is a HorizontalListView.
Would you recommend something like this:
https://github.com/sephiroth74/HorizontalVariableListView
Or should I add views programmatically in a HorizontalScrollView?
ScrollView is widget that should be used to keep static layouts inside. In general - ones that just are ~slightly bigger that the screen.
If you need something really dynamic you should use elements based on adapters like ListView, or ViewPager.

Categories