-
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 pull request #37 from liaohuqiu/dev
add ViewPager in Demo, release 1.0.7
- Loading branch information
Showing
24 changed files
with
452 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +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" /> | ||
</selector> |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/cube_mints_f1f1f1" | ||
android:orientation="vertical"> | ||
|
||
<in.srain.cube.views.pager.TabPageIndicator | ||
android:id="@+id/view_pager_tab_indicator" | ||
android:layout_width="match_parent" | ||
android:layout_height="36dp" | ||
android:background="@color/cube_mints_white" | ||
android:fadingEdge="none" | ||
android:paddingLeft="15dp" | ||
android:paddingRight="15dp" /> | ||
|
||
<in.srain.cube.views.ptr.PtrClassicFrameLayout | ||
android:id="@+id/view_pager_ptr_frame" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_weight="1"> | ||
|
||
<android.support.v4.view.ViewPager | ||
android:id="@+id/view_pager_view_pager" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/cube_mints_white" /> | ||
|
||
</in.srain.cube.views.ptr.PtrClassicFrameLayout> | ||
|
||
|
||
</LinearLayout> |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/cube_mints_white"> | ||
|
||
<ListView | ||
android:id="@+id/view_pager_list_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:divider="@null" | ||
android:fadingEdge="none" | ||
android:listSelector="@android:color/transparent" | ||
android:paddingLeft="12dp" | ||
android:paddingRight="12dp" | ||
android:scrollbarStyle="outsideOverlay" /> | ||
|
||
</RelativeLayout> |
18 changes: 18 additions & 0 deletions
18
ptr-demo/res/layout/view_pager_fragment_list_view_header.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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingBottom="15dp" | ||
android:paddingTop="15dp"> | ||
|
||
<TextView | ||
android:id="@+id/view_pager_fragment_list_view_header_title" | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:padding="5dp" | ||
android:textColor="#000" | ||
android:textSize="16sp" /> | ||
|
||
</LinearLayout> |
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,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="center_horizontal" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/view_pager_indicator_name" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:paddingLeft="10dp" | ||
android:paddingRight="10dp" | ||
android:textColor="#000" | ||
android:textSize="16sp" /> | ||
|
||
<TextView | ||
android:id="@+id/view_pager_indicator_tab_current" | ||
android:layout_width="match_parent" | ||
android:layout_height="2dp" | ||
android:background="@color/cube_mints_4d90fe" /> | ||
|
||
</LinearLayout> | ||
</LinearLayout> |
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
33 changes: 33 additions & 0 deletions
33
ptr-demo/src/in/srain/cube/views/ptr/demo/ui/viewpager/ImageListViewHolder.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 in.srain.cube.views.ptr.demo.ui.viewpager; | ||
|
||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.widget.ImageView; | ||
import in.srain.cube.image.CubeImageView; | ||
import in.srain.cube.image.ImageLoader; | ||
import in.srain.cube.request.JsonData; | ||
import in.srain.cube.views.list.ViewHolderBase; | ||
import in.srain.cube.views.ptr.demo.R; | ||
|
||
public class ImageListViewHolder extends ViewHolderBase<JsonData> { | ||
|
||
private ImageLoader mImageLoader; | ||
private CubeImageView mImageView; | ||
|
||
private ImageListViewHolder(ImageLoader imageLoader) { | ||
mImageLoader = imageLoader; | ||
} | ||
|
||
@Override | ||
public View createView(LayoutInflater inflater) { | ||
View v = inflater.inflate(R.layout.list_view_item, null); | ||
mImageView = (CubeImageView) v.findViewById(R.id.list_view_item_image_view); | ||
mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP); | ||
return v; | ||
} | ||
|
||
@Override | ||
public void showData(int position, JsonData itemData) { | ||
mImageView.loadImage(mImageLoader, itemData.optString("pic")); | ||
} | ||
} |
Oops, something went wrong.