Change double tap toast to long toast.
Change toast count to static to cross all the windows. It should be --count instead of count--.
This commit is contained in:
@@ -195,7 +195,7 @@ public class WebSettings {
|
|||||||
static GoogleLocationSettingManager sGoogleLocationSettingManager;
|
static GoogleLocationSettingManager sGoogleLocationSettingManager;
|
||||||
|
|
||||||
// private WebSettings, not accessible by the host activity
|
// private WebSettings, not accessible by the host activity
|
||||||
private int mDoubleTapToastCount = 3;
|
static private int mDoubleTapToastCount = 3;
|
||||||
|
|
||||||
private static final String PREF_FILE = "WebViewSettings";
|
private static final String PREF_FILE = "WebViewSettings";
|
||||||
private static final String DOUBLE_TAP_TOAST_COUNT = "double_tap_toast_count";
|
private static final String DOUBLE_TAP_TOAST_COUNT = "double_tap_toast_count";
|
||||||
@@ -1357,8 +1357,10 @@ public class WebSettings {
|
|||||||
sGoogleLocationSettingManager.start();
|
sGoogleLocationSettingManager.start();
|
||||||
SharedPreferences sp = mContext.getSharedPreferences(PREF_FILE,
|
SharedPreferences sp = mContext.getSharedPreferences(PREF_FILE,
|
||||||
Context.MODE_PRIVATE);
|
Context.MODE_PRIVATE);
|
||||||
mDoubleTapToastCount = sp.getInt(DOUBLE_TAP_TOAST_COUNT,
|
if (mDoubleTapToastCount > 0) {
|
||||||
mDoubleTapToastCount);
|
mDoubleTapToastCount = sp.getInt(DOUBLE_TAP_TOAST_COUNT,
|
||||||
|
mDoubleTapToastCount);
|
||||||
|
}
|
||||||
nativeSync(frame.mNativeFrame);
|
nativeSync(frame.mNativeFrame);
|
||||||
mSyncPending = false;
|
mSyncPending = false;
|
||||||
mEventHandler.createHandler();
|
mEventHandler.createHandler();
|
||||||
|
|||||||
@@ -3772,10 +3772,10 @@ public class WebView extends AbsoluteLayout
|
|||||||
mZoomButtonsController.setVisible(true);
|
mZoomButtonsController.setVisible(true);
|
||||||
int count = settings.getDoubleTapToastCount();
|
int count = settings.getDoubleTapToastCount();
|
||||||
if (mInZoomOverview && count > 0) {
|
if (mInZoomOverview && count > 0) {
|
||||||
settings.setDoubleTapToastCount(count--);
|
settings.setDoubleTapToastCount(--count);
|
||||||
Toast.makeText(mContext,
|
Toast.makeText(mContext,
|
||||||
com.android.internal.R.string.double_tap_toast,
|
com.android.internal.R.string.double_tap_toast,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user