Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18DC373D9 for ; Mon, 24 Oct 2011 19:23:07 +0000 (UTC) Received: (qmail 10894 invoked by uid 500); 24 Oct 2011 19:23:07 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 10874 invoked by uid 500); 24 Oct 2011 19:23:07 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 10863 invoked by uid 99); 24 Oct 2011 19:23:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 19:23:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of purplecabbage@gmail.com designates 209.85.220.175 as permitted sender) Received: from [209.85.220.175] (HELO mail-vx0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 19:22:58 +0000 Received: by vcbf1 with SMTP id f1so5576758vcb.6 for ; Mon, 24 Oct 2011 12:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=09hF2fbZbhA33piiRHwLxRDj6xdxRwIvGi9adlKjeVM=; b=FGXg/oFI5tuOii1Irs6HBeIIsaT+qLd8xVEIxlDD6dkRjS724ThTHt41GdhuH74+0O KiDXoLgWLRR8uX72lBS3wO1CXlUsTJDPt84eRyAQGYGnF4x4OonJHsuQoEVUNsoNpz3q IeQL2QGm9TiWuNoiX2relaZ+wA2gZQaOIuCgs= MIME-Version: 1.0 Received: by 10.52.34.78 with SMTP id x14mr23874401vdi.122.1319484157057; Mon, 24 Oct 2011 12:22:37 -0700 (PDT) Received: by 10.52.112.234 with HTTP; Mon, 24 Oct 2011 12:22:36 -0700 (PDT) Date: Mon, 24 Oct 2011 12:22:36 -0700 Message-ID: Subject: [PROPOSAL] Orientation Interface From: Jesse To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=20cf3079b74e77d9a004b0105880 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3079b74e77d9a004b0105880 Content-Type: text/plain; charset=ISO-8859-1 This proposal is intended to be a discussion, so if you have strong feelings about anything here, or any recommendations or corrections, this thread should be the outlet for that. Upon reaching some general consensus, and having the concept sit with everyone for a bit, we will put it to a vote. The proposal (in brief): Add a JavaScript interface to allow developers to specify at runtime what orientations they allow. A simple use-case : - an app with 2 views, managed by manipulating the DOM, and showing/hiding elements View 1 is a list of flickr images with a thumbnail, title, date + author info. This view should not re-orient and should always be displayed in portrait. Selecting an item shows View2. View 2 is an image view of the selected image User should be allowed to freely re-orient the device to their pleasing, for viewing the picture. Clicking a close button returns the user to View1 The current implementation: - all major CallBack devices support orientation, but the method that you use to specify which orientation your app will allow are different. - supported orientations are uniformly mapped on devices to 0,-90,90,180 - orientations are a build time setting, and there is no way to change what you support at runtime. iOS ---- - plist specifies supported orientations Android ---- - manifest.xml specifies ... BB WebWorks ---- false landscape WP7 ---- The proposal (in detail): 1. All devices should support a runtime getter/setter on the static JS PhoneGap object. 2. The 'property' should be called supportedOrientations and should be an array of integer values. ex. // allow the device to orient to Portrait or PortraitUpsidedown PhoneGap.supportedOrientations = [0,180]; 3. Orientation events should NOT be sent when the device is moved to an unsupported orientation. 4. supportedOrientations should be considered to be in order of preference. 5. setting supportedOrientations to a value that would preclude the current physical device orientation should trigger an immediate orientation change and subsequent change event. ex. // Device is currently in landscape left PhoneGap.supportedOrientations = [0,180]; // result : Native view reorients to Portrait and triggers orientation change event. Cheers, Jesse --20cf3079b74e77d9a004b0105880--