Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
youth5201314 committed Sep 30, 2016
1 parent 6a07bb6 commit b9ea44f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Android图片轮播控件 *如果对你有帮助请star哦!*
[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0.html)

![关于图片加载方式更新](https://raw.githubusercontent.com/youth5201314/banner/master/image/1.4.png)

<br>
现在的绝大数app都有banner界面,实现循环播放多个广告图片和手动滑动循环等功能。因为ViewPager并不支持循环翻页,
所以要实现循环还得需要自己去动手,我就把项目中的控件剔了出来,希望大家觉得有用。目前框架可以进行不同样式、不同动画设置,
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/com/test/banner/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
import android.widget.Button;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.Toast;

import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.Transformer;
import com.youth.banner.listener.OnBannerClickListener;

import java.util.Arrays;

Expand All @@ -25,7 +27,7 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
images= getResources().getStringArray(R.array.url);
images= getResources().getStringArray(R.array.url2);
titles= getResources().getStringArray(R.array.title);

banner = (Banner) findViewById(R.id.banner);
Expand All @@ -51,7 +53,12 @@ protected void onCreate(Bundle savedInstanceState) {
banner.setIndicatorGravity(BannerConfig.CENTER);
//banner设置方法全部调用完毕时最后调用
banner.start();*/

banner.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void OnBannerClick(int position) {
Toast.makeText(getApplicationContext(),"点击:"+position,Toast.LENGTH_SHORT).show();
}
});
}


Expand Down
Binary file added image/1.4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9ea44f

Please sign in to comment.