Update: Android Widget Themes

android-theme-feat
Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

Starting in the most recent public build, all Corona developers can now opt to use two new widget themes in their projects. These new themes are styled after the Android “Holo Light” and “Holo Dark” themes which are commonly found on Android devices running recent versions of the OS.

Both of the new themes contain assets up to the @4x scale profile, which means that your widgets should appear crisp and clean on even the highest resolution Android devices like the Nexus 10.

android-themes

Setting the Themes

The new themes can be set by passing the proper value to the widget.setTheme() API:

And that’s it — all non-skinned widgets throughout the project will appear in the new chosen theme.

Updated Sample Project

To preview the new themes in action, please load the WidgetDemo sample project included with Corona SDK:

CoronaSDK → SampleCode → Interface → WidgetDemo

Previous Android Theme

Note that using the new Holo themes is entirely optional. The previous Android theme files are still available, so if you wish to continue using that theme, be sure to set the theme as follows:

In Summary

Hopefully you can easily integrate these new themes into your existing projects with a minimal amount of repositioning, although some adjustments will be necessary due to slightly differing sizes of the updated styles.

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0
Brent

Brent Sorrentino serves as a full-time Developer Evangelist for Corona Labs, assisting developers in the forums, maintaining documentation/guides, and creating samples which highlight core features of Corona SDK.

This entry has 2 replies

  1. Kerem says:

    Great update! Many thanks.

  2. Lerg says:

    local function some()
    print('code')
    end

    local function some()
    print(‘lua’)
    end

    local function some()
    print(‘source’)
    end

    local function some()
    print(‘pre’)
    end

Leave a reply

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">