Subscribe to the RSS feed then follow me on twitter at @mrlacey (misc) and @wpug (WPDev news)

Tuesday, December 03, 2013

Better alphabetic jumplist formatting

The following no doubt looks familiar to you. It shows the JumpList from the people hub. Recently I wanted to recreate this view in an app and was surprised at the lack of documentation available for recreating this view accurately.


Unfortunately the MSDN docs on creating a jumplist (from a LongListSelector) with alphabetic groupings leave something to be desired.

Here's what the formatting in the MSDN docs produce:


Admittedly I haven't done anything to improve the display of the names but hopefully you can see a lot of differences in the alignment, margins and spacing of the characters in the red boxes.

Unfortunately I've seen lots of apps which include something that looks like the above. I can't help but notice all the ways it varies from the native one. The lack of attention to detail it shows and the failure to craft something to be proud of is disappointing.

Here's my attempt:


As best as I can do it's pixel perfect ;) with the exception of the size of the globe icon which I've chosen not to resize and so left slightly larger than the native one. - It would be easy to make smaller if you wanted to though.

So how did I do it?

Firstly the formatting:

Also at https://gist.github.com/mrlacey/7779351

The picture converter is from MSDN and the JumpListItemBackgroundConverter is from the Toolkit.

Secondly a tweak to the CreateGroups method in the AlphaKeyGroup class:
    private static List<AlphaKeyGroup<PhoneContact>> CreateGroups(SortedLocaleGrouping slg)
    {
        var list = new List<AlphaKeyGroup<PhoneContact>>();
 
        foreach (string key in slg.GroupDisplayNames)
        {
            var k = key;
            if (key == "...")
            {
                k = "��";  // &#x1F310;
            }
 
            list.Add(new AlphaKeyGroup<PhoneContact>(k));
        }
 
        return list;
    }

If your browser has trouble rendering the globe character you may be able to see it better at https://gist.github.com/mrlacey/7779172

Let me know if you use this in your apps. :)




Are you a Windows Phone developer? If so, you could be getting rewards for the apps you build and the success they achieve by joining Nokia's DVLUP program.

4 comments:

  1. I'm definitely going to use this. Tried the infragistics one before but it didn't look as good as the native so I ended up not using a jumplist at all

    ReplyDelete
  2. Outstanding post, best to know that this topic is being secured also in this web page. Thanks for investing a while to discuss this, keep up with this interesting perform.

    ReplyDelete
  3. In line Coach Outlet Online is bringing Michael Kors Outlet unique Coach Factory Outlet to a Toms Shoes USA shoe for Cheap Jerseys Spring/Michael Kors Outlet 2014 Coach Factory Outlet, and this Coach Outlet, it's a Coach Outlet. The Coach Outlet Sale Sandal Giuseppe Zanotti Outlet.Supermodel mom Coach Factory Outlet was Coach Factory Outlet Online being all kinds of hot this weekend Coach Factory Outlet she Coach Store Online out in a Michael Kors Outlet-turning, Celine Outlet I did, I was Celine Bags possessed by Fitflops Flipflops suit madness.Fitflops USA-there string Michael Kors during Michael Kors Store vacation in Tomss Hoes Bahamas. Fitflop Footwear by her family, the 40-year-old looked happy and relaxed - Fitflops Outlet, uh, did we Fitflops Sandals super hot? - as she Giuseppe Zanotti by the pool.I've Giuseppe Zanotti Designer making my own vanilla extract for years. I love it! It's cost-effective, and in my opinion, Vanilla extract is also (easily) the most used extract in my Prada Outlet , sort of pretty (although it kind of looks like spiders too) tastes way better than imitation vanilla extract.

    ReplyDelete