MaterialBanner


Source link: https://github.com/rtugeek/MaterialBanner

MaterialBanner

ScreenShot:

Idea from Google Trips:

## Demo APK

Attrs

attr format default
indicatorMargin dimension 10dp
indicatorInside boolean true
indicatorGravity flag:left,center,right left
match boolean false

Gradle:

Step 1. Add the JitPack repository in your root build.gradle at the end of repositories:

  allprojects {

repositories {

 ...
 maven {
 url "https://jitpack.io" 
}

}
  
}
 

Step 2. Add the dependency

  compile 'com.github.rtugeek:materialbanner:1.0.1' 

XML

  <com.freegeek.android.materialbanner.MaterialBanner

 android:id="@+id/material_banner"

 android:layout_width="match_parent"

 app:match="true"

 android:layout_height="200dp"/>
  MaterialBanner materialBanner = (MaterialBanner) findViewById(R.id.material_banner);

materialBanner.setPages(new ViewHolderCreator() {

 @Override

 public Object createHolder() {

  return new ImageHolderView();

 
}

}
,bannerData);

//set circle indicator
materialBanner.setIndicator(new CirclePageIndicator(this));

//indicators:
//CirclePageIndicator,IconPageIndicator,LinePageIndicator
//Custom indicator view needs to implement com.freegeek.android.materialbanner.view.indicator.PageIndicator

More usage

Listener

  materialBanner.setOnItemClickListener(new MaterialBanner.OnItemClickListener() {

 @Override

 public void onItemClick(int position) {

}

}
);

materialBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

 @Override

 public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

  
}

  @Override

 public void onPageSelected(int position) {

  textView.setText("My hometown: page " + ++position);

 
}

  @Override

 public void onPageScrollStateChanged(int state) {

  
}

}
);

Spread the word

Thanks to:

Android-ConvenientBanner ViewPagerIndicator

License



  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

  Version 2, December 2004  Copyright (C) 2004 Leon Fu <[email protected]>  Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO. 

Resources

Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.

Core-Adapter supports any type of items in RecyclerView with no pain.

A simple customizable indicator for ViewPagers.

This is a simple CheckBox for Android with cool animation.

An Android View system for indicating Views using fading pulses.

A cool material sign up transition.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes