An Android Wear Menu implementation

Related tags

Menu WearMenu
Overview

WearMenu

Build Status Android Weekly Android Arsenal

alt poster

WearMenu is an Android Wear Menu implementation

alt gif

Download

In your wear module Download

compile 'com.github.florent37:wearmenu:1.0.0@aar'

Usage

Add WearMenu above your GridViewPager

<?xml version="1.0" encoding="utf-8"?>
<com.github.florent37.WearMenu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/wear_menu"
    app:wearMenuPosition="bottomLeft"
    >

    <android.support.wearable.view.GridViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:keepScreenOn="true"/>

    <android.support.wearable.view.DotsPageIndicator
        android:id="@+id/page_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|bottom"
        android:layout_marginBottom="5dp"/>

</com.github.florent37.WearMenu>

You can change the opening direction of the WearMenu

<com.github.florent37.WearMenu

    app:wearMenuPosition="bottomLeft"
    app:wearMenuPosition="bottomRight"
    app:wearMenuPosition="topLeft"
    app:wearMenuPosition="topRight"

To open/close manually the WearMenu

WearMenu wearMenu = (WearMenu) findViewById(R.id.wear_menu);
wearMenu.toggle();

Display a list

In your activity, customise the wear list menu

wearMenu.setMenuElements(
                new String[]{
                        "title 1",
                        "title 2",
                        "title 3",
                        "title 4"
                });

You can display elements with icons

wearMenu.setMenuElements(
                new String[]{
                        "title 1",
                        "title 2",
                        "title 3",
                        "title 4"
                },
                new Drawable[]{
                        getResources().getDrawable(R.drawable.icon1),
                        getResources().getDrawable(R.drawable.icon2),
                        getResources().getDrawable(R.drawable.icon3),
                        getResources().getDrawable(R.drawable.icon4)
                });

And get back the selected element

wearMenu.setWearMenuListener(new WearMenu.WearMenuListener() {
            @Override
            public void onWearMenuListClicked(int position) {

            }
        });

Customisation

You can display a custom view in WearMenu

<com.github.florent37.WearMenu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/wear_menu"
    app:wearMenuLayout="@layout/myCustomView"
    app:wearMenuPosition="bottomLeft"
    >

Changing colors & backgrounds

<com.github.florent37.WearMenu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/wear_menu"
    app:wearMenuPosition="bottomLeft"
    app:wearMenuListTextColor="@color/blue"
    app:wearMenuListSelectedColor="@color/red"
    app:wearMenuListBackground="@color/black"
    >

Modify animation duration (500ms by default)

<com.github.florent37.WearMenu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/wear_menu"
    app:wearMenuPosition="bottomLeft"
    app:wearMenuDuration="300"
    >

TODO

  • Adding circle animation from touch position
  • Enabling fill list from xml layout
  • Adding preview for tools: package
  • Adding custom colors for each list element

Community

Looking for contributors, feel free to fork !

Wear

If you want to learn wear development : http://tutos-android-france.com/developper-une-application-pour-les-montres-android-wear/.

Credits

Author: Florent Champigny www.florentchampigny.com/

Follow me on Google+ Follow me on Twitter Follow me on LinkedIn

Pictures by Logan Bourgouin

Follow me on Google+

License

Copyright 2015 florent37, Inc.

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.
You might also like...
(UNMAINTAINED) An implemention of  Filter Menu concept for android
(UNMAINTAINED) An implemention of Filter Menu concept for android

FilterMenu This is a library project with a custom view that implements concept of Filter Menu(https://dribbble.com/shots/1956586-Filter-Menu) made by

Navigation menu for Android (based off Google+ app)
Navigation menu for Android (based off Google+ app)

RibbonMenu Navigation menu for Android (based on Google+ app). Usage Menus are created in xml as normal, adding text and an icon. In the layout you wa

Simple and easy to use circular menu widget for Android.
Simple and easy to use circular menu widget for Android.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

A multicard menu that can open and close with animation on android
A multicard menu that can open and close with animation on android

MultiCardMenu A multicard menu that can open and close with animation on android,require API level = 11 Demo ##Usage net.wujingchao.android.view.

An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

Android Overlay Menu
Android Overlay Menu

Overlay Menu Android Overlay Menu Demo: Installation: Add this dependency to your gradle script: compile 'it.sephiroth.android.library.overlaymenu:ove

A floating menu library for Android.
A floating menu library for Android.

Hover Hover is a floating menu implementation for Android. Goals The goals of Hover are to: Provide an easy-to-use, out-of-the-box floating menu imple

Side menu with some categories to choose.
Side menu with some categories to choose.

Side Menu Side menu with some categories to choose. Check this project on dribbble. Check this project on Behance. God bless Ukraine! Sample Sample &

You can easily add awesome animated context menu to your app.
You can easily add awesome animated context menu to your app.

ContextMenu You can easily add awesome animated context menu to your app. Check this project on dribbble Check this project on Behance Usage: For a wo

🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.

SlidingUpMenu A library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet. Gradle Dependency

Rasheed Sulayman 26 Jul 17, 2022
Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app)

Android SideNavigation Library Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app). Description The Go

Evgeny Shishkin 319 Nov 25, 2022
A powerful & customizable menu implementation for android.

A powerful & customizable menu implementation for android. It supports any level of nested menu structures along with custom header and footer views, and much more. Follow the steps below to import the library to your project. You will also find some sample codes.

Nowrose Muhammad Ragib 5 Nov 8, 2022
** A slide-out menu implementation, which allows users to navigate between views in your app.

MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dra

Simon Vig Therkildsen 2.6k Dec 8, 2022
Android-NewPopupMenu 3.9 0.0 Java is an android library to create popup menu with GoogleMusic app-like style.

Android-NewPopupMenu Android-NewPopupMenu is an android library to create popup menu with GoogleMusic app-like style. Requirements Tested with APIv4 H

u1aryz 159 Nov 21, 2022
an animated circular menu for Android

CircularFloatingActionMenu An animated, customizable circular floating menu for Android, inspired by Path app. Getting Started Requirements API >= 15

OÄŸuz Bilgener 2.7k Dec 24, 2022
A menu which can ... BOOM! - Android

BoomMenu 2.0.0 Comes Finally Approximately 8 months ago, I got an inspiration to creating something that can boom and show menu, which I named it Boom

Nightonke 5.8k Dec 27, 2022
Android Satellite Menu

#Satellite Menu 'Path' has a very attractive menu sitting on the left bottom corner of the screen. Satellite Menu is the open version of this menu. Fo

Siyamed SINIR 1.4k Nov 15, 2022
An android custom view which looks like the menu in Path 2.0 (for iOS).

ArcMenu & RayMenu ArcMenu An android custom view which looks like the menu in Path 2.0 (for iOS). RayMenu About The user experience in Path 2.0 (for i

daCapricorn 1.3k Nov 29, 2022