How to disable swipe in Android Image Slider (daimajia) - android

I have a slider with daimajia like this
<com.daimajia.slider.library.SliderLayout
android:id="#+id/bsNews"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bck_rounded"
custom:indicator_visibility="invisible"
custom:pager_animation_span="1100"/>
and i want the slider to auto-cycle, but we wouldn't touch it and disable swipe left and right in slider.
can help me?

One approach can be : that you need to extend existing functionality(SliderLayout) and change it to receive touch events and do nothing on those touches.
Can you think along these lines?
If you are still confused, check out this original answer to a similar query.

Related

Swipe to delete, ripple effect on background

I want to add this ripple effect when card view is swipe.
How i can achieve this?
Here's the video i'm questioning, nowhere can't find answer.
https://drive.google.com/file/d/0B1vNFnrquuFFOVJPSlJKY0I1bDdYY21mYjRqQlFqWFYwZHl3/view?usp=sharing
I already maked swipeAdapter i just need that ripple effect when swiping is started. Here's my code:
pastebin.com/zGfmmbwm, and interface for listener, pastebin.com/9JzX1yhC
, do i need to create some interface for listener when swiping ?
Please refer to https://github.com/daimajia/AndroidSwipeLayout.
If u get stuck, please feel free to comment.
i just need that ripple effect when swiping is started
There can be so many ways it can be done but the simplest one is to add ripple background to your CardView, that is, when user touches the cardView the ripple will be shown.
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"/>
The logic is whether the user wants to just see the content or want to swipe, he has to touch the Card, which it turn will add the ripple effect.

Swipe Up/Left/Right/Bottom, Float button in android

I'm looking for something like this to use in my apps. What is it called and what /i have to search for? Is anyone know any library that do so?
I want somewhere in my app to swipe from center to up and do rating, swipe right to like, swipe left to call, swipe bottom to cancel
I think MultiChoicesCircleButton will help
Here is an Example Gif
It's customizable so you can
Change it's color
Change distance between items and the center
Disable the parallax effect if you
want and lots of more stuff
I have found this library, you should do some work to make it work like you want, but it's very close to it!
https://github.com/TheFinestArtist/MovingButton

how to swipe image horizontally and do actions when (swipe)left in between in android

I am working on an app in which i want to swipe image horizontally and while making swiping to half it would do some action and it would regain its original position. this is to be done in both ways left and right swipe.for an example gmail app uses this, in which when we swipe it half and left it, it will regain its same position. but in similar terms i also want to make some function call. please suggest me what to do.
for this i have tried something swipe features but i am not getting it properly.
If I got ur question correct, this is the solution
http://developer.android.com/training/implementing-navigation/lateral.html#horizontal-paging

Add "Rubber Band" effect in android while changing background of application

I am working on the application in which:
User will have a control to change the background and text (multiples) by doing horizontal swipe for BG and vertical swipe for text. In this case, if I am changing BG, text should remain constant and if I am changing text then BG should remain constant.
Also, I want to add Rubber Band effect like in iOS when user changes Text and BG.
I am thinking of twoway-view library to support for vertical and horizontal scrolling. But how to use this library in my case?
Any idea/solution will be appreciated.
twoway-view implements an AdapterView that can scroll vertically or horizontally, but not both at the same time. It wouldn't work in your case.
I would use a ViewPager in which each fragment:
Shows a certain background
Lets the user select the text through swipe up and down gestures.
To obtain a rubber band effect, just add a BounceInterpolator to the animation that moves the text up & down. In the ViewPager you could get a similar effect applying a custom PageTransformer.
You will probably need to use a combination of GestureDetector, SimpleOnGestureListener and TranslateAnimation on your layout. This can be fairly involved but you can find a Translation example at this SO question and GestureDetector/SimpleOnGestureListener example here. Hopefully you can figured out how to adapt the code to suit your needs.
You can try this library for the Rubber Band effect: AndroidViewAnimations

Android horizontal scroll programmatically

In Android, I want to create a particular control which may require to set the location of a component by fixed coordinates.
This is what I want to do. These screenshot are taken from a swing application of mine. I want to clone the buttons on top and their behaviour, into an android application. Basically if there are too many buttons in the menubar, left and/or right arrows appear, and clicking on them will scroll horizontally to access the hidden buttons.
I need to be able to set the coordinates of an horizontal linear layout inside another one, and even to set negative coordinates in order to scroll on the right.
I'm doing this using a null layout in swing. Can I achieve this with Android ?
I'm not sure if an HorizontalScrollView can do this. Could someone point out a good tutorial or something related to what I'd like to do.
I think a HorizontalScrollView can achieve what you intend to do with your Menu Bar. You don't need these "scroll" Buttons, because a user can swipe the menu.
You can nest LinearLayouts together, however you want. if you want to control their flow try to apply margins to them. You can set fixed Coordinates in an AbsoluteLayout, too.
Consider using a gallery? If not gallery, then a child or cousin of it. As far as I know, there is no ViewParent that will allow what your are shooting for.
Hope that helped ~Aedon

Categories

Resources