summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrizzoli <joey@cyanogenmoditalia.it>2016-05-01 22:31:14 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-10 10:08:48 -0700
commit7324f6eb40a50d59f71ca148274c01416fd5b701 (patch)
treee0b097e96497e3e3d765fe8d0cf010a0c30c0e83
parent4ec3df1ab97dae49d7994515930ec3a91ef31781 (diff)
downloadandroid_packages_apps_Gello-7324f6eb40a50d59f71ca148274c01416fd5b701.tar.gz
android_packages_apps_Gello-7324f6eb40a50d59f71ca148274c01416fd5b701.tar.bz2
android_packages_apps_Gello-7324f6eb40a50d59f71ca148274c01416fd5b701.zip
Gello: swipe on navbar
swipe down from tabs icon to see all open tabs or from menu icon to open menu like chrome does Change-Id: I0bf2e9936b07ea85af2231a900bb083d6525aa5f Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
-rw-r--r--src/com/android/browser/NavigationBarBase.java19
-rw-r--r--src/com/android/browser/NavigationBarPhone.java11
2 files changed, 26 insertions, 4 deletions
diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java
index 246235aa..248f57f2 100644
--- a/src/com/android/browser/NavigationBarBase.java
+++ b/src/com/android/browser/NavigationBarBase.java
@@ -40,6 +40,7 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
@@ -135,6 +136,16 @@ public class NavigationBarBase extends LinearLayout implements
mDefaultFavicon = BitmapFactory.decodeResource(getResources(),
R.drawable.ic_deco_favicon_normal);
+ mMore.setOnTouchListener(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ showMenu(mMore);
+ }
+ return true;
+ }
+ });
+
mHandler = new Handler() {
@Override
public void handleMessage(Message m) {
@@ -360,12 +371,12 @@ public class NavigationBarBase extends LinearLayout implements
url = currentTab.getUrl();
}
- if (mMore == v) {
- showMenu(mMore);
- } else if (mFaviconTile == v) {
- if (urlHasSitePrefs(url) && (wv != null && !wv.isShowingInterstitialPage()) ){
+ if (mFaviconTile == v) {
+ if (urlHasSitePrefs(url) && (wv != null && !wv.isShowingInterstitialPage())) {
showSiteSpecificSettings();
}
+ } else if (mMore == v) {
+ showMenu(mMore);
} else if (mVoiceButton == v) {
mUiController.startVoiceRecognizer();
} else if (mStopButton == v) {
diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/browser/NavigationBarPhone.java
index 5fa093be..9abc3569 100644
--- a/src/com/android/browser/NavigationBarPhone.java
+++ b/src/com/android/browser/NavigationBarPhone.java
@@ -18,6 +18,7 @@ package com.android.browser;
import android.content.Context;
import android.util.AttributeSet;
import android.util.TypedValue;
+import android.view.MotionEvent;
import android.view.View;
import org.codeaurora.swe.util.Activator;
@@ -57,6 +58,16 @@ public class NavigationBarPhone extends NavigationBarBase implements StateListen
mUrlInput.setStateListener(this);
mIncognitoIcon = findViewById(R.id.incognito_icon);
+ mTabSwitcher.setOnTouchListener(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ ((PhoneUi) mBaseUi).toggleNavScreen();
+ }
+ return true;
+ }
+ });
+
if (mTabSwitcherInitialTextSize == 0) {
mTabSwitcherInitialTextSize = mTabText.getTextSize();
mTabSwitcherCompressedTextSize = (float) (mTabSwitcherInitialTextSize / 1.2);