Skip to content

Commit 7de4416

Browse files
author
zhangxutong
committed
横向 循环 视差 画廊
1 parent 975c2b6 commit 7de4416

File tree

15 files changed

+290
-8
lines changed

15 files changed

+290
-8
lines changed

.idea/libraries/adapters_1_2_1.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/all_base_adapter_V1_8_0.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/all_base_adapter_V1_3_0.xml renamed to .idea/libraries/constraint_layout_1_0_1.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/constraint_layout_solver_1_0_1.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/library_1_2_1.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
//Adapter终结者 地址:https://github.com/mcxtzhang/all-base-adapter
2525
compile project(':layoutmanager')
2626
compile 'com.android.support:appcompat-v7:24.2.1'
27-
compile 'com.github.mcxtzhang:all-base-adapter:V1.3.0'
27+
//compile 'com.github.mcxtzhang:all-base-adapter:V1.3.0'
2828
compile 'com.android.support:cardview-v7:25.1.0'
2929
compile 'com.squareup.picasso:picasso:2.3.2'
3030
compile 'com.android.support.constraint:constraint-layout:1.0.1'

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
</activity>
3232
<activity android:name=".avatar.TanTanAvatarActivity">
3333
</activity>
34+
<activity android:name=".gallery.LoopGalleryActivity"/>
3435
</application>
3536

3637
</manifest>

app/src/main/java/com/mcxtzhang/flowlayoutmanager/LauncherActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.mcxtzhang.flowlayoutmanager.avatar.TanTanAvatarActivity;
99
import com.mcxtzhang.flowlayoutmanager.gallary.GalleryActivity;
10+
import com.mcxtzhang.flowlayoutmanager.gallery.LoopGalleryActivity;
1011
import com.mcxtzhang.flowlayoutmanager.swipecard.SwipeCardActivity;
1112
import com.mcxtzhang.flowlayoutmanager.tantan.TanTanActivity;
1213
import com.mcxtzhang.flowlayoutmanager.zuimei.ScaleCardActivity;
@@ -53,5 +54,11 @@ public void onClick(View view) {
5354
startActivity(new Intent(LauncherActivity.this, TanTanAvatarActivity.class));
5455
}
5556
});
57+
findViewById(R.id.btnLoopGallery).setOnClickListener(new View.OnClickListener() {
58+
@Override
59+
public void onClick(View view) {
60+
startActivity(new Intent(LauncherActivity.this, LoopGalleryActivity.class));
61+
}
62+
});
5663
}
5764
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.mcxtzhang.flowlayoutmanager.gallery;
2+
3+
import android.content.Context;
4+
import android.support.annotation.Nullable;
5+
import android.util.AttributeSet;
6+
import android.widget.ImageView;
7+
8+
import com.mcxtzhang.flowlayoutmanager.R;
9+
import com.mcxtzhang.layoutmanager.gallery.BaseLoopGallery;
10+
import com.squareup.picasso.Picasso;
11+
12+
/**
13+
* Intro:
14+
* Author: zhangxutong
15+
* E-mail: mcxtzhang@163.com
16+
* Home Page: http://blog.csdn.net/zxt0601
17+
* Created: 2017/7/4.
18+
* History:
19+
*/
20+
21+
public class AlyLoopGallery extends BaseLoopGallery<String> {
22+
public AlyLoopGallery(Context context) {
23+
super(context);
24+
}
25+
26+
public AlyLoopGallery(Context context, @Nullable AttributeSet attrs) {
27+
super(context, attrs);
28+
}
29+
30+
public AlyLoopGallery(Context context, @Nullable AttributeSet attrs, int defStyle) {
31+
super(context, attrs, defStyle);
32+
}
33+
34+
@Override
35+
public void onBindData(com.mcxtzhang.commonadapter.rv.ViewHolder holder, String data) {
36+
Picasso.with(holder.itemView.getContext())
37+
.load(data)
38+
.into((ImageView) holder.getView(R.id.image));
39+
}
40+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.mcxtzhang.flowlayoutmanager.gallery;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
6+
import com.mcxtzhang.flowlayoutmanager.R;
7+
8+
import java.util.ArrayList;
9+
import java.util.List;
10+
11+
public class LoopGalleryActivity extends AppCompatActivity {
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_loop_gallery);
17+
AlyLoopGallery alyLoopGallery = (AlyLoopGallery) findViewById(R.id.alyLoopGallery);
18+
alyLoopGallery.setDatasAndLayoutId(initDatas(), R.layout.uc_item_main_image_header);
19+
}
20+
21+
22+
public List<String> initDatas() {
23+
List<String> datas = new ArrayList<>();
24+
datas.add(new String("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg"));
25+
datas.add(new String("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg"));
26+
datas.add(new String("http://news.k618.cn/tech/201604/W020160407281077548026.jpg"));
27+
datas.add(new String("http://www.kejik.com/image/1460343965520.jpg"));
28+
datas.add(new String("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg"));
29+
datas.add(new String("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg"));
30+
datas.add(new String("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg"));
31+
datas.add(new String("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg"));
32+
return datas;
33+
}
34+
}

0 commit comments

Comments
 (0)