ToolBarLib


Source link: https://github.com/jjhesk/ToolBarLib

Advanced Toolbar support library

[ ][ http://android-arsenal.com/details/1/2158]

dependencies {

  compile 'com.hkm.ui:advancedtoolbar:1.2.0' 
}
 

##setup this gradle only stores at

repositories {

  maven {
  url "http://dl.bintray.com/jjhesk/maven"  
}
 
}

Android ActionBar Advanced Support Library for API v23, v22, v21, v19. This library gives a better hand to handle all sorts of interactions on the toolbar. There are various built-in API and methods to speed up the development and design requirements and implemenations. There are fundamental design patterns are ready to be explored. The features listed as below:

  • automatic show and hide softkeyboard
  • social bar for sharing content implementation
  • animation of the search bar and search view design for custom layouts
  • custom textview and design
  • dynamic custom icon and textview on top of Thanks to mikepenz
  • interchangable between logos and the backgrounds
  • title history support
  • title shown as single line or more than single line
  • Custom call back onButtonPressListener
  • transparent background
  • additional loaded components (switchers, custom loading progress circles)

Project Website: TOOLBARLIB

##Quick review

  • Custom Textview

  • Center Textview alignment

  • Search pattern redesigned

  • CandyBar implementation

##implementation You can call by simple direct API from the code and it will do the magic for you. The new implementation - the easiest Simple way to start your module

TopBarManager actionToolBar =

  TopBarManager.ManagerBulider.with(this)
  ...

.companyLogo(R.drawable.actionbar_bg_pb_logo)

.background(R.drawable.actionbar_bg_white_greyline)

.burgerIcon(R.mipmap.ic_action_menu)

.searchView(SearchCustom.LAYOUT.classic_3)
  ...

.build(tb);

Implementation of the search view:

...
  .searchBarEvents(new TopBarManager.searchBarListener() {

  @Override

  public void onKeySearchStartConfirm(String s) {

if (currentFragmentNow instanceof listTemplate) {

 listTemplate k = (listTemplate) currentFragmentNow;

 k.triggerSearch(s);

}
 else {

 setinternalChangeNoToggle(listTemplate.B(listTemplate.conSearch(s)), "search");

}

  
}

@Override

  public void onKeySearchLetter(String s) {

}

@Override

  public void onRestoreToNormal(ActionBar actionBar) {

actionToolBar.showBack();

  
}

  
}
)  ...

Methods table for custom toolbar introduction

There are several attributes you can set:

methods func
searchView there are 4 options. The available options are classic_3, classic_2, classic_1
companyLogo The drawable Id for the company logo
background The navigation bar background drawable Id
burgerIcon customize the top left corner icon with the resource Id
searchBarEvents the implementation of the listener event for the plugins
setLiveIcon there are two overriding: 1) is the actual LiveIcon object . 2) two configurations for the layout xml resource id and the image resource id

Implementation for dynamic icon for on the action tool bar

###setup 1: prepare the custom layout for the dynamic icon and here is the sample

<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@id/liveicon_counterpanel"
  style="?android:attr/actionButtonStyle"
  android:layout_width="48dp"
  android:layout_height="48dp"
  android:clickable="true"
  android:focusable="true"
  android:gravity="center">

 <ImageView

android:id="@id/liveiconloc"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:scaleType="centerInside" />

<RelativeLayout

android:id="@id/liveicon_position"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="11dp">

 <TextView

 android:id="@id/liveicon_text"

 android:layout_width="match_parent"

 android:layout_height="match_parent"

 android:layout_centerInParent="true"

 android:gravity="center"

 android:text="88+"

 android:textColor="#FFFFFF"

 android:textSize="15dp" />
  </RelativeLayout> </FrameLayout>

###setup 2: setup on configurations

worker = TopBarManager.ManagerBulider.with(this)
 ...
 .setLiveIcon(layout_id , drawable_id)
 ...
 .build(toolbar);

###setup 3: retrieve the object LiveIcon

dynamic_icon = worker.getDynamicIcon();

###setup 4: inject object into these overrides

@Override
  public boolean onCreateOptionsMenu(Menu menu) {

getMenuInflater().inflate(R.menu.main, menu);

...

// the id of the menu item

dynamic_icon.onOptionItemInit(menu, R.id.dynamic);

...

return true;
  
}

 @Override
  public boolean onOptionsItemSelected(MenuItem item) {

if (item.getItemId() == R.id.dynamic) {

 dynamic_icon.update(item, [the new number] );

}

return super.onOptionsItemSelected(item);

  
}

Implementation for the Candy Bar

worker = CandyBar

 .Builder.with(this)

 .companyLogo(R.drawable.starz_logo)

 .searchView(LayoutAsset.classic_3)

 .searchBarEvents(new TopBarManager.searchBarListener() {

 @Override

 public void onKeySearchStartConfirm(String text) {

  Log.d("start", text);

 
}

  @Override

 public void onKeySearchLetter(String text) {

  Log.d("start", text);

 
}

  @Override

 public void onRestoreToNormal(ActionBar toolbar) {

  worker.showBack();

 
}

}
)

 .setNotificationOffset(15)

 .setNotificationDrawableId(R.drawable.notg)

 .overrideIcons(R.mipmap.cross_grey, R.mipmap.ic_action_close, R.mipmap.crossmp)

 .background(R.drawable.bottom_line)

 .presetCountNotification(u)

 .build(toolbar);
 

Other manipulations


 //demo to show the title only

worker.showTitle("fill this up now");

//demo to show the title only

worker.showLogo();

//demo to show the title only

worker.triggerfromSearchIcon();

//demo to show the title only

worker.updateCount(u++);

//demo to show the title only

worker.updateCount(0);

//demo to show the previous layout

worker.showBack();
 

Beast Bar

Put the following code into the onCreate section

 Toolbar temp = (Toolbar) findViewById(R.id.toolbar);

  BeastBar.Builder bb = new BeastBar.Builder();

//enter your back icon

bb.back(R.drawable.ic_m_back);

//enter your company icon

bb.companyIcon(R.drawable.starz_logo);

//enter your background drawable

bb.background(R.drawable.actionbar_bg_dark_black);

 //enter your search icon

bb.search(R.drawable.ic_find_mg);

 final BeastBar toolbar = BeastBar.withToolbar(this, temp, bb);
 

Implementation for the social tool bar

Add this component into your xml layout in anywhere


<com.hkm.advancedtoolbar.socialbar.combar

android:id="@+id/social_bar_combar"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginLeft="10dp"

android:layout_marginTop="10dp" /> 

retrieve the component combar and use the method setShareContent to inject the information needed for the sharing intents. Please also refer to the table.


public void setShareContentBar(String title, String except, String link) {

 combar mCombo = (combar) content_view.findViewById(R.id.social_bar_combar);

 mCombo

 .connectAlert(getFragmentManager())

 .setShareContent(title, except, link);

}

Social Bar method table for combar:

methods func
searchView there are 4 options. The available options are classic_3, classic_2, classic_1
setShareContent inject information into the sharing intents

Thank you for your support and we will bring more amazing libraries to your productive works. We are accepting bitcoin by the address as below. Please scan the QR code to start

Resources

Endless background scrolling for Android.

Utility for creating ContentProviders without boilerplate and with heavy customization options.

ThirtyInch - a MVP library for Android.

The perfect distance to the Android Framework is approximately thirty inches, the average length of the human arm, shoulder to fingertips.

The EllipsizeTextView extends TextView and supports to omit redundant characters in situation with multiple lines.

Floating expandable action button.

Easy to implement a drop-down warning / message.

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