opt
This commit is contained in:
@@ -8,6 +8,7 @@ import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
@@ -82,7 +83,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private View mHome;
|
||||
private View mCompany;
|
||||
|
||||
private TextView mUploadRoadCondition;
|
||||
private View mUploadRoadCondition;
|
||||
private TextView mUpload;
|
||||
private ImageView mUploading;
|
||||
|
||||
private View mVRMode;
|
||||
private View mMove2CurrentLocation;
|
||||
@@ -119,21 +122,52 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
@DrawableRes
|
||||
private int[] mUploadingFrameRes = {
|
||||
R.drawable.amap_route_color_texture_0_arrow,
|
||||
R.drawable.amap_route_color_texture_1_arrow,
|
||||
R.drawable.amap_route_color_texture_2_arrow,
|
||||
R.drawable.amap_route_color_texture_3_arrow,
|
||||
R.drawable.amap_route_color_texture_4_arrow,
|
||||
R.drawable.amap_route_color_texture_5_arrow,
|
||||
R.drawable.amap_route_color_texture_6_arrow,
|
||||
R.drawable.amap_route_color_texture_7_arrow,
|
||||
R.drawable.amap_route_color_texture_8_arrow,
|
||||
R.drawable.amap_route_color_texture_9_arrow,
|
||||
R.drawable.module_ext_ic_uploading_00000,
|
||||
R.drawable.module_ext_ic_uploading_00001,
|
||||
R.drawable.module_ext_ic_uploading_00002,
|
||||
R.drawable.module_ext_ic_uploading_00003,
|
||||
R.drawable.module_ext_ic_uploading_00004,
|
||||
R.drawable.module_ext_ic_uploading_00005,
|
||||
R.drawable.module_ext_ic_uploading_00006,
|
||||
R.drawable.module_ext_ic_uploading_00007,
|
||||
R.drawable.module_ext_ic_uploading_00008,
|
||||
R.drawable.module_ext_ic_uploading_00009,
|
||||
R.drawable.module_ext_ic_uploading_00010,
|
||||
R.drawable.module_ext_ic_uploading_00011,
|
||||
R.drawable.module_ext_ic_uploading_00012,
|
||||
R.drawable.module_ext_ic_uploading_00013,
|
||||
R.drawable.module_ext_ic_uploading_00014,
|
||||
R.drawable.module_ext_ic_uploading_00015,
|
||||
R.drawable.module_ext_ic_uploading_00016,
|
||||
R.drawable.module_ext_ic_uploading_00017,
|
||||
R.drawable.module_ext_ic_uploading_00018,
|
||||
R.drawable.module_ext_ic_uploading_00019,
|
||||
R.drawable.module_ext_ic_uploading_00020,
|
||||
R.drawable.module_ext_ic_uploading_00021,
|
||||
R.drawable.module_ext_ic_uploading_00022,
|
||||
R.drawable.module_ext_ic_uploading_00023,
|
||||
R.drawable.module_ext_ic_uploading_00024,
|
||||
R.drawable.module_ext_ic_uploading_00025,
|
||||
R.drawable.module_ext_ic_uploading_00026,
|
||||
R.drawable.module_ext_ic_uploading_00027,
|
||||
R.drawable.module_ext_ic_uploading_00028,
|
||||
R.drawable.module_ext_ic_uploading_00029,
|
||||
R.drawable.module_ext_ic_uploading_00030,
|
||||
R.drawable.module_ext_ic_uploading_00031,
|
||||
R.drawable.module_ext_ic_uploading_00032,
|
||||
R.drawable.module_ext_ic_uploading_00033,
|
||||
R.drawable.module_ext_ic_uploading_00034,
|
||||
R.drawable.module_ext_ic_uploading_00035,
|
||||
R.drawable.module_ext_ic_uploading_00036,
|
||||
R.drawable.module_ext_ic_uploading_00037,
|
||||
R.drawable.module_ext_ic_uploading_00038,
|
||||
R.drawable.module_ext_ic_uploading_00039,
|
||||
R.drawable.module_ext_ic_uploading_00040
|
||||
};
|
||||
private int mCurrentUploadFrame = 0;
|
||||
private Handler mUploadFrameAnimHandler;
|
||||
public static final int MSG_FRAME_ANIM = 307;
|
||||
public static final long TIME_FRAME_INTERVAL_TIME = 200;
|
||||
public static final long TIME_FRAME_INTERVAL_TIME = 80;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -174,6 +208,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
} );
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUpload = findViewById( R.id.module_entrance_id_upload );
|
||||
mUploading = findViewById( R.id.module_entrance_id_uploading );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
isClickShare = true;
|
||||
if ( mIMogoAuthorizeModuleManager.needAuthorize( AUTHORIZE_TYPE_LAUNCHER_SHARE ) ) {
|
||||
@@ -472,11 +508,14 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
if ( descriptor == StatusDescriptor.UPLOADING ) {
|
||||
if ( isTrue ) {
|
||||
mUploading.setVisibility( View.VISIBLE );
|
||||
mUpload.setVisibility( View.GONE );
|
||||
doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
mUploadRoadCondition.setText( R.string.module_map_str_upload_road_condition );
|
||||
mUploadRoadCondition.setBackgroundResource( R.drawable.module_ext_dw_upload_road_condition_bkg );
|
||||
mUploading.setVisibility( View.GONE );
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,17 +528,24 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == MSG_FRAME_ANIM ) {
|
||||
if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
|
||||
if ( mUploading != null ) {
|
||||
mUploading.setVisibility( View.GONE );
|
||||
}
|
||||
if ( mUpload != null ) {
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( !mMogoStatusManager.isUploading() ) {
|
||||
mCurrentUploadFrame = 0;
|
||||
if ( mUploadRoadCondition != null ) {
|
||||
mUploadRoadCondition.setText( R.string.module_map_str_upload_road_condition );
|
||||
mUploadRoadCondition.setBackgroundResource( R.drawable.module_ext_dw_upload_road_condition_bkg );
|
||||
}
|
||||
return;
|
||||
}
|
||||
mUploadRoadCondition.setBackgroundResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
|
||||
if ( mUploading != null ) {
|
||||
if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
|
||||
mCurrentUploadFrame = 12;
|
||||
}
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++%mUploadingFrameRes.length] );
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM, TIME_FRAME_INTERVAL_TIME );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user