Apollo One (2 Viewers)

wizard123

Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,569
    2,680
    Home Country
    United Kingdom United Kingdom
    That image looks fine no problem, for the rest of the tiles in tv they are attached to post on page 41
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    The main media (movie, series, ...) ListViewStyle is defined here: https://github.com/MediaPortal/Medi...mes/default/styles/MediaStyles.xaml#L741-L752.
    It is only one style, but it selects other templates depending on the user setting (list, grid, cover).

    The (un-)watched indicator are for the "List" style (ListViewMovieItemTemplate), so look there: https://github.com/MediaPortal/Medi...mes/default/styles/MediaStyles.xaml#L272-L371. It is a bit longer, because it needs to contain:
    1. Unfocused version (text only)
    2. Focused version (cover + genres + rating)
    The latter binds to the available MediaItemAspects. Our wiki has a summary: http://wiki.team-mediaportal.com/2_...ent/3_Concepts/Metadata_system/1_MediaAspects. The interpretation if an items is "watched" is currently implemented on the MediaAspect.PlayCount (> 0 means watched). (Note: PlayCount is exposed directly as property on the MediaItem. If you like to access any other MediaAspect like MovieAspect, you need the wrapper controls for property binding, like MovieAspectWrapper).

    I removed all stuff that is not (yet) needed in ApolloOne to get a clean skin. So as reference take a look at Titanium, there I use different text colors depending on playcount: https://github.com/MediaPortal/Medi...mes/default/styles/MediaStyles.xaml#L985-L991.

    For ApolloOne you should apply this logic to Image + its source:
    XML:
     <Image>
    <Image.Source>
    <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} == 0 ? {1} : {2}">
    <Binding Path="PlayCount"/>
    <Binding Source="unwatched.png"/>
    <Binding Source="watched.png"/>
    </MultiBinding>
    </Image.Source>
    </Image>
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @morpheus_xx
    thanks, I understood roughly the structure. But not clear for me is for example wthere and how TeamResources are defined.
    Below example refers to ThemeResource Text Color and the opacity is changed according to watched/unwatched.

    In case I link images do I need to refer to another resource? I couldn't find any xaml where resources are defined.

    Code:
          <Label x:Name="ItemLabel" Grid.Row="0" Grid.Column="1" Content="{Binding SimpleTitle}" Color="{ThemeResource TextColor}" FontSize="{ThemeResource SmallFontSize}" FontFamily="DefaultBold">
            <Label.Opacity>
              <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} ? {1} : {2}">
                <!--<Binding Path="PlayCount"/>-->
                <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type Button}}" Path="HasFocus"/>
                <Binding Source="1.0"/>
                <Binding Source="0.6"/>
              </MultiBinding>
            </Label.Opacity>

    Following makes MP2 just crash. All my changes leaded only to crashes so far :D
    Code:
      <ControlTemplate x:Key="ListViewMovieFilterItemTemplate">
        <Grid x:Name="ItemControl" Margin="8,0,8,0">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="50"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
          </Grid.RowDefinitions>
    
          <Label x:Name="ItemLabel" Grid.Row="0" Grid.Column="1" Content="{Binding SimpleTitle}" Color="{ThemeResource TextColor}" FontSize="{ThemeResource SmallFontSize}" FontFamily="DefaultBold">
            <Label.Opacity>
              <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} ? {1} : {2}">
                <!--<Binding Path="PlayCount"/>-->
                <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type Button}}" Path="HasFocus"/>
                <Binding Source="1.0"/>
                <Binding Source="0.6"/>
              </MultiBinding>
            </Label.Opacity>
          </Label>
    
    <!--<Ge2301/>-->
           <Image Grid.Row="0" Grid.Column="1">
            <Image.Source>
              <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} == 0 ? {1} : {2}">
                <Binding Path="PlayCount"/>
                <Binding Source="unwatched_flag.png"/>
                <Binding Source="watched_flag.png"/>
                </MultiBinding>
              </Image.Source>
            </Image>
    <!--<Ge2301/>-->
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    . But not clear for me is for example wthere and how TeamResources are defined.
    ThemeResources are defined inside the Skin\Themes\default\...xaml. The "ThemeResource" only means, that the resource can be overridden by themes. WPF doesn't know that MarkupExtension, it's MPF special.

    In case I link images do I need to refer to another resource? I couldn't find any xaml where resources are defined.
    See my quote above, it should work already that way. Images can be referenced only by their name and are looked up from the images subfolder of:
    • Current Theme
    • Current Skin
    • Default Skin
    in this order (as other resources).
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I followed your example before checking something else and MP2 directly crashes when pressing the movie button.
    Afterwards I added [Grid.Row="0" Grid.Column="1"], because it's nowhere defined where MP2 should place the picture.

    Code:
      <ControlTemplate x:Key="ListViewMovieItemTemplate">
        <Grid x:Name="ItemControl" Margin="8,0,8,0">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
          </Grid.RowDefinitions>
    
          <Label x:Name="ItemLabel" Grid.Row="0" Grid.Column="1" Content="{Binding SimpleTitle}" FontSize="{ThemeResource SmallFontSize}" Color="{ThemeResource TextColor}" FontFamily="DefaultBold">
            <Label.Opacity>
              <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} ? {1} : {2}">
                <!--<Binding Path="PlayCount"/>-->
                <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type Button}}" Path="HasFocus"/>
                <Binding Source="1.0"/>
                <Binding Source="0.6"/>
              </MultiBinding>
            </Label.Opacity>
          </Label>
    
          <Image Grid.Row="0" Grid.Column="1">
            <Image.Source>
              <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} == 0 ? {1} : {2}">
                <Binding Path="PlayCount"/>
                <Binding Source="unwatched_flag.png"/>
                <Binding Source="watched_flag.png"/>
              </MultiBinding>
            </Image.Source>
          </Image>

    Edit: I tried severel things and looked into other skins, always with the result MP2 crashes back to desktop. As I mentioned I'm also not sure how the position is defined, in your example there is no position. Even if I add Grid.Row="0" Grid.Column="1", not sure how it can work, because already "itemLabel" is written there...

    Gridview also doesn't work. I just took over the same code as from Titanium skin.
    Result is again MP2 crash ... I have no idea what to do :D

    Code:
      <ControlTemplate x:Key="GridViewMovieItemTemplate">
        <Grid>
          <Image Source="MediaItem_Shadow.png" Margin="-7,-4,-8,-6"/>
          <Image Width="{StaticResource MEDIA_POSTER_WIDTH}" Height="{StaticResource MEDIA_POSTER_HEIGHT}" Stretch="UniformToFill" FallbackSource="VideoLarge.png"
                 OpacityMask="{ThemeResource MediaItemsOpacityBrush}">
            <Image.Source>
              <fanart:FanArtImageSource fanart:FanArtMediaType="Movie" fanart:FanArtType="Poster" fanart:FanArtName="{Binding SimpleTitle}"
                  fanart:MaxWidth="{StaticResource FANART_POSTER_WIDTH}" fanart:MaxHeight="{StaticResource FANART_POSTER_HEIGHT}"/>
            </Image.Source>
          </Image>
         
    <!-- ge2301 -->     
          <Image Source="unwatched_flag.png" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Image.IsVisible>
              <Binding Path="PlayCount" Converter="{StaticResource ExpressionValueConverter}" ConverterParameter="{}{0} == 0"/>
            </Image.IsVisible>
          </Image>
    <!-- ge2301 -->   
         
        </Grid>
      </ControlTemplate>

    Edit
    Need to sleep , having a busy week and only once again time on Wednesday evening for 1-2 hours. Friday I'm on business trip to Germany for 8 days. On company laptop I have no admin rights, so no chance to work with MP2 there o_O
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    If MP2 crashes, then please look into the MP2-Client.log. There all xaml parsing errors are logged with filename and message to check.

    On company laptop I have no admin rights, so no chance to work with MP2 there o_O
    This is no excuse, simply copy MP2-Client folder to USB stick, xaml files can be edited by notepad as well and live tested ;) :D
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    If MP2 crashes, then please look into the MP2-Client.log. There all xaml parsing errors are logged with filename and message to check.

    On company laptop I have no admin rights, so no chance to work with MP2 there o_O
    This is no excuse, simply copy MP2-Client folder to USB stick, xaml files can be edited by notepad as well and live tested ;) :D

    USB and DVD drive are also blocked ;) I can download MP2 and try to build without server. But this works only if no additional packages for building need to be installed. Also no server means no media in the list :D
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @morpheus_xx
    Restoring to original mediastyles.xaml did not work. I deleted the complete build and compiled from the beginning. Afterwards MP2 does not crash anymore!!!! :) Don't ask me why, but at least I can continue now.

    Following is only a test by taking some code from Titanium skin.
    test.jpg
    @wizard123
    What do you think about something similar with small symbols for unwatched movies? Do you prefer there red markes instead? If the red markers are used w/o legend some people might not know the meaning. Anyway, it's your skin and I will at first code it accorind to your wish :)
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Here the view with red markers for unwatched movies:
    test2.jpg

    Problem: Currently the red marker is also overlapping the grey-white focus frame
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Here the list view with un-/watched icons:
    test3.jpg
    Will do some fine tuning for all views. First I wait for you feedback @wizard123
    I personally think it's little bit hard to differentiate the unwatched and watched symbols. Especially on small TV's/screens.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom