Swipe to delete, ripple effect on background - android

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.

Related

How to disable swipe in Android Image Slider (daimajia)

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.

onRecieve show a single ripple effect on imageView

I want to be able to show to my users whenever they recieve a new location update in my app.
So, whenever onRecieve() is called in my activity I want a imageView to animate a single ripple effect.
Ive tried to find a appropriate librabry that can do this easily but with no success.
Given my requirements can anyone point me in the right direction or suggest a good way to accomplish this?
Using this library https://github.com/skyfishjy/android-ripple-background i couldnt make a single ripple effect.. it never stops until i call stopRippleAnimation();
Edit: Using a valueanimator was a perfect solution for this
Call stopRippleAnimation after the ripple animation duration.
Also you can easily perform this animation using valueAnimator, Fadeout and scale using the values between 0 and 1.

Can i trigger a ripple effect on another event except onClick?

I have a timer, and i want to trigger a ripple effect every second.
I don't have a problem with the ripple effect, i can't find a way to trigger it on another event except the user's onClick.
Is it possible?
I guess you want to acheive something like this?
https://github.com/skyfishjy/android-ripple-background

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 custom button

I need to create some custom buttons as shown in the image below
what is the best approach to follow?
thanks
Abdul Khaliq
That's a hard one. I made a lot of custom views, and the first thing I would thinking of is, made one Button with that above image, and handle onTouch by yourself so you can distinguish which area the user hit. There you can also change the state of the button, like changing the image to a bevel one e.g. when the left button is hit.
Can you imagine this ansatz?
You can place two transparent "invisible" buttons over the top of a background in a LinearView. Like two ImageButtons with a transparent png inside.
It is also possible to make this background animated when buttons are clicked using android animation class.

Categories

Resources