本文整理汇总了Java中com.daimajia.slider.library.SliderTypes.TextSliderView类的典型用法代码示例。如果您正苦于以下问题:Java TextSliderView类的具体用法?Java TextSliderView怎么用?Java TextSliderView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextSliderView类属于com.daimajia.slider.library.SliderTypes包,在下文中一共展示了TextSliderView类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private void setupSlider() {
HashMap<String,Integer> slidesMap = new HashMap<>();
slidesMap.put("We can't wait for Pantheon 2018, stay tuned!", R.drawable.slide5);
slidesMap.put("Lots of flash mobs and street dancing...", R.drawable.slide4);
slidesMap.put("Pantheon 2016",R.drawable.slide0);
slidesMap.put("Aathma were our musical guests!",R.drawable.slide2);
slidesMap.put("Thermal Projekt were here!",R.drawable.slide1);
slidesMap.put("Argenil, the Bangalore-based EDM duo performed!", R.drawable.slide3);
for(String caption : slidesMap.keySet()) {
TextSliderView textSliderView = new TextSliderView(getContext());
textSliderView
.description(caption)
.image(slidesMap.get(caption))
.setScaleType(BaseSliderView.ScaleType.CenterCrop);
throwbackSlider.addSlider(textSliderView);
}
throwbackSlider.setCustomIndicator(throwBackSliderIndicator);
}
示例2: imageSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private void imageSlider(NewsModel result) {
int sliderCount = (result.getPosts().size()%2 == 0) ?
result.getPosts().size() / 2:
result.getPosts().size() / 3;
for (int i = 0; i < sliderCount; i++) {
slidingImages.put(result.getPosts().get(i).getTitle(), result.getPosts().get(i).getThumbnail());
}
for(String name : slidingImages.keySet()){
TextSliderView textSliderView = new TextSliderView(getContext());
textSliderView
.description(name)
.image(slidingImages.get(name))
.setScaleType(BaseSliderView.ScaleType.Fit);
textSliderView.bundle(new Bundle());
textSliderView.getBundle()
.putString("extra", name);
sliderMain.addSlider(textSliderView);
}
sliderMain.setPresetTransformer(SliderLayout.Transformer.Default);
sliderMain.setPresetIndicator(SliderLayout.PresetIndicators.Center_Top);
sliderMain.setCustomAnimation(new DescriptionAnimation());
sliderMain.setDuration(4000);
}
示例3: onCreateView
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_project, container, false);
// Inflate the layout for this fragment
mDemoSlider = (SliderLayout) view.findViewById(R.id.slider);
simpleList = (GridView) view.findViewById(R.id.simpleGridView);
mHandler = new Handler(Looper.getMainLooper()); // udaan hurdanii shalgax davtalt
HashMap<String,String> url_maps = new HashMap<String, String>();
url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://www.colourbox.com/preview/1282705-colorful-child-hand-prints-on-white-background.jpg");
url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://image.freepik.com/free-vector/fantastic-background-of-children-playing-together_23-2147608068.jpg");
url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://ak2.picdn.net/shutterstock/videos/14967505/thumb/1.jpg");
for(String name : url_maps.keySet()){
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(name)
.image(url_maps.get(name))
.setScaleType(BaseSliderView.ScaleType.Fit);
// .setOnSliderClickListener(getContext());
//add your extra information
textSliderView.bundle(new Bundle());
textSliderView.getBundle()
.putString("extra",name);
mDemoSlider.addSlider(textSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
simpleList.setNumColumns(2);
simpleList.setVisibility(View.VISIBLE);
getProject();
return view;
}
示例4: initSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
/**
* 初始化slider中的内容
*/
private void initSlider() {
if (mTextSliderViews == null) {
mSliderLayout.addSlider(buildTextSlider(null, "欢迎使用", 0));
getBmobSliderData();
} else {
mSliderLayout.removeAllSliders();
for (TextSliderView textSliderView : mTextSliderViews) {
mSliderLayout.addSlider(textSliderView);
}
}
}
示例5: buildTextSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private TextSliderView buildTextSlider(String url, String description, int key) {
TextSliderView textSliderView = new TextSliderView(mContext);
if (url == null) {
textSliderView.image(R.mipmap.sliderlayout_default);
} else {
textSliderView.image(url);
}
textSliderView.description(description);
Bundle bundle = new Bundle();
bundle.putInt("msg", key);
textSliderView.bundle(bundle);
textSliderView.setOnSliderClickListener(this);
return textSliderView;
}
示例6: addImage
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
/**
* ajoute une nouvelle image au slider
* @param image l'image à ajouter
*/
public void addImage(Image image){
if(image.getPosition() != null && image.getPosition()[0] == mPosition.latitude && image.getPosition()[1] == mPosition.longitude){
Log.d(TAG, "adding image to slider");
File imageAsFile = getTempFile(getActivity().getApplicationContext(), image);
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(dtf.print(image.getTimestamp()))
.image(imageAsFile)
.setScaleType(BaseSliderView.ScaleType.FitCenterCrop);
mDemoSlider.addSlider(textSliderView);
}
}
示例7: onCreateView
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_apropos, container, false);
mDemoSlider = (SliderLayout)rootView.findViewById(R.id.slider);
HashMap<String,Integer> file_maps = new HashMap<String, Integer>();
file_maps.put("About",R.drawable.apropos);
file_maps.put("GDG Miage Gi", R.drawable.devfest);
file_maps.put("Adidas...", R.drawable.football);
for(String name : file_maps.keySet()){
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(name)
.image(file_maps.get(name))
.setScaleType(BaseSliderView.ScaleType.Fit)
.setOnSliderClickListener(this);
//add your extra information
textSliderView.getBundle()
.putString("extra",name);
mDemoSlider.addSlider(textSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Fade);
mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
return rootView;
}
示例8: initSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private void initSlider() {
if (mBanner != null) {
for (Banner banner : mBanner) {
TextSliderView textSliderView = new TextSliderView(this.getActivity());
textSliderView.image(banner.getImgUrl());
textSliderView.description(banner.getName());
textSliderView.setScaleType(BaseSliderView.ScaleType.Fit);
mSliderLayout.addSlider(textSliderView);
}
}
mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mSliderLayout.setCustomAnimation(new DescriptionAnimation());
mSliderLayout.setPresetTransformer(SliderLayout.Transformer.RotateUp);
mSliderLayout.setDuration(3000);
}
示例9: onSucces
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
@Override
public void onSucces(JSONObject result) {
progressDialog.hide();
JSONArray jsonArray = null;
try {
JSONObject productObject = result.getJSONObject("product");
productID = productObject.getInt("productID");
int star = productObject.getInt("stars");
String name = productObject.getString("name");
String description = productObject.getString("description");
price = productObject.getDouble("price");
JSONArray imageArray = productObject.getJSONArray("images");
tvPrice.setText(price+" TL");
for (int j=0; j<imageArray.length(); j++){
JSONObject imageObject = imageArray.getJSONObject(j);
imageList.add(imageObject.getString("image"));
}
for (int k=0; k<imageList.size(); k++){
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(name)
.image(imageList.get(k))
.setScaleType(BaseSliderView.ScaleType.Fit)
.setOnSliderClickListener(this);
sliderLayout.addSlider(textSliderView);
}
sliderLayout.setPresetTransformer(SliderLayout.Transformer.Accordion);
sliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
sliderLayout.setCustomAnimation(new DescriptionAnimation());
sliderLayout.setDuration(3000);
sliderLayout.addOnPageChangeListener(this);
} catch (JSONException e) {
e.printStackTrace();
}
}
示例10: onCreate
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
homeItemList = (GridView)findViewById(R.id.homeItemList);
prgLoading = (ProgressBar) findViewById(R.id.homeLoading);
txtAlert = (TextView) findViewById(R.id.homeTxtAlert);
NewsAPI = HackConstants.AllNewsApi +"?accesskey="+HackConstants.AccessKey;
Intent iGet = getIntent();
homeNewsAdapter = new HomeNewsAdapter(MainActivity.this);
getSupportActionBar().setTitle(Category_name);
new getDataTask().execute();
homeNewsAdapter = new HomeNewsAdapter(this);
homeItemList.setNumColumns(2);
homeItemList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
Intent iDetail = new Intent(getApplicationContext(), NewsDetailActivity.class);
iDetail.putExtra("product_id", News_ID.get(position));
startActivity(iDetail);
}
});
//slider
homeSlider = (SliderLayout)findViewById(R.id.slider);
HashMap<String,String> url_maps = new HashMap<String, String>();
url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
url_maps.put("Big Bang Theory", "http://tvfiles.alphacoders.com/100/hdclearart-10.png");
url_maps.put("House of Cards", "http://cdn3.nflximg.net/images/3093/2043093.jpg");
url_maps.put("Game of Thrones", "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg");
for(String name : url_maps.keySet()){
TextSliderView textSliderView = new TextSliderView(this);
// initialize a SliderLayout
textSliderView
.description(name)
.image(url_maps.get(name))
.setScaleType(BaseSliderView.ScaleType.Fit);
// .setOnSliderClickListener(this);
//add your extra information
textSliderView.bundle(new Bundle());
textSliderView.getBundle()
.putString("extra",name);
homeSlider.addSlider(textSliderView);
}
homeSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
homeSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
homeSlider.setCustomAnimation(new DescriptionAnimation());
homeSlider.setDuration(4000);
// homeSlider.addOnPageChangeListener((ViewPagerEx.OnPageChangeListener) this);
}
示例11: initializeWithImages
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
/**
* charge le slider avec des images
* @param images les images à montrer
*/
public void initializeWithImages(List<Image> images) {
if(getActivity() == null)
return;
Log.i(TAG, "initializing with images");
clearCache();
Log.i(TAG, (images == null ? 0 : images.size()) + " images to load");
if(images == null || images.size() == 0){
mProgressView.setVisibility(View.GONE);
mDemoSlider.setVisibility(View.GONE);
mDemoSliderIndicator.setVisibility(View.GONE);
mImagesEmptyView.setVisibility(View.VISIBLE);
return;
} else{
mDemoSlider.setVisibility(View.VISIBLE);
mDemoSliderIndicator.setVisibility(View.VISIBLE);
mImagesEmptyView.setVisibility(View.GONE);
}
List<Pair<String, File>> fileList = new ArrayList<>();
for(Image image : images){
Log.d(TAG, "creating temporary image file " + image.getTimestamp());
File imageAsFile = getTempFile(getActivity().getApplicationContext(), image);
if(imageAsFile != null){
fileList.add(new Pair<>(dtf.print(image.getTimestamp()), imageAsFile));
} else {
Log.e(TAG, "erreur à la création du fichier temporaire pour les images");
}
}
for(Pair<String, File> pair : fileList){
Log.d(TAG, "adding a slider for " + pair.first);
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(pair.first)
.image(pair.second)
.setScaleType(BaseSliderView.ScaleType.FitCenterCrop);
mDemoSlider.addSlider(textSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Stack);
mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mDemoSlider.stopAutoCycle();
if(mDemoSlider.getChildCount() > 0) {
mDemoSlider.setCurrentPosition(mDemoSlider.getChildCount() - 1);
}
setLoading(false);
}
示例12: onCreateView
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_home, container, false);
// Inflate the layout for this fragment
initUI(rootView);
mDemoSlider = (SliderLayout)rootView.findViewById(R.id.slider);
HashMap<String,String> url_maps = new HashMap<String, String>();
url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
url_maps.put("Big Bang Theory", "http://tvfiles.alphacoders.com/100/hdclearart-10.png");
url_maps.put("House of Cards", "http://cdn3.nflximg.net/images/3093/2043093.jpg");
url_maps.put("Game of Thrones", "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg");
HashMap<String,Integer> file_maps = new HashMap<String, Integer>();
file_maps.put("Tous contre EBOLA",R.drawable.ivoirien);
file_maps.put("Champion d'afrique 2013",R.drawable.nigeria);
file_maps.put("l'Algerie, un favorie...",R.drawable.algeri);
file_maps.put("la CAF", R.drawable.slide1);
file_maps.put("Eliminatoires ....", R.drawable.slide2);
file_maps.put("Ballon officiel de la CAN 2015", R.drawable.ballon);
file_maps.put("Adidas...", R.drawable.football);
for(String name : file_maps.keySet()){
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(name)
.image(file_maps.get(name))
.setScaleType(BaseSliderView.ScaleType.Fit)
.setOnSliderClickListener(this);
//add your extra information
textSliderView.getBundle()
.putString("extra",name);
mDemoSlider.addSlider(textSliderView);
}
mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
return rootView;
}
示例13: updateImages
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private void updateImages (boolean isButton){
mSlider.removeAllSliders();
if ((ValidacionPlaya.imagenes != null) && (ValidacionPlaya.imagenes.size() > 0)){
no_photos.setVisibility(View.GONE);
if (Image.imageChooserManager == null) {
Image.reinitializeImageChooser(getActivity(), "ShorcialPhotos", this);
}
for (Imagen imagen : ValidacionPlaya.imagenes) {
TextSliderView textSliderView = new TextSliderView(getActivity());
// initialize a SliderLayout
textSliderView
.description(Utilities.formatFechaNotHour(imagen.fecha))
.image(imagen.link)
.setScaleType(BaseSliderView.ScaleType.CenterInside)
.setOnSliderClickListener(this);
textSliderView.getBundle().putString("link", imagen.link);
textSliderView.getBundle().putString("comentario", imagen.comentario);
textSliderView.getBundle().putString("idfb", imagen.idfbautor);
textSliderView.getBundle().putString("nombrefb", imagen.nombreautor);
mSlider.addSlider(textSliderView);
}
mSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mSlider.setPresetTransformer(SliderLayout.Transformer.Tablet);
if (ValidacionPlaya.imagenes.size() > 1) {
DescriptionAnimationSlider descriptionAnimationSlider = new DescriptionAnimationSlider();
descriptionAnimationSlider.setParams(mSlider, autorProfile, nombreAutor);
mSlider.setCustomAnimation(descriptionAnimationSlider);
mSlider.setDuration(6000);
} else {
mSlider.stopAutoCycle();
autorProfile.setProfileId(mSlider.getCurrentSlider().getBundle().get("idfb").toString());
nombreAutor.setText(mSlider.getCurrentSlider().getBundle().get("nombrefb").toString());
}
} else {
if (isButton) {
ProgressDialog pd = ProgressDialog.show(getActivity(), getResources().getText(R.string.esperar), getResources().getText(R.string.esperar));
pd.setIndeterminate(false);
pd.setCancelable(true);
pd.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if ((ValidacionPlaya.imagenes != null) && (ValidacionPlaya.imagenes.size() > 0)) {
no_photos.setVisibility(View.VISIBLE);
}
}
});
Request.getImagenesPlaya(getActivity(), ValidacionPlaya.playa.idserver, pd, null);
} else {
no_photos.setVisibility(View.VISIBLE);
}
}
}
示例14: initSlider
import com.daimajia.slider.library.SliderTypes.TextSliderView; //导入依赖的package包/类
private void initSlider(){
if(mBanner !=null){
for (Banner banner : mBanner){
TextSliderView textSliderView = new TextSliderView(this.getActivity());
textSliderView.image(banner.getImgUrl());
textSliderView.description(banner.getName());
textSliderView.setScaleType(BaseSliderView.ScaleType.Fit);
mSliderLayout.addSlider(textSliderView);
}
}
mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
mSliderLayout.setCustomAnimation(new DescriptionAnimation());
mSliderLayout.setPresetTransformer(SliderLayout.Transformer.RotateUp);
mSliderLayout.setDuration(3000);
}