08 August 2014
Update: Android Widget Themes
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.
Setting the Themes
The new themes can be set by passing the proper value to the widget.setTheme() API:
1 2 |
-- Use new 'Holo Light' theme widget.setTheme( "widget_theme_android_holo_light" ) |
1 2 |
-- Use new 'Holo Dark' theme widget.setTheme( "widget_theme_android_holo_dark" ) |
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:
1 2 |
-- Use older Android 2.x theme widget.setTheme( "widget_theme_android" ) |
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.
Kerem
Posted at 15:59h, 08 AugustGreat update! Many thanks.
Lerg
Posted at 20:13h, 26 Novemberlocal function some()
print('code')
end
local function some()
print(‘lua’)
end
local function some()
print(‘source’)
end
local function some()
print(‘pre’)
end