Minor


Source link: https://github.com/Batterii/Minor

Minor

A bottom navigation view solution for Android.
See: https://www.google.com/design/spec/components/bottom-navigation.html

About

There are quite a few solutions for Bottom Navigation on Android, most of them don't allow for using Views as navigation items.

Minor does!

This allows for any View to be used as a navigation item, including a TextView with a custom font (like an icon font)

Yay!!!

Gradle

  allprojects {

repositories {

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

}
  
}

 dependencies {

 compile 'com.github.Batterii:Minor:v1.2.4'  
}

##Usage ###Layout

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  tools:context="com.akiniyalocts.minorsample.MainActivity">

<com.akiniyalocts.minor.MinorLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_alignParentBottom="true"

app:minor_center_items="true"

android:background="@color/colorPrimary">

 <com.akiniyalocts.minor.MinorView

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 app:minor_selected="true"

 app:minor_title_selected_color="@color/colorAccent"

 app:minor_title="Home"

 app:minor_title_text_color="@android:color/white"

 app:minor_icon_view="@layout/minor_home"/>

 <com.akiniyalocts.minor.MinorView

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 app:minor_title="Favorites"

 app:minor_title_text_color="@android:color/white"

 app:minor_icon_view="@layout/minor_home"/>

 <com.akiniyalocts.minor.MinorView

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 app:minor_title="Lists"

 app:minor_title_text_color="@android:color/white"

 app:minor_icon_view="@layout/minor_home"/>

 <com.akiniyalocts.minor.MinorView

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 android:id="@+id/last_home"

 android:background="?attr/selectableItemBackgroundBorderless"

 app:minor_title="Friends"

 app:minor_title_text_color="@android:color/white"

 app:minor_icon_view="@layout/minor_home"/>

 <com.akiniyalocts.minor.MinorView

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 app:minor_title="Account"

 app:minor_title_text_color="@android:color/white"

 app:minor_icon_view="@layout/minor_home"/>

</com.akiniyalocts.minor.MinorLayout>  </RelativeLayout>

###Attributes ####MinorView

 app:minor_selected="true" //default is false
  app:minor_title_selected_color="@color/colorAccent" // text color for your selected item
  app:minor_title="Home" // text for your item
  app:minor_title_text_color="@android:color/white" // text color for your unselected item
  app:minor_icon_view="@layout/minor_home"// the view (ImageView, Custom font TextView, etc.)

 // inflated as an icon for your item

// REQUIRED!!!a

####MinorLayout

 app:minor_center_items="true" //items are weighted evenly, and centered in the layout
  android:background="@color/colorPrimary" // set the background color for your layout

app:layout_behavior="com.akiniyalocts.minor.behavior.MinorBehavior"//quick return scrolling behavior (similar to toolbar) 

####Notifications <img src=" https://raw.githubusercontent.com/Batterii/Minor/master/screenshots/Screen%20Shot%202016-05-17%20at%2011.28.47%20AM.png"</>

package com.akiniyalocts.minorsample;  import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View;  import com.akiniyalocts.minor.MinorView;  public class MainActivity extends AppCompatActivity {

@Override
  protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

 final MinorView home = (MinorView)findViewById(R.id.last_home);

 home.addNotifcation(8);

  
}
 
}

###Handling Clicks Since your navigation items are just views, setting a simple OnClickListener on that view works!

###TODO Handle click state within the view. Currently, clicking an item does not show an item as selected. You must apply the attribute, app:minor_selected="true" to show a MinorView as selected. License

Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

A method call logging based on dexposed.

A gallery used to host an array of images.

Android library to use Google Analytics through annotations.

The SimpleCropView is an image cropping library for Android. It simplify your code for cropping image and provides easily customizable UI.

With SnackbarAnimation class you can clone the Snackbar animation to move the ViewGroup above of the Snackbar when it is visible and avoid view overlapping (clone of fab animation).

Android Library for RecyclerView to manage order of items and multiple view types.

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