{"action":"opened","issue":{"url":"https://api.github.com/repos/daimajia/AndroidSwipeLayout/issues/130","labels_url":"https://api.github.com/repos/daimajia/AndroidSwipeLayout/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/daimajia/AndroidSwipeLayout/issues/130/comments","events_url":"https://api.github.com/repos/daimajia/AndroidSwipeLayout/issues/130/events","html_url":"https://github.com/daimajia/AndroidSwipeLayout/issues/130","id":68717212,"number":130,"title":"Problem when expanding in a ListView","user":{"login":"FelipeRRM","id":10159615,"avatar_url":"https://avatars.githubusercontent.com/u/10159615?v=3","gravatar_id":"","url":"https://api.github.com/users/FelipeRRM","html_url":"https://github.com/FelipeRRM","followers_url":"https://api.github.com/users/FelipeRRM/followers","following_url":"https://api.github.com/users/FelipeRRM/following{/other_user}","gists_url":"https://api.github.com/users/FelipeRRM/gists{/gist_id}","starred_url":"https://api.github.com/users/FelipeRRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FelipeRRM/subscriptions","organizations_url":"https://api.github.com/users/FelipeRRM/orgs","repos_url":"https://api.github.com/users/FelipeRRM/repos","events_url":"https://api.github.com/users/FelipeRRM/events{/privacy}","received_events_url":"https://api.github.com/users/FelipeRRM/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-15T15:44:47Z","updated_at":"2015-04-15T15:44:47Z","closed_at":null,"body":"When in a ListView, one row doesn't expand properly (in fact it wasn't even expading before).\r\nThis is what is happening:\r\n\r\n![screenrecord_2015-04-15-12-23-27](https://cloud.githubusercontent.com/assets/10159615/7162419/d56f8b8c-e36a-11e4-9eb3-452fcca99c81.gif)\r\n\r\n\r\nAll the other rows after the buggy one work just fine. And if I scroll the list the buggy row changes, some row that was previously working stops working and the buggy row starts to work.\r\n\r\nPreviously, the buggy row wasn't even expanding at all, the click was being registered but nothing happened. Then after some debuging I discovered that rect.left in this method was 0 in the buggy row and 690 in the other rows:\r\n\r\n```java\r\npublic void open(boolean smooth, boolean notify){\r\n        ViewGroup surface = getSurfaceView(), bottom = getBottomView();\r\n        int dx,dy;\r\n        Rect rect = computeSurfaceLayoutArea(true);\r\n        if(smooth) {\r\n            Log.d(\"SurfaceView\",getSurfaceView().toString());\r\n            Log.d(\"SurfaceView\",\"Left: \" + rect.left + \" Top: \"+ rect.top);\r\n            mDragHelper.smoothSlideViewTo(getSurfaceView(), rect.left, rect.top);\r\n        }\r\n```\r\n\r\nSo I grossly changed it to:\r\n\r\n```java\r\npublic void open(boolean smooth, boolean notify){\r\n        ViewGroup surface = getSurfaceView(), bottom = getBottomView();\r\n        int dx,dy;\r\n        Rect rect = computeSurfaceLayoutArea(true);\r\n        if(smooth) {\r\n            Log.d(\"SurfaceView\",getSurfaceView().toString());\r\n            Log.d(\"SurfaceView\",\"Left: \" + rect.left + \" Top: \"+ rect.top);\r\n            int left = rect.left;\r\n            if(left==0){\r\n                left = 690;\r\n            }\r\n            mDragHelper.smoothSlideViewTo(getSurfaceView(), left, rect.top);\r\n        }\r\n```\r\n\r\nand got the behaviour on the video, the row now expands, but what should be underneath it simply does not appear. What could be wrong? Is this a bug in the framework or am I doing something bad in my listadapter?\r\n\r\nSome code of my ListAdapter implementation:\r\n\r\n```java\r\npublic abstract class ListAdapterCardsBase extends BaseAdapter {\r\n\r\n    ArrayList<SwipeLayout> swipeList =new ArrayList<SwipeLayout>();\r\n    ArrayList<FriendshipFrom> filtro;\r\n\r\n\r\nclass ViewHolder{\r\n       // Other views\r\n        LinearLayout layoutPrincipal;\r\n        SwipeLayout swipe;   \r\n    }\r\n\r\n@Override\r\n    public View getView(final int position, View convertView, ViewGroup parent) {\r\n            final ViewHolder h;\r\n            if (convertView == null) {\r\n                h = new ViewHolder();\r\n                convertView = inflater.inflate(R.layout.layout_list_part1, parent, false);\r\n                h.swipe = (SwipeLayout) convertView.findViewById(R.id.simple1);\r\n                h.layoutPrincipal = (LinearLayout) convertView.findViewById(R.id.RelativeLayoutDosCartoes);\r\n                \r\n                //set show mode.\r\n                h.swipe.setShowMode(SwipeLayout.ShowMode.LayDown);\r\n                h.swipe.setDragEdge(SwipeLayout.DragEdge.Left);\r\n\r\n                h.swipe.addSwipeListener(new SwipeLayout.SwipeListener() {\r\n                    @Override\r\n                    public void onClose(SwipeLayout layout) {\r\n              // Set on the Object being displayed on the list that his row on the list has been closed\r\n                        getAmigo(position).setListExpanded(false);\r\n                                           }\r\n                    @Override\r\n                    public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {\r\n                    }\r\n\r\n                    @Override\r\n                    public void onStartOpen(SwipeLayout layout) {\r\n                        for (SwipeLayout swipeLayout : swipeList) {\r\n                            if(swipeLayout!=layout)\r\n                                swipeLayout.close();\r\n                        }\r\n                    }\r\n\r\n                    @Override\r\n                    public void onOpen(SwipeLayout layout) { \r\n                        // Set on the Object being displayed on the list that his row on the list has been expanded\r\n                        getAmigo(position).setListExpanded(true);\r\n                        // Close all the other expanded layouts\r\n                        for (SwipeLayout swipeLayout : swipeList) {\r\n                            if(swipeLayout!=layout)\r\n                                swipeLayout.close();\r\n                        }\r\n                    }\r\n\r\n                    @Override\r\n                    public void onStartClose(final SwipeLayout layout) {\r\n                  \r\n                   }\r\n\r\n                    @Override\r\n                    public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {\r\n                        \r\n                    }\r\n                });\r\n                convertView.setTag(h);\r\n            } else {\r\n                h = (ViewHolder) convertView.getTag();\r\n            }\r\n\r\n        final ViewHolder vh =h;\r\n        h.layoutPrincipal.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                swipeClick(vh, position);\r\n            }\r\n        });\r\n\r\n   // MORE CODE\r\n\r\n     return convertView;\r\n}\r\n\r\nprivate void swipeClick(ViewHolder h, int position){\r\n        getAmigo(position).setListExpanded(!getAmigo(position).isListExpanded());\r\n\r\n        if(!swipeList.contains(h.swipe)){\r\n            swipeList.add(h.swipe);\r\n        }\r\n\r\n        // Close all the other expanded layouts\r\n        for (SwipeLayout swipeLayout : swipeList) {\r\n            if(swipeLayout!=h.swipe)\r\n                swipeLayout.close();\r\n        }\r\n        h.swipe.toggle();\r\n\r\n      }\r\n\r\nUser getAmigo(int position) {\r\n        return filtro.get(position).getUserfrom();\r\n    }\r\n\r\n}\r\n\r\n```\r\n\r\nAny help is appreciated!"}}