0
Welcome Guest! Login
0 items Join Now

Android browser orientation problem

    • Reneskou's Avatar
    • Reneskou
    • Newbie
    • Posts: 1
    • Thanks: 0
    • Android Developer

    Android browser orientation problem

    Posted 13 years 10 months ago
    • Hi all

      Today i was doing mobile optimization for android browser for a client when i discovered a problem. When you first open the browser or reload the page, the javascript function "orient()" in the index-android.php file is not called.

      Because this function is not called, the css class is not added and the styling is bad. The way i solved it was to use Jquery's document.ready method and call the function.

      Some info:
      Gantry version 3.2.5
      Joomla version 1.6.3
      Testet on Samsung Galaxy s with android 2.3.3
      also used firefox user agent plugin to test for android version 2.1 and 2.2
    • "A critical ability in OO development is to skillfully assign responsibilities to software objects."
  • Re: Android browser orientation problem

    Posted 13 years 3 months ago
    • Thank you so much for this. I was having a horrible time with the Android mobile template for the free gantry Joomla! template available at www.gantry-framework.org .

      Additional search text: Android portrait issue, android gantry portrait, android portrait (I used these and found nothing)
      Today i was doing mobile optimization for android browser for a client when i discovered a problem. When you first open the browser or reload the page, the javascript function "orient()" in the index-android.php file is not called.

      Because this function is not called, the css class is not added and the styling is bad. The way i solved it was to use Jquery's document.ready method and call the function.
      This was the fix for sure!

      Navigate to /libraries/gantry/tmpl/index-android.php

      Add the following:

      1) After the the opening head tag add:
      <script type="text/javascript" src=" code.jquery.com/jquery-1.6.4.min.js "></script>

      2) Replace line 48 "window.addEvent('domready', function() {" with the following:
      $(document).ready(function(){

      all done!
    • I am a mobile web presence expert working in Canada.
      Work: www.nextgen-pc.com
      Play: www.gounce.com
  • Re: Android browser orientation problem

    Posted 13 years 2 months ago
    • This does not seem to work for Android 4 (Ice Cream Sandwich).
      However, I do not have the directory structure you mentioned:
      /libraries/gantry/tmpl/index-android.php

      and instead modified the index-android.php file found in:
      components/com_gantry/tmpl

      Also tried modifying the index-android.php file found in the primary template directory

      Joomla 1.5.25 and Gantry v3.1.18
    • Wes Odom's Avatar
    • Wes Odom
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    Re: Android browser orientation problem

    Posted 12 years 10 months ago
    • I have applied this fix to templates/rt_tachyon/index-android.php (Joomla 2.5, latest release of Tachyon) and it did fix the orientation issue, however it appears to now break the main menu. It will not slide back and forth anymore on some Android mobile devices. I don't know if the new JS code is clashing with it or what, but I would appreciate any input or support on this issue, as our client's mobile site is very overdue and we are a bit stuck now. The website address is narme.trythiswebsite.com.

Time to create page: 0.075 seconds