Fixed scrolling sensitivity in full-screen, fixed http auth dialog issue

This commit is contained in:
Anthony Restaino 2015-04-22 08:49:05 -04:00
parent 68a9b1de7e
commit 532860245d

View File

@ -60,17 +60,19 @@ public class LightningView {
private GestureDetector mGestureDetector; private GestureDetector mGestureDetector;
private Activity mActivity; private Activity mActivity;
private WebSettings mSettings; private WebSettings mSettings;
private static int API = android.os.Build.VERSION.SDK_INT;
private static String mHomepage; private static String mHomepage;
private static String mDefaultUserAgent; private static String mDefaultUserAgent;
private static Bitmap mWebpageBitmap; private static Bitmap mWebpageBitmap;
private static PreferenceManager mPreferences; private static PreferenceManager mPreferences;
private AdBlock mAdBlock; private AdBlock mAdBlock;
private boolean isForegroundTab;
private IntentUtils mIntentUtils; private IntentUtils mIntentUtils;
private Paint mPaint = new Paint(); private final Paint mPaint = new Paint();
private boolean isForegroundTab;
private boolean mTextReflow = false; private boolean mTextReflow = false;
private boolean mInvertPage = false; private boolean mInvertPage = false;
private static final int API = android.os.Build.VERSION.SDK_INT;
private static final int SCROLL_UP_THRESHOLD = Utils.convertDpToPixels(10);
private static final int SCROLL_DOWN_THRESHOLD = Utils.convertDpToPixels(100);
private static final float[] mNegativeColorArray = { -1.0f, 0, 0, 0, 255, // red private static final float[] mNegativeColorArray = { -1.0f, 0, 0, 0, 255, // red
0, -1.0f, 0, 0, 255, // green 0, -1.0f, 0, 0, 255, // green
0, 0, -1.0f, 0, 255, // blue 0, 0, -1.0f, 0, 255, // blue
@ -691,7 +693,9 @@ public class LightningView {
passLayout.addView(password); passLayout.addView(password);
name.setHint(mActivity.getString(R.string.hint_username)); name.setHint(mActivity.getString(R.string.hint_username));
name.setSingleLine();
password.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); password.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
password.setSingleLine();
password.setTransformationMethod(new PasswordTransformationMethod()); password.setTransformationMethod(new PasswordTransformationMethod());
password.setHint(mActivity.getString(R.string.hint_password)); password.setHint(mActivity.getString(R.string.hint_password));
builder.setTitle(mActivity.getString(R.string.title_sign_in)); builder.setTitle(mActivity.getString(R.string.title_sign_in));
@ -1043,10 +1047,9 @@ public class LightningView {
} }
private class TouchListener implements OnTouchListener { private class TouchListener implements OnTouchListener {
float mLocation; float mLocation;
float mY; float mY;
int mAction; int mAction;
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
@ -1060,13 +1063,13 @@ public class LightningView {
if (mAction == MotionEvent.ACTION_DOWN) { if (mAction == MotionEvent.ACTION_DOWN) {
mLocation = mY; mLocation = mY;
} else if (mAction == MotionEvent.ACTION_UP) { } else if (mAction == MotionEvent.ACTION_UP) {
if ((mY - mLocation) > 10) { if ((mY - mLocation) > SCROLL_DOWN_THRESHOLD) {
if (mWebView.getScrollY() != 0) { if (mWebView.getScrollY() != 0) {
mBrowserController.showActionBar(); mBrowserController.showActionBar();
} else { } else {
mBrowserController.toggleActionBar(); mBrowserController.toggleActionBar();
} }
} else if ((mY - mLocation) < -10) { } else if ((mY - mLocation) < -SCROLL_UP_THRESHOLD) {
mBrowserController.hideActionBar(); mBrowserController.hideActionBar();
} }
mLocation = 0; mLocation = 0;