Skip to content

An Android application that provides a persisting overlay of media buttons for quick access to changing, starting, and stopping music.

License

Notifications You must be signed in to change notification settings

mkorcha/MediaButtonOverlay

Repository files navigation

MediaButtonOverlay

An Android application that provides a persisting overlay of media buttons for quick access to changing music.

App can be found on Google Play

Copyright © Mike Korcha 2013-2017

Notes

Project built in Android Studio. First you should run the task gitClone (using gradlew) to ensure that you pull in the other projects this one depends on. Afterwards, you should just be able to build and run the project as usual.

Use

Basics

All you really have to do to get started is select your media player from the menu, then hit the red start button to get started. You can opt to start the player with the overlay, in case it hasn't started already.

If your player isn't shown, the "Default Fallback" option is usually sufficient - if not, see below on how to add your own, or alternatively, open an issue.

Customizing

You can set the skin, the colour (if the skin allows for it), the opacity (transparency) of the overlay on the screen, and set if it should display horizontally or vertically, for skins which allow it.

Want to create a skin? See below for more information.

The Overlay

The overlay can be moved to either side of the screen by long pressing, then dragging it to either side of the screen. You can also move it vertically to reposition to your liking.

There is also an "x" icon that shows. Simply drag the overlay onto this icon to stop it. Alternatively, you can press the red start button again in the menu.

Note: If the overlay drop view (for lack of a better name) gets stuck, you can press the "x" icon to keep the overlay running and close the drop view, or long-press the "x" icon to stop the overlay itself.

Automation

Media Button Overlay comes with a couple of automation features built in to start and stop the overlay via Intents, which can be used from your own applications or other methods.

To start the overlay (using the settings previously selected):

com.mikekorcha.mediabuttonoverlay.START

To stop the overlay:

com.mikekorcha.mediabuttonoverlay.STOP

Additionally, this app has built-in support for Tasker and Locale, so if you use either of these automation apps you don't need to do anything else.

Contributing

The latest release has made it significantly easier to add a player or a skin.

Player

Extend the MediaPlayer class, included in the base directory, and put it in the players package. Then, just add the name of the player to players_strings and the class name to players_classes in the players.xml value file.

To allow for the button to change properly with play status, when calling the parent constructor, pass the needed BroadcastReceiver and IntentFilter.

To allow the player to start with the overlay, make sure to set playerPackage to the package ID of the player you want to start.

Skin

Create an XML layout file. Make sure the buttons have the ID of btnPrevious, btnPlayPause, and btnNext, for those you want to implement. Then, add the skin name to skins_names and the layout resource name to skins_resources in the skins.xml value file.

To allow the orientation of the layout to change (assuming a LinearLayout), make sure the enclosing layout has the ID buttonLayout.

To allow the element to be recoloured, make sure the element is tagged "recolourable". If any additional processing needs to be done for your recolour, look at MediaOverlayView.java in the setColour() method.

License

LGPL 2.1. All libraries are licensed as stated by their authors.

Credit

About

An Android application that provides a persisting overlay of media buttons for quick access to changing, starting, and stopping music.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages