Giter Site home page Giter Site logo

swipemenulistview's Introduction

SwipeMenuListView

Android Arsenal Download

A swipe menu for ListView.

Demo

Screenshot

Usage

Add dependency

dependencies {
    compile 'com.baoyz.swipemenulistview:library:1.3.0'
}

Step 1

  • add SwipeMenuListView in layout xml
<com.baoyz.swipemenulistview.SwipeMenuListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

Step 2

  • create a SwipeMenuCreator to add items.
SwipeMenuCreator creator = new SwipeMenuCreator() {

	@Override
	public void create(SwipeMenu menu) {
		// create "open" item
		SwipeMenuItem openItem = new SwipeMenuItem(
				getApplicationContext());
		// set item background
		openItem.setBackground(new ColorDrawable(Color.rgb(0xC9, 0xC9,
				0xCE)));
		// set item width
		openItem.setWidth(dp2px(90));
		// set item title
		openItem.setTitle("Open");
		// set item title fontsize
		openItem.setTitleSize(18);
		// set item title font color
		openItem.setTitleColor(Color.WHITE);
		// add to menu
		menu.addMenuItem(openItem);

		// create "delete" item
		SwipeMenuItem deleteItem = new SwipeMenuItem(
				getApplicationContext());
		// set item background
		deleteItem.setBackground(new ColorDrawable(Color.rgb(0xF9,
				0x3F, 0x25)));
		// set item width
		deleteItem.setWidth(dp2px(90));
		// set a icon
		deleteItem.setIcon(R.drawable.ic_delete);
		// add to menu
		menu.addMenuItem(deleteItem);
	}
};

// set creator
listView.setMenuCreator(creator);

Step 3

  • listener item click event
listView.setOnMenuItemClickListener(new OnMenuItemClickListener() {
	@Override
	public boolean onMenuItemClick(int position, SwipeMenu menu, int index) {
		switch (index) {
		case 0:
			// open
			break;
		case 1:
			// delete
			break;
		}
		// false : close the menu; true : not close the menu
		return false;
	}
});

Swipe directions

	// Right
	mListView.setSwipeDirection(SwipeMenuListView.DIRECTION_RIGHT);
	
	// Left
	mListView.setSwipeDirection(SwipeMenuListView.DIRECTION_LEFT);

Create Different Menu

  • Use the ViewType of adapter
	class AppAdapter extends BaseAdapter {

		...
		
		@Override
		public int getViewTypeCount() {
			// menu type count
			return 2;
		}
		
		@Override
		public int getItemViewType(int position) {
			// current menu type
			return type;
		}

		...
	}
  • Create different menus depending on the view type
	SwipeMenuCreator creator = new SwipeMenuCreator() {

			@Override
			public void create(SwipeMenu menu) {
				// Create different menus depending on the view type
				switch (menu.getViewType()) {
				case 0:
					// create menu of type 0
					break;
				case 1:
					// create menu of type 1
					break;
				...
				}
			}

		};
  • Demo

Screenshot

Other

  • OnSwipeListener
listView.setOnSwipeListener(new OnSwipeListener() {
			
	@Override
	public void onSwipeStart(int position) {
		// swipe start
	}
	
	@Override
	public void onSwipeEnd(int position) {
		// swipe end
	}
});
  • open menu method for SwipeMenuListView
listView.smoothOpenMenu(position);
  • Open/Close Animation Interpolator
// Close Interpolator
listView.setCloseInterpolator(new BounceInterpolator());
// Open Interpolator
listView.setOpenInterpolator(...);

Screenshot

swipemenulistview's People

Contributors

baoyongzhang avatar ddyos avatar jitpack-io avatar juliasoboleva avatar nimengbo avatar zhanhui913 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swipemenulistview's Issues

Listview performance slowdown issue

Hi,
I am using SwipeMenuListView in tabs with view pager(Custom pager which is removed swipe) which is having lift and right sliding menus my list view performance is too slow for image view visible and invisible also taking time to perform.

Thanks and Regards

swipe does not work

swipe menu status is close, when touch a widget ( my problem is a TextView ) which set onClickListener, then the menu can not swipe out.

Items without Swipe Menu

Can we disable menu for some items ? If how, please provide a solution. I have a list in which the default item should not have the swipe menu, rest need the menu. Is it possible ?

Not Working With NavigationDrawer

I am using listView in a navigation Drawer.The swipe menu not showing always.If swipe menu shows then listView stop scrolling.Any idea whats wrong

关于添加SwipeMenuItem的问题

那些set方法一定要按照一定的顺序区调用么? 为什么我调用了setTitle()方法,但是在程序中并没有显示,而是空白的?

On lollipop scrolling is very slow

If version of a device is < 5 scrolling works perfectly, on the lollipop device scrolling is very slow, and jumping. How can I solve this?

Touch intercepts event if menu was not shown

Pre-conditions: only for some items we have a menu (for example viewType = 1), for others there is no menu when swipe

Steps to reproduce:

  1. Try to swipe an item with no menu for that item type
  2. Perform any other type of touch event for the ListView

Actual result: Touch event from step 2 was intercepted by the SwipeMenuListView and no action was performed. (like we had opened swipe menu, but it is not, because we tried to swipe an item with no Swipe Menu)

Expected result: Touch event was performed and appropriate action (scroll, item click or any other, which user was tried to perform in step 2) was proceeded.

note3 crash

java.lang.ClassCastException SwipeMenuListView$1 cannot be cast to android.widget.BaseAdapter
at android.widget.FastScroller.getSectionsFromIndexer(FastScroller.java:875)
at android.widget.FastScroller.getPosFromItemCount(FastScroller.java:1147)
at android.widget.FastScroller.onItemCountChanged(FastScroller.java:453)
at android.widget.AbsListView.onLayout(AbsListView.java:2543)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15664)
at android.view.ViewGroup.layout(ViewGroup.java:4869)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2246)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1968)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1200)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6401)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:573)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

Delete item not working

I am using your SwipeMenuListView backed by a BaseAdapter which has an ArrayList. After removing an item from the ArrayList, I call notifyDataSetChanged(), and find that the View is not updating correctly. It always removes the last item, and so the items displayed are out of sync with the ArrayList.

I verified it's not my sample code because this works fine if I use a standard ListView. In your Readme it looks like you do have delete items working, so is there a regression?

Drag and drop

Hi
Any possibility to add D&D list item rearrangement?
Thanks
Ivan

Duplicate items in listview

SwipeListview giving duplicate values in list view display, even if you use viewholder Its also happening in the example you have given.

Move divider with menu opening

Is there any way to move the top and the bottom divider for the item along with the swipe? I tried to but seems very tricky..

误操作问题

水平滑动的时候能不能禁用ListView的垂直滑动,不然很容易触发误操作

Duplicate items in listview

SwipeListview giving duplicate values in list view display, even if you use viewholder Its also happening in the example you have given.

Problem in Android 5.0 Lollipop

at com.baoyz.swipemenulistview.SwipeMenuListView.onTouchEvent(SwipeMenuListView.java:182)

java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6563)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4916)
at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3398)
at android.widget.AbsListView.startScrollIfNeeded(AbsListView.java:3326)
at android.widget.AbsListView.onTouchMove(AbsListView.java:3754)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:3612)
at com.baoyz.swipemenulistview.SwipeMenuListView.onTouchEvent(SwipeMenuListView.java:182)
at android.view.View.dispatchTouchEvent(View.java:8388)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2158)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
at android.app.Activity.dispatchTouchEvent(Activity.java:2739)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2275)
at android.view.View.dispatchPointerEvent(View.java:8578)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3578)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3635)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3502)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3468)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3476)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3449)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5701)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5675)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5791)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:122)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.

Swipemenu with ExpandableListview

Hello.
Can this all functionality possible with ExpandableListView instead of Simple ListView in android.
If yes then can you please make a code for that i really need it.

如何控制 MenuItem 的高度?

我的ListViewItem是在GetView 的时候动态计算的,但是每个View的高度是一样的,使用SwipeMenuListView 之后我的ViewItem高度就错了。
而且我也看不到哪里可以设置这个MenuItem的高度。

Limited data entry

total records 7
its display like 1 2 3 4 5 1 2
if total records 8
than 1 2 3 4 5 6 1 2
and can't show more than 20 records.
if I remove this custom layout then all records are displaced perfectly so there is no problem in adapter.
plz help me

Swiping and scrolling at the same time

Great library to make a SwipeMenu like in iOS.

One problem. When I scroll vertically at the same time as swiping, the swiping stops.
In iOS the swiping continues when scrolling. Can this be enabled in the current version of the library
or has it yet to be implemented?

Change Item Icon when it's clicked

Hi! I want to know how to change the icon when the item is clicked. I use 2 different items, so in the next code I access to the second that contains an icon, but it doesn't work:
productsList.setOnMenuItemClickListener(new SwipeMenuListView.OnMenuItemClickListener() {
@OverRide
public boolean onMenuItemClick(int position, SwipeMenu menu, int index) {

            menu.getMenuItem(1).setIcon(getResources().getDrawable(R.drawable.list_added,getApplicationContext().getTheme()));

            return false;
        }
    });

Thanks a lot!

Invalid position returned in ArrayAdapter

Tested versus regular ListView and correct position was returned, but SwipeMenuListView returns invalid position.

I have an array of 38 objects and using simple getView(int position, View convertView, ViewGroup parent) method to return a custom view.

Here's log file to show how it works with SwipeMenuListView and regular ListView

SwipeMenuListView - Invalid position example:
03-14 01:29:43.717 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.718 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.718 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.719 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.720 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.721 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 01:29:43.721 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 01:29:43.721 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 01:29:43.722 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.722 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.723 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.724 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.725 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.726 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 01:29:43.726 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 01:29:43.727 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 01:29:43.727 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.728 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.728 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.729 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.729 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.731 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 01:29:43.731 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 01:29:43.731 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 01:29:43.732 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.732 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.733 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.733 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.734 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.734 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 01:29:43.735 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 01:29:43.735 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 01:29:43.736 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.737 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.738 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.739 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.740 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.740 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 01:29:43.741 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 01:29:43.742 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 01:29:43.748 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.748 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.749 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.749 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.749 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.750 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.750 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.750 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.750 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.751 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.751 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.751 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.752 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3
03-14 01:29:43.752 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 01:29:43.752 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0
03-14 01:29:43.752 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1
03-14 01:29:43.753 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2
03-14 01:29:43.753 3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3

ListView - valid position example:
03-14 02:06:58.644 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 4
03-14 02:06:58.660 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 5
03-14 02:06:58.678 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 6
03-14 02:06:58.694 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 7
03-14 02:06:58.694 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 8
03-14 02:06:58.710 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 9
03-14 02:06:58.731 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 10
03-14 02:06:58.732 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 11
03-14 02:06:58.743 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 12
03-14 02:06:58.762 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 13
03-14 02:06:58.777 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 14
03-14 02:06:58.778 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 15
03-14 02:06:58.794 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 16
03-14 02:06:58.811 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 17
03-14 02:06:58.828 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 18
03-14 02:06:58.846 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 19
03-14 02:06:58.846 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 20
03-14 02:06:58.863 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 21
03-14 02:06:58.877 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 22
03-14 02:06:58.894 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 23
03-14 02:06:58.912 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 24
03-14 02:06:58.927 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 25
03-14 02:06:58.929 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 26
03-14 02:06:58.944 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 27
03-14 02:06:58.961 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 28
03-14 02:06:58.977 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 29
03-14 02:06:58.994 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 30
03-14 02:06:59.012 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 31
03-14 02:06:59.028 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 32
03-14 02:06:59.045 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 33
03-14 02:06:59.061 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 34
03-14 02:06:59.077 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 35
03-14 02:06:59.094 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 36
03-14 02:06:59.110 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 37
03-14 02:06:59.128 4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 30

Gradle

Hey,

Can you provide me the compile address to gradle, non of the examples here work for me.

Best,
Idan

Question: Can it delete a row?

When the list row Swipes, and the menu appears, upon clicking on the delete button, can it remove the current row and/or remove currently displayed data item from the Adapter?

Or Do we have to handle it manually?

item 布局失效!

你好,你的控件写的很好!不过这里有个小问题!是否可以修正?

SwipeMenuLayout 文件
init 方法

    if (mOpenInterpolator != null) {
            mOpenScroller = ScrollerCompat.create(getContext(),
                    mOpenInterpolator);
        } else {
            mOpenScroller = ScrollerCompat.create(getContext());
        }

        LayoutParams contentParams = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        mContentView.setLayoutParams(contentParams);
        if (mContentView.getId() < 1) {
            mContentView.setId(CONTENT_VIEW_ID);
        }

mContentView.setLayoutParams(contentParams); 重置了布局参数,把布局中配置 LayoutParams 忽略了! 这样导致的结果是,无论怎么控制item 布局都是一样的高度。

Set height of swipe menu

How can i set the height of the swipe menu?
(The setMenuHeight function in SwipeMenuLayout class is in comments)

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.