Coder Social home page Coder Social logo

bordermenu's Introduction

Phone tutorial logo

Border Menu

Android app on Google Play

Phone tutorial giff

How to use

If you want use this library, you only have to download BorderMenu project, import it into your workspace and add the project as a library in your android project settings.

If you prefer it, you can use the gradle dependency, you have to add these lines in your build.gradle file:

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.navasmdc:bordermenu:1.1@aar'
    compile 'com.android.support:support-v4:22.+'
    compile 'com.nineoldandroids:library:2.4.+'
}

This library support Android 2.2

To add this menu in your activities, these have to extends of BorderMenuActivity

BorderMenuActivity extends of FragmentActivity, if you need use fragments in your activity.

Configuration

You can configure some elements of this Menu:

#####Menu color: You can change the color menu by calling this function:

	setMenuColor(int color);

#####Menu icon color: You can change the color icon menu by calling this function:

	setMenuIconColor(int color);

#####Hide menu by touching out You can configure the menu for hide it when the user will be touch out of it:

	setHidedOnTouchOutside(boolean bool);

#####Show/Hide the menu icon You can show or hide the menu icon whenever you want by calling these functions:

	showIconMenu();
	
	hideIconMenu()

#####Show/Hide the menu You can show or hide the menu icon whenever you want by calling these functions:

	showMenu();
	
	hideMenu()

You can know if the menu if showed by calling to function isMenuShowed()

Items

#####Icon item

Icon item

new IconItem(Context context, int id, int drawable);

When you generate a IconItem you've to set an id for detect it in the event listener and a drawable resource for the icon.

#####Text item

Icon item

new TextItem(Context context, int id, String text,int color);

When you generate a TextItem you've to set an id for detect it in the event listener,a string for the text and the color of the text.

#####Interaction with the items

#####Add items

For add items to the menu bars, you can call to these functions:

	addTopItem(MenuItem item);
	
	addLeftItem(IconItem item);

The left menu bar only allow add IconItems

#####Get items

For get items on the menu bars, you can call to this function:

	getItemById(int id);

#####Remove items

For remove items on the menu bars, you can call to these functions::

	removeTopItem(int id);
	
	removeLeftItem(int id);
	
	removeAllTopItems();

#####Item click listener

For detect the click on the items, you've to overwrite this function:

	@Override
	public void onItemClick(int id) { }

For more information see MainActivity of BorderMenuDemo project.

bordermenu's People

Contributors

navasmdc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.