Sunday, July 16, 2017

3.0 Work in Progress 5: Library view

In this update I added a library view similar to the one in the old UI.  I also added in an artist list, genre list, and track list tabs.

The big difference with this one is the toolbar will collapse when you scroll down and if you scroll up it will become visible again

Here is a video of it in action

The plan with the library view is to allow the user to choose which views to add to the library (others will end up in the side navigation view if they are not in the library), the title of those views, and their order.  Below is the chunk of code responsible for building the library, its "hardcoded" currently but will be fairly simple to hook up to the preferences.

v.setupAdapter(listOf(BaseFragmentEntry("Artists", ArtistListFragment::class)
                                  , BaseFragmentEntry("Albums", AlbumListFragment::class)
                                  , BaseFragmentEntry("Genres", GenreListFragment::class)
                                  , BaseFragmentEntry("Songs", TrackListFragment::class)))

I am sure many of you are anxious to try out the new UI, but it is still a ways off.  Some of the views are not too straight forward to code like the equalizer and the browser / folder view, so I expect they will take some time to code.  My plan is to have a working alpha by this fall.  The alpha however will not really contain much customization.  Its really easy to add customization to the code, however actually creating UIs to configure everything is going to take a long time.  Because of this, the alpha will be through a separate group in google+ that users will have to join.  I didnt want to push something so incomplete to the beta channel

Thursday, June 29, 2017

3.0 Work in Progress 4: MultiSelect, Overflow Menu, and Sort

For those who havent noticed, I am trying to do post progess updates every 2 weeks.  This iteration doesnt have too much to actually show off, however a lot of work was done under the hood.  Everything has been wired for easily adding multi select (and its action menu), the overflow menu, and sort.   By "wired" I mean that the majority of the code was written and for each new view I only have to write a few lines of code to add the capabilities and then write the code to handle the actual selected actions.


This is in the album list view's presenter code (couldnt figure out a way to post code so the formatting is a bit weird).  As you can see its not much code at all to add a lot of functionality

override fun onViewAttached()

    view?.let {        addBehavior(MenuBehavior::class
, ViewModeMenuBehavior(, state))
, GridSizeMenuBehavior(, state))
, SortMenuBehavior(, state))
, AlbumSelectionBehavior())
, AlbumActionModeBehavior(it))

Anyway here are some screenshots

Friday, June 16, 2017

3.0 Work in Progress 3: Album Details + Album Grid transitions

The last 2 weeks I've been working on the album details view along with learning how to do transitions between different views.  As mentioned before I'm currently just focusing on the code portion so the actual UIs themselves are not final and still need a lot of work.

This is the current state of the album details view.  Its using the CoordinaterLayout with a collapseable toolbar, so when you scroll up the album art will basically collapse into the toolbar at the top.  I currently like how the album title moves while you scroll up and eventually becomes the title in the toolbar, but im not 100% sure if that is the direction i will go.

Below is a video that shows the transitions between selecting an album from the album grid and opening the album details.  This was recorded on an old galaxy s3 running Lineage OS (7.1.2) so it appears the actual recording is a bit glitchy.  The Image showing over half of the floating action button doesnt actually happen on the device.

Progress might seem slow but once a lot of the essential capabilities are written, they will be reusable on almost all the other views (IE artist detail view and genre detail view will be pretty similar to the album view, so it wont take long for me to add).  Next up on my list is adding the 3 dot buttons / context menus on to the list / grid items.

Friday, June 2, 2017

3.0 Work in Progress 2: Album Grid

Before I talk about my latest progress I want to reiterate that this is just a work in progress / prototype so nothing shown in the screenshots will be final.  I havent spent too much time on the UIs themselves, but have been focusing on the underlying UI code (presenters / data access / adapters / etc).  I encourage people to give feedback, however just because something is not being shown, does not mean I am getting rid of it.

Recently, google announced a bunch of new architecture libraries and since I was in the middle of some major rework, I decided to go ahead and start adapting GMMP to use these new libs.

  • Room is going to greatly simplify access GMMP's database.
  • LiveData combined with Room makes it super simple for my UI to get access to the data and get notified on changes to the database
  • ViewModel allows me to maintain UI state between orientation changes
  • Lifecycle gives my presenters access to the fragment/activity lifecycle without being tightly coupled to the fragment/activity

Google also announced official support for Kotlin in Android Studio.  I have only played around with it a little but from everything I have read it looks amazing and I do have plans to convert some of GMMP over to it.  Since its compatible with the JVM I can mix and match both kotlin and java in the same project.

Anyway for the last 2 weeks I have been working on the album view (its a standalone since I have not done anything with drawer navigation or the viewpager / tab navigation yet).  For now I have created 4 different modes for the albums list.


Card List


Card Grid

There are also nice transitions in between each view mode (and changing the number of grid columns).

I also made the metadata shown in each grid/list item configurable in the same way as now playing.  There will however be less options for the variables depending on the view (IE albums view would only give you access to the artist/album/year and not trackname variable. stuff like that).  I also added another small addition to the markup language used for the metadata lines and that is the ability to set the color.. in a very limited way.  <color=secondary> or <color=primary> can be added to each metadata line.  Primary is the whiter color and secondary is the grayer one.  For a light theme these colors would be different.  Also, each view mode will have its own metadata lines.  In the images above you will see that the list views are aligned left, but the grid views the text is aligned center.

Now Playing

There are 2 minor changes to now playing.

I made the buttons at the bottom configurable.  Besides play/pause you will be able to configure them to show other actions and also choose the icon side (small/medium/large).  In the image above I adjusted the icon sizes a bit: Shuffle/repeat are small, Next/Prev are medium, and Play/Pause is Large

Finally here is a gif if the play/pause animation:

Saturday, May 20, 2017

3.0 Work In Progress 1: New theme engine and now playing

I'd like to start off by saying that GMMP 3.0 is a long long way from being complete, but I have made some progress so I wanted to share whats been done so far.

New Theme Engine

In 2.x, GMMP had 2 main theme types: Holo and Material.  The holo themes leveraged a library called HoloAccent which reimplemented all of the UI elements in a dynamically color-able holo style.  The material themes used the android compatibility library and required each theme to be predefined in xml.  I generated roughly 1000 or so different color combinations and thats what was available to choose from.  On top of that, a lot of custom code had to be placed through out the UI code to make sure everything colored properly.

GMMP 3.0 will feature a new theme engine that will do the dynamic coloring of Material themes.  That unfortunately means there will no longer be any holo themes.  Google keeps releasing updates that break parts of that holo accent library, so I decided to drop it.  Anyway the new engine will traverse through the entire view and theme things accordingly.  It also allows me to specify different behaviors straight in the UI xml instead of in code.  (Example would be the the play/pause button using the accent color instead of the standard button color).

As of right now, a theme is defined by 6 different colors.  Primary, Primary Light, Primary Dark, Accent, Accent Dark, and Accent Light.  GMMP 3.0 will allow all 6 of these to be chosen by the user.  There will also be tons of predetermined themes available to select from for those who dont want to customize each color.

New Now Playing

The pictures above show the current state of the now playing screen.  The album art area will be where gestures are done.  I will also probably make an option to choose between having the album art extend all the way through the status bar, and having a standard colored toolbar with the album art underneath it.  The floating action button is just a placeholder currently but its purpose is going to be for quick actions.  The actions will be similar to the options available for the gesture actions.  I have not yet determined how they will be presented.

One option is the FAB to expand out to a bunch of smaller floating buttons like below:

It looks nice, but due to the location of the FAB it doesnt leave room for many buttons, so I may have to modify it to show both above and below the FAB or go down a different route all together.  The other thought i had was to make it expand out to a toolbar with buttons that sits on top of where the song information is shown.  I"ll have to prototype both to see which works better.

Below the album art is the metadata display which I will go into more detail later on in this post.  When single tapping the metadata area it will transition the UI to the queue.  I've had a lot of requests for easier queue access and it seems like this allows for that.  Perhaps a long press on that area would open up a popup with all the song details.  Finally the play/pause button will do a nice transition animation when pressed (the one where the play morphs into the pause).

Not everything mentioned here implemented yet, but that is what im shooting for.   I'll most likely do partial implementations of most of the UI views just to see how everything works together first before doing the full implementations.

Metadata View Customization

In GMMP 1.x/2.x, users were giving the option to choose from a long list of different metadata fields for each line or allowed the user to write there own custom lines using variables like %ar% (artist), %al% (album), etc.  I've greatly expanded upon this for 3.0.  There will still be presets that users can choose from if they dont want to mess with writing the lines themselves.


This has not changed.  %field% will be replaced by metadata from the tags.  The code was completely rewritten so its much more efficient this time around.  It actually parses each line instead of just doing a general replace for each field.


Entire lines or specific words in a line can be wrapped with formatting tags (there will be examples later on)

  • <align> : Aligns the text left, right, or centered.  This applies to the entire line of text
  • <b> : Bold
  • <i> : Italics
  • <size> : Text/Font size
  • <typeface> : Choose the font to use
  • <u> : Underline


Inspired by foobar2000, I've put in a few functions to allow you to apply a little logic to the lines
  • $ifequal(val1, val2, text_if_equal, text_if_not) : Compares 2 integers (val1, val2) and if they are the same it will display [text_if_equal], otherwise show [text_if_not] or nothing if that field is not specified.  
  • $ifgreater(val1, val2, text_if_greater, text_if_not) : Compares 2 integers (val1, val2) and if val > val2 it will display [text_if_greater], otherwise show [text_if_not] or nothing if that field is not specified.  
  • $notempty(val1, val2, val3, etc) : Will display the first parameter that is not empty.
All of these parameters can contain fields (which is really the only way they are useful).  More functions will probably come later, but at least right now with these 3 you can do some nice things like:  
  • Hiding disc number or track number if its 0
  • Show composer or album artist if the field is set, otherwise show artist




"<align=center><typeface=sans-serif><size=20><b>$notempty(%cp%,   ,%ar%)</b> - <i>%al%</i>"

Multiple alignments on a single line

The last customization that can be done is essentially splitting a single line into multiple segments that take up an equal percentage of the line (2 segments = 50% each or 3 segments is 33.3% each).  Each segment can get their own alignment

This is the java code representing above.  I will try to make this much more user friendly when creating lines in app

new String[]
 "<align=left><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",
new String[]
 "<align=center><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",

So thats it for now.  I will be doing more posts as things get developed

Friday, April 7, 2017


2.2.2 (04/05/2017):
-Fixed m4a crossfade bug
-Updated crashlytics to 2.6.7
-Updated support library to 25.3.1
-Updated google services to 10.2.1

Saturday, March 11, 2017


2.2.1 (03/09/2017):
-Fixed crash when executing a search with nothing but blank spaces
-New m4a decoder is now available to lollipop devices
-Fixed issue loading embedded album art when the "prefer embedded art" option was off
-Effects view now shows the correct effects when the custom audioengine is disabled
-Fixed crash on the Lenovo A6000 when raising volume above the "safe media volume"
-Other various fixes

Thursday, March 2, 2017

2.2 Released - Android Auto support & On Sale for $0.99 USD through March 12th

2.2 is finally ready to go.  Major updates were the additional of Android Auto support, a new m4a decoder (a lot of devices shipped their 6.0+ updates with broken opensl decoders, which gmmp previously used for m4a playback), and a lot of voice search improvements.  Also included are a few nice bug fixes that should improve stability.

One other thing to note is GMMP 2.2 (and 3.0 hopefully later this year) requires an android device running at least 5.0 or higher.  5.0+ represents about 80% of the active installs, so it was time to increase the minimum to take full advantage of the newer apis.

This is the playback screen when in landscape 

Menu options

More menu options (Artists, Albums, and Genres are off by default but can be enabled by turning on the Full Android Auto Access option)

Queue with the icon next to the current playing track

Playlists menu combines both smart playlists and playlist files

All Artists

Auto has the option to filter by letter


View when outside of the music player in Auto.  It has widgets for each auto app

2.2.0 (03/02/2017):
-Added Android Auto support
-Added Full Android Auto Access option in Prefs -> Library to allow access to all artists, albums, and genres
-Added new m4a/aac decoder to replace opensl on android 6.0+
-Added support for .oga extension (ogg audio)
-Added support for opus files with the .ogg or .oga extension

-Voice search refactoring/improvements
-More voice search accuracy improvements
-Added genre voice search
-Added unstructured voice search support
-Refactored data access layer
-Audiofocus is now persisted if the music service is restarted by the OS
-Playback will no longer auto resume after audiofocus loss (always play on plugin is not affected by this)
-Unlocker validation moved to the MusicService
-Updated crashlytics to 2.6.6
-Updated translations
-Improved sample rate, channel count, and duration detection
-GMMP should no longer auto resume when regaining audiofocus after a full loss (like using another player to play audio)
-Upgraded Glide to 3.7.0
-GMMP will now attempt to free up memory when the OS requests it

-The full length audio file associated with a cue will no longer show in the library views
-Fixed audioengine crash when changing tracks multiple times in a short period of time
-Fixed memory leak
-Other various minor bug fixes

-Removed support for kitkat and below
-Removed any code specific to kitkat or below
-Removed music service timeout (interferes with a lot of functionality)

Friday, January 20, 2017


2.1.4 (01/14/2016):
-Music service will stay a foreground service to prevent it from being killed/restarted when show when paused is true and dismissable notifications are turned off
-Notification controls now properly update after changing tracks when paused/stopped
-Fixed tasker support
-Persist auto resume when music service restarts or is killed
-Fixed issue reading album art from APEv2 tags
-Improved APEv2 tag reading
-Upgraded google play services to 10.0.1
-Upgrade support library to 25.1.0

2.1.3 (12/01/2016):
-Added option to disable dismissable notification controls when paused (Android 5.0+)
-Disabled "Show in status bar" on Android 5.0+ due to google removing the capability in 5.0
-Fixed crash when trying to save playlists to a location where gmmp does not have access to write
-Fixed blank notification issue
-Composer no longer defaults to artist tag if composer tag is not present
-Other minor fixes

Tuesday, January 3, 2017

2017 Plans

I've been fairly quiet on here for the last few months but I wanted to give an update on the plans for this new year.

2.1.4: Tasker users are probably aware that the lastest version of tasker no longer works with gmmp due to an api change made by the tasker dev.  The next update will fix that along with another small annoyance I found regarding the auto resume not working if the OS restarts the music service (which seems to happen after not using gmmp for an hour or 2). This should be released in 2-3 weeks.

2.2: The next major update will add android auto support.  I have it working currently with limited access to gmmps content (just the queue so far).  Due to the guidelines android put out for auto, gmmp will only expose some thing by default like the queue,  top songs,  recently played, and other things like that.  The reason for this is so the update will get approved by the play store.  According to their docs they do manual testing of the auto support and everything must comply with their guidelines.  I will however,  add an option in the settings to expose the full library.

2.2 will also remove the support for kitkat in order to start the transition to some of the 5.0 apis that will really help out the app.  The first will be the switch to vector graphics which should reduce the size of the app by a fairly large amount.  In earlier versions of android i had to include images for every screen size for every icon / image.  Vector drawables allow me to just include one file for each icon and android will scale it to the appropriate screen size with no loss of quality.

The other big change will be a new aac decoder using the MediaCodec api.  A few manufacturers shipped their 6.0 updates with a completely broken  implementation of opensl (which is what gmmp uses for aac playback).  OnePlus is the big name that comes to mind but a few others have done it as well.  This new api should allow aac playback again in gmmps audioengine on those devices.

Betas with auto support should start being released in 3-4 weeks.  Final release wont be for a couple of months most likely.

While working on 2.x i have also been doing some work on 3.0. Mainly a new theme engine for gmmp.  It will allow me to dynamically color the ui with any arbitrary color set and also switch color sets without restarting the UI.

Its coming along nicely in a demo app i wrote which i plan on showing some previews on here when i feel its ready.  Integration will gmmp wont happen until 2.2 is finished however. For those who did not read my other post about 3.0, it will mostly focus on rewriting the UI.  I will start from scratch leveraging all the material design animation libraries and other niceties added in 5.0+. The base of the current UI was from the gingerbread days so it really just needs a rewrite.

I would like to start pushing out early 3.0 betas in the late summer.  Betas will mostly continue throughout the rest of a year with a final release at the end of 2017 or early 2018. It really all depends how much time i get to work on gmmp this year.  Im changing positions at my day job next months so i will probably not be as burned out on coding as i have been these last 2 years (hence the slower progression in the app)