From fa969561e28a5e7d7ae67c3e559212293002368f Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 15:42:16 +0200 Subject: [PATCH 1/3] Hide tab(s) if only one tab visible --- .../com/cradle/iitc_mobile/share/ShareActivity.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java index aeec04cc..9e23bb50 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java @@ -103,7 +103,6 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList mFragmentAdapter = new IntentFragmentAdapter(getSupportFragmentManager()); final ActionBar actionBar = getActionBar(); - actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setDisplayHomeAsUpEnabled(true); Intent intent = getIntent(); @@ -126,7 +125,8 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { - actionBar.setSelectedNavigationItem(position); + if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) + actionBar.setSelectedNavigationItem(position); setSelected(position); } }); @@ -141,11 +141,15 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList .setTabListener(this)); } + if (mFragmentAdapter.getCount() > 1) + actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); + mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); int selected = mSharedPrefs.getInt("pref_share_selected_tab", 0); if (selected < mFragmentAdapter.getCount()) { mViewPager.setCurrentItem(selected); - actionBar.setSelectedNavigationItem(selected); + if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) + actionBar.setSelectedNavigationItem(selected); } } From d0408d1f49bee1973b16cc29643f369a2c2c0cb0 Mon Sep 17 00:00:00 2001 From: fkloft Date: Thu, 17 Oct 2013 00:20:54 +0200 Subject: [PATCH 2/3] Remove any tooltip on pane change (there is no JS event triggered that would remove the tooltip when the action comes from Android) --- code/panes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/code/panes.js b/code/panes.js index 8ab4610e..7470b44b 100644 --- a/code/panes.js +++ b/code/panes.js @@ -39,4 +39,5 @@ window.hideall = function() { $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); $('#farm_level_select').hide(); $('#map').css('visibility', 'hidden'); + $('.ui-tooltip').remove(); } From 3b6533c7dcedd72de15cbb4e3b55bffa510db756 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Thu, 17 Oct 2013 00:59:22 +0200 Subject: [PATCH 3/3] - disable all map properties when switching to another pane - bumped mobile version number --- code/panes.js | 24 +++++++++++++++++++++++- mobile/AndroidManifest.xml | 4 ++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/code/panes.js b/code/panes.js index 7470b44b..5fd037fe 100644 --- a/code/panes.js +++ b/code/panes.js @@ -1,10 +1,17 @@ // created to start cleaning up "window" interaction // window.show = function(id) { - window.hideall(); if (typeof android !== 'undefined' && android && android.switchToPane) { android.switchToPane(id); } + /* + * disable all map properties when switching to another pane + * because sometimes (bug?) touch events are passed to the map when + * other panes are focussed + */ + window.disableMapProperties(); + window.hideall(); + switch(id) { case 'full': window.chat.show('full'); @@ -22,6 +29,7 @@ window.show = function(id) { window.debug.console.show(); break; case 'map': + window.enableMapProperties(); window.smartphone.mapButton.click(); $('#portal_highlight_select').show(); $('#farm_level_select').show(); @@ -35,6 +43,20 @@ window.show = function(id) { } } +window.enableMapProperties = function() { + window.map.tap.enable(); + window.map.dragging.enable(); + window.map.touchZoom.enable(); + window.map.doubleClickZoom.enable(); +} + +window.disableMapProperties = function() { + window.map.tap.disable(); + window.map.dragging.disable(); + window.map.touchZoom.disable(); + window.map.doubleClickZoom.disable(); +} + window.hideall = function() { $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); $('#farm_level_select').hide(); diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index 9416f52f..bfe5e003 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="55" + android:versionName="0.7.5">