forked from youth5201314/banner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90d7cd0
commit b5b6ff5
Showing
13 changed files
with
97 additions
and
23 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
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/test/banner/demo/BannerLocalActivity.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,39 @@ | ||
package com.test.banner.demo; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
|
||
import com.test.banner.App; | ||
import com.test.banner.R; | ||
import com.test.banner.loader.GlideImageLoader; | ||
import com.youth.banner.Banner; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class BannerLocalActivity extends AppCompatActivity { | ||
|
||
Banner banner; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_banner_local); | ||
initView(); | ||
} | ||
|
||
private void initView() { | ||
banner = (Banner) findViewById(R.id.banner); | ||
//本地图片数据(资源文件) | ||
List<Integer> list=new ArrayList<>(); | ||
list.add(R.mipmap.b1); | ||
list.add(R.mipmap.b2); | ||
list.add(R.mipmap.b3); | ||
|
||
|
||
|
||
banner.setImages(list) | ||
.setImageLoader(new GlideImageLoader()) | ||
.start(); | ||
} | ||
} |
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,22 @@ | ||
<?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:orientation="vertical"> | ||
<com.youth.banner.Banner xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/banner" | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
app:indicator_drawable_selected="@drawable/selected_radius"/> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:padding="10dp" | ||
android:text=" | ||
第三方加载器一般都支持(资源文件、文件、Uri、assets、raw、ContentProvider、sd卡资源) | ||
这里只是以glide举例加载本地(资源文件)图片, | ||
加载本地图片的具体方法请参考你使用的图片加载器, | ||
图片加载的链接格式是你在setImages时设置的格式, | ||
原样返回的,所以格式问题请仔细检查!"/> | ||
</LinearLayout> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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