-
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.
Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Andro…
…id into feature/modularize-editor
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
...PressUtils/src/main/java/org/wordpress/android/util/widgets/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,33 @@ | ||
package org.wordpress.android.util.widgets; | ||
|
||
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) { | ||
// Fix for https://github.com/wordpress-mobile/WordPress-Android/issues/2373 | ||
// Catch IllegalArgumentException which can be fired by the underlying SwipeRefreshLayout.onTouchEvent() | ||
// method. | ||
// When android support-v4 fixes it, we'll have to remove that custom layout completely. | ||
AppLog.e(T.UTILS, e); | ||
return true; | ||
} | ||
} | ||
} |