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.

Example:

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()
{
    super.onViewAttached()

    view?.let {        addBehavior(MenuBehavior::class
, ViewModeMenuBehavior(R.menu.menu_gm_shared_view_mode, state))
        addBehavior(MenuBehavior::class
, GridSizeMenuBehavior(R.menu.menu_gm_shared_gridsize, state))
        addBehavior(MenuBehavior::class
, SortMenuBehavior(R.menu.menu_gm_sort_album_list, state))
        addBehavior(SelectionBehavior::class
, AlbumSelectionBehavior())
        addBehavior(ActionModeBehavior::class
, 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 https://developer.android.com/topic/libraries/architecture/index.html 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.

List


Card List



Grid


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:  https://media.giphy.com/media/1pvYO3Fs7nPpK/giphy.gif

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.

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

Friday, April 7, 2017

2.2.2

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

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