优化显示逻辑

This commit is contained in:
wangcongtao
2021-03-17 14:03:34 +08:00
parent 610e7d56cf
commit 16145c5586
8 changed files with 173 additions and 93 deletions

View File

@@ -19,13 +19,13 @@ public
*/
abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportable {
protected volatile static Class< ? > mTargetClazz;
protected Class< ? > mTargetClazz;
protected Object mDelegate;
protected volatile static Method sMethodApplySkin;
protected volatile static Method sMethodLoadFromAttributes;
private static Constructor sConstructor;
protected Method sMethodApplySkin;
protected Method sMethodLoadFromAttributes;
private Constructor sConstructor;
private static boolean sIsSupport = false;
private boolean sIsSupport = false;
public MogoSkinCompatHelperDelegate( View view ) {
loadClazz();
@@ -68,7 +68,7 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
protected abstract String getDelegateClazzName();
@Keep
protected static Method getLoadFromAttributesMethod() throws Exception {
protected Method getLoadFromAttributesMethod() throws Exception {
if ( mTargetClazz != null ) {
sMethodLoadFromAttributes = mTargetClazz.getDeclaredMethod( "loadFromAttributes", AttributeSet.class, int.class );
sMethodLoadFromAttributes.setAccessible( true );
@@ -77,7 +77,7 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
}
@Keep
private static Method getApplySkinMethod() throws Exception {
private Method getApplySkinMethod() throws Exception {
if ( mTargetClazz != null ) {
sMethodApplySkin = mTargetClazz.getDeclaredMethod( "applySkin" );
sMethodApplySkin.setAccessible( true );
@@ -112,7 +112,7 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
}
}
public static boolean isSupport() {
public boolean isSupport() {
return sIsSupport;
}
}