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"
|
||||
package="acr.browser.lightning"
|
||||
android:versionCode="69"
|
||||
android:versionName="4.0.1a" >
|
||||
android:versionCode="70"
|
||||
android:versionName="4.0.2a" >
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<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
|
||||
*/
|
||||
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);
|
||||
int backgroundColor;
|
||||
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;
|
||||
LightningView startingTab = new LightningView(mActivity, url);
|
||||
if (mIdGenerator == 0) {
|
||||
@ -1199,6 +1199,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
mDrawerListLeft.setItemChecked(mWebViews.size() - 1, true);
|
||||
showTab(startingTab);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private synchronized void deleteTab(int position) {
|
||||
@ -2064,9 +2065,9 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
Message click = mClickHandler.obtainMessage();
|
||||
if (click != null) {
|
||||
click.setTarget(mClickHandler);
|
||||
}
|
||||
mCurrentView.getWebView().requestFocusNodeHref(click);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowCustomView(View view, int requestedOrientation, CustomViewCallback callback) {
|
||||
@ -2077,7 +2078,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
callback.onCustomViewHidden();
|
||||
return;
|
||||
}
|
||||
try{
|
||||
view.setKeepScreenOn(true);
|
||||
} catch (SecurityException e){
|
||||
Log.e(Constants.TAG, "WebView is not allowed to keep the screen on");
|
||||
}
|
||||
mOriginalOrientation = getRequestedOrientation();
|
||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||
mFullscreenContainer = new FullscreenHolder(this);
|
||||
@ -2103,7 +2108,11 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
}
|
||||
Log.d(Constants.TAG, "onHideCustomView");
|
||||
mCurrentView.setVisibility(View.VISIBLE);
|
||||
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));
|
||||
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
||||
if (decor != null) {
|
||||
@ -2217,11 +2226,12 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
if (resultMsg == null) {
|
||||
return;
|
||||
}
|
||||
newTab("", true);
|
||||
if (newTab("", true)) {
|
||||
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
||||
transport.setWebView(mCurrentView.getWebView());
|
||||
resultMsg.sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
|
@ -329,7 +329,13 @@ public class LightningView {
|
||||
mTextReflow = true;
|
||||
mSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
|
||||
if (API >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||
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 {
|
||||
mTextReflow = false;
|
||||
|
Loading…
Reference in New Issue
Block a user