[add] 添加分享Presenter
This commit is contained in:
@@ -3,6 +3,7 @@ package com.zhidao.mogo.module.event.panel.adapter
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.ShareEventsFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
|
||||
@@ -12,7 +13,7 @@ import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
|
||||
private val fragments:Array<Fragment> = arrayOf(TripRecordFragment(), SurroundingEventFragment(), MyShareFragment())
|
||||
private val fragments:Array<Fragment> = arrayOf(TripRecordFragment(), SurroundingEventFragment(), ShareEventsFragment())
|
||||
|
||||
/**
|
||||
* 目前一共就三个fragment
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.presenter.ShareEventsPresenter;
|
||||
|
||||
public class ShareEventsFragment extends MvpFragment {
|
||||
public class ShareEventsFragment extends MvpFragment <ShareEventsFragment, ShareEventsPresenter> {
|
||||
|
||||
private RecyclerView roadCase;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_event_panel_fragment_my_share;
|
||||
return R.layout.module_event_share_description;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
roadCase = (RecyclerView) findViewById(R.id.road_case_share_list);
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Presenter createPresenter() {
|
||||
return null;
|
||||
protected ShareEventsPresenter createPresenter() {
|
||||
return new ShareEventsPresenter(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.zhidao.mogo.module.event.panel.fragment.ShareEventsFragment;
|
||||
|
||||
public class ShareEventsPresenter extends Presenter <ShareEventsFragment>{
|
||||
public ShareEventsPresenter(IView view) {
|
||||
super((ShareEventsFragment) view);
|
||||
}
|
||||
}
|
||||
@@ -1,141 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/share_linear">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:id="@+id/share_linear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/share_num"
|
||||
android:text="0"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/shre_num_des"
|
||||
android:layout_height="30dp"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="分享次数"/>
|
||||
android:orientation="horizontal">
|
||||
|
||||
</>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF"/>
|
||||
<TextView
|
||||
android:id="@+id/share_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/share_approve"
|
||||
android:text="0"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_approve_des"
|
||||
android:layout_height="30dp"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="车友认同次数"/>
|
||||
<TextView
|
||||
android:id="@+id/shre_num_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="分享次数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/share_index"
|
||||
android:background="@drawable/amap_ride"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_index_des"
|
||||
android:layout_height="30dp"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="热心指数"/>
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_approve"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_approve_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="车友认同次数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000ff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_index"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/amap_ride" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_index_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="热心指数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/share_event_guide_des"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_below="@+id/share_linear"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#0000ff"
|
||||
android:gravity="center"
|
||||
android:text="小窍门:分享路况、点赞其他车友,有助于提高热心指数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_below="@+id/share_linear"
|
||||
android:id="@+id/share_event_guide_des"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="#0000ff"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="小窍门:分享路况、点赞其他车友,有助于提高热心指数">
|
||||
</TextView>
|
||||
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/share_event_null_des"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="100dp"
|
||||
android:layout_below="@+id/share_event_guide_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:text="你还没有分享过道路事件,快去试试吧" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="100dp"
|
||||
android:id="@+id/share_event_null_des"
|
||||
android:layout_below="@+id/share_event_guide_des"
|
||||
android:gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="你还没有分享过道路事件,快去试试吧"/>
|
||||
<Button
|
||||
android:id="@+id/shre_event_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#FFFFFF"
|
||||
android:text="去分享"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/shre_event_button"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
android:text="去分享"
|
||||
android:background="#FFFFFF"
|
||||
android:shadowRadius="4dp"
|
||||
android:textSize="25sp"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/road_case_share_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/share_linear"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/road_case_share_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
android:layout_below="@+id/share_linear"
|
||||
app:layout_constraintBottom_toBottomOf = "parent"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user