From a70594058166ffef93ad5fad8ab6d64b2b8e230f Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 6 Dec 2013 10:34:37 -0600 Subject: [PATCH] Fixed #273 - android specific title sizes --- dist/css/ionic.css | 13 +++++++++++-- dist/js/ionic.js | 30 +++++++++++++++++++++++++++--- js/ext/angular/test/tabs.html | 2 +- js/utils/platform.js | 30 +++++++++++++++++++++++++++--- scss/_bar.scss | 4 ++-- scss/_platform.scss | 22 ++++++++++++++++++++++ 6 files changed, 90 insertions(+), 11 deletions(-) diff --git a/dist/css/ionic.css b/dist/css/ionic.css index b53018083c..6a1e6502dc 100644 --- a/dist/css/ionic.css +++ b/dist/css/ionic.css @@ -2823,7 +2823,6 @@ a.subdued { padding: 0 8px; min-width: initial; min-height: 31px; - height: 32px; font-size: 12px; line-height: 30px; } .bar .button .icon, .bar .button.icon:before, .bar .button.icon-left:before, .bar .button.icon-right:before { @@ -2839,7 +2838,6 @@ a.subdued { padding-left: 2px; } .bar .button-bar > .button, .bar .buttons > .button { min-height: 31px; - height: 32px; line-height: 30px; } .bar .button-bar + .button, .bar .button + .button-bar { margin-left: 5px; } @@ -6120,3 +6118,14 @@ a.button { top: 64px; } .platform-ios7 .has-subheader { top: 108px; } + +.platform-android .bar-header { + height: 48px; } +.platform-android .has-header { + top: 56px; } +.platform-android .bar-subheader { + top: 48px; } +.platform-android .has-subheader { + top: 96px; } +.platform-android .title { + line-height: 48px; } diff --git a/dist/js/ionic.js b/dist/js/ionic.js index 47ed032328..c22f1bce4e 100644 --- a/dist/js/ionic.js +++ b/dist/js/ionic.js @@ -1736,10 +1736,19 @@ window.ionic = { this._checkPlatforms(platforms); - for(var i = 0; i < platforms.length; i++) { - document.body.classList.add('platform-' + platforms[i]); - } + var classify = function() { + if(!document.body) { return; } + for(var i = 0; i < platforms.length; i++) { + document.body.classList.add('platform-' + platforms[i]); + } + }; + + document.addEventListener( "DOMContentLoaded", function(){ + classify(); + }); + + classify(); }, _checkPlatforms: function(platforms) { if(this.isCordova()) { @@ -1748,6 +1757,12 @@ window.ionic = { if(this.isIOS7()) { platforms.push('ios7'); } + if(this.isIPad()) { + platforms.push('ipad'); + } + if(this.isAndroid()) { + platforms.push('android'); + } }, // Check if we are running in Cordova, which will have @@ -1757,11 +1772,20 @@ window.ionic = { //&& /^file:\/{3}[^\/]/i.test(window.location.href) //&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent); }, + isIPad: function() { + return navigator.userAgent.toLowerCase().indexOf('ipad') >= 0; + }, isIOS7: function() { if(!window.device) { return false; } return parseFloat(window.device.version) >= 7.0; + }, + isAndroid: function() { + if(!window.device) { + return navigator.userAgent.toLowerCase().indexOf('android') >= 0; + } + return device.platform === "Android"; } }; diff --git a/js/ext/angular/test/tabs.html b/js/ext/angular/test/tabs.html index 415401af92..606781d054 100644 --- a/js/ext/angular/test/tabs.html +++ b/js/ext/angular/test/tabs.html @@ -60,7 +60,7 @@
- +

Tasks

diff --git a/js/utils/platform.js b/js/utils/platform.js index 55717caaf9..19fa62d6ee 100644 --- a/js/utils/platform.js +++ b/js/utils/platform.js @@ -6,10 +6,19 @@ this._checkPlatforms(platforms); - for(var i = 0; i < platforms.length; i++) { - document.body.classList.add('platform-' + platforms[i]); - } + var classify = function() { + if(!document.body) { return; } + for(var i = 0; i < platforms.length; i++) { + document.body.classList.add('platform-' + platforms[i]); + } + }; + + document.addEventListener( "DOMContentLoaded", function(){ + classify(); + }); + + classify(); }, _checkPlatforms: function(platforms) { if(this.isCordova()) { @@ -18,6 +27,12 @@ if(this.isIOS7()) { platforms.push('ios7'); } + if(this.isIPad()) { + platforms.push('ipad'); + } + if(this.isAndroid()) { + platforms.push('android'); + } }, // Check if we are running in Cordova, which will have @@ -27,11 +42,20 @@ //&& /^file:\/{3}[^\/]/i.test(window.location.href) //&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent); }, + isIPad: function() { + return navigator.userAgent.toLowerCase().indexOf('ipad') >= 0; + }, isIOS7: function() { if(!window.device) { return false; } return parseFloat(window.device.version) >= 7.0; + }, + isAndroid: function() { + if(!window.device) { + return navigator.userAgent.toLowerCase().indexOf('android') >= 0; + } + return device.platform === "Android"; } }; diff --git a/scss/_bar.scss b/scss/_bar.scss index c8bdc2429e..bf01effe2a 100644 --- a/scss/_bar.scss +++ b/scss/_bar.scss @@ -132,7 +132,7 @@ padding: 0 $button-bar-button-padding; min-width: initial; min-height: $button-bar-button-height - 1; - height: $button-bar-button-height; + //height: $button-bar-button-height; font-size: $button-bar-button-font-size; line-height: $button-bar-button-height - $button-border-width - 1; @@ -163,7 +163,7 @@ .button-bar > .button, .buttons > .button { min-height: $button-bar-button-height - 1; - height: $button-bar-button-height; + //height: $button-bar-button-height; line-height: $button-bar-button-height - 2; } diff --git a/scss/_platform.scss b/scss/_platform.scss index 1fcc3a3a7b..8d7d1b5cdb 100644 --- a/scss/_platform.scss +++ b/scss/_platform.scss @@ -25,3 +25,25 @@ top: 108px; } } + +.platform-android { + .bar-header { + height: 48px; + } + + .has-header { + top: 56px; + } + + .bar-subheader { + top: 48px; + } + + .has-subheader { + top: 96px; + } + + .title { + line-height: 48px; + } +}