Jump to content
Poweramp

Recommended Posts

On 12/7/2018 at 9:02 AM, flyingdutchman said:

Centered where? For small devices the track title is centered above the albumart, artist is hidden

Centered like this. Or below album art.

unnamed.png

Share this post


Link to post
Share on other sites
8 hours ago, flyingdutchman said:

@marcony nice clean look. I notice you have hidden the 4 buttons too. Is this a mock up? 

I found this image online as a example what I was talking about. I think this was a theme for V2. 

Share this post


Link to post
Share on other sites

Centred like that and with a transparent background certainly looks a lot nicer and more polished than left-justified black boxes. All we'd then need would be for Max to implement auto-scrolling for long titles.

Andre

Share this post


Link to post
Share on other sites
On 12/13/2018 at 12:32 PM, andrewilley said:

Centred like that and with a transparent background certainly looks a lot nicer and more polished than left-justified black boxes. All we'd then need would be for Max to implement auto-scrolling for long titles.

Andre

I hope he sees this and make it happen

Share this post


Link to post
Share on other sites

From attrs-powerui.xml

        <!-- By default, view gravitates to its parent (via standard android:layout_gravity). If layout_gravityTarget is some non-parent view id, 
             that view becomes the point of gravitaion. E.g. if android:gravity="center" and layout_gravityTarget="@id/some_view", this view
             will be centered relatively to "some_view".
             If gravity target view doesn't exist, or is GONE, view gravitates to parent.
             Cyclic references are not allowed (you'll see stack overflow exception). The referenced view will be layed out first (xml order is ignored).
             Not supported for layout_flex views
             NOTE: this disables accounting for gravity based consumed parent space, as gravityTarget view bounds become the reference bounds for this view
             Consume space still works if layout_attach*="parent" is used
        -->
 

        <attr name="layout_gravityTarget" format="reference|integer">
            <enum name="parent" value="0"/>
        </attr>

trying to center 

    <style name="ItemTrackTitle_scene_aa" parent="com.maxmpz.audioplayer:ItemTrackTitle_scene_aa">

        <item name="android:textColor">@color/TextColor</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:gravity">center</item>
        <item name="com.maxmpz.audioplayer:layout_gravityTarget">@com.maxmpz.audioplayer:id/aa_bounds</item>
(also tried parent, @com.maxmpz.audioplayer:id/aa_image)
        <item name="com.maxmpz.audioplayer:lineBackground">@color/transparent</item>
        <item name="android:layout_marginLeft">@dimen/ItemTrackTextLeftMargin</item>
        <item name="android:layout_marginRight">@dimen/ItemTrackTextLeftMargin</item>
        <item name="android:layout_marginTop">0dp</item>
        <item name="android:layout_marginBottom">-25dp</item>
        <item name="com.maxmpz.audioplayer:layout_attachLeft">@null</item>
        <item name="com.maxmpz.audioplayer:layout_attachRight">@null</item>
        <item name="com.maxmpz.audioplayer:layout_attachTop">@null</item>
        <item name="com.maxmpz.audioplayer:layout_attachBottom">parent</item>
        <item name="android:visibility">visible</item>
    </style>

So, given the explanation above, I would expect the text to show centered below the album art but is does not.
I have also tried the android:gravity etc to no avail.
Anyone with suggestions on how to center the text?

Share this post


Link to post
Share on other sites

@maxmp I believe this has regressed since the last version. My first skin showed centered text on an earlier version (812/813?)but with the latest version, it no longer does. Given the above detail, it should be centered right?

Share this post


Link to post
Share on other sites

Sorry, but I can't reproduce your issue. If I go to sample skin and modify AAA_ItemTrackTitle_scene_aa to:

<style name="AAA_ItemTrackTitle_scene_aa" parent="com.maxmpz.audioplayer:ItemTrackTitle_scene_aa">
   <item name="com.maxmpz.audioplayer:scale">@dimen/AAA_ItemTrackTitle_scene_aa_scale</item>
   <item name="com.maxmpz.audioplayer:layout_compensateScale">@dimen/AAA_ItemTrackTitle_scene_aa_scale</item>
   <!--<item name="com.maxmpz.audioplayer:layout_attachRight">@com.maxmpz.audioplayer:id/menu</item>-->
   <item name="android:layout_marginLeft">@dimen/AAA_ItemTrackAAImage_scene_aa_margin</item><!-- Sync margins with AA image margins -->
   <item name="android:layout_marginRight">8dp</item>
   <!-- NOTE: to make it centered, use something like: -->
   <item name="com.maxmpz.audioplayer:layout_attachRight">@null</item>
   <item name="com.maxmpz.audioplayer:layout_attachLeft">@null</item>
   <item name="android:layout_gravity">center_horizontal</item>
</style>

I'm getting it centered.

PS As all the styles are derived from some default ones, please refer to appropriate reference_resources (just search them for style in question) and disable the attributes which are not needed (in this case, layout_attachRight/Left).

Share this post


Link to post
Share on other sites

I appreciate your continuing support. I will work through your example tomorrow as xmas dinner is coming out :).

i do look at all the details as provided which is why i expected my example to center

 

Share this post


Link to post
Share on other sites

Some more help needed please

As a result of previous posts by maxmp I have been able to sort most of the headers out. I have restyled the following:

<!-- first level    
<style name="ItemTopTextBackDecor" parent="com.maxmpz.audioplayer:ItemTopTextBackDecor">
<style name="ItemTopTextBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTopTextBackDecorTitle_scene_header_back_decor">

<!-- second level
<style name="ItemTextBackDecor" parent="com.maxmpz.audioplayer:ItemTextBackDecor">     
<style name="ItemTextBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTextBackDecorTitle">
<style name="ItemTextBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTextBackDecorTitle_scene_header_back_decor">

  <!-- third level header eg, artists, beatles, album -->
<style name="ItemTrackBackDecor" parent="com.maxmpz.audioplayer:ItemTrackBackDecor">    
<style name="ItemTrackBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle">
<style name="ItemTrackBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle">
<style name="ItemTrackBackDecorTitle_scene_header_1" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_1">
<style name="ItemTrackBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_back_decor">
 

As you can see from the screeshot there remain 2 fields which have none of the aboive styles defined. I have worked through each style but I have been unable to discover the srtyles for the Album and artist.

I would appreciate some further guidance on how to either set android:background or Poweramp: lineBackground

image.png.214c3c5454b286cb2c55b16619f91814.png

Share this post


Link to post
Share on other sites

That "albums" with arrow up - it's a "back decor". There are a few back decor styles, they depend on what is the parent list (top, text or "track"), so you need to redefine all of them.

They have 2 scenes, and both may define color, so you need to override all such scenes. Search for "backdecor" in reference resources styles-item.xml (ItemBackDecorTitle, ItemTextBackDecorTitle, ItemTopTextBackDecorTitle).

For example, let's override all of them to directly assigned red text color (I also added this example to Sample skin on Github): Note that if you change color or other attributes of backdecors, you may want to change appropriate attributes for just title styles to match appropriate backdecor - otherwise their animation will be broken.

Main skin theme style:

 
<item name="com.maxmpz.audioplayer:ItemTopTextBackDecorTitle">@style/ItemTopTextBackDecorTitle</item>
<item name="com.maxmpz.audioplayer:ItemTopTextBackDecorTitle_scene_header_back_decor">@style/ItemTopTextBackDecorTitle_scene_header_back_decor</item>

<item name="com.maxmpz.audioplayer:ItemTextBackDecorTitle">@style/ItemTextBackDecorTitle</item>
<item name="com.maxmpz.audioplayer:ItemTextBackDecorTitle_scene_header_back_decor">@style/ItemTextBackDecorTitle_scene_header_back_decor</item>

<item name="com.maxmpz.audioplayer:ItemTrackBackDecorTitle">@style/ItemTrackBackDecorTitle</item>
<item name="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_1">@style/ItemTrackBackDecorTitle_scene_header_1</item>
<item name="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_back_decor">@style/ItemTrackBackDecorTitle_scene_header_back_decor</item>

Styles:

<style name="ItemTopTextBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTopTextBackDecorTitle">
   <item name="android:textColor">#f00</item>
</style>
<style name="ItemTopTextBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTopTextBackDecorTitle_scene_header_back_decor">
   <item name="android:textColor">#f00</item>
</style>

<style name="ItemTextBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTextBackDecorTitle">
   <item name="android:textColor">#f00</item>
</style>
<style name="ItemTextBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTextBackDecorTitle_scene_header_back_decor">
   <item name="android:textColor">#f00</item>
</style>

<style name="ItemTrackBackDecorTitle" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle">
   <item name="android:textColor">#f00</item>
</style>
<style name="ItemTrackBackDecorTitle_scene_header_1" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_1">
   <item name="android:textColor">#f00</item>
</style>
<style name="ItemTrackBackDecorTitle_scene_header_back_decor" parent="com.maxmpz.audioplayer:ItemTrackBackDecorTitle_scene_header_back_decor">
   <item name="android:textColor">#f00</item>
</style>

 

Share this post


Link to post
Share on other sites

As for just titles and line2 - just search reference item-track.xml and override appropriate styles for *_scene_header and scene_header_1

Share this post


Link to post
Share on other sites

Thanks @maxmp, this fixed the issue

  <!-- level 2 text in header part  eg Playlists, then list playlist content to display playlist title at the top -->
  <item name="com.maxmpz.audioplayer:ItemTrackTitle_scene_header_1">@style/ItemTrackTitle_scene_header_1</item>
  <!-- there is no ItemTrackLine2_scene_header_1 style as we have only 1 field to display eg playlist name-->
<!-- level 3 text in header part eg, artists, beatles, "let it be" list album content to display artist and album title at the top-->
  <item name="com.maxmpz.audioplayer:ItemTrackLine2_scene_header">@style/ItemTrackLine2_scene_header</item>
  <item name="com.maxmpz.audioplayer:ItemTrackTitle_scene_header">@style/ItemTrackTitle_scene_header</item>

Share this post


Link to post
Share on other sites

@maxmp given that Poweramp does not install on intel based avd's  and skin developers are mainly concerned with layout, would it be possible to publish a basic layout xml against which skin developers could test different configurations on avd's?.

None of the other functionality is required. 

Not sure if this is at all possible as the styles require the Poweramp app but I thought I'll ask as perhaps you have some ideas on how to test skins for a variety of devices

thanks in advance

Share this post


Link to post
Share on other sites

 

Before posting I have tried everything I could think of. My aim is to offer the option to hide/show the 4 buttons TopSubAAButtons. However when implementing a style based on hiding/showing seekbar,

<item name="android:enabled">false</item>
<item name="android:visibility">gone</item>
<item name="com.maxmpz.audioplayer:applyScene">false</item>

the display goes black with a small border. I have tried android:visibility:invisible so that if anything is attached to TopSubAAButtons, it would not be orphaned.

When setting it to  android:visibility:invisible and launch the skin (without the option setting in skins.xml) it does not show as expected.

I have also tried to apply the "hide" settings the following styles:

        <item name="TopSubAAButtons">@style/TopSubAAButtons</item>
        <item name="TopSubAAButtons_scenes_playing">@style/TopSubAAButtons_scenes_playing</item>
        <item name="TopSubAAButtons_scene_lib">@style/TopSubAAButtons_scene_lib</item>
        <item name="TopSubAAButtons_scenes_hidden">@style/TopSubAAButtons_scenes_hidden</item>
        <item name="TopVisButtonLayout">@style/TopVisButtonLayout</item>
        <item name="TopShuffleButtonLayout">@style/TopShuffleButtonLayout</item>
        <item name="TopRepeatButtonLayout">@style/TopRepeatButtonLayout</item>

        <item name="TopSleepTimerButtonLayout">@style/TopSleepTimerButtonLayout</item>

but all give me a black screen and small border, nothing else shows.

Unless a fellow skin designer can help me out I hope @maxmp can give me some help.

thanks in advance
 

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×