JQuery Mobile Windows phone 8 fixed footer - android

I have a phonegap windows phone 8 app with jquery mobile for styling. I am using the fixed footer for navigation. The footer however floats a few pixels above from the bottom of the phone.
Ive completed the android/Ios version of the application. Im using Adobe Phonegap build to build my application. Android/IOS version is working perfectly. But now im trying to test the Windows Phone 8 version of the app and also i've tested in phone browsers as well its working perfectly in windows 8 phone,ios and android. but i build windows phone app (app.xap) and installed in windows phone and footer is not positioned as expected there is gap above from the bottom.
Please help me out. Any kinda help would be deeply appreciated. Thanks =)
<div data-role="page" data-theme="a" id="page_Login">
<div data-role="header" data-theme="a" class="okn_applicationTitleLogo">
<img src="Content/mobile/themes/default/images/logo.png" />
</div>
<div data-role="content" data-theme="a" id="loginpage" >
<div class="okn_contentContainer">
Login
<div data-role="fieldcontain" class="ui-hide-label">
<label for="txtLogin">Username</label>
<input type="email" name="txtLogin" id="txtLogin" data-bind="value: Username" placeholder="Username" />
</div>
<div data-role="fieldcontain" class="ui-hide-label">
<label for="txtPassword">Password</label>
<input type="password" name="txtPassword" id="txtPassword" data-bind="value: Password" placeholder="Password" />
</div>
<div data-role="fieldcontain">
<label>
<input type="checkbox" name="chkRememberLogin" data-bind="checked: RememberMe " />
Remember me</label>
</div>
</div>
<div data-role="footer" data-id="footer_Main" id="firstFooter" data-theme="a" >
<h4>© <span class="footer_copyrightYear">2000</span> <span class="footer_version"></span></h4>
</div>
</div>
</div>

change footer div like this:
<div data-role="footer" data-position="fixed" style="position: absolute">
Or you can add position absolute directly in your jquery mobile CSS if you prefer.

Related

cordova app with framework 7 css work different at various android devices

working on Cordova android application with framework 7, I create bottom bar as a music player, and top of the bottom bar add song progress bar.
To add progress bar div on the top position I use CSS property -position: absolute. its display fine at my device and many other devices I tested but some Android devices face some issue like song progress bar displayed middle of the bottom bar.
<div class="views pageview">
<div class="view view-main">
<div class="toolbar toolbar-bottom hidden-toolbar" id="buttomBar" style="opacity: 0;height: 80px;">
<div class="toolbar-inner">
<div class="myProgress2" id="myProgress2" style="background-color: grey; width:100%;position: absolute!important;">
<div id="myBar2" class="myBar2" style="width: 3%;height: 10px;background-color:#00bcd4;"></div>
</div>
<div class="list-block" id="songname" onclick="showToolbar();">
<a href="#" class=" size-30 item-link smart-select">
<select name="fruits" id="tracklistappend" onchange="getAudioUrl(this)">
</select>
<div class="item-content">
<img src="img/pula.jpg" width="70px" height="50px" id="trackimage">
<div class="item-inner">
<div class="item-title" id="trackNameNclipName"></div>
</div>
</div>
</a>
</div>
<span style="margin-left: 2px;" id="duration"></span>
<a onclick="playButton()" class="link size-50 left" id="play"><i class="fa fa-play-circle" aria-hidden="true"></i></a>
<a onclick="puseButton()" class="link size-50 left" id="pause"><i class="fa fa-pause-circle" aria-hidden="true"></i></a>
</div>
</div>
<div class="pages">
<div data-page="index" class="page no-navbar no-toolbar navbar-hidden toolbar-hidden hide-toolbar-on-scroll">
<div class="page-content landingpage">
<div class="content-block" style="height:60px;"></div>
<div class="logo main col12"> <img src="img/bplogo.png" alt=""> </div>
</div>
</div>
</div>
</div>
</div>
other android devices like Samsung j2 progress bar displayed like above
on my device progress bar displayed at the top
You need to set up a consistent code for each major change in webview.
Explore the user fragmentation per webview version in order to decide which support you're in need to give.
If you're on first version, try to refer to webview-supported html5 and CSS.

Android responsive UI webapp

I'm using bootstrap to make a responsive webapp.
I started doing some tests with a navbar and a form in my website, the problem is the navbar in android because is being rendered with full width (like a desktop view) and chrome (for android) shows a zoom and this is not the idea behind the responsive UI.
I also tried on my windows phone and it's rendering correctly, this happends with black berry mission tool for web develop wich emulates a tablet or mobile view.
So the problem now is android...
My code for the navbar is this:
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1">
<span class="sr-only"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'vetpet.views.index.showIndex' %}">Vetpet Alpha</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
Veterinarias <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li><span class="fa fa-plus" style="color:green"></span>Agregar Veterinaria</li>
<li><span class="fa fa-list " ></span>Listar</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
Do you use the bootstrap basic template?
http://getbootstrap.com/getting-started/#template
If not, make sure you use the correct viewport settings. Have a look at this page:
https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag
Also keep in mind that css calculations are not available in androids default browser before 4.4. But you can use a workaround for this (box-sizing, positive padding, negative margin).
And in case you didn't know, you can use chrome to simulate webkit mobile devices. This also includes touch screen simulation, sensors and so on although it is not a perfect simulation:
https://developers.google.com/web/fundamentals/tools/test/emulator

iScroll jumps to the bottom of the page and get stuck there when using JQM switch element on Android 2.x

I'm fighting against this bug over the weekend and I can't find a solution. My JQuery Mobile app has some switches. When testing on android 2.2 or 2.3 a strange bug happens: I scroll down a little to reach the switches then I trigger them with a swipe gesture and the page jumps to the bottom or even over the bottom. From then on it's not possible to scroll to the top of the page! Seems a like the scrollable area has redefined itself somehow.
I made a simple demo to show this behavior. Everything is out of the box. JQM, JQ, iScroll and iScrollview untouched and no own code.
Update
I just made an upgrade brunch on Github with JQM 1.3.2 - the switches are now working but a range slider doesen't ;/ Seems to be somethin with the slide event that triggers iscroll somehow.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>iScroll Jumpbug Demo</title>
<link rel="stylesheet" href="css/jquery.mobile-1.2.1.min.css"/>
<link rel="stylesheet" href="css/jquery.mobile.iscrollview.css" />
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery.mobile-1.2.1.min.js"></script>
<script src="js/iscroll.js"></script>
<script src="js/jquery.mobile.iscrollview.js"></script>
</head>
<body>
<!-- Home -->
<div data-role="page" data-theme="b" id="main">
<div data-role="header" data-id="persist" data-theme="b" data-position="fixed">
<h3>
iScroll Jumpbug Test
</h3>
</div>
<div data-role="content" data-iscroll="{"hScroll":false, "vScroll": true, "vScrollbar":false, "bounce":false, "snap": false, "momentum":false}" style="padding: 2,5%">
<ul data-role="listview" data-divider-theme="b" data-inset="true">
<li data-theme="b">
<a href="#" data-transition="slidefade">
Text
</a>
</li>
</ul>
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<ul data-role="listview" data-divider-theme="b" data-inset="true">
<li data-theme="b">Testelement1</li>
<li data-theme="b">Testelement2</li>
<li data-theme="b">Testelement3</li>
</ul>
<div style="width:100%; height: 3em;"> </div>
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<p>
This demo shows a bug that occures using JQM 1.2 and iScroll 4 with iScrollview on Android 2.x Devices.
When you drag the page a little down and then use the second swipe trigger, the page jumps to the bottom
over the border and "stucks" there - it's not more possible to scroll to the top. Looks a like the scrollable area redefines itself.
</p>
<!-- Test Form -->
<form>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="form_text">
Some Label
</label>
<textarea name="form_textarea" id="form_text" placeholder="Some fill element">
</textarea>
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="toggleswitch1">
Switch me #1
</label>
<select name="form_mailinglist" id="toggleswitch1" data-theme="" data-role="slider">
<option value="0">
no
</option>
<option value="1">
yes
</option>
</select>
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="toggleswitch2">
Switch me #2
</label>
<select name="form_mailinglist2" id="toggleswitch2" data-theme="" data-role="slider">
<option value="0">
no
</option>
<option value="1">
yes
</option>
</select>
</fieldset>
</div>
</form>
<!-- Linebreaks meant to make the scrollable area longer for testing purposes -->
<p>
<br/>
1
<br/>
2
<br/>
3
<br/>
4
<br/>
5
<br/>
6
<br/>
7
<br/>
8
<br/>
9
<br/>
10
<br/>
11
<br/>
12
<br/>
13
<br/>
14
<br/>
15
<br/>
16
<br/>
17
<br/>
18
<br/>
19
<br/>
20
<br/>
21
<br/>
22
<br/>
23
<br/>
24
<br/>
25
<br/>
26
<br/>
27
<br/>
28
<br/>
29
<br/>
30
</p>
<div> Wellcome to the bottom dude!</div>
</div> <!-- End of the content -->
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Footer >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<div data-role="footer" data-id="persist" data-iconpos="top" data-position="fixed" data-theme="b">
<div data-role="navbar">
<ul>
<li>
Test
</li>
<li>
Test2
</li>
</ul>
</div>
</div>
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
</div> <!-- End of the page -->
</body>
</html>
You can find the demo on GitHub:
https://github.com/Hexodus/iScroll_Jumpbug
There is even the apk file when you like to take a quick glance (your phone should be Android 2.2 or 2.3):
Or you can quickly install it via QR code:
By the way - I really can't replicate this bug on jsfiddle because it doesen't happen there. Jsfiddle is changing something so the page is not even shown correctly.
I badly need your assistance folks.

Image in JQueryMobile

I want to have a 2-column layout in a JQM page. The first column will be an image, and the second column will be some text.
<div data-role="content">
<div class="ui-grid-a">
<img class="ui-block-a" src="/image/no-picture.jpg"/>
<div class="ui-block-b">
<h1>Some Text Here</h1>
</div>
</div>
</div>
I tried to set max-width, it works in a browser, but didn't work in android webview. What is the best way to do this?
Thanks
This is a working example. I have tested it on Galaxy S3 andr. 4.1
<div class="ui-grid-a">
<div class="ui-block-a">
<img src="http://www.index.hr/thumbnail.ashx?path=images2/europskimljekari_AFP26112012.jpg&width=325&height=197"/>
</div>
<div class="ui-block-b">
<h1>Some Text Here</h1>
</div>
</div>
Give me a comment if you wanted something else. Also dont forget to use this in your header:
<meta content="width=device-width, minimum-scale=1, maximum-scale=2" name="viewport">

Can't edit input type="text" or textarea with Cordova 1.9.0 and Android Jelly Bean

I just got my shiny new Nexus 7 and was playing around with Cordova (Phonegap). I created a simple page with a couple of text input fields and a text area. On my iPhone I can click the text fields and the keyboard comes up and I can edit the text. On my Nexus 7 running 4.1.1 Jelly Bean with Cordova 1.9.0, the keyboard comes up but when you type nothing shows up in the text field or text area.
I'm pretty sure my code is fine since it works on the iPhone and Android 2.3.5, but here is the snippet in question just in case:
<body onload="onBodyLoad()">
<div data-role="page" id="mainpage">
<div data-role="header" data-theme="a">
<h2>Lightweight</h2>
</div>
<div data-role="content">
<div>
<a href="#" data-role="button" data-icon="check" data-iconpos="bottom" data-theme="b" onClick=onClickInterrogate()>Interrogate</a>
</div>
<div align="center">
<a href="#" data-role="button" data-inline="true" data-icon="forward" data-theme="b" onClick=downloadFile()>Send</a>
<a href="#" data-role="button" data-inline="true" data-icon="gear" data-iconpos="right" data-theme="b" onClick=onClickSettings()>Settings</a>
</div>
<div align="center">
<label for="serverUrl">Server URL:</label>
<input type="text" name="name" id="serverUrl" value="urlGoesHere"/>
<label for="zipFile">Zip File:</label>
<input type="text" name="name" id="zipFile" value="tran1.zip"/>
</div>
<div data-role="fieldcontain">
<label for="textarea">Textarea:</label>
<textarea name="textarea" id="textarea">urlGoesHere</textarea>
</div>
</div>
<div data-role="footer">
<h1> © 2012 Company Name </h1>
</div>
</div>
I just tried this on Android 2.3.5 and it works fine. Anyone experienced something similar?
The issue persists in 2.1.0 as well.
Here's how I got it fixed.
Remove the following CSS rule and you can type happily in the input elements.
-webkit-user-select: none;
Phonegap just released 2.0. It has fixed the issue with the keyboard.
I must use my application with browser too and there is the same problem. It's possible fix this on textarea only:
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
}
textarea
{
-webkit-user-select: auto !important;
}
it works with jquery mobile too.
-webkit-user-select: none;
that did the trick for me. I was completely lost for couple of hours trying variations of input field parameters, nothing else worked. (phonegap 2.5.0 / android 4.1.1)

Categories

Resources