Browse Source

分享,下载 gui

liuzhenxing1118 2 years ago
parent
commit
f31dccb24b
25 changed files with 499 additions and 36 deletions
  1. 5 0
      app/src/main/AndroidManifest.xml
  2. 68 0
      app/src/main/java/com/xplora/xpchat/activity/MemberShareActivity.java
  3. 9 1
      app/src/main/java/com/xplora/xpchat/activity/PagerActivity.java
  4. 58 0
      app/src/main/java/com/xplora/xpchat/fragment/BaseActionFragment.java
  5. 37 23
      app/src/main/java/com/xplora/xpchat/fragment/VideoFragment.java
  6. 0 1
      app/src/main/java/com/xplora/xpchat/manager/DataManager.java
  7. 2 0
      app/src/main/java/com/xplora/xpchat/manager/DatabaseUtils.java
  8. 1 0
      app/src/main/java/com/xplora/xpchat/model/GridModel.java
  9. 1 0
      app/src/main/java/com/xplora/xpchat/observer/Listener.java
  10. 1 0
      app/src/main/java/com/xplora/xpchat/utils/Constant.java
  11. 2 0
      app/src/main/java/com/xplora/xpchat/utils/Macros.java
  12. 144 0
      app/src/main/java/com/xplora/xpchat/view/HeaderViewRecyclerAdapter.java
  13. 55 0
      app/src/main/java/com/xplora/xpchat/view/XPRecyclerView.java
  14. BIN
      app/src/main/res/drawable-xhdpi/action_close.png
  15. BIN
      app/src/main/res/drawable-xhdpi/action_download.png
  16. BIN
      app/src/main/res/drawable-xhdpi/action_pause.png
  17. BIN
      app/src/main/res/drawable-xhdpi/action_play.png
  18. BIN
      app/src/main/res/drawable-xhdpi/action_share.png
  19. BIN
      app/src/main/res/drawable-xhdpi/icon_select_member.png
  20. BIN
      app/src/main/res/drawable-xhdpi/icon_video_pause.png
  21. BIN
      app/src/main/res/drawable-xhdpi/icon_video_play.png
  22. 19 0
      app/src/main/res/layout/activity_itemlist_share.xml
  23. 38 0
      app/src/main/res/layout/chat_fragment_photo.xml
  24. 46 11
      app/src/main/res/layout/chat_fragment_video.xml
  25. 13 0
      app/src/main/res/layout/item_contacts.xml

+ 5 - 0
app/src/main/AndroidManifest.xml

@@ -69,6 +69,11 @@
             android:exported="true"
             android:configChanges="keyboardHidden|orientation|screenSize"
             android:launchMode="singleInstance" />
+        <activity
+            android:name=".activity.MemberShareActivity"
+            android:exported="true"
+            android:configChanges="keyboardHidden|orientation|screenSize"
+            android:launchMode="singleInstance" />
         <activity
             android:name=".activity.GroupActivity"
             android:exported="true"

+ 68 - 0
app/src/main/java/com/xplora/xpchat/activity/MemberShareActivity.java

@@ -0,0 +1,68 @@
+package com.xplora.xpchat.activity;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.RelativeLayout;
+
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+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.ContactBean;
+import com.xplora.xpchat.model.GridModel;
+import com.xplora.xpchat.utils.Constant;
+import com.xplora.xpchat.view.XPRecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MemberShareActivity extends BaseActivity {
+    private List<GridModel> mDataList = new ArrayList<>();
+    private RecyclerAdapter mRecyclerAdapter = null;
+
+    @Override
+    protected void onCreateBase() {
+        super.onCreateBase();
+        setContentView(R.layout.activity_itemlist_share);
+    }
+
+    @Override
+    protected void initData() {
+        super.initData();
+        List<ContactBean> contactList = new DatabaseUtils().loadContacts();
+        mDataList = DataManager.getMembersList(contactList);
+    }
+
+    @Override
+    protected void initView() {
+        super.initView();
+
+        XPRecyclerView 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);
+    }
+
+    RecyclerAdapter.GridItemOnClickListener mGridItemOnClickListener = new RecyclerAdapter.GridItemOnClickListener() {
+        @Override
+        public void onClick(Constant.E_PAGER pagerType, int mViewIndex, int itemIndex, GridModel gridModel) {
+            for (int i = 0; i < mDataList.size(); i++) {
+                GridModel model = mDataList.get(itemIndex);
+                model.isSelected = i == itemIndex;
+            }
+            if (mRecyclerAdapter != null) {
+                mRecyclerAdapter.notifyDataSetChanged();
+            }
+        }
+    };
+}

+ 9 - 1
app/src/main/java/com/xplora/xpchat/activity/PagerActivity.java

@@ -526,6 +526,8 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
 
     @Override
     public void onItemLongClick(int position) {
+        if (Macros.SHARE_MEMBER)
+            return;
         MessageBean bean = DataManager.instance().getMessagesList().get(position);
         Log.d(TAG, "onItemLongClick position:" + position + " bean:" + bean.beanToString());
         ChatFunctionFragment fragment = ChatFunctionFragment.newInstance(this);
@@ -539,7 +541,7 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
         Log.d(TAG, "onItemClick position:" + position + " bean:" + bean.beanToString());
 
         //失败重新发送
-        if (bean.localState == Constant.MESSAGE_STATE_SEND_FAIL) {
+        if (bean.owner == Constant.OWNER_ME && bean.localState == Constant.MESSAGE_STATE_SEND_FAIL) {
             Log.d(TAG, "onItemClick Reset send");
             ChatResendFragment fragment = ChatResendFragment.newInstance(this);
             fragment.setItemInfo(position, bean);
@@ -897,6 +899,12 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
         }).start();
     }
 
+    @Override
+    public void onShareFile(int position, MessageBean bean) {
+        Intent intent = new Intent(this, MemberShareActivity.class);
+        startActivityForResult(intent, Constant.REQUEST_CODE_SHARE);
+    }
+
     @Override
     public void onDeleteMessage(int position, MessageBean bean) {
         Log.d(TAG, "onDeleteMessage:" + bean._id);

+ 58 - 0
app/src/main/java/com/xplora/xpchat/fragment/BaseActionFragment.java

@@ -0,0 +1,58 @@
+package com.xplora.xpchat.fragment;
+
+import android.app.DialogFragment;
+import android.content.Context;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.xplora.xpchat.R;
+import com.xplora.xpchat.model.MessageBean;
+
+public class BaseActionFragment extends DialogFragment {
+    private Context mContext = null;
+    private int position;
+    private MessageBean bean;
+
+    public static BaseActionFragment newInstance(Context context) {
+        BaseActionFragment fragment = new BaseActionFragment();
+        fragment.mContext = context;
+        return fragment;
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        getDialog().getWindow().requestFeature(Window.FEATURE_SWIPE_TO_DISMISS);
+        View rootView = inflater.inflate(R.layout.chat_fragment_photo, container, false);
+        ImageView imageView = (ImageView)rootView.findViewById(R.id.mItemPhoto);
+        TextView noFileText = (TextView)rootView.findViewById(R.id.mNoFileText);
+
+        Uri uri = Uri.parse(bean.filePath);
+        imageView.setImageURI(uri);
+        if (noFileText != null) {
+            noFileText.setVisibility(uri == null ? View.VISIBLE : View.GONE);
+        }
+
+        return rootView;
+    }
+
+    public void setItemInfo(int position, MessageBean bean) {
+        this.position = position;
+        this.bean = bean;
+    }
+
+    private void remove() {
+        dismissAllowingStateLoss();
+    }
+}

+ 37 - 23
app/src/main/java/com/xplora/xpchat/fragment/VideoFragment.java

@@ -24,14 +24,17 @@ import com.xplora.xpchat.observer.Listener;
 
 import java.io.IOException;
 
-public class VideoFragment extends DialogFragment implements Listener.PlayListener {
+public class VideoFragment extends DialogFragment implements Listener.PlayListener, View.OnClickListener {
     public String TAG = "losion / xpchat :" +  getClass().getSimpleName();
     private Context mContext = null;
     private int position;
     private MessageBean bean;
     private MediaPlayerUtils mMediaPlayerUtils = null;
     private SurfaceHolder mSurfaceHolder = null;
-    private ImageView mActionButton = null;
+    private ImageButton mPlayPauseBtn = null;
+    private ImageButton mShareBtn = null;
+    private ImageButton mSaveFileBtn = null;
+    private ImageButton mCloseBtn = null;
 
     public static VideoFragment newInstance(Context context) {
         VideoFragment fragment = new VideoFragment();
@@ -50,13 +53,20 @@ public class VideoFragment extends DialogFragment implements Listener.PlayListen
         getDialog().getWindow().requestFeature(Window.FEATURE_SWIPE_TO_DISMISS);
         View rootView = inflater.inflate(R.layout.chat_fragment_video, container, false);
         SurfaceView surfaceView = (SurfaceView) rootView.findViewById(R.id.surfaceView);
-        mActionButton = (ImageView)rootView.findViewById(R.id.mActionBtn);
-        TextView noFileText = (TextView)rootView.findViewById(R.id.mNoFileText);
-
         mSurfaceHolder = surfaceView.getHolder();
-        mActionButton.setOnClickListener(onActionClick);
+
+        mPlayPauseBtn = (ImageButton) rootView.findViewById(R.id.mPlayPauseBtn);
+        mShareBtn = (ImageButton)rootView.findViewById(R.id.mShareBtn);
+        mSaveFileBtn = (ImageButton)rootView.findViewById(R.id.mSaveFileBtn);
+        mCloseBtn = (ImageButton)rootView.findViewById(R.id.mCloseBtn);
+
+        mPlayPauseBtn.setOnClickListener(this);
+        mShareBtn.setOnClickListener(this);
+        mSaveFileBtn.setOnClickListener(this);
+        mCloseBtn.setOnClickListener(this);
         initVideo();
 
+        TextView noFileText = (TextView)rootView.findViewById(R.id.mNoFileText);
         Uri uri = Uri.parse(bean.videoPath);
         if (noFileText != null) {
             noFileText.setVisibility(uri == null ? View.VISIBLE : View.GONE);
@@ -77,12 +87,26 @@ public class VideoFragment extends DialogFragment implements Listener.PlayListen
         }, 30);
     }
 
-    View.OnClickListener onActionClick = new View.OnClickListener() {
-        @Override
-        public void onClick(View v) {
-            actionButtonClick();
+    @Override
+    public void onClick(View v) {
+        if (v == mCloseBtn) {
+            dismissAllowingStateLoss();
+        } else if (v == mShareBtn) {
+            Listener.ClickButtonListener listener = (Listener.ClickButtonListener)mContext;
+            listener.onShareFile(position, bean);
+        } else if (v == mSaveFileBtn) {
+            Listener.ClickButtonListener listener = (Listener.ClickButtonListener)mContext;
+            listener.onSaveFile(position, bean);
+        } else if (v == mPlayPauseBtn) {
+            if (mMediaPlayerUtils.getIsPlaying()) {
+                mMediaPlayerUtils.mediaPause();
+                setButtonStatus(false);
+            } else {
+                mMediaPlayerUtils.mediaStart();
+                setButtonStatus(true);
+            }
         }
-    };
+    }
 
     MediaPlayer.OnCompletionListener onPlayCompletion = new MediaPlayer.OnCompletionListener() {
         @Override
@@ -92,19 +116,9 @@ public class VideoFragment extends DialogFragment implements Listener.PlayListen
         }
     };
 
-    private void actionButtonClick() {
-        if (mMediaPlayerUtils.getIsPlaying()) {
-            mMediaPlayerUtils.mediaPause();
-            setButtonStatus(false);
-        } else {
-            mMediaPlayerUtils.mediaStart();
-            setButtonStatus(true);
-        }
-    }
-
     private void setButtonStatus(boolean isPlaying) {
-        int resId = isPlaying ? R.drawable.icon_video_pause : R.drawable.icon_video_play;
-        mActionButton.setImageResource(resId);
+        int resId = isPlaying ? R.drawable.action_pause : R.drawable.action_play;
+        mPlayPauseBtn.setBackgroundResource(resId);
     }
 
     public void setItemInfo(int position, MessageBean bean) {

+ 0 - 1
app/src/main/java/com/xplora/xpchat/manager/DataManager.java

@@ -366,7 +366,6 @@ public class DataManager {
         if (!isShareMode) {
             //retList.add(addModel);
         }
-
         return retList;
     }
 

+ 2 - 0
app/src/main/java/com/xplora/xpchat/manager/DatabaseUtils.java

@@ -438,6 +438,8 @@ public class DatabaseUtils {
             bean.dur = ToolsUtils.random(60);
             bean.localState = Constant.MESSAGE_STATE_SEND_FAIL;
             bean.create = ToolsUtils.getCurrentTime() - 10000;
+            bean.filePath = "test share";
+            bean.videoPath = "test share";
             //bean.localState = (5);
             arrayList.add(bean);
         }

+ 1 - 0
app/src/main/java/com/xplora/xpchat/model/GridModel.java

@@ -11,6 +11,7 @@ public class GridModel {
     public String filePath = "";
     public int count = 0; //数量
     public Constant.E_FUNCTION type;
+    public boolean isSelected = false;
 
     public BaseBean bean;
 }

+ 1 - 0
app/src/main/java/com/xplora/xpchat/observer/Listener.java

@@ -45,6 +45,7 @@ public class Listener {
         void onResendMessage(int position, MessageBean bean);
         void onDeleteMessage(int position, MessageBean bean);
         void onDownloadFile(int position, MessageBean bean);
+        void onShareFile(int position, MessageBean bean);
         void onSaveFile(int position, MessageBean bean);
         void onGotoWifi();
     }

+ 1 - 0
app/src/main/java/com/xplora/xpchat/utils/Constant.java

@@ -106,6 +106,7 @@ public class Constant {
     public final static int IMG_SUONA_WIDTH = 20; //小喇叭宽度
 
     public final static int REQUEST_CODE_EMOJI = 1000;
+    public final static int REQUEST_CODE_SHARE = 1001;
     public final static int REQUEST_CODE_CAMERA = 1010;
     public final static int REQUEST_CODE_ALBUM = 1011;
     public final static int REQUEST_CODE_VIDEO = 1012;

+ 2 - 0
app/src/main/java/com/xplora/xpchat/utils/Macros.java

@@ -4,6 +4,8 @@ public class Macros {
 
     public static boolean LOCAL_EMOJI = true; //本地预置表情
 
+    public static boolean SHARE_MEMBER = true; //分享文件给成员
+
     //TODO:测试使用,正式版本需要关闭false
     public static boolean DEBUG = false;
 

+ 144 - 0
app/src/main/java/com/xplora/xpchat/view/HeaderViewRecyclerAdapter.java

@@ -0,0 +1,144 @@
+package com.xplora.xpchat.view;
+
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+
+public class HeaderViewRecyclerAdapter extends RecyclerView.Adapter {
+    private final int HEADER = 1;
+    private final int FOOTER = 2;
+    private ArrayList<View> mHeadView;
+    private ArrayList<View> mFootView;
+    private RecyclerView.Adapter mAdapter;
+
+    public HeaderViewRecyclerAdapter(ArrayList<View> HeadView, ArrayList<View> FootView, RecyclerView.Adapter adapter) {
+        mAdapter = adapter;
+        if (HeadView == null) {
+            //为了防止空指针异常
+            mHeadView = new ArrayList<>();
+        } else {
+            mHeadView = HeadView;
+        }
+
+        if (FootView == null) {
+            mFootView = new ArrayList<>();
+        } else {
+            mFootView = FootView;
+        }
+    }
+
+
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        //头部修改newHeadViewHolder的方法,mFooterView,有几个头,就需要几个headViewHolder
+        if (viewType == HEADER) {
+            return new HeadViewHolder(mHeadView.get(0));
+        } else if (viewType == FOOTER) {
+            //脚部,修改newHeadViewHolder的方法,mFooterView,有多个
+            return new FootViewHolder(mFootView.get(0));
+        }
+        //body部分,暴露出去操作
+        return mAdapter.onCreateViewHolder(parent, viewType);
+    }
+
+    //判断view的类型,头,身体,脚
+    @Override
+    public int getItemViewType(int position) {
+        int headcount = getHeadCount();
+        //返回头部
+        if (position < headcount) {
+            //返回头部类型,
+            return HEADER;
+        }
+
+        //body类型
+        final int midPosition = position - headcount;
+        int itemCount = 0;
+        if (mAdapter != null) {
+            itemCount = mAdapter.getItemCount();
+            if (midPosition < itemCount) {
+                //返回type不要写死了,body的类型可能不一致
+                return mAdapter.getItemViewType(midPosition);
+            }
+        }
+
+        //Footer类型
+        return FOOTER;
+
+    }
+
+
+    /**
+     * 和数据绑定,这里只做body部分的绑定
+     * 头和脚的数据绑定逻辑都是在外部操作的
+     * 传入前都已经绑定好l
+     */
+    @Override
+    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+        int headcount = getHeadCount();
+        if (position < headcount) {
+            //头部数据绑定,外部传入前已经操作,这里不再操作
+            return;
+        }
+
+        //body数据绑定
+        final int midPosition = position - headcount;
+        int itemcount = 0;
+        if (mAdapter != null) {
+            itemcount = mAdapter.getItemCount();
+            if (midPosition < itemcount) {
+                //暴露出去自由操作,传入的是调整后的位置,而不是算上头角的位置
+//                mAdapter.onBindViewHolder(holder, position);
+                mAdapter.onBindViewHolder(holder, midPosition);
+                return;
+            }
+        }
+        //脚部数据绑定,和头一样,啥也不用操作
+
+    }
+
+    @Override
+    public int getItemCount() {
+        //身体部分不为空
+        if (mAdapter != null) {
+            return getHeadCount() + getFootCount() + mAdapter.getItemCount();
+        } else {
+            //只有头和脚的情况下
+            return getHeadCount() + getFootCount();
+        }
+    }
+
+
+    private int getFootCount() {
+        return mFootView.size();
+    }
+
+    public int getHeadCount() {
+        return mHeadView.size();
+    }
+
+    /**
+     * 面两个head viewholder 没什么卵用
+     * viewholder是为了相同的item减少findviewbyid的时间
+     * 头部holder和尾部holder没有共性的findviewbyid
+     * 为了拓展方便只得创建,但是不会用到
+     */
+
+    class HeadViewHolder extends RecyclerView.ViewHolder {
+
+        public HeadViewHolder(View itemView) {
+            super(itemView);
+        }
+    }
+
+    class FootViewHolder extends RecyclerView.ViewHolder {
+
+        public FootViewHolder(View itemView) {
+            super(itemView);
+        }
+    }
+
+}

+ 55 - 0
app/src/main/java/com/xplora/xpchat/view/XPRecyclerView.java

@@ -0,0 +1,55 @@
+package com.xplora.xpchat.view;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+
+public class XPRecyclerView extends RecyclerView {
+
+    //用来存储添加的headerView和footerView
+    private ArrayList<View> mHeadView = new ArrayList<>();
+    private ArrayList<View> mFootView = new ArrayList<>();
+
+    //RecyclierView的适配器
+    private Adapter mAdapter;
+
+    public XPRecyclerView(Context context, @Nullable AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    //添加头部view,仿ListView的源码改造
+    public void addHeaderView(View headerView) {
+        mHeadView.add(headerView);
+        if (mAdapter != null) {
+            if (!(mAdapter instanceof HeaderViewRecyclerAdapter)) {
+                mAdapter = new HeaderViewRecyclerAdapter(mHeadView,mFootView, mAdapter);
+            }
+        }
+    }
+
+    //添加脚View
+    public void addFooterView(View footView) {
+        mFootView.add(footView);
+        if (mAdapter != null) {
+            if (!(mAdapter instanceof HeaderViewRecyclerAdapter)) {
+                mAdapter = new HeaderViewRecyclerAdapter(mHeadView,mFootView, mAdapter);
+            }
+        }
+    }
+
+    @Override
+    public void setAdapter(Adapter adapter) {
+        //参考listview方法 setAdapter的源码,对adapter进行更换
+        if (mHeadView.size() > 0 || mFootView.size() > 0)
+            mAdapter = new HeaderViewRecyclerAdapter(mHeadView, mFootView, adapter);
+        else {
+            mAdapter = adapter;
+        }
+        super.setAdapter(mAdapter);
+    }
+}

BIN
app/src/main/res/drawable-xhdpi/action_close.png


BIN
app/src/main/res/drawable-xhdpi/action_download.png


BIN
app/src/main/res/drawable-xhdpi/action_pause.png


BIN
app/src/main/res/drawable-xhdpi/action_play.png


BIN
app/src/main/res/drawable-xhdpi/action_share.png


BIN
app/src/main/res/drawable-xhdpi/icon_select_member.png


BIN
app/src/main/res/drawable-xhdpi/icon_video_pause.png


BIN
app/src/main/res/drawable-xhdpi/icon_video_play.png


+ 19 - 0
app/src/main/res/layout/activity_itemlist_share.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black"
+    >
+
+    <com.xplora.xpchat.view.XPRecyclerView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="15dp"
+        android:layout_marginTop="30dp"
+        android:layout_marginBottom="0dp"
+        android:id="@+id/recyclerView"
+        android:scrollbars="vertical"
+        android:scrollbarThumbVertical="@color/xp_yellow"
+        />
+
+</RelativeLayout>

+ 38 - 0
app/src/main/res/layout/chat_fragment_photo.xml

@@ -26,4 +26,42 @@
         android:visibility="gone"
         />
 
+    <RelativeLayout
+        android:id="@+id/mButtonLayout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        >
+
+        <ImageButton
+            android:id="@+id/mCloseBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="15dp"
+            android:layout_marginEnd="10dp"
+            android:layout_alignParentEnd="true"
+            android:background="@drawable/action_close"
+            />
+
+        <ImageButton
+            android:id="@+id/mShareBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="9dp"
+            android:layout_marginStart="15dp"
+            android:background="@drawable/action_share"
+            />
+
+        <ImageButton
+            android:id="@+id/mSaveFileBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="9dp"
+            android:layout_marginEnd="15dp"
+            android:layout_alignParentEnd="true"
+            android:background="@drawable/action_download"
+            />
+    </RelativeLayout>
+
 </RelativeLayout>

+ 46 - 11
app/src/main/res/layout/chat_fragment_video.xml

@@ -11,17 +11,6 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
 
-
-    <ImageView
-        android:id="@+id/mActionBtn"
-        android:layout_width="30dp"
-        android:layout_height="30dp"
-        android:layout_centerHorizontal="true"
-        android:layout_alignParentBottom="true"
-        android:layout_marginBottom="30dp"
-        android:src="@drawable/icon_video_play"
-        />
-
     <TextView
         android:id="@+id/mNoFileText"
         android:layout_width="wrap_content"
@@ -35,4 +24,50 @@
         android:visibility="gone"
         />
 
+    <RelativeLayout
+        android:id="@+id/mButtonLayout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        >
+
+        <ImageButton
+            android:id="@+id/mCloseBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="15dp"
+            android:layout_marginEnd="10dp"
+            android:layout_alignParentEnd="true"
+            android:background="@drawable/action_close"
+            />
+
+        <ImageButton
+            android:id="@+id/mPlayPauseBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:background="@drawable/action_play"
+            />
+
+        <ImageButton
+            android:id="@+id/mShareBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="9dp"
+            android:layout_marginStart="15dp"
+            android:background="@drawable/action_share"
+            />
+
+        <ImageButton
+            android:id="@+id/mSaveFileBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="9dp"
+            android:layout_marginEnd="15dp"
+            android:layout_alignParentEnd="true"
+            android:background="@drawable/action_download"
+            />
+    </RelativeLayout>
+
 </RelativeLayout>

+ 13 - 0
app/src/main/res/layout/item_contacts.xml

@@ -5,6 +5,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <LinearLayout
+        android:id="@+id/mContactLayout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
@@ -30,6 +31,18 @@
             />
     </LinearLayout>
 
+    <ImageView
+        android:id="@+id/mSelectImage"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignEnd="@+id/mContactLayout"
+        android:layout_alignBottom="@+id/mContactLayout"
+        android:layout_marginEnd="7dp"
+        android:layout_marginBottom="15dp"
+        android:src="@drawable/icon_select_member"
+        android:visibility="gone"
+        />
+
     <Button
         android:id="@+id/btn_count"
         android:layout_width="17dp"