Compare commits
5 Commits
db09ca5d79
...
730475b021
Author | SHA1 | Date |
---|---|---|
|
730475b021 | 6 years ago |
|
2b3fc3b10f | 6 years ago |
|
c33d0bf3c7 | 6 years ago |
|
2b583cff1c | 6 years ago |
|
af215378a8 | 6 years ago |
@ -0,0 +1,40 @@ |
|||||||
|
package com.android.base.widget.compat; |
||||||
|
|
||||||
|
import android.annotation.TargetApi; |
||||||
|
import android.content.Context; |
||||||
|
import android.content.res.Configuration; |
||||||
|
import android.os.Build; |
||||||
|
import android.util.AttributeSet; |
||||||
|
import android.webkit.WebView; |
||||||
|
|
||||||
|
/** |
||||||
|
* @see <a href='https://stackoverflow.com/questions/41025200/android-view-inflateexception-error-inflating-class-android-webkit-webview'>android-view-inflateexception-error-inflating-class-android-webkit-webview</a>
|
||||||
|
*/ |
||||||
|
public class LollipopFixedWebView extends WebView { |
||||||
|
|
||||||
|
public LollipopFixedWebView(Context context) { |
||||||
|
super(getFixedContext(context)); |
||||||
|
} |
||||||
|
|
||||||
|
public LollipopFixedWebView(Context context, AttributeSet attrs) { |
||||||
|
super(getFixedContext(context), attrs); |
||||||
|
} |
||||||
|
|
||||||
|
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr) { |
||||||
|
super(getFixedContext(context), attrs, defStyleAttr); |
||||||
|
} |
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP) |
||||||
|
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { |
||||||
|
super(getFixedContext(context), attrs, defStyleAttr, defStyleRes); |
||||||
|
} |
||||||
|
|
||||||
|
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, boolean privateBrowsing) { |
||||||
|
super(getFixedContext(context), attrs, defStyleAttr, privateBrowsing); |
||||||
|
} |
||||||
|
|
||||||
|
public static Context getFixedContext(Context context) { |
||||||
|
return context.createConfigurationContext(new Configuration()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ExtraTranslation"> |
||||||
|
|
||||||
|
<string name="ucrop_rotate" tools:ignore="PrivateResource">旋转</string> |
||||||
|
<string name="ucrop_scale" tools:ignore="PrivateResource">缩放</string> |
||||||
|
<string name="ucrop_crop" tools:ignore="PrivateResource">裁剪</string> |
||||||
|
|
||||||
|
</resources> |
Loading…
Reference in new issue