opt
This commit is contained in:
@@ -11,8 +11,12 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.extensions.anim.AnimRes;
|
||||
import com.mogo.module.extensions.anim.JSurfaceView;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -36,6 +40,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
private View mMsgContainer;
|
||||
private TextView mMsgCounter;
|
||||
|
||||
private IMogoFragmentManager mMogoFragmentManager;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_ext_layout_extensions;
|
||||
@@ -47,8 +53,11 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
mVoiceMsg = findViewById( R.id.module_ext_id_voice_msg );
|
||||
|
||||
mVoiceIcon.setOnClickListener( view -> {
|
||||
mVoiceMsg.performClick();
|
||||
} );
|
||||
mVoiceMsg.setOnClickListener( view -> {
|
||||
AIAssist.startAssistant( getContext() );
|
||||
} );
|
||||
mVoiceMsg.setOnClickListener( view -> {} );
|
||||
|
||||
mTime = findViewById( R.id.module_ext_id_time );
|
||||
mDate = findViewById( R.id.module_ext_id_date );
|
||||
@@ -65,6 +74,15 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
mMsgCounter = findViewById( R.id.module_ext_id_msg_counter );
|
||||
|
||||
mVoiceIcon.setFrames( AnimRes.sRes );
|
||||
|
||||
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation( getContext() );
|
||||
mMogoFragmentManager.addMainFragmentStackTransactionListener( size -> {
|
||||
if ( size == 0 ) {
|
||||
mVoiceIcon.setVisibility( View.VISIBLE );
|
||||
} else {
|
||||
mVoiceIcon.setVisibility( View.INVISIBLE );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -51,7 +51,7 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
private void init() {
|
||||
mHolder = getHolder();
|
||||
mHolder.addCallback( this );
|
||||
setZOrderOnTop( false );
|
||||
setZOrderOnTop( true );
|
||||
mHolder.setFormat( PixelFormat.TRANSLUCENT );
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
return;
|
||||
}
|
||||
//绘制透明色
|
||||
mCanvas.drawColor( Color.parseColor( "#1F000000" ) );
|
||||
mCanvas.drawColor( Color.TRANSPARENT, PorterDuff.Mode.CLEAR );
|
||||
Bitmap mBitmap = BitmapFactory.decodeResource( getResources(), mFrames[mCurrentPos % mFrames.length] );
|
||||
|
||||
Paint paint = new Paint();
|
||||
|
||||
Reference in New Issue
Block a user