Category : swipe

I have a google map with markers, I wanted to intergrade it with ebanx /swipe-button but When I try to swipe the button I get the following error java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.ebanx.swipebtn.SwipeButton.setOnStateChangeListener(com.ebanx.swipebtn.OnStateChangeListener)’ on a null object reference Bellow is my Code MapsActivity.java public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private ..

Read more

I have MotionLayout as a parent ViewGroup of the layout. As child it has CardView, which contain some Button views. When I beginning swipe on the button, it don’t work, and when i start swiping on the background, it’s work. <Transition motion:constraintSetEnd="@+id/top" motion:constraintSetStart="@+id/start" motion:motionInterpolator="easeIn"> <OnSwipe motion:dragDirection="dragUp" motion:touchRegionId="@id/fn_card" /> </Transition> <androidx.cardview.widget.CardView android:id="@+id/fn_card" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardCornerRadius="26dp" app:layout_constraintTop_toBottomOf="@id/fn_guideline_middle"> ..

Read more

I locked the swipe gesture of my ViewPager with this code: myviewpager.setOnTouchListener { view, _ -> view.performClick() true } Below the xml code of the fragment attached to the pager via FragmentPagerAdapter <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="12dp" android:paddingStart="24dp" android:paddingEnd="24dp" android:scrollHorizontally="false" android:layout_marginBottom="8dp"> <TextView android:scrollHorizontally="false" android:id="@+id/title_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="test" android:textColor="@color/greyish_brown" android:textSize="24sp" ..

Read more

Here is my SwipeHelper code where I can swipe the list from Right to Left as of now. public abstract class SwipeHelper extends ItemTouchHelper.SimpleCallback { int BUTTON_WIDTH = 200; private RecyclerView recyclerView; private List<UnderlayButton> buttonList; private GestureDetector gestureDetector; private int swipedPos = -1; private float swipeThreshold = 0.5f; private Map<Integer, List<UnderlayButton>> buttonsBuffer; private Queue<Integer> recoverQueue; ..

Read more