• Stars
    star
    441
  • Rank 95,963 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ButtonMenu is an Android library created to build user interfaces based on buttons. This library has been implemented using Model View ViewModel pattern combined with an Android custom view that extends LinearLayout.

Button Menu Build Status Maven Central Android Arsenal

ButtonMenu is an Android library created to build user interfaces based on buttons. This library has been implemented using Model View ViewModel pattern combined with an Android custom view that extends LinearLayout.

In this library you will find a custom view implementation called ButtonMenu and a custom animator called ScrollAnimator you can use to link the scroll of a ListView with your ButtonMenu to show or hide the view when the user uses the ListView scroll.

This library works on Android 2.X or higher versions.

Screenshots

Demo Screenshot 1 Demo Screenshot 2

Download

Download the project, compile it using mvn clean install import buttonmenu-1.0.9.jar into your project.

Or declare it into your pom.xml

<dependency>
    <groupId>com.tuenti.buttonmenu</groupId>
    <artifactId>library</artifactId>
    <version>1.0.9</version>
</dependency>

Or into your build.gradle

dependencies{
    compile 'com.tuenti.buttonmenu:library:1.0.9'
}

Usage

    1. Add a ButtonMenu to your layout.
<com.tuenti.buttonmenu.ButtonMenu
		android:id="@+id/button_menu"
		style="@style/button_menu"/>
    1. Initialize your ButtonMenu widget with a ButtonMenuVM implementation inside your Activity or Fragment. You can use our SimpleButtonMenuVM implementation or create your own ButtonMenuVM implementation.
private void initializeButtonMenu() {
	button_menu = (ButtonMenu) findViewById(R.id.button_menu);
	button_menu.setButtonMenuVM(buttonMenuVM);
	button_menu.initialize();
}
    1. If you want to create your custom ButtonMenuVM implementation you can follow the sample implemented in CustomButtonMenuVM.
public class CustomButtonMenuVM extends SimpleButtonMenuVM {

/*
 * Every ButtonVM implementation could be moved to a different file extending SimpleButtonVM if needed.
 */
private final ButtonVM moment = new SimpleButtonVM(R.layout.moment_button, R.id.moment, null);
private final ButtonVM photo = new SimpleButtonVM(R.layout.photo_button, R.id.photo, null);
private final ButtonVM contact = new SimpleButtonVM(R.layout.contact_button, R.id.contact, null);

public CustomButtonMenuVM() {
	super();
	addItem(moment);
	addItem(photo);
	addItem(contact);
}
    1. Connect your ButtonMenu widget with the ScrollAnimator to attach the scroll animation effect.
private void initializeScrollAnimator() {
	ScrollAnimator scrollAnimator = new ScrollAnimator(button_menu, new ObjectAnimatorFactory());
	scrollAnimator.configureListView(lv_contacts);
	scrollAnimator.setDurationInMillis(300);
}

Review different ButtonVM implementations -like SimpleButtonVM or ButtonWithMutableSubjectVM - in this project if you want to create your custom ButtonVM.

Credits & Contact

ButtonMenu was created by Android team at Tuenti Technologies S.L.. You can follow Tuenti engineering team on Twitter @tuentieng.

License

ButtonMenu is available under the Apache License, Version 2.0. See LICENSE.txt file for more info.

More Repositories

1

SmsRadar

Android library created to listen incoming and outgoing SMS's
Java
390
star
2

TUDelorean

TUDelorean helps you test your time-dependent Objetive-C code allowing you travel anywhere in time.
Objective-C
281
star
3

secrets-manager

A daemon to sync Vault secrets to Kubernetes secrets
Go
171
star
4

activity-detector

Simple js module to detect when the user is really using your page
JavaScript
133
star
5

TUScheduler

TUScheduler is a very simple iOS library that solves the problem of asynchronous testing in an elegant and robust way. Furthermore, TUScheduler allows you to decouple your code from the underlying concurrency API.
Objective-C
36
star
6

animated-circle-progress-view

Progress view that animates its state changes.
Java
35
star
7

VideoRecorderService

VideoRecorderService is a lightweight web-based service that offers a REST interface to easily manage the recording of screen videos.
Java
34
star
8

pouch

Tools to provision secrets using Vault with AppRole authentication method
Go
31
star
9

sdp-to-jingle-java

Java
27
star
10

ikusth

Threads dependency graph generator
Java
25
star
11

kube2lb

Dinamically configure load balancers to expose Kubernetes services
Go
22
star
12

TMAERecorder

AVAudioRecorder replacement which allows audio recording with real time sound filtering. Implemented using The Amazing Audio Engine.
Objective-C
20
star
13

hiphop-php

Source code transformer from PHP to C++
C++
18
star
14

programming-challenge-2

Solutions and writeups from participants of the Tuenti Programming Challenge 2
Java
17
star
15

android-deferred

Java
14
star
16

python-repoman

Repoman is a python library designed to automate repository operations in release processes.
Python
13
star
17

TMInstanceMethodSwizzler

Method swizzling library for Objetive-C
Objective-C
13
star
18

TMDebugConsole

TMDebugConsole is a simple in-app console to be used with Cocoa Lumberjack. It allows you to see your logs on the device, without needing to be paired with a debug session in XCode, using different colors for errors, warnings, and informative messages
Objective-C
9
star
19

ldap-expire-notify

ldap-expire-notify is a tool to notify your LDAP users when their password is about to expire. It supports several kind of notification channels.
Python
9
star
20

supernanny

Java
8
star
21

haproxy-docker-wrapper

Docker-friendly wrapper for haproxy
Go
7
star
22

pyflapjackevents

Pyflapjackevents is a small library that serializes Flapjack events for the Python language
Python
7
star
23

simtron

TypeScript
4
star
24

php-json-rpc

Tuenti's implementation of json rpc according to the json-rpc spec 2.0 excluding events and batches. It provides the implementation of the objects described in the implementation and a json-rpc client.
PHP
4
star
25

tuenti-star-validator

Submission validator and score calculator for #TuentiChallenge6's Tuenti Star challenge
OCaml
4
star
26

geoip

C
1
star
27

tuenti-php-sdk

Tuenti PHP SDK for Applications
PHP
1
star