[TIMOB-4104] Android: Expose Window Pixel Format
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-08-29T10:32:50.000+0000 |
| Affected Version/s | Release 1.7.0 |
| Fix Version/s | Sprint 2011-32, Release 1.8.0 |
| Components | Android |
| Labels | module_window, qe-testadded |
| Reporter | Dawson Toth |
| Assignee | Don Thorp |
| Created | 2011-05-16T09:41:02.000+0000 |
| Updated | 2013-12-02T09:14:53.000+0000 |
Description
The Problem
If your window uses images with gradients, the gradients can appear very blocky.The Solution
Expose the "setFormat" method of a native Android window, and allow it to be set to PixelFormat.RGBA_8888 or PixelFormat.OPAQUE [default].For More Information
You can read more about the problem and solution here: http://stuffthathappens.com/blog/2010/06/04/android-color-banding/Associated Helpdesk Ticket
http://appc.me/c/QZP-88323-317Attachments
| File | Date | Size |
|---|---|---|
| gradient.png | 2011-08-14T13:09:01.000+0000 | 28523 |
You'll need the gradient.png to test it.
var w = Ti.UI.createWindow({ navBarHidden: false, exitOnClose: true, backgroundImage: 'gradient.png', windowPixelFormat: Ti.UI.Android.PIXEL_FORMAT_RGB_565 }); var v = Ti.UI.createImageView({ image: "KS_nav_ui.png" }); var b1 = Ti.UI.createButton({ title: "RGB_565", bottom: 10, left: 10, width: 100, height: 'auto' }); b1.addEventListener('click', function() { w.windowPixelFormat = Ti.UI.Android.PIXEL_FORMAT_RGB_565; }); var b2 = Ti.UI.createButton({ title: "RGBA_8888", bottom: 10, right: 10, width: 100, height: 'auto' }); b2.addEventListener('click', function() { w.setWindowPixelFormat(Ti.UI.Android.PIXEL_FORMAT_RGBA_8888); }); w.add(v); w.add(b1); w.add(b2); w.open();Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120207171634 OSX Lion 10.7.3 Nexus S OS 2.3.6 Verified expected behavior is shown