This commit is contained in:
liujing
2020-08-14 10:20:37 +08:00
parent 58311d4a6a
commit 8220fd50ed
4 changed files with 58 additions and 25 deletions

View File

@@ -207,7 +207,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
} }
/* /*
* 去分享 * 去分享 刷新
* */ * */
class shareEmptyViewHolder extends RecyclerView.ViewHolder { class shareEmptyViewHolder extends RecyclerView.ViewHolder {
public shareEmptyViewHolder(@NonNull View itemView) { public shareEmptyViewHolder(@NonNull View itemView) {
@@ -218,6 +218,14 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
V2XEventPanelFragment.Companion.getInstance().hidePanel(); V2XEventPanelFragment.Companion.getInstance().hidePanel();
mApis.getShareManager().showShareDialog(); mApis.getShareManager().showShareDialog();
}); });
Button refresh = itemView.findViewById(R.id.refresh_button);
refresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
callback.loadMoreShareEventList(false);
}
});
} }
} }
@@ -234,7 +242,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
@Override @Override
public void onClick(View v) { public void onClick(View v) {
callback.loadMoreShareEventList(); callback.loadMoreShareEventList(true);
} }
}); });
} }

View File

@@ -170,10 +170,12 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
} }
@Override @Override
public void loadMoreShareEventList() { public void loadMoreShareEventList(boolean moreOnePage) {
Log.d(TAG, "page--" + pageNum); Log.d(TAG, "page--" + pageNum);
animatioonAcction(View.VISIBLE); animatioonAcction(View.VISIBLE);
pageNum += 1; if (moreOnePage == true){
pageNum += 1;
}
v2XShareNetworkModel.getShareEventList(pageNum, 10, new V2XRefreshCallback() { v2XShareNetworkModel.getShareEventList(pageNum, 10, new V2XRefreshCallback() {
@Override @Override
public void onSuccess(Object result) { public void onSuccess(Object result) {

View File

@@ -5,5 +5,5 @@ package com.mogo.module.v2x.listener;
*/ */
public interface AdapterCallback { public interface AdapterCallback {
//分享列表加载更多 //分享列表加载更多
void loadMoreShareEventList(); void loadMoreShareEventList(boolean moreOnePage);
} }

View File

@@ -2,8 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="center"
android:gravity="center"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/no_share_image" android:id="@+id/no_share_image"
@@ -14,29 +14,52 @@
<TextView <TextView
android:id="@+id/share_event_null_des" android:id="@+id/share_event_null_des"
android:layout_below="@+id/no_share_image"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/no_share_image"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:gravity="bottom"
android:alpha="0.7"
android:layout_marginTop="12.6px" android:layout_marginTop="12.6px"
android:textSize="18px" android:alpha="0.7"
android:gravity="bottom"
android:text="你还没有分享过道路事件,快去试试吧" android:text="你还没有分享过道路事件,快去试试吧"
android:textColor="#FFFFFF" />
<Button
android:id="@+id/share_event_button"
android:layout_width="150px"
android:layout_height="48px"
android:layout_below="@+id/share_event_null_des"
android:layout_centerHorizontal="true"
android:background="@drawable/bg_v2x_event_live_show"
android:clickable="true"
android:onClick="shareEventAction"
android:layout_marginTop="21px"
android:text="去分享"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="25sp" /> android:textSize="18px" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="33px">
<Button
android:id="@+id/share_event_button"
android:layout_width="150px"
android:layout_height="48px"
android:layout_centerHorizontal="true"
android:layout_toLeftOf="@id/center"
android:background="@drawable/v2xt_dw_common_corner_bkg_dark"
android:clickable="true"
android:onClick="shareEventAction"
android:text="去分享"
android:textColor="#FFFFFF"
android:textSize="18px" />
<View
android:id="@+id/center"
android:layout_width="29px"
android:layout_height="29px"
android:layout_centerInParent="true" />
<Button
android:id="@+id/refresh_button"
android:layout_width="150px"
android:layout_height="48px"
android:layout_toRightOf="@id/center"
android:background="@drawable/v2xt_dw_common_corner_bkg_light"
android:text="刷新"
android:textColor="#FFFFFF"
android:textSize="18px" />
</RelativeLayout>
</LinearLayout> </LinearLayout>