Skip to content
Snippets Groups Projects

Extend merge request !310

  1. Nov 04, 2023
    • Hugh Daschbach's avatar
      Fix landscape view induced MainActivity leak. · b2490c61
      Hugh Daschbach authored
      With landscape view enabled (e.g. e06b2c7d) in the app and auto
      rotation enabled on the phone, switching between portrait and
      landscape orientations leaks instances of MainActivity.  This prevents
      garbage collection of not just the MainActivity object, but fragments
      and other objects referenced by the Activity.
      
      This is caused by repositories, the AppContext instance, the player
      service, and authentication code maintaining a reference to the
      context which with they are initialized.  So rather than initialize
      these with an Activity context, pass them the Application context.
      
      Activities are torn down and rebuilt on screen rotation.  The
      Application context is not.
      
      To enable instantiation of the FavoritedRepository with the
      Application context, delay that repository’s initialization until
      first use.  This ensures the Application context is fully initialized.
      It is not fully initialized until the MainActivity has been fully
      initialized.
      b2490c61
    • Hugh Daschbach's avatar
      Increase player controls touchpoint size. · eaf3c550
      Hugh Daschbach authored
      Adopting AndroidStudio suggestion to help those of us with fat
      fingers.
      eaf3c550
    • Hugh Daschbach's avatar
      Prevent BottomSheet tap leaking to nav panels. · ab3205c0
      Hugh Daschbach authored
      With the BottomSheet open, while trying to tap one of the
      controls (esp. add to playlist and favorite buttons) it is easy to
      miss the touch point and tap directly on the BottomSheet.
      
      This tap bleeds through to whatever fragment is currently displayed in
      the navigation area (Artist, Album, Playlists, etc.).  That tap
      changes the view in the navigation panel.  For example, if the Artist
      fragment it current, it will open a list of the artists albums.
      
      That change may be surprising when the BottomSheet is toggled closed.
      So, ignore BottomSheet taps outside the active controls.
      ab3205c0
    • Hugh Daschbach's avatar
      Refactor CoverArt.withContext(). · 9cd8826e
      Hugh Daschbach authored
      Having changed the context object in CoverArt from a received function
      parameter to an initialization time derived variable, withContext no
      longer needs a Context parameter.
      
      That leaves the method misnamed.  So rename withContext ->
      requestCreator and drop the first parameter.
      9cd8826e
    • Hugh Daschbach's avatar
      Do not create unnecessary Picasso objects. · c86f81b4
      Hugh Daschbach authored
      Address "java.lang.IllegalStateException: Too many receivers"
      exceptions.  (See Issue #145).  Each new Picasso object registers its
      own NetworkBroadcastReceiver.  Worse, we create a new Picasso object
      each time we transform an AlbumCover image.  So do not create
      unnecessary Picasso objects.
      
      Rather than depend on receiving a Context object when called to load
      an cover art, fetch the Application context as returned from FFA.get()
      at singleton construction time.  The Application context is long
      lived.
      
      This has an additional advantage.  Not generation new Picasso objects
      for each CoverArt image avoids holding a reference to an object that
      cannot, later, be garbage collected.
      c86f81b4
  2. Oct 02, 2023
  3. Sep 28, 2023
  4. Sep 27, 2023
  5. Sep 18, 2023
Loading