-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new CustomSwipeRefreshLayout with a workaround to catch onTouchEvent …
…IllegalArgumentException
- Loading branch information
Showing
2 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
WordPressUtils/src/main/java/org/wordpress/android/util/ptr/CustomSwipeRefreshLayout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.wordpress.android.util.ptr; | ||
|
||
import android.content.Context; | ||
import android.support.v4.widget.SwipeRefreshLayout; | ||
import android.util.AttributeSet; | ||
import android.view.MotionEvent; | ||
|
||
import org.wordpress.android.util.AppLog; | ||
import org.wordpress.android.util.AppLog.T; | ||
|
||
public class CustomSwipeRefreshLayout extends SwipeRefreshLayout { | ||
public CustomSwipeRefreshLayout(Context context) { | ||
super(context); | ||
} | ||
|
||
public CustomSwipeRefreshLayout(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
@Override | ||
public boolean onTouchEvent(MotionEvent event) { | ||
try{ | ||
return super.onTouchEvent(event); | ||
} catch(IllegalArgumentException e) { | ||
AppLog.e(T.UTILS, e); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters