You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2016/06/08 16:02:13 UTC
[11/40] incubator-taverna-mobile git commit: custom swipe refresh
layout
custom swipe refresh layout
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/9f4a246d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/9f4a246d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/9f4a246d
Branch: refs/heads/master
Commit: 9f4a246daec57d4495a2acc49fb8879b41504dfe
Parents: 704137b
Author: Sagar <ku...@gmail.com>
Authored: Fri May 6 16:55:47 2016 +0530
Committer: Sagar <ku...@gmail.com>
Committed: Fri May 6 16:55:47 2016 +0530
----------------------------------------------------------------------
.../utils/ScrollChildSwipeRefreshLayout.java | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/9f4a246d/app/src/main/java/org/apache/taverna/mobile/utils/ScrollChildSwipeRefreshLayout.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/utils/ScrollChildSwipeRefreshLayout.java b/app/src/main/java/org/apache/taverna/mobile/utils/ScrollChildSwipeRefreshLayout.java
new file mode 100644
index 0000000..f4e0e70
--- /dev/null
+++ b/app/src/main/java/org/apache/taverna/mobile/utils/ScrollChildSwipeRefreshLayout.java
@@ -0,0 +1,32 @@
+package org.apache.taverna.mobile.utils;
+
+import android.content.Context;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.util.AttributeSet;
+import android.view.View;
+
+public class ScrollChildSwipeRefreshLayout extends SwipeRefreshLayout {
+
+ private View mScrollUpChild;
+
+ public ScrollChildSwipeRefreshLayout(Context context) {
+ super(context);
+ }
+
+ public ScrollChildSwipeRefreshLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public boolean canChildScrollUp() {
+ if (mScrollUpChild != null) {
+ return ViewCompat.canScrollVertically(mScrollUpChild, -1);
+ }
+ return super.canChildScrollUp();
+ }
+
+ public void setScrollUpChild(View view) {
+ mScrollUpChild = view;
+ }
+}