Skip to main content

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.

Fields

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.

Formatting

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

Functions

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

Examples


"<align=center><typeface=sans-serif><size=24>%tr%"
"<align=center><typeface=sans-serif><size=20>%ar%"
"<align=center><typeface=sans-serif><size=20>%al%"


"<align=left><b><typeface=sans-serif><size=24>%tr%"
"<align=center><i><typeface=serif><size=20>%ar%"
"<align=right><u><typeface=monospace><size=20>%al%"

"<align=center><b><typeface=sans-serif><size=24>%tr%"
"<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

"<align=center><typeface=serif><size=24>%tr%"
new String[]
{
 "<align=left><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",
 "<align=center><typeface=serif><size=20>%br%",
 "<align=right><typeface=serif><size=20>%sr%",
}
new String[]
{
 "<align=center><typeface=serif><size=20>$ifequal(%yr%,0,No Year,%yr%)",
 "<align=center><typeface=serif><size=20>%sr%"
}

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

Popular posts from this blog

3.4.5 Release / Preview of 3.5

3.4.5 was just uploaded to google play and should be rolling out over the next few days. Changelog: 3.4.5 (2023-08-29): Added Dutch translation Fixed crash editing rules in rule groups Disable IAP donation options if Full Version Unlock has not been purchased to prevent confusion Other changes since 3.4.0: Added Finnish translation and updated other translations Added donation options to the purchase settings area Fixed crash when trying to bookmark / unbookmark currently playing song Fixed Finnish not showing up in the language select Fixed other various crashes Fixed issue where rating or editing tags could potentially split the album Fixed some of the lists/grids not refreshing after changes 3.5 Preview I've been working on some new UI options planned for 3.5.  So far I've finished a new gradient background option for now playing.  There are 2 different styles (linear / radial) with 2 different color sources for each.  One source will take from the theme colors, the ot...

3.4.9

More fixes.  Check out discord for info on the 3.5 alpha. 3.4.9 (2024-02-14): Fixed tab navigation returning to the wrong view on screen orientation change Fixed queue not being focused on the playing track sometimes while using tab navigation 3.4.8 (2023-12-21): Fixed backup/restore intent receiver not working with IAP unlock Fixed crash sorting playlist contents

3.4.14

Google really messed with alarms and timers for android 14, so 3.4.14 should fix the sleep timer.  You will notice an alarm will show up in your alarms menu when the sleep timer is turned on.  This is the only way to actually get the sleep timer to reliably stop playback on time when your screen is off / phone locked. 3.4.14 (2024-05-17): Sleep timer should now be more reliable on android 14+ 3.4.13 (2024-04-29) Fixed metadata view incorrect sizing in now playing layout 1 3.4.12 (2024-04-23) Updated translations Fixed issues with left and right metadata alignment when no album art Multi artist/genre/composers should now be separated by a comma and space throughout GMMP 3.4.11 (2024-04-16) Added ability to choose whether to crop album art to 1:1 aspect ratio in now playing layout 2 (customize -> album art -> crop to fit) Fixed now playing tab 1:1 aspect ratio album art getting cropped Album art preview pop up should no longer crop art 3.4.10 (2024-03-31) Fixed auto bookma...