本文整理汇总了Java中com.daimajia.slider.library.SliderLayout.setPresetIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java SliderLayout.setPresetIndicator方法的具体用法?Java SliderLayout.setPresetIndicator怎么用?Java SliderLayout.setPresetIndicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.daimajia.slider.library.SliderLayout
的用法示例。
在下文中一共展示了SliderLayout.setPresetIndicator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.daimajia.slider.library.SliderLayout; //导入方法依赖的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;
}
示例2: onCreateView
import com.daimajia.slider.library.SliderLayout; //导入方法依赖的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;
}
示例3: onCreate
import com.daimajia.slider.library.SliderLayout; //导入方法依赖的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);
}
示例4: onCreateView
import com.daimajia.slider.library.SliderLayout; //导入方法依赖的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;
}