This commit is contained in:
lixiaopeng
2020-08-13 11:33:41 +08:00
parent fd528690da
commit 0d71a377db
2 changed files with 34 additions and 5 deletions

View File

@@ -9,9 +9,12 @@ import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -35,6 +38,8 @@ import com.mogo.module.v2x.adapter.V2XSurroundingAdapter;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
import com.mogo.module.v2x.utils.animation.AnimationResources;
import com.mogo.module.v2x.utils.animation.V2XAnimationManager;
import com.mogo.module.v2x.view.SurroundingEventView;
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
import com.mogo.service.IMogoServiceApis;
@@ -68,6 +73,9 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
private SurroundingEventPresenter surroundingEventPresenter;
private List<SurroundingConstruction> poiInfosList = new ArrayList<>();
private IMogoServiceApis mApis;
private V2XAnimationManager mV2XAnimationManager;
private ImageView mloadingImage;
@Override
protected int getLayoutId() {
@@ -75,9 +83,17 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
return R.layout.module_event_panel_fragment_surrounding;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
return mRootView;
}
@Override
protected void initViews() {
Log.d(TAG, "initViews --------> ");
mV2XAnimationManager = new V2XAnimationManager();
mRecyclerView = findViewById(R.id.surrounding_recycleview);
mTotalTv = findViewById(R.id.tv_brief);
mTopLayout = findViewById(R.id.layout_top);
@@ -85,6 +101,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
mTopFreshTv = findViewById(R.id.tv_top_refresh);
mShareTv = findViewById(R.id.tv_main_share);
mFreshTv = findViewById(R.id.tv_main_refresh);
mloadingImage = mRootView.findViewById(R.id.loading_iv);
mTopFreshTv.setOnClickListener(this);
mShareTv.setOnClickListener(this);
mFreshTv.setOnClickListener(this);
@@ -137,6 +154,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
* 获取和刷新数据
*/
private void initData() {
mV2XAnimationManager.animationWithTarget(mloadingImage, AnimationResources.loadingRes, 100);
mV2XAnimationManager.start();
surroundingEventPresenter.getSurroundingEventData();
}
@@ -145,6 +164,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
*/
@Override
public void showSurroudingData(List<MarkerExploreWay> exploreWayList) {
mV2XAnimationManager.stop();
if (exploreWayList != null && exploreWayList.size() > 0) {
//展示数据
mTopLayout.setVisibility(View.VISIBLE);

View File

@@ -11,7 +11,7 @@
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="35px"
android:visibility="visible">
android:visibility="gone">
<TextView
android:id="@+id/tv_brief"
@@ -19,6 +19,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="20px"
android:textSize="18px"
android:text="周围5公里共15条交通信息"
android:textColor="@color/white" />
<TextView
@@ -41,7 +42,7 @@
android:id="@+id/list_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10px"
android:layout_marginTop="15px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:layout_marginBottom="20px"
@@ -64,8 +65,8 @@
<ImageView
android:id="@+id/iv_empty"
android:layout_width="194px"
android:layout_height="194px"
android:layout_width="200px"
android:layout_height="200px"
android:layout_centerHorizontal="true"
android:layout_marginTop="59px"
android:src="@drawable/mogo_image_blank_nor" />
@@ -92,7 +93,7 @@
android:layout_marginTop="1px"
android:gravity="center_horizontal"
android:text="你可以试着分享一个事件给其他车主"
android:textColor="@color/transparent_white_30"
android:textColor="@color/white"
android:textSize="18px"
android:textStyle="bold" />
@@ -127,6 +128,14 @@
</RelativeLayout>
</RelativeLayout>
<ImageView
android:layout_height="200px"
android:layout_width="200px"
android:visibility="gone"
android:id="@+id/loading_iv"
android:layout_centerInParent="true" >
</ImageView>
</RelativeLayout>