-
Notifications
You must be signed in to change notification settings - Fork 157
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 #986 from Wanghengdan/master
- Loading branch information
Showing
3 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
57 changes: 49 additions & 8 deletions
57
...in/java/edu/hzuapps/androidworks/homeworks/com1314080901133/Com1314080901133Activity.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 |
---|---|---|
@@ -1,13 +1,54 @@ | ||
package com.hzu.com1314080901133; | ||
package com.whd.imageviewpager; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import java.util.ArrayList; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Toast; | ||
|
||
import com.example.imageviewpager.R; | ||
import com.whd.imageviewpager.Com1314080901133_ImageCycleView.ImageCycleViewListener; | ||
|
||
public class Com1314080901133Activity extends Activity { | ||
|
||
private Com1314080901133_ImageCycleView mAdView; | ||
private ArrayList<String> mImageUrl = null; | ||
|
||
private ArrayList<String> mImageTitle = null; | ||
private String imageUrl1 = "http://www.yueqikan.com/uploads/141010/3425-14101011103Q57.jpg"; | ||
private String imageUrl2 = "http://chinapic.people.com.cn/data/attachment/forum/201503/25/113355cxziyi1ud12vijad.jpg"; | ||
private String imageUrl3 = "http://wiki.mdaxue.com/uploads/201210/1350886571YE7hD7NI.jpg"; | ||
|
||
private String imageTitle1 = "惠州学院"; | ||
private String imageTitle2 = "惠州学院夜景"; | ||
private String imageTitle3 = "惠州学院计算机系"; | ||
|
||
public class Com1314080901133Activity extends AppCompatActivity { | ||
public int stype=1; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_com1314080901133_main); | ||
mImageUrl = new ArrayList<String>(); | ||
mImageUrl.add(imageUrl1); | ||
mImageUrl.add(imageUrl2); | ||
mImageUrl.add(imageUrl3); | ||
|
||
|
||
mImageTitle = new ArrayList<String>(); | ||
mImageTitle.add(imageTitle1); | ||
mImageTitle.add(imageTitle2); | ||
mImageTitle.add(imageTitle3); | ||
mAdView = (Com1314080901133_ImageCycleView) findViewById(R.id.ad_view); | ||
mAdView.setImageResources(mImageUrl ,mImageTitle, mAdCycleViewListener,stype); | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_com1314080901133); | ||
} | ||
private ImageCycleViewListener mAdCycleViewListener = new ImageCycleViewListener() { | ||
@Override | ||
public void onImageClick(int position, View imageView) { | ||
|
||
|
||
Toast.makeText(Com1314080901133Activity.this, mImageUrl.get(position)+position, 1).show(); | ||
} | ||
}; | ||
} |