Bug Fixes for rouge Android versions/OEMs that don't behave correctly
This commit is contained in:
parent
9ffeecc584
commit
43950d4f71
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="acr.browser.lightning"
|
package="acr.browser.lightning"
|
||||||
android:versionCode="69"
|
android:versionCode="70"
|
||||||
android:versionName="4.0.1a" >
|
android:versionName="4.0.2a" >
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
|
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
|
||||||
|
@ -61,7 +61,7 @@ public class AnimatedProgressBar extends LinearLayout {
|
|||||||
* @param attrs is the attribute set passed by the constructor
|
* @param attrs is the attribute set passed by the constructor
|
||||||
*/
|
*/
|
||||||
private void init(final Context context, AttributeSet attrs) {
|
private void init(final Context context, AttributeSet attrs) {
|
||||||
|
this.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||||
TypedArray array = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AnimatedProgressBar, 0, 0);
|
TypedArray array = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AnimatedProgressBar, 0, 0);
|
||||||
int backgroundColor;
|
int backgroundColor;
|
||||||
int progressColor;
|
int progressColor;
|
||||||
|
@ -1185,7 +1185,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void newTab(String url, boolean show) {
|
protected synchronized boolean newTab(String url, boolean show) {
|
||||||
mIsNewIntent = false;
|
mIsNewIntent = false;
|
||||||
LightningView startingTab = new LightningView(mActivity, url);
|
LightningView startingTab = new LightningView(mActivity, url);
|
||||||
if (mIdGenerator == 0) {
|
if (mIdGenerator == 0) {
|
||||||
@ -1199,6 +1199,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
mDrawerListLeft.setItemChecked(mWebViews.size() - 1, true);
|
mDrawerListLeft.setItemChecked(mWebViews.size() - 1, true);
|
||||||
showTab(startingTab);
|
showTab(startingTab);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void deleteTab(int position) {
|
private synchronized void deleteTab(int position) {
|
||||||
@ -1594,7 +1595,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
filter = new ColorMatrixColorFilter(colorMatrix);
|
filter = new ColorMatrixColorFilter(colorMatrix);
|
||||||
paint.setColorFilter(filter);
|
paint.setColorFilter(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.drawBitmap(favicon, 0, 0, paint);
|
c.drawBitmap(favicon, 0, 0, paint);
|
||||||
holder.favicon.setImageBitmap(grayscaleBitmap);
|
holder.favicon.setImageBitmap(grayscaleBitmap);
|
||||||
}
|
}
|
||||||
@ -2064,8 +2065,8 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
Message click = mClickHandler.obtainMessage();
|
Message click = mClickHandler.obtainMessage();
|
||||||
if (click != null) {
|
if (click != null) {
|
||||||
click.setTarget(mClickHandler);
|
click.setTarget(mClickHandler);
|
||||||
|
mCurrentView.getWebView().requestFocusNodeHref(click);
|
||||||
}
|
}
|
||||||
mCurrentView.getWebView().requestFocusNodeHref(click);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -2077,7 +2078,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
callback.onCustomViewHidden();
|
callback.onCustomViewHidden();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
view.setKeepScreenOn(true);
|
try{
|
||||||
|
view.setKeepScreenOn(true);
|
||||||
|
} catch (SecurityException e){
|
||||||
|
Log.e(Constants.TAG, "WebView is not allowed to keep the screen on");
|
||||||
|
}
|
||||||
mOriginalOrientation = getRequestedOrientation();
|
mOriginalOrientation = getRequestedOrientation();
|
||||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||||
mFullscreenContainer = new FullscreenHolder(this);
|
mFullscreenContainer = new FullscreenHolder(this);
|
||||||
@ -2103,7 +2108,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
}
|
}
|
||||||
Log.d(Constants.TAG, "onHideCustomView");
|
Log.d(Constants.TAG, "onHideCustomView");
|
||||||
mCurrentView.setVisibility(View.VISIBLE);
|
mCurrentView.setVisibility(View.VISIBLE);
|
||||||
mCustomView.setKeepScreenOn(false);
|
try{
|
||||||
|
mCustomView.setKeepScreenOn(false);
|
||||||
|
} catch (SecurityException e){
|
||||||
|
Log.e(Constants.TAG, "WebView is not allowed to keep the screen on");
|
||||||
|
}
|
||||||
setFullscreen(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false));
|
setFullscreen(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false));
|
||||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||||
if (decor != null) {
|
if (decor != null) {
|
||||||
@ -2217,10 +2226,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
|||||||
if (resultMsg == null) {
|
if (resultMsg == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newTab("", true);
|
if (newTab("", true)) {
|
||||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||||
transport.setWebView(mCurrentView.getWebView());
|
transport.setWebView(mCurrentView.getWebView());
|
||||||
resultMsg.sendToTarget();
|
resultMsg.sendToTarget();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -329,7 +329,13 @@ public class LightningView {
|
|||||||
mTextReflow = true;
|
mTextReflow = true;
|
||||||
mSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
|
mSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
|
||||||
if (API >= android.os.Build.VERSION_CODES.KITKAT) {
|
if (API >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||||
mSettings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING);
|
try {
|
||||||
|
mSettings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// This shouldn't be necessary, but there are a number
|
||||||
|
// of KitKat devices that crash trying to set this
|
||||||
|
Log.e(Constants.TAG, "Problem setting LayoutAlgorithm to TEXT_AUTOSIZING");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mTextReflow = false;
|
mTextReflow = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user