Giter Club home page Giter Club logo

coolmenu's Introduction

coolMenu

The Android implementation of Cards Menu Concept by Gal Shir.

This is Gal Shir's awesome shot.

Usage

I published the library with Jitpack, so add it to your build.gradle with:

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

Add the dependency:

dependencies {
	compile 'com.github.DxTT:coolMenu:v1.1'
}

The usage is really like ViewPager, just add CoolMenuFrameLayout to your layout.

An example of basic usage in layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.foocoder.coolmenu.MainActivity"
    tools:ignore="all"
    tools:showIn="@layout/activity_main">

    <com.dxtt.coolmenu.CoolMenuFrameLayout
        android:id="@+id/rl_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        app:num="four"/>
</merge>

This statement declares the number of cards, The upper limit is five.

app:num="four"

You can set your title icon or title style in xml like this:

app:titleSize="@dimen/cl_title_size"
app:titleColor="@color/colorPrimary"
app:titleIcon="@drawable/menu"

Like ViewPager,set an Adapter for the CoolMenuFrameLayout view.

coolMenuFrameLayout = $(R.id.rl_main);
String[] titles = {"CONTACT", "ABOUT", "TEAM", "PROJECTS"};
titleList = Arrays.asList(titles);
//set your titles,which is optional
coolMenuFrameLayout.setTitles(titleList);
//set your menu icon
coolMenuFrameLayout.setMenuIcon(R.drawable.menu2);

fragments.add(new Fragment1());
fragments.add(new Fragment2());
fragments.add(new Fragment3());
fragments.add(new Fragment4());

FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
		return fragments.size();
    }
};
coolMenuFrameLayout.setAdapter(adapter);

License

coolMenu is available under the MIT license

Android Gems

coolmenu's People

Contributors

csuft avatar liaohuqiu avatar notice501 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coolmenu's Issues

Wrong gradle on docs

There is a mistake on gradle configuration on docs

Need to change

compile 'com.github.DxTT:coolMenu:v1.1'

to
implementation 'com.github.DxTT:coolMenu:1.2' (without the "v")

Hide Title Text

Is it possible to hide title text in when the menu is opened?
whatsapp image 2019-02-06 at 11 50 27

Hamburger icon not working

Thanks a lot for such an awesome library. I used your library and generated a signed apk, but after installing the signed apk the hamburger icon is not detecting any touch inputs else in debug mode the app is working fine.

Configuration to the right

Hello, thank you for your valuable work. We want to use this menu on the reverse (right) but this seems not possible for now. Can you add this feature?

interface

Why did the headmost fragment become transparent?

Change array size

I need to change the String[] titles = {"CONTACT", "ABOUT", "TEAM", "PROJECTS"}; as String[] titles = {"CONTACT", "ABOUT", "PROJECTS"};. Means need to change the array size as 3. How to change this. If i change the array size as 3 i get an error Caused by: java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3.

How to sort screen order

Is it possible to change the orders of the layouts in the main menu? If yes how?
Thanks in regards

Plugin is too old, please update to a more recent version

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "693e8a773f76c66153c045392447148610fc80ef"

FAILURE: Build failed with an exception.

* Where:
Build file '/home/wsdjeg/forks/coolMenu/app/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Could not create plugin of type 'AppPlugin'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 28.306 secs

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.