-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge from dev, for 1.0.9.2-SNAPSHOT
- Loading branch information
Showing
13 changed files
with
167 additions
and
24 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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@color/cube_mints_app_base_background" android:state_pressed="true" /> | ||
<item android:drawable="@color/cube_mints_4d90fe" /> | ||
<item android:drawable="@color/cube_holo_orange_light" android:state_pressed="true" /> | ||
<item android:drawable="@color/cube_holo_orange_dark" /> | ||
</selector> |
66 changes: 66 additions & 0 deletions
66
ptr-demo/res/layout/fragment_classic_header_with_scroll_view.xml
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,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<in.srain.cube.views.ptr.PtrClassicFrameLayout | ||
android:id="@+id/rotate_header_web_view_frame" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/cube_mints_f1f1f1" | ||
app:ptr_duration_to_close="200" | ||
app:ptr_duration_to_close_header="1000" | ||
app:ptr_keep_header_when_refresh="true" | ||
app:ptr_pull_to_fresh="false" | ||
app:ptr_ratio_of_header_height_to_refresh="1.2" | ||
app:ptr_resistance="1.7"> | ||
|
||
<ScrollView | ||
android:id="@+id/rotate_header_scroll_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:layout_margin="@dimen/cube_mints_content_view_padding" | ||
android:background="@drawable/text_view_bg" | ||
android:clickable="true" | ||
android:gravity="center" | ||
android:text="text 1" | ||
android:textColor="@color/cube_mints_white" | ||
android:textSize="30sp" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="400dp" | ||
android:layout_margin="@dimen/cube_mints_content_view_padding" | ||
android:background="@drawable/text_view_bg" | ||
android:clickable="true" | ||
android:gravity="center" | ||
android:text="text 2" | ||
android:textColor="@color/cube_mints_white" | ||
android:textSize="30sp" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="300dp" | ||
android:layout_margin="@dimen/cube_mints_content_view_padding" | ||
android:background="@drawable/text_view_bg" | ||
android:clickable="true" | ||
android:gravity="center" | ||
android:text="text 3" | ||
android:textColor="@color/cube_mints_white" | ||
android:textSize="30sp" /> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</in.srain.cube.views.ptr.PtrClassicFrameLayout> | ||
</RelativeLayout> |
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
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
63 changes: 63 additions & 0 deletions
63
ptr-demo/src/in/srain/cube/views/ptr/demo/ui/classic/WithScrollView.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,63 @@ | ||
package in.srain.cube.views.ptr.demo.ui.classic; | ||
|
||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ScrollView; | ||
import in.srain.cube.mints.base.TitleBaseFragment; | ||
import in.srain.cube.views.ptr.PtrClassicFrameLayout; | ||
import in.srain.cube.views.ptr.PtrDefaultHandler; | ||
import in.srain.cube.views.ptr.PtrFrameLayout; | ||
import in.srain.cube.views.ptr.PtrHandler; | ||
import in.srain.cube.views.ptr.demo.R; | ||
|
||
public class WithScrollView extends TitleBaseFragment { | ||
|
||
private PtrClassicFrameLayout mPtrFrame; | ||
private ScrollView mScrollView; | ||
|
||
@Override | ||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
|
||
setHeaderTitle(R.string.ptr_demo_block_scroll_view); | ||
|
||
final View contentView = inflater.inflate(R.layout.fragment_classic_header_with_scroll_view, null); | ||
mScrollView = (ScrollView) contentView.findViewById(R.id.rotate_header_scroll_view); | ||
mPtrFrame = (PtrClassicFrameLayout) contentView.findViewById(R.id.rotate_header_web_view_frame); | ||
mPtrFrame.setLastUpdateTimeRelateObject(this); | ||
mPtrFrame.setPtrHandler(new PtrHandler() { | ||
@Override | ||
public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) { | ||
return PtrDefaultHandler.checkContentCanBePulledDown(frame, mScrollView, header); | ||
} | ||
|
||
@Override | ||
public void onRefreshBegin(PtrFrameLayout frame) { | ||
mPtrFrame.postDelayed(new Runnable() { | ||
@Override | ||
public void run() { | ||
mPtrFrame.refreshComplete(); | ||
} | ||
}, 100); | ||
} | ||
}); | ||
|
||
// the following are default settings | ||
mPtrFrame.setResistance(1.7f); | ||
mPtrFrame.setRatioOfHeaderHeightToRefresh(1.2f); | ||
mPtrFrame.setDurationToClose(200); | ||
mPtrFrame.setDurationToCloseHeader(1000); | ||
// default is false | ||
mPtrFrame.setPullToRefresh(false); | ||
// default is true | ||
mPtrFrame.setKeepHeaderWhenRefresh(true); | ||
mPtrFrame.postDelayed(new Runnable() { | ||
@Override | ||
public void run() { | ||
mPtrFrame.autoRefresh(); | ||
} | ||
}, 100); | ||
return contentView; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION_NAME=1.0.9.1-SNAPSHOT | ||
VERSION_NAME=1.0.9.2-SNAPSHOT | ||
|
||
POM_GROUP=in.srain.cube | ||
POM_ARTIFACT_ID=ultra-ptr | ||
|
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
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
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