|
@@ -6,20 +6,31 @@ import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v4.app.Fragment;
|
|
import android.support.v4.app.Fragment;
|
|
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
|
|
+import android.support.v7.widget.OrientationHelper;
|
|
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
|
|
|
+import android.widget.ImageView;
|
|
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
+import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* created on:2018/8/28 on 12:32
|
|
* created on:2018/8/28 on 12:32
|
|
|
* created by: YSL
|
|
* created by: YSL
|
|
|
* 描述:
|
|
* 描述:
|
|
|
*/
|
|
*/
|
|
|
@SuppressLint("ValidFragment")
|
|
@SuppressLint("ValidFragment")
|
|
|
-public class FragmentMessageCenter extends Fragment{
|
|
|
|
|
|
|
+public class FragmentMessageCenter extends Fragment implements MessageLeftAdapter.ItemOnClickListener{
|
|
|
private Context mContext;
|
|
private Context mContext;
|
|
|
|
|
+ private RecyclerView recyclerView;
|
|
|
|
|
+ private MessageLeftAdapter adapter;
|
|
|
|
|
+ private List<?>mList;
|
|
|
|
|
|
|
|
public FragmentMessageCenter(Context mContext) {
|
|
public FragmentMessageCenter(Context mContext) {
|
|
|
this.mContext = mContext;
|
|
this.mContext = mContext;
|
|
@@ -28,12 +39,23 @@ public class FragmentMessageCenter extends Fragment{
|
|
|
@Nullable
|
|
@Nullable
|
|
|
@Override
|
|
@Override
|
|
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
- View view=LayoutInflater.from(mContext).inflate(R.layout.layout_fragment_mseeages,null);
|
|
|
|
|
|
|
+ View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_messagecenter, null);
|
|
|
|
|
+ recyclerView = view.findViewById(R.id.recycle_fragment_message_center);
|
|
|
return view;
|
|
return view;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
|
super.onViewCreated(view, savedInstanceState);
|
|
super.onViewCreated(view, savedInstanceState);
|
|
|
|
|
+ adapter = new MessageLeftAdapter(mContext,mList ,this);
|
|
|
|
|
+ LinearLayoutManager manager=new LinearLayoutManager(mContext);
|
|
|
|
|
+ manager.setOrientation(OrientationHelper.VERTICAL);
|
|
|
|
|
+ recyclerView.setLayoutManager(manager);
|
|
|
|
|
+ recyclerView.setAdapter(adapter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void itemClick(int position) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|