|
@@ -5,6 +5,7 @@ import android.content.Intent;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.RelativeLayout;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
@@ -13,6 +14,7 @@ import com.xplora.xpchat.R;
|
|
|
import com.xplora.xpchat.adapter.RecyclerAdapter;
|
|
|
import com.xplora.xpchat.manager.DataManager;
|
|
|
import com.xplora.xpchat.manager.DatabaseUtils;
|
|
|
+import com.xplora.xpchat.model.BaseBean;
|
|
|
import com.xplora.xpchat.model.ContactBean;
|
|
|
import com.xplora.xpchat.model.GridModel;
|
|
|
import com.xplora.xpchat.utils.Constant;
|
|
@@ -24,6 +26,8 @@ import java.util.List;
|
|
|
public class MemberShareActivity extends BaseActivity {
|
|
|
private List<GridModel> mDataList = new ArrayList<>();
|
|
|
private RecyclerAdapter mRecyclerAdapter = null;
|
|
|
+ private RelativeLayout mShareLayout = null;
|
|
|
+ private TextView mShareNameTv = null;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreateBase() {
|
|
@@ -41,32 +45,41 @@ public class MemberShareActivity extends BaseActivity {
|
|
|
@Override
|
|
|
protected void initView() {
|
|
|
super.initView();
|
|
|
-
|
|
|
RecyclerView mRecyclerView = findViewById(R.id.recyclerView);
|
|
|
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 2);
|
|
|
mRecyclerView.setHasFixedSize(true);
|
|
|
mRecyclerView.setLayoutManager(mLayoutManager);
|
|
|
|
|
|
-// View footerView = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.chat_list_footer, null);
|
|
|
-// mRecyclerView.addFooterView(footerView);
|
|
|
-
|
|
|
mRecyclerAdapter = new RecyclerAdapter(this, mDataList, Constant.E_PAGER.CONTACT, 0);
|
|
|
mRecyclerAdapter.setListOnClickListener(mGridItemOnClickListener);
|
|
|
mRecyclerView.setAdapter(mRecyclerAdapter);
|
|
|
+
|
|
|
+ mShareLayout = findViewById(R.id.shareLayout);
|
|
|
+ mShareNameTv = (TextView) findViewById(R.id.shareNameTv);
|
|
|
}
|
|
|
|
|
|
RecyclerAdapter.GridItemOnClickListener mGridItemOnClickListener = new RecyclerAdapter.GridItemOnClickListener() {
|
|
|
@SuppressLint("NotifyDataSetChanged")
|
|
|
@Override
|
|
|
public void onClick(Constant.E_PAGER pagerType, int mViewIndex, int itemIndex, GridModel gridModel) {
|
|
|
+
|
|
|
+ ContactBean shareBean = new ContactBean();
|
|
|
for (int i = 0; i < mDataList.size(); i++) {
|
|
|
GridModel model = mDataList.get(i);
|
|
|
model.isSelected = i == itemIndex;
|
|
|
+ if (i == itemIndex) {
|
|
|
+ shareBean = (ContactBean) model.bean;
|
|
|
+ }
|
|
|
}
|
|
|
if (mRecyclerAdapter != null) {
|
|
|
//mRecyclerAdapter.setDataList(mDataList);
|
|
|
mRecyclerAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
+
|
|
|
+ if (mShareLayout != null) {
|
|
|
+ mShareLayout.setVisibility(View.VISIBLE);
|
|
|
+ mShareNameTv.setText(shareBean.name);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|