业务开发

This commit is contained in:
wangcongtao
2020-09-03 20:50:34 +08:00
parent 3f87ef2974
commit 26a8d66ca6
19 changed files with 118 additions and 40 deletions

View File

@@ -160,7 +160,7 @@ targetSdkVersion : 22,
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
adasapi : "com.zhidao.autopilot.support:adas:1.0.1",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.0.5",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.0.6",
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F710121E"/>
<corners android:radius="@dimen/module_push_panel_corner"/>
<solid android:color="#F710121E" />
<corners android:radius="@dimen/module_push_panel_corner" />
</shape>

View File

@@ -87,9 +87,9 @@
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
<dimen name="module_push_panel_marginTop">16px</dimen>
<dimen name="module_push_panel_marginBottom">16px</dimen>
<dimen name="module_push_panel_marginRight">16px</dimen>
<dimen name="module_push_panel_marginTop">8px</dimen>
<dimen name="module_push_panel_marginBottom">8px</dimen>
<dimen name="module_push_panel_marginRight">8px</dimen>
<dimen name="module_push_panel_paddingLeft">28px</dimen>
<dimen name="module_push_panel_paddingBottom">16px</dimen>
<dimen name="module_push_panel_corner">16px</dimen>
@@ -97,4 +97,5 @@
<dimen name="module_push_item_time_textSize">5px</dimen>
<dimen name="module_push_item_image_width">118px</dimen>
<dimen name="module_push_item_image_height">86px</dimen>
<dimen name="module_push_panel_bkg_padding">8px</dimen>
</resources>

View File

@@ -87,9 +87,9 @@
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
<dimen name="module_push_panel_marginTop">16px</dimen>
<dimen name="module_push_panel_marginBottom">16px</dimen>
<dimen name="module_push_panel_marginRight">16px</dimen>
<dimen name="module_push_panel_marginTop">8px</dimen>
<dimen name="module_push_panel_marginBottom">8px</dimen>
<dimen name="module_push_panel_marginRight">8px</dimen>
<dimen name="module_push_panel_paddingLeft">28px</dimen>
<dimen name="module_push_panel_paddingBottom">16px</dimen>
<dimen name="module_push_panel_corner">16px</dimen>
@@ -97,4 +97,5 @@
<dimen name="module_push_item_time_textSize">5px</dimen>
<dimen name="module_push_item_image_width">118px</dimen>
<dimen name="module_push_item_image_height">86px</dimen>
<dimen name="module_push_panel_bkg_padding">8px</dimen>
</resources>

View File

@@ -87,9 +87,9 @@
<dimen name="module_push_item_minHeight_vertical">618px</dimen>
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
<dimen name="module_push_content_paddingBottom_vertical">120px</dimen>
<dimen name="module_push_panel_marginTop">30px</dimen>
<dimen name="module_push_panel_marginBottom">30px</dimen>
<dimen name="module_push_panel_marginRight">30px</dimen>
<dimen name="module_push_panel_marginTop">20px</dimen>
<dimen name="module_push_panel_marginBottom">20px</dimen>
<dimen name="module_push_panel_marginRight">20px</dimen>
<dimen name="module_push_panel_paddingLeft">50px</dimen>
<dimen name="module_push_panel_paddingBottom">28px</dimen>
<dimen name="module_push_panel_corner">29px</dimen>
@@ -97,4 +97,5 @@
<dimen name="module_push_item_time_textSize">11px</dimen>
<dimen name="module_push_item_image_width">212px</dimen>
<dimen name="module_push_item_image_height">154px</dimen>
<dimen name="module_push_panel_bkg_padding">10px</dimen>
</resources>

View File

@@ -87,9 +87,9 @@
<dimen name="module_push_item_minHeight_vertical">310px</dimen>
<dimen name="module_push_item_maxHeight_vertical">350px</dimen>
<dimen name="module_push_content_paddingBottom_vertical">60px</dimen>
<dimen name="module_push_panel_marginTop">16px</dimen>
<dimen name="module_push_panel_marginBottom">16px</dimen>
<dimen name="module_push_panel_marginRight">16px</dimen>
<dimen name="module_push_panel_marginTop">8px</dimen>
<dimen name="module_push_panel_marginBottom">8px</dimen>
<dimen name="module_push_panel_marginRight">8px</dimen>
<dimen name="module_push_panel_paddingLeft">28px</dimen>
<dimen name="module_push_panel_paddingBottom">16px</dimen>
<dimen name="module_push_panel_corner">16px</dimen>
@@ -97,4 +97,5 @@
<dimen name="module_push_item_time_textSize">5px</dimen>
<dimen name="module_push_item_image_width">118px</dimen>
<dimen name="module_push_item_image_height">86px</dimen>
<dimen name="module_push_panel_bkg_padding">8px</dimen>
</resources>

View File

@@ -11,6 +11,8 @@ import androidx.annotation.Keep;
import com.facebook.drawee.view.GenericDraweeView;
import com.mogo.service.R;
import com.mogo.skin.support.IMogoSkinCompatSupportable;
import com.mogo.skin.support.helper.MogoSkinCompatImageHelperDelegate;
/**
* @author congtaowang
@@ -19,7 +21,9 @@ import com.mogo.service.R;
* 封装 facebook GenericDraweeView实现占位图、失败占位图、形状、边框、模糊等效果
*/
@Keep
public class MogoImageView extends GenericDraweeView {
public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatSupportable {
private MogoSkinCompatImageHelperDelegate imageHelperDelegate;
private int mPlaceHolder;
private int mFailureHolder;
@@ -65,6 +69,8 @@ public class MogoImageView extends GenericDraweeView {
mBlurRadius = arrays.getInt( R.styleable.MogoImageView_miv_blurRadius, 25 );
arrays.recycle();
imageHelperDelegate = new MogoSkinCompatImageHelperDelegate( this );
imageHelperDelegate.loadFromAttributes( attrs, theme );
setImageResource( mPlaceHolder );
}
@@ -167,6 +173,14 @@ public class MogoImageView extends GenericDraweeView {
return builder.toString();
}
@Override
public void setImageResource( int resId ) {
super.setImageResource( resId );
if ( imageHelperDelegate != null ) {
imageHelperDelegate.setImageResource( resId );
}
}
/**
* 解决共享动画无效的问题
*
@@ -175,4 +189,11 @@ public class MogoImageView extends GenericDraweeView {
public void animateTransform( Matrix matrix ) {
invalidate();
}
@Override
public void applySkin() {
if ( imageHelperDelegate != null ) {
imageHelperDelegate.applySkin();
}
}
}

View File

@@ -28,6 +28,7 @@ import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import java.io.File;
import java.sql.ClientInfoStatus;
/**
* @author congtaowang
@@ -125,25 +126,40 @@ public class GlideImageLoader implements IMogoImageloader {
.asBitmap()
.load( url )
.apply( options )
.addListener( new RequestListener< Bitmap >() {
.into( new SimpleTarget< Bitmap >() {
@Override
public boolean onLoadFailed( @Nullable GlideException e, Object model, Target< Bitmap > target, boolean isFirstResource ) {
if ( listener != null ) {
listener.onFailure( e );
}
return false;
}
@Override
public boolean onResourceReady( Bitmap resource, Object model, Target< Bitmap > target, DataSource dataSource, boolean isFirstResource ) {
public void onResourceReady( @NonNull Bitmap resource, @Nullable Transition< ? super Bitmap > transition ) {
if ( listener != null ) {
listener.onCompleted( resource );
}
return false;
imageView.setImageResource( 0 );
imageView.setImageBitmap( resource );
}
} )
.into( imageView );
@Override
public void onLoadStarted( @Nullable Drawable placeholder ) {
super.onLoadStarted( placeholder );
if ( listener != null ) {
listener.onStart();
}
imageView.setImageResource( imageView.getPlaceHolder() );
}
@Override
public void onLoadCleared( @Nullable Drawable placeholder ) {
super.onLoadCleared( placeholder );
imageView.setImageResource( imageView.getPlaceHolder() );
}
@Override
public void onLoadFailed( @Nullable Drawable errorDrawable ) {
super.onLoadFailed( errorDrawable );
if ( listener != null ) {
listener.onFailure( new Exception( "onLoadFailed" ) );
}
imageView.setImageResource( imageView.getFailureHolder() );
}
} );
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#E6F5F5F5"/>
<corners android:radius="@dimen/module_push_panel_corner"/>
</shape>

View File

@@ -1,10 +1,7 @@
package com.mogo.skin.support.helper;
import android.util.AttributeSet;
import android.view.View;
import com.mogo.skin.support.IMogoSkinCompatSupportable;
import java.lang.reflect.Method;
public
@@ -33,15 +30,18 @@ class MogoSkinCompatBackgroundHelperDelegate extends MogoSkinCompatHelperDelegat
}
public void onSetBackgroundResource( int resId ) {
if ( !isSupport() ) {
return;
}
if ( sMethodOnSetBackgroundResource == null ) {
try {
sMethodOnSetBackgroundResource = mTargetClazz.getDeclaredMethod( "onSetBackgroundResource", int.class );
sMethodOnSetBackgroundResource.setAccessible( true );
} catch ( Exception e ) {
e.printStackTrace();
}
}
if ( sMethodOnSetBackgroundResource != null ) {
sMethodOnSetBackgroundResource.setAccessible( true );
try {
sMethodOnSetBackgroundResource.invoke( mDelegate, resId );
} catch ( Exception e ) {

View File

@@ -29,6 +29,9 @@ class MogoSkinCompatCompoundButtonHelperDelegate extends MogoSkinCompatHelperDel
}
public void setButtonDrawable( int resId ) {
if ( !isSupport() ) {
return;
}
if ( sSetButtonDrawableMethod == null ) {
try {
sSetButtonDrawableMethod = mTargetClazz.getDeclaredMethod( "setButtonDrawable", int.class );

View File

@@ -23,6 +23,8 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
protected volatile static Method sMethodLoadFromAttributes;
private static Constructor sConstructor;
private static boolean sIsSupport = false;
public MogoSkinCompatHelperDelegate( View view ) {
loadClazz();
initDelegateInstance( view );
@@ -34,6 +36,7 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
mTargetClazz = Class.forName( getDelegateClazzName() );
getLoadFromAttributesMethod();
getApplySkinMethod();
sIsSupport = true;
} catch ( Exception e ) {
e.printStackTrace();
}
@@ -77,6 +80,9 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
}
public void loadFromAttributes( AttributeSet attrs, int defStyleAttr ) {
if ( !isSupport() ) {
return;
}
if ( sMethodLoadFromAttributes != null ) {
try {
sMethodLoadFromAttributes.invoke( mDelegate, attrs, defStyleAttr );
@@ -88,6 +94,9 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
@Override
public void applySkin() {
if ( !isSupport() ) {
return;
}
if ( sMethodApplySkin != null ) {
try {
sMethodApplySkin.invoke( mDelegate );
@@ -96,4 +105,8 @@ abstract class MogoSkinCompatHelperDelegate implements IMogoSkinCompatSupportabl
}
}
}
public static boolean isSupport() {
return sIsSupport;
}
}

View File

@@ -27,6 +27,9 @@ class MogoSkinCompatImageHelperDelegate extends MogoSkinCompatHelperDelegate {
}
public void setImageResource( int resId ) {
if ( !isSupport() ) {
return;
}
if ( sSetImageResourceMethod == null ) {
try {
sSetImageResourceMethod = mTargetClazz.getDeclaredMethod( "setImageResource", int.class );

View File

@@ -33,6 +33,9 @@ class MogoSkinCompatTextHelperDelegate extends MogoSkinCompatHelperDelegate {
}
public void onSetTextAppearance( Context context, int resId ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetTextAppearanceMethod == null ) {
try {
sOnSetTextAppearanceMethod = mTargetClazz.getDeclaredMethod( "onSetTextAppearance", Context.class, int.class );
@@ -55,6 +58,9 @@ class MogoSkinCompatTextHelperDelegate extends MogoSkinCompatHelperDelegate {
public void onSetCompoundDrawablesRelativeWithIntrinsicBounds(
@DrawableRes int start, @DrawableRes int top, @DrawableRes int end, @DrawableRes int bottom ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetCompoundDrawablesRelativeWithIntrinsicBoundsMethod == null ) {
try {
sOnSetCompoundDrawablesRelativeWithIntrinsicBoundsMethod = mTargetClazz.getDeclaredMethod( "onSetCompoundDrawablesRelativeWithIntrinsicBounds", int.class, int.class, int.class, int.class );
@@ -76,6 +82,9 @@ class MogoSkinCompatTextHelperDelegate extends MogoSkinCompatHelperDelegate {
public void onSetCompoundDrawablesWithIntrinsicBounds(
@DrawableRes int left, @DrawableRes int top, @DrawableRes int right, @DrawableRes int bottom ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetCompoundDrawablesWithIntrinsicBoundsMethod == null ) {
try {
sOnSetCompoundDrawablesWithIntrinsicBoundsMethod = mTargetClazz.getDeclaredMethod( "onSetCompoundDrawablesWithIntrinsicBounds", int.class, int.class, int.class, int.class );
@@ -96,6 +105,9 @@ class MogoSkinCompatTextHelperDelegate extends MogoSkinCompatHelperDelegate {
}
public int getTextColorResId() {
if ( !isSupport() ) {
return 0;
}
if ( sGetTextColorResIdMethod == null ) {
try {
sGetTextColorResIdMethod = mTargetClazz.getDeclaredMethod( "getTextColorResId" );

View File

@@ -37,6 +37,9 @@ class MogoSkinCompatTextHelperV17Delegate extends MogoSkinCompatHelperDelegate {
}
public void onSetTextAppearance( Context context, int resId ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetTextAppearanceMethod == null ) {
try {
sOnSetTextAppearanceMethod = mTargetClazz.getDeclaredMethod( "onSetTextAppearance", Context.class, int.class );
@@ -59,6 +62,9 @@ class MogoSkinCompatTextHelperV17Delegate extends MogoSkinCompatHelperDelegate {
public void onSetCompoundDrawablesRelativeWithIntrinsicBounds(
@DrawableRes int start, @DrawableRes int top, @DrawableRes int end, @DrawableRes int bottom ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetCompoundDrawablesRelativeWithIntrinsicBoundsMethod == null ) {
try {
sOnSetCompoundDrawablesRelativeWithIntrinsicBoundsMethod = mTargetClazz.getDeclaredMethod( "onSetCompoundDrawablesRelativeWithIntrinsicBounds", int.class, int.class, int.class, int.class );
@@ -80,6 +86,9 @@ class MogoSkinCompatTextHelperV17Delegate extends MogoSkinCompatHelperDelegate {
public void onSetCompoundDrawablesWithIntrinsicBounds(
@DrawableRes int left, @DrawableRes int top, @DrawableRes int right, @DrawableRes int bottom ) {
if ( !isSupport() ) {
return;
}
if ( sOnSetCompoundDrawablesWithIntrinsicBoundsMethod == null ) {
try {
sOnSetCompoundDrawablesWithIntrinsicBoundsMethod = mTargetClazz.getDeclaredMethod( "onSetCompoundDrawablesWithIntrinsicBounds", int.class, int.class, int.class, int.class );
@@ -100,6 +109,9 @@ class MogoSkinCompatTextHelperV17Delegate extends MogoSkinCompatHelperDelegate {
}
public int getTextColorResId() {
if ( !isSupport() ) {
return 0;
}
if ( sGetTextColorResIdMethod == null ) {
try {
sGetTextColorResIdMethod = mTargetClazz.getDeclaredMethod( "getTextColorResId" );