Giter VIP home page Giter VIP logo

enhancedlistview's Introduction

Welcome to my GitHub profile 👋

🌍 ❬ www.timroes.de
👥 ❬ LinkedInMastodonYouTube
👨‍💻 ❬ Working at Airbyte

Tools and Techstack

🖥️ ❬ Arch Linux · Awesome WM · zsh ❭
🛠️ ❬ TypeScript · React · Gatsby · Netlify ❭
📝 ❬ Visual Studio Code · GitHub · Todoist · Notion ❭
🎨 ❬ iPad Pro · Concepts · Affinity Designer ❭

enhancedlistview's People

Contributors

cketti avatar marcolizza avatar ranhaveshush avatar saadfarooq avatar timroes 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

enhancedlistview's Issues

using finger to fast swipe may cause exception

yes,i try to help u find out the #4 ,but i found another bugs here when i using finger to fast swipe the item.may cause the following exception

09-24 17:25:52.765 25820-25820/de.timroes.android.listviewdemo W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40bb7300)
09-24 17:25:52.765 25820-25820/de.timroes.android.listviewdemo E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IndexOutOfBoundsException: Invalid index 26, size is 21
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at de.timroes.android.listviewdemo.MainActivity$EnhancedListAdapter.getItem(MainActivity.java:312)
at de.timroes.android.listviewdemo.MainActivity$4.onDismiss(MainActivity.java:127)
at de.timroes.android.listview.EnhancedListView$3.onAnimationEnd(EnhancedListView.java:745)
at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43)
at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4931)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)

Maven Dependency Problem

just wanted to try EnhancedListView.by putting it to a android quickstart maven project (generated by: mvn archetype:generate -> 123)
Added the maven EnhancedListView dependency in the pom

    <dependency>
        <groupId>de.timroes.android</groupId>
        <artifactId>EnhancedListView</artifactId>
        <version>0.1.2</version>
    </dependency>

but idea 12 marks com.android.support:support-v4:13.0.0 red because it cannot find it.

Any idea for a bloody beginner, please :-)

P.S. here the pom: http://pastebin.com/fL0PyrvM

Find out right content for gitignore

Checking in .idea doesn't seem to be a good idea, since it contains absolute pathes, and leads in Android Studio renaming modules when opening on another pc. Not checking .idea neither seems like a good idea. Unfortunately IntelliJ IDEA suggestions are not very helpful.

EnhancedListView consuming events it shouldn't

I'm using EnchancedListView with a layout which contains an image and text.
EnchancedListView is set to allow the user to swipe an item left (and left only) to dismiss it. When the user swipes a picture inside the listview right, it should display some data.

Problem is, it seems like even though EnchancedListView is set to only detect left swipes, it also consumes the events of right swipes, so the imageview never gets the onTouch event.

This is a bug since EnchancedListView shouldn't consume a swipe to right event when its set to consume swipe to left event.

Problem with SwipeRefreshLayout

Hi, I'm using your EnhancedListView and it's great, but I have problem with it in combination with SwipeRefreshLayout from support library. If you swipe verticaly during swiping horizontaly it stops the item at the place and doesn't put it to right place. I'm cliping the image.
2014-08-04 15 54 44

Can't implement onClick() in child views when onTouch() (swiping) is enabled

Clicks are not detected in child views of EhancedListView (at least I couldn't get it to work consistently). Here's what I put into the EhancedListView's onTouchEvent():

        case MotionEvent.ACTION_UP: {
            if (mVelocityTracker == null) {
                break;
            }
            float deltaX = ev.getRawX() - mDownX;
            // CODE ADDED HERE
            // detects a click and passes the click
            // onto the child view. without this, there
            // is no click vs. swipe detection
            if (deltaX == 0) {
                mSwipeDownView.callOnClick();
                // this was only a press, not a swipe
                return false;
            }
            // CODE ADDED END
            mVelocityTracker.addMovement(ev);
            mVelocityTracker.computeCurrentVelocity(1000);

This works on my Droid Maxx, 4.2.2. Still have to test it on other devices. I'd like to know if you see any problems with it. Thanks! --Dave A

Edit: for the above, a AdapterView.OnItemClickListener() needs to be added to the child view that has it's callOnClick() method called.

Null pointer exception when deleting items by calling delete()

When you call delete with a position of a listItem that is not visible you get a nullpointer exception because you try to animate a null view.

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewPropertyAnimator android.view.View.animate()' on a null object reference
at com.nineoldandroids.view.ViewPropertyAnimatorICS.(ViewPropertyAnimatorICS.java:22)
at com.nineoldandroids.view.ViewPropertyAnimator.animate(ViewPropertyAnimator.java:62)
at de.timroes.android.listview.EnhancedListView.slideOutView(EnhancedListView.java:615)
at de.timroes.android.listview.EnhancedListView.delete(EnhancedListView.java:592)

New KitKat styling

KitKat has a new way of styling toasts. It uses the condensed Roboto font & uses fully rounded ends.

It would be nice to have the popup switch to the KitKat style on API 19 & above.

This library may be of some help, though when I gave it a simple effort it didn't go smoothly.

ArrayIndexOutOfBoundsException while Scrolling

Hey,

first of: cool library!

But I'm facing one problem: When I open the view that contains the EnhancedListView and I start scrolling it simply crashes with an ArrayIndexOutOfBoundsException.

The according stack trace:

java.lang.ArrayIndexOutOfBoundsException: length=2; index=2130903077
            at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6724)
            at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5084)
            at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3236)
            at android.widget.AbsListView.onTouchMove(AbsListView.java:3580)
            at android.widget.AbsListView.onTouchEvent(AbsListView.java:3424)
            at de.timroes.android.listview.EnhancedListView.onTouchEvent(EnhancedListView.java:784)
            at android.view.View.dispatchTouchEvent(View.java:7706)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2210)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1945)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2068)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1515)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2458)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2016)
            at android.view.View.dispatchPointerEvent(View.java:7886)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3954)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3833)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3418)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3525)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3426)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3582)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3449)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3418)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3426)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5602)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5582)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5553)
            at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5682)
            at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
            at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
            at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
            at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5655)
            at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:5701)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
            at android.view.Choreographer.doCallbacks(Choreographer.java:574)
            at android.view.Choreographer.doFrame(Choreographer.java:542)
            at android.view.Choreographer$FrameDisplayEve

To my app:

  • I placed the EnhancedListView in my fragment layout
  • during the fragment's onViewCreated method I get a reference to the EnhancedListView, place an onItemClickListener, a DismissCallback, enable the swipe, and set the swipe direction
  • since the data is coming via an asynchronous network request, I set the adapter for the ListView in a callback method

Do you have any idea what's going on there? Do you need more code? :)

Unable to compare strings in onitemclicklistener

I am trying to use this library in my app. I successfully linked it with my database and set all swipe to remove and undo operations. But I am stuck with a major problem.
My listview has strings which open respective activities, when I compare them and try to open new activity, it just doesnt work. While simple code in onitemclicklistener works.

Here's sample code

lv.setOnItemClickListener(new OnItemClickListener() {
    @Override
        public void onItemClick(AdapterView<?> parent, View view,int position, long _id) {
            String values = adapter.getItem(position);
            Log.d("List item", values);
            // TODO Auto-generated method stub

            if(values == "21 Guns") {
                Toast.makeText(Favorites.this, "found it", Toast.LENGTH_LONG).show();
            }

The Log successfully shows the List item xyz but the toast doesnt shows up, even if the value is exactly same.
Can you please try it, this is really strange.

View flicker issue with CursorAdapter

When using a cursor adapter with EnhancedListView after I swipe to dismiss the swiped view reappears momentarily and then disappears creating a very ugly flickering effect.

After looking on StackOverflow it looks this is a known issue with CursorAdapters and animated list views such as EnhancedListView. The issue seems to be that the animation finishes and redraws the list view before the item is actually deleted from the adapter. This causes the item being swiped out to reappear on the list and latter when the CursorAdapter finishes updating with the item removed the list is again redrawn without the removed item. This results in noticeable flickering.

I tried several solutions proposed (see links below) but they did not work with the EnhancedListView. The last solution I tried was to reload the cursor without the deleted item inside the dismiss callback but the flickering is still there.

I am open to suggestions on how to work around this issue.

Swipeable list items inside a fragment in a ViewPager

Hello all,

I'm having trouble with the EnhancedListView in a fragment from ViewPager. I'm not sure if this question has been answered here, but I couldn't find a solution.

I've initialized an enhanced list view with a custom BaseAdapter which is in a the first out of 3 fragments of a view pager. The swiping (SwipeDirection.END) only works when my list is scrolling and I interrupt the scrolling with a horizontal slide on top of a list item. When the list isn't scrolling, the swipe on top of a list item isn't detected.

I tried calling view.getParent().requestDisallowInterceptTouchEvent(true); for every single list item in the adapter, but that only cancels the list view scrolling, and view.getParent().getParent().requestDisallowInterceptTouchEvent(true); which cancels the swiping to the next fragment but does not enable swipe to dismiss.

For the record, I initialize the list like this:
EnhancedListView lv = (EnhancedListView) v.findViewById(R.id.transactionsList);
lv.setAdapter(adapter);
lv.enableSwipeToDismiss();
// transactionHolder - id of the list item layout
lv.setSwipingLayout(R.id.transactionHolder);
EnhancedListView.UndoStyle style = UndoStyle.SINGLE_POPUP;
lv.setUndoStyle(style);
EnhancedListView.SwipeDirection direction = SwipeDirection.END;
lv.setSwipeDirection(direction);

mSlop for horizontal swipe is too low

When using the view with swipe to dismiss on, repeated vertical scrolling often gets interrupted by the initiation of a swipe action (try making a long list, and scrolling as fast as you can to the bottom). I think this is because mSlop is set too low.

I know the documentation says you should use vc.getScaledTouchSlop(), but I think this is far too low in this context. I've had pretty better results with a constant value of 48dp:

mSlop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 48, ctx.getResources().getDisplayMetrics());

[Important] Deprecation Notice

I added a deprecation notice in favor of the new RecyclerView coming soon in the support library.

Please make sure to read the updated README file.

Provide .jar package.

Hello Tim,

I would like to ask you if you can upload a simple jar package in your maven repository (instead of aar).

I tried to import EnhancedListView in Eclipse (my m2e plugin is the latest 1.5.0 snapshot) but there is a pending feature request for ADT for correctly handling .aar dependencies and it didn't work (see rgladwell/m2e-android#177 for details).

By the way, the current correct Maven import is (note type):

<dependency>
    <groupId>de.timroes.android</groupId>
    <artifactId>EnhancedListView</artifactId>
    <version>0.1.3</version>
    <type>aar</type>
</dependency>

But as I said, the compilation phase fails.

Ps: thank you for the other answer.

Intuitive SwipeDirection names

I just started using your library (great work btw), but I found your SwipeDirection enum constants confusing.

I had a look at your source code, have read the according JavaDoc and now I understand why they are called this way.

But wouldn't it be easier for "users" of your code to name them

SwipeDirection.RightToLeft
SwipeDirection.LeftToRight

This way, no one would be confused where the item will be moved to.

dependencies missing in 0.3.2 pom

Something changed in the plugins, so that the dependencies are missing in the pom file of the 0.3.2 version. You will most likely need to add com.nineoldandroids:library:2.4.0 to your dependencies and the support lib v4. I will try to fix this as soon as possible.

listview refresh bug

hey,first great work,cool stuff.
i try to build this demo this morning.i found a little bug in listview refresh.when i swipe to dismiss item.sometime it will appear the following bugs (black line)
device-2013-09-24-104337

on this moments when i try to Reset items than
device-2013-09-24-104352

any idea ?

Open Source License

I can't find a license under which you publish this library.. What's your idea here?

Add `elv` prefix to resources

It is possible for users to override resources accidentally.

An easy one being:

<color name="btn_normal">#00000000</color>

If the user defines a color for btn_normal in their app, the resource for the popup is overriden.

Demo issue

Dear,

Your demo source have compilation problems, you can't import it to eclipse.

Swipe to reveal

Swipe an list item away to reveal something behind (but don't delete).

Change location of Toast message

I need to change the location of the toast since it overlaps a button in my UI. Is there any exposed interface to do this ?

A simple margin should be enough but I couldn't find anything in the resources that could help.

Left Swipe Handler?

Hello,

I am using your excellent library, for my list-view. I have implemented right-swipe-to-delete.
How can i implement a Left Swipe?

Whole list dismissed after swipe.

I tried to use this EnhancedListView but every time I swipe one item the whole list dissapears. I am not sure if is that all items are deleted from the list or the list itself is removed from the layout. I have to refresh the cursor loader for the items to appear again but this causes a irritating flickering after each dismiss.

The only different thing from the demo app is that my list lies on top of a sliding up panel: https://github.com/umano/AndroidSlidingUpPanel.git.

Library in JAR format?

Hi, have you considered providing the library in JAR format, too?

I'm still developing using Eclipse and I would like not to include your source file (and resources) in the app-codebase itself...

Do not Swiping

Hello!

i'm trying to make my list swipable with undo bar. But i'm setting up all of the parameters like the Demo and still not working...

My XML:

<de.timroes.android.listview.EnhancedListView
android:id="@+id/historicoListView"
android:drawSelectorOnTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerHeight="5dp"
android:divider="#00000000"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"/>

And i'm setting the list on this method:

private void setLista(){
this.lista.setDismissCallback(new OnDismissCallback() {

        @Override
        public Undoable onDismiss(EnhancedListView listView, final int position) {
            final CardHistoricoVO item = (CardHistoricoVO) adapter.getItem(position);
            adapter.remove(position);
            return new Undoable() {
              @Override 
              public void undo() {
                  adapter.insert(position, item);
              }
              @Override 
              public String getTitle() {
                return "Deleted '" + ((ValorVO) item.getObject()).getId() + "'";
              }
              @Override 
              public void discard() {
                bancoValor.deleteValor((ValorVO) item.getObject());
              }
            };
        }
    });

    this.lista.enableSwipeToDismiss();
    this.lista.setUndoStyle(UndoStyle.MULTILEVEL_POPUP);
    this.lista.setSwipeDirection(SwipeDirection.BOTH);
    this.lista.setSwipingLayout(0); //R.id.card_item_categoria);

    this.lista.setShouldSwipeCallback(new OnShouldSwipeCallback() {
          @Override
          public boolean onShouldSwipe(EnhancedListView lv, int position) {
            return true;
          }
    });
}

IllegalStateException during "stress test"

I'm able to easily reproduce the following exception when quickly deleting items from the listview. I have the "delete on click" enabled so deleting is much easier compared to "swipe to delete":

E/AndroidRuntime( 1832): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131165219, class de.timroes.android.listview.EnhancedListView) with Adapter(class com.pushcoin.app.bitsypos.adapter.CartEntryArrayAdapter)]
E/AndroidRuntime( 1832): at android.widget.ListView.layoutChildren(ListView.java:1544)
E/AndroidRuntime( 1832): at android.widget.AbsListView$CheckForTap.run(AbsListView.java:2963)
E/AndroidRuntime( 1832): at android.os.Handler.handleCallback(Handler.java:725)
E/AndroidRuntime( 1832): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 1832): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1832): at android.app.ActivityThread.main(ActivityThread.java:5063)
E/AndroidRuntime( 1832): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1832): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 1832): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 1832): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 1832): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManagerService( 364): Force finishing activity com.pushcoin.app.bitsypos/.activity.ShoppingActivity

Enabled loading library in Eclipse

Hi timroes,

I was able to add your library in my Eclipse project by doing the following:

  • in build.gradle file inside the library folder (not the root folder project), I added this line: apply plugin: 'eclipse';
  • I had to add the ANDROID_HOME environment variable pointing to the root of Android SDK (it needs to reboot the system before it works; if this wouldn't work, add to the root folder project a local.properties file containing this line: sdk.dir=pathToAndroidSDK);
  • in a terminal, I have executed this command from the root folder of the project:
    gradlew eclipse.

When the process is finished, inside the library folder there were these three files:

  • .classpath file;
  • .project file;
  • .settings folder.

In other words, the command above has "translated" the gradle project into an Eclipse project.

Done that, I have imported the project into my Eclipse workspace, made changes to get a valid project without any error, set it to be an Android library and added it to my application as usual in Eclipse.

I hope this will help.

NullPointerException in Android Studio layout preview

NullPointerException when viewing the layout in Android Studio 0.3.1. Otherwise everything works fine, so view this as an enhancement more than anything else. Thanks! (Sorry for the screenshot, seems that window of Android Studio doesn't allow copying)

2013-11-03 22_06_16-xmaslistapp - c__work_java_engapps_xmaslistappproject - xmaslistapp - _xm

Merging EnhancedListView and your ABSListView.

Hi Tim! First of all good job ;)
Secondly, would it make sense to merge this EnhancedListView with the ABSListView you have in android-snippets? The one for enabling Sherlock ActionBar features?
Thanks and keep it up 👍 !

Clicked item view is not redrawn if the swipe to dismiss is enabled.

I have implemented a list, using EnhancedListView, that allows users to remove items from it by swiping. But also I would like to allow users to select one item from the list by clicking on it.

For some reason when the I enable swipeToDismiss on the list and click on a item, all other items in the list get redrawn except the one I clicked. For this reason the clicked item view is not updated and never changes to the selected state.

You can see this my modifying the EnhancedListViewDemo application so it prints the list items that are redrawn in the getView() method and call the notifyDataSetChanged() on the adapter in the onItemClick callback.

When swipeToDismiss is disabled and you click on an item the notifyDataSetChanged() is called and you can see in the log that all items in the list are redrawn by calls to the getView() method.

When I enable the swipeToDismiss on the list and you click on an item you will notice on the logs that all items are redrawn (via getView()) except for the item you clicked.

You may use this patch to see what I am saying:

From c60e5b95add865fd3f5ba3efa2ee86fefbaf1ce1 Mon Sep 17 00:00:00 2001
From: Horacio Sanson <[email protected]>
Date: Mon, 30 Sep 2013 20:23:33 +0900
Subject: [PATCH] Simple test for testing a bug.

---
 .../src/main/java/de/timroes/android/listviewdemo/MainActivity.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/EnhancedListViewDemo/src/main/java/de/timroes/android/listviewdemo/MainActivity.java b/EnhancedListViewDemo/src/main/java/de/timroes/android/listviewdemo/MainActivity.java
index 03268ce..b29d884 100644
--- a/EnhancedListViewDemo/src/main/java/de/timroes/android/listviewdemo/MainActivity.java
+++ b/EnhancedListViewDemo/src/main/java/de/timroes/android/listviewdemo/MainActivity.java
@@ -140,6 +140,7 @@ public class MainActivity extends ActionBarActivity {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 Toast.makeText(MainActivity.this, "Clicked on item " + mAdapter.getItem(position), Toast.LENGTH_SHORT).show();
+                mAdapter.notifyDataSetChanged();
             }
         });
         mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@@ -368,6 +369,7 @@ public class MainActivity extends ActionBarActivity {
             }

             holder.position = position;
+            Log.d("XXX", "Get view " + mItems.get(position));
             holder.mTextView.setText(mItems.get(position));

             return convertView;
-- 
1.8.1.2

Android 5.0 Undo message appearing on top of Navigationbar.

The Undo bar is appearing on top of the navigation bar in Android 5.0 or higher.
When i set the dimens of the undo bar according to the docs it will also appear higher on devices lower than Android 5.0. It should be possible to set the dimens during runtime or fix the bug for Material 5.0.

New GMail like design

Do you have in plan to add design like new gmail app use?
I mean inline undo button instead off Toast like design.

Android Studio doesn't show import properly

Android Studio 0.4.0 isn't able to "show" the import properly i.e. the actual import works fine. The project builds and runs fine. It's just that AS can't find it. This is probably an AS issue but I think you'd be a better person to raise the issue if that is the case.

image

WindowLeak Exception + Solution in pull request

WindowLeak Exception when invoking mUndoPopup.dismiss(); while the container window is no longer visible.

Scenario:

  1. Swipe to dismiss so reveal the undo popup window.
  2. Press the Home button to go to the recently used apps view.
  3. Swipe to dismiss the application.

Now if you set the EnhancedListView to:
myEnhancedListView.setRequireTouchBeforeDismiss(true);

You'll get an exception of WindowLeak on the undo popup window which didn't had the time to dismiss himself.

Or worse if you set the EnhacedListView to:
myEnhancedListView.setRequireTouchBeforeDismiss(false);
myEnhancedListView.setUndoHideDelay(10000); (10 sec so you have time to dismiss the application).

The application will crush cos the undo popup window which will try to dismiss himself after 10 seconds but the container layout is no longer exists.

Touch events not being intercepted when in DrawerLayout

Hi, I am trying to use this library inside my right drawer in Android Support DrawerLayout, but the drawer seems to be capturing the touch events, so swiping does not work.

Ideally, I would like the drawer to handle the left-to-write swipe (so that it can close by swiping; it's the right drawer) and the ExtendedListView to handle the right-to-left swipe, so that I can have swipe to delete working.

After fiddling around, I can only either get the ListView or the drawer to handle both swipes.

Any help would be appreciated...

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.