Kaynağa Gözat

添加表情包成功

zengjiebin 7 yıl önce
ebeveyn
işleme
6c8c65cf80
24 değiştirilmiş dosya ile 985 ekleme ve 70 silme
  1. 315 0
      app/src/main/java/com/lqr/emoji/EmotionKeyboard.java
  2. 193 0
      app/src/main/java/com/lqr/emoji/EmotionLayout.java
  3. 18 0
      app/src/main/java/com/lqr/emoji/HtmlTvUtil.java
  4. 7 0
      app/src/main/java/com/lqr/emoji/IEmotionSelectedListener.java
  5. 46 0
      app/src/main/java/com/lqr/emoji/ListPagerAdapter.java
  6. 25 0
      app/src/main/java/com/sheep/gamegroup/util/KeyEventUtil.java
  7. 1 1
      app/src/main/java/com/sheep/gamegroup/util/ResImageGetter.java
  8. 4 3
      app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java
  9. 10 0
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  10. 41 9
      app/src/main/java/com/sheep/gamegroup/view/activity/ActTestExpression.java
  11. 10 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActUserCommentDetail.java
  12. 58 8
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java
  13. 4 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java
  14. 5 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  15. 7 0
      app/src/main/res/drawable/emotion_drawable_selector_dian.xml
  16. 5 0
      app/src/main/res/drawable/shape_circle_red_solid.xml
  17. 7 0
      app/src/main/res/drawable/shape_circle_red_stroke.xml
  18. 61 47
      app/src/main/res/layout/act_test_expression.xml
  19. 7 0
      app/src/main/res/layout/emotion_dian.xml
  20. 6 0
      app/src/main/res/layout/emotion_item.xml
  21. 12 0
      app/src/main/res/layout/emotion_item_page.xml
  22. 30 0
      app/src/main/res/layout/emotion_layout.xml
  23. 53 0
      app/src/main/res/layout/include_input_comment_exp.xml
  24. 60 0
      app/src/main/res/layout/net_empty_smart_refresh_rv_exp.xml

+ 315 - 0
app/src/main/java/com/lqr/emoji/EmotionKeyboard.java

@@ -0,0 +1,315 @@
+package com.lqr.emoji;
+
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.graphics.Rect;
+import android.os.Build;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+
+/**
+ * CSDN_LQR
+ * 表情键盘协调工具
+ */
+
+public class EmotionKeyboard {
+
+    private static final String SHARE_PREFERENCE_NAME = "EmotionKeyBoard";
+    private static final String SHARE_PREFERENCE_SOFT_INPUT_HEIGHT = "sofe_input_height";
+    private Activity mActivity;
+    private InputMethodManager mInputManager;//软键盘管理类
+    private SharedPreferences mSp;
+    private View mEmotionLayout;//表情布局
+    private EditText mEditText;
+    private View mContentView;//内容布局view,即除了表情布局或者软键盘布局以外的布局,用于固定bar的高度,防止跳闪
+
+    public EmotionKeyboard() {
+    }
+
+    public static EmotionKeyboard with(Activity activity) {
+        EmotionKeyboard emotionInputDetector = new EmotionKeyboard();
+        emotionInputDetector.mActivity = activity;
+        emotionInputDetector.mInputManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
+        emotionInputDetector.mSp = activity.getSharedPreferences(SHARE_PREFERENCE_NAME, Context.MODE_PRIVATE);
+        return emotionInputDetector;
+    }
+
+    /**
+     * 绑定内容view,此view用于固定bar的高度,防止跳闪
+     */
+    public EmotionKeyboard bindToContent(View contentView) {
+        mContentView = contentView;
+        return this;
+    }
+
+    /**
+     * 绑定编辑框
+     */
+    public EmotionKeyboard bindToEditText(EditText editText) {
+        mEditText = editText;
+        mEditText.requestFocus();
+        mEditText.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                if (event.getAction() == MotionEvent.ACTION_UP && mEmotionLayout.isShown()) {
+                    lockContentHeight();//显示软件盘时,锁定内容高度,防止跳闪。
+                    hideEmotionLayout(true);//隐藏表情布局,显示软件盘
+                    //软件盘显示后,释放内容高度
+                    mEditText.postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            unlockContentHeightDelayed();
+                        }
+                    }, 200L);
+                }
+                return false;
+            }
+        });
+        return this;
+    }
+
+    /**
+     * 绑定表情按钮(可以有多个表情按钮)
+     *
+     * @param emotionButton
+     * @return
+     */
+    public EmotionKeyboard bindToEmotionButton(View... emotionButton) {
+        for (View view : emotionButton) {
+            view.setOnClickListener(getOnEmotionButtonOnClickListener());
+        }
+        return this;
+    }
+
+    private View.OnClickListener getOnEmotionButtonOnClickListener() {
+        return new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mOnEmotionButtonOnClickListener != null) {
+                    if (mOnEmotionButtonOnClickListener.onEmotionButtonOnClickListener(v)) {
+                        return;
+                    }
+                }
+
+                if (mEmotionLayout.isShown()) {
+                    lockContentHeight();//显示软件盘时,锁定内容高度,防止跳闪。
+                    hideEmotionLayout(true);//隐藏表情布局,显示软件盘
+                    unlockContentHeightDelayed();//软件盘显示后,释放内容高度
+                } else {
+                    if (isSoftInputShown()) {//同上
+                        lockContentHeight();
+                        showEmotionLayout();
+                        unlockContentHeightDelayed();
+                    } else {
+                        showEmotionLayout();//两者都没显示,直接显示表情布局
+                    }
+                }
+            }
+        };
+    }
+
+    /*================== 表情按钮点击事件回调 begin ==================*/
+    public interface OnEmotionButtonOnClickListener {
+        /**
+         * 主要是为了适用仿微信的情况,微信有一个表情按钮和一个功能按钮,这2个按钮都是控制了底部区域的显隐
+         *
+         * @param view
+         * @return true:拦截切换输入法,false:让输入法正常切换
+         */
+        boolean onEmotionButtonOnClickListener(View view);
+    }
+
+    OnEmotionButtonOnClickListener mOnEmotionButtonOnClickListener;
+
+    public void setOnEmotionButtonOnClickListener(OnEmotionButtonOnClickListener onEmotionButtonOnClickListener) {
+        mOnEmotionButtonOnClickListener = onEmotionButtonOnClickListener;
+    }
+    /*================== 表情按钮点击事件回调 end ==================*/
+
+    /**
+     * 设置表情内容布局
+     *
+     * @param emotionLayout
+     * @return
+     */
+    public EmotionKeyboard setEmotionLayout(View emotionLayout) {
+        mEmotionLayout = emotionLayout;
+        return this;
+    }
+
+    public EmotionKeyboard build() {
+        //设置软件盘的模式:SOFT_INPUT_ADJUST_RESIZE  这个属性表示Activity的主窗口总是会被调整大小,从而保证软键盘显示空间。
+        //从而方便我们计算软件盘的高度
+        mActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN |
+                WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
+        //隐藏软件盘
+        hideSoftInput();
+        return this;
+    }
+
+    /**
+     * 点击返回键时先隐藏表情布局
+     *
+     * @return
+     */
+    public boolean interceptBackPress(boolean showSoftInput) {
+        if (mEmotionLayout.isShown()) {
+            hideEmotionLayout(showSoftInput);
+            return true;
+        }
+        return false;
+    }
+
+    private void showEmotionLayout() {
+        int softInputHeight = getSupportSoftInputHeight();
+        if (softInputHeight == 0) {
+            softInputHeight = mSp.getInt(SHARE_PREFERENCE_SOFT_INPUT_HEIGHT, dip2Px(270));
+        }
+        hideSoftInput();
+        mEmotionLayout.getLayoutParams().height = softInputHeight;
+        mEmotionLayout.setVisibility(View.VISIBLE);
+    }
+
+    public int dip2Px(int dip) {
+        float density = mActivity.getApplicationContext().getResources().getDisplayMetrics().density;
+        int px = (int) (dip * density + 0.5f);
+        return px;
+    }
+
+    /**
+     * 隐藏表情布局
+     *
+     * @param showSoftInput 是否显示软件盘
+     */
+    private void hideEmotionLayout(boolean showSoftInput) {
+        if (mEmotionLayout.isShown()) {
+            mEmotionLayout.setVisibility(View.GONE);
+            if (showSoftInput) {
+                showSoftInput();
+            }
+        }
+    }
+
+    /**
+     * 锁定内容高度,防止跳闪
+     */
+    private void lockContentHeight() {
+        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mContentView.getLayoutParams();
+        params.height = mContentView.getHeight();
+        params.weight = 0.0F;
+    }
+
+    /**
+     * 释放被锁定的内容高度
+     */
+    public void unlockContentHeightDelayed() {
+        mEditText.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                ((LinearLayout.LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
+            }
+        }, 200L);
+    }
+
+    /**
+     * 编辑框获取焦点,并显示软件盘
+     */
+    public void showSoftInput() {
+        mEditText.requestFocus();
+        mEditText.post(new Runnable() {
+            @Override
+            public void run() {
+                mInputManager.showSoftInput(mEditText, 0);
+            }
+        });
+    }
+
+    /**
+     * 隐藏软件盘
+     */
+    public void hideSoftInput() {
+        mInputManager.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);
+    }
+
+    /**
+     * 是否显示软件盘
+     *
+     * @return
+     */
+    public boolean isSoftInputShown() {
+        return getSupportSoftInputHeight() != 0;
+    }
+
+    /**
+     * 获取软件盘的高度
+     *
+     * @return
+     */
+    private int getSupportSoftInputHeight() {
+        Rect r = new Rect();
+        /**
+         * decorView是window中的最顶层view,可以从window中通过getDecorView获取到decorView。
+         * 通过decorView获取到程序显示的区域,包括标题栏,但不包括状态栏。
+         */
+        mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
+        //获取屏幕的高度
+        int screenHeight = mActivity.getWindow().getDecorView().getRootView().getHeight();
+        //计算软件盘的高度
+        int softInputHeight = screenHeight - r.bottom;
+        /**
+         * 某些Android版本下,没有显示软键盘时减出来的高度总是144,而不是零,
+         * 这是因为高度是包括了虚拟按键栏的(例如华为系列),所以在API Level高于20时,
+         * 我们需要减去底部虚拟按键栏的高度(如果有的话)
+         */
+        if (Build.VERSION.SDK_INT >= 20) {
+            // When SDK Level >= 20 (Android L), the softInputHeight will contain the height of softButtonsBar (if has)
+            softInputHeight = softInputHeight - getSoftButtonsBarHeight();
+        }
+        if (softInputHeight < 0) {
+            Log.w("LQR", "EmotionKeyboard--Warning: value of softInputHeight is below zero!");
+        }
+        //存一份到本地
+        if (softInputHeight > 0) {
+            mSp.edit().putInt(SHARE_PREFERENCE_SOFT_INPUT_HEIGHT, softInputHeight).apply();
+        }
+        return softInputHeight;
+    }
+
+    /**
+     * 底部虚拟按键栏的高度
+     *
+     * @return
+     */
+    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
+    private int getSoftButtonsBarHeight() {
+        DisplayMetrics metrics = new DisplayMetrics();
+        //这个方法获取可能不是真实屏幕的高度
+        mActivity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+        int usableHeight = metrics.heightPixels;
+        //获取当前屏幕的真实高度
+        mActivity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
+        int realHeight = metrics.heightPixels;
+        if (realHeight > usableHeight) {
+            return realHeight - usableHeight;
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * 获取软键盘高度
+     *
+     * @return
+     */
+    public int getKeyBoardHeight() {
+        return mSp.getInt(SHARE_PREFERENCE_SOFT_INPUT_HEIGHT, 400);
+    }
+}

+ 193 - 0
app/src/main/java/com/lqr/emoji/EmotionLayout.java

@@ -0,0 +1,193 @@
+package com.lqr.emoji;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.support.v4.view.ViewPager;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+import com.sheep.gamegroup.view.adapter.ArrayAdapter;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * CSDN_LQR
+ * 表情布局
+ */
+public class EmotionLayout extends LinearLayout implements View.OnClickListener {
+
+    public static int EMOJI_COLUMNS = 3;
+    public static int EMOJI_ROWS = 3;
+    public static int EMOJI_PER_PAGE = EMOJI_COLUMNS * EMOJI_ROWS;
+
+    private Context mContext;
+    private ViewPager mVpEmotioin;
+    private LinearLayout mLlPageNumber;
+
+    private IEmotionSelectedListener mEmotionSelectedListener;
+
+    public EmotionLayout(Context context) {
+        this(context, null);
+    }
+
+    public EmotionLayout(Context context, @Nullable AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public EmotionLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        mContext = context;
+    }
+
+    public void setEmotionSelectedListener(IEmotionSelectedListener emotionSelectedListener) {
+        if (emotionSelectedListener != null) {
+            this.mEmotionSelectedListener = emotionSelectedListener;
+        } else {
+            Log.i("CSDN_LQR", "IEmotionSelectedListener is null");
+        }
+    }
+
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        super.onSizeChanged(w, h, oldw, oldh);
+        init();
+        initListener();
+    }
+
+    private void init() {
+        LayoutInflater.from(mContext).inflate(R.layout.emotion_layout, this);
+        mVpEmotioin = findViewById(R.id.vpEmotioin);
+        mLlPageNumber = findViewById(R.id.llPageNumber);
+
+        initViews();
+        mVpEmotioin.setAdapter(new ListPagerAdapter(viewList));
+
+    }
+
+    private List<View> viewList;
+    private List<View> dianViewList;
+
+    private void initViews() {
+        int totalCount = PNG_NAMES.length;
+        int pageTotal = (totalCount - 1) / EMOJI_PER_PAGE + 1;
+        int perPageCount = EMOJI_PER_PAGE;
+        viewList = new ArrayList<>(pageTotal);
+        dianViewList = new ArrayList<>(pageTotal);
+        for (int i = 0; i < pageTotal; i++) {
+            //组装图片数据
+            List<String> pngList = new ArrayList<>(perPageCount);
+            for (int j = 0; j < perPageCount; j++) {
+                int index = i * EMOJI_COLUMNS + j;
+                if (index + 1 >= totalCount) {
+                    break;
+                }
+                pngList.add(PNG_NAMES[index]);
+            }
+            //添加每页GridView
+            View itemView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.emotion_item_page, null);
+            GridView gridView = itemView.findViewById(R.id.emotion_item_page_gv);
+            gridView.setNumColumns(EMOJI_COLUMNS);
+            gridView.setAdapter(new ArrayAdapter<String>(mContext, R.layout.emotion_item, pngList) {
+                @Override
+                public boolean convert(int position, View convertView, ViewGroup parent, String item) {
+                    ImageView imageView = convertView.findViewById(R.id.emotion_item_iv);
+                    if (imageView != null) {
+                        imageView.setTag(item);
+                        imageView.setImageResource(mContext.getResources().getIdentifier(item, "mipmap", BuildConfig.APPLICATION_ID));
+                        imageView.setOnClickListener(EmotionLayout.this);
+                    }
+                    return true;
+                }
+            });
+            viewList.add(itemView);
+
+            //tabs
+            View dianView = View.inflate(mContext, R.layout.emotion_dian, null);
+            int radius = getResources().getDimensionPixelSize(R.dimen.content_padding_10);
+            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(radius, radius);
+            if (i != 0)
+                layoutParams.leftMargin = radius;
+            mLlPageNumber.addView(dianView, layoutParams);
+            dianViewList.add(dianView);
+            dianViewList.get(i).setEnabled(i == 0);
+        }
+    }
+
+    private void initListener() {
+
+        mVpEmotioin.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                for (int i = 0; i < dianViewList.size(); i++) {
+                    dianViewList.get(i).setEnabled(i == position);
+                }
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
+            }
+        });
+
+    }
+
+    @Override
+    public void onClick(View v) {
+        Object tag = v.getTag();
+        if (tag instanceof String) {
+            selectEmotionItem(tag.toString());
+        }
+    }
+
+    private void selectEmotionItem(String name) {
+        if (mMessageEditText != null) {
+            mMessageEditText.append(String.format(Locale.CHINA, "[%s]", nameToTagMap.get(name)));
+        }
+    }
+
+
+    EditText mMessageEditText;
+
+    public void attachEditText(EditText messageEditText) {
+        mMessageEditText = messageEditText;
+    }
+
+
+
+    public static final String[] PNG_NAMES = {"exp_666", "exp_ccc", "exp_ggl", "exp_hjz", "exp_kbjbg", "exp_lll", "exp_sxyj", "exp_wxll", "exp_xq", "exp_yd", "exp_yx"};
+    public static final String[] PNG_TAGS = {"666", "戳", "尴尬了", "好紧张", "苦逼加班狗", "略略略~", "伤心欲绝", "我心凉凉", "嫌弃", "悠闲", "有毒"};
+    public static final Map<String, String> nameToTagMap = new HashMap<>();
+    public static final Map<String, String> tagToNameMap = new HashMap<>();
+    static {
+        for (int i = 0; i < PNG_NAMES.length; i++) {
+            nameToTagMap.put(PNG_NAMES[i], PNG_TAGS[i]);
+            tagToNameMap.put(PNG_TAGS[i], PNG_NAMES[i]);
+        }
+    }
+    //转换内容
+    public static String changeContent(String content) {
+        for (String pngTag : PNG_TAGS) {
+            String replaceContent = String.format(Locale.CHINA, "<img src=\"%s\" />", tagToNameMap.get(pngTag));
+            content = content.replaceAll(String.format(Locale.CHINA, "\\[%s\\]", pngTag), replaceContent);
+        }
+        return content;
+    }
+}

+ 18 - 0
app/src/main/java/com/lqr/emoji/HtmlTvUtil.java

@@ -0,0 +1,18 @@
+package com.lqr.emoji;
+
+import android.text.Html;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.util.ResImageGetter;
+
+import java.util.Locale;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public class HtmlTvUtil {
+    public static void setHtmlToTv(TextView textView,  String content){
+        textView.setText(Html.fromHtml(content, new ResImageGetter(textView), null));
+    }
+}

+ 7 - 0
app/src/main/java/com/lqr/emoji/IEmotionSelectedListener.java

@@ -0,0 +1,7 @@
+package com.lqr.emoji;
+
+public interface IEmotionSelectedListener {
+    void onEmojiSelected(String key);
+
+    void onStickerSelected(String categoryName, String stickerName, String stickerBitmapPath);
+}

+ 46 - 0
app/src/main/java/com/lqr/emoji/ListPagerAdapter.java

@@ -0,0 +1,46 @@
+package com.lqr.emoji;
+
+import android.support.annotation.NonNull;
+import android.support.v4.view.PagerAdapter;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public class ListPagerAdapter extends PagerAdapter {
+    private List<View> views;
+
+    public ListPagerAdapter(List<View> views) {
+        this.views = views;
+    }
+
+    @Override
+    public int getCount() {
+        return views.size();
+    }
+
+    @NonNull
+    @Override
+    public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
+        return view == object;
+    }
+
+    @NonNull
+    @Override
+    public Object instantiateItem(@NonNull ViewGroup container, int position) {
+        View view = views.get(position);
+        container.addView(view);
+        return view;
+    }
+
+    @NonNull
+    @Override
+    public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
+        container.removeView(views.get(position));
+    }
+
+}

+ 25 - 0
app/src/main/java/com/sheep/gamegroup/util/KeyEventUtil.java

@@ -0,0 +1,25 @@
+package com.sheep.gamegroup.util;
+
+import android.app.Instrumentation;
+
+/**
+ * Created by realicing on 2018/11/8.
+ * realicing@sina.com
+ */
+public class KeyEventUtil {
+    public static void sendKeyDownUp(final int keyCode) {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    // 创建一个Instrumentation对象
+                    Instrumentation inst = new Instrumentation();
+                    // 调用inst对象的按键模拟方法
+                    inst.sendKeyDownUpSync(keyCode);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }).start();
+    }
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/ResImageGetter.java

@@ -17,7 +17,7 @@ public class ResImageGetter implements Html.ImageGetter {
     private int textSize;
 
     public ResImageGetter(TextView textView) {
-        textSize = (int) textView.getTextSize() * 2;
+        textSize = (int) textView.getTextSize() * 3;
     }
 
     @Override

+ 4 - 3
app/src/main/java/com/sheep/gamegroup/util/TextViewUtil.java

@@ -38,9 +38,10 @@ public class TextViewUtil {
                     listenEllipsizeChange(textView, action1);
                 }
             }
-        },100L);
+        }, 100L);
 
     }
+
     //初始化文本介绍,必须有 intro_content 和 intro_show_all
     public static void initIntroView(View itemView, final ShowAll showAll) {
         String text = showAll.getContent();
@@ -49,8 +50,8 @@ public class TextViewUtil {
         final View intro_show_all_no = itemView.findViewById(showAll.getIntroShowAllNoId());
         boolean isFirst = showAll.isFirst();
 
-        ViewUtil.setText(intro_content, text);
-        if(isFirst) {
+        ViewUtil.setH5ImgText(intro_content, text);
+        if (isFirst) {
             intro_content.setMaxLines(showAll.getMaxLine());
             TextViewUtil.listenEllipsizeChange(intro_content, new Action1<Integer>() {
                 @Override

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -914,6 +914,16 @@ public class ViewUtil {
             textView.setMovementMethod(new ScrollingMovementMethod());
         }
     }
+    public static void setH5ImgText(TextView textView, String content) {
+        if (textView != null) {
+            if (TextUtils.isEmpty(content)) {
+                textView.setText("");
+                return;
+            }
+            content = content.replaceAll("\n", "<br>");//替换换行
+            textView.setText(Html.fromHtml(content, new ResImageGetter(textView), null));
+        }
+    }
 
     public static void loadDataWithBaseURL(com.tencent.smtt.sdk.WebView webView, String content) {
         webView.loadDataWithBaseURL(null,

+ 41 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/ActTestExpression.java

@@ -3,11 +3,15 @@ package com.sheep.gamegroup.view.activity;
 import android.text.Html;
 import android.view.View;
 import android.widget.EditText;
+import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
+import com.lqr.emoji.EmotionKeyboard;
+import com.lqr.emoji.EmotionLayout;
+import com.lqr.emoji.IEmotionSelectedListener;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.util.ResImageGetter;
-import com.sheep.gamegroup.util.UrlImageGetter;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
@@ -24,7 +28,13 @@ public class ActTestExpression extends BaseActivity {
     @BindView(R.id.test_content)
     TextView test_content;
     @BindView(R.id.test_input_comment)
-    EditText test_input_comment;
+    EditText mEtContent;
+    @BindView(R.id.llContent)
+    LinearLayout mLlContent;
+    @BindView(R.id.elEmotion)
+    EmotionLayout mElEmotion;
+
+    private EmotionKeyboard mEmotionKeyboard;
     @Override
     protected int getLayoutId() {
         return R.layout.act_test_expression;
@@ -32,16 +42,42 @@ public class ActTestExpression extends BaseActivity {
 
     @Override
     public void initView() {
-
         TitleBarUtils.getInstance().setTitle(this, "写评价")
                 .setEndTv(this, "发表", 0xFF2EBEF2, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
-                        String content = test_input_comment.getText().toString();
+                        String content = mEtContent.getText().toString();
                         commitComment(content);
                     }
                 })
                 .setTitleFinish(this);
+        initEmotionKeyboard();
+        initSticker();
+    }
+
+    private void initSticker() {
+        mElEmotion.attachEditText(mEtContent);
+
+        mElEmotion.setEmotionSelectedListener(new IEmotionSelectedListener() {
+            @Override
+            public void onEmojiSelected(String key) {
+
+            }
+
+            @Override
+            public void onStickerSelected(String categoryName, String stickerName, String stickerBitmapPath) {
+                String stickerPath = stickerBitmapPath;
+                Toast.makeText(getApplicationContext(), stickerPath, Toast.LENGTH_SHORT).show();
+            }
+        });
+    }
+
+    private void initEmotionKeyboard() {
+        mEmotionKeyboard = EmotionKeyboard.with(this);
+        mEmotionKeyboard.bindToContent(mLlContent);
+        mEmotionKeyboard.bindToEmotionButton(test_content);
+        mEmotionKeyboard.bindToEditText(mEtContent);
+        mEmotionKeyboard.setEmotionLayout(mElEmotion);
     }
 
     //提交数据
@@ -49,13 +85,9 @@ public class ActTestExpression extends BaseActivity {
         test_content.setText(Html.fromHtml(String.format(Locale.CHINA, "%s<img src=\"%s\" />", content, "exp_666"), new ResImageGetter(test_content), null));
     }
 
-    //点击文本弹出表情包选择框
-    public void onClickContent(View view) {
-
-    }
     //点击x来清空输入内容
     public void onClickXInput(View view) {
         ViewUtil.setText(test_content);
-        ViewUtil.setText(test_input_comment);
+        ViewUtil.setText(mEtContent);
     }
 }

+ 10 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActUserCommentDetail.java

@@ -13,12 +13,21 @@ import com.sheep.gamegroup.view.fragment.FgtUserCommentDetail;
  */
 public class ActUserCommentDetail extends BaseContainerActivity {
 
+    private FgtUserCommentDetail fgt;
+
     @Override
     protected Fragment initFragment() {
         Integer user_comment_id = DataUtil.getObject(getIntent(), Integer.class);
-        FgtUserCommentDetail fgt = new FgtUserCommentDetail();
+        fgt = new FgtUserCommentDetail();
         fgt.setUser_comment_id(user_comment_id);
         return fgt;
     }
 
+    @Override
+    public void onBackPressed() {
+        if(fgt.onBackPressed()){
+            return;
+        }
+        super.onBackPressed();
+    }
 }

+ 58 - 8
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java

@@ -3,13 +3,18 @@ package com.sheep.gamegroup.view.fragment;
 import android.content.DialogInterface;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.EditText;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.lqr.emoji.EmotionKeyboard;
+import com.lqr.emoji.EmotionLayout;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
@@ -20,6 +25,7 @@ import com.sheep.gamegroup.model.entity.UserCommentReply;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.KeyEventUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.TestUtil;
@@ -49,20 +55,35 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
 
     @Override
     public int getLayoutId() {
-        return R.layout.net_empty_smart_refresh_rv;
+        return R.layout.net_empty_smart_refresh_rv_exp;
     }
 
     @BindView(R.id.refresh)
     SmartRefreshLayout refresh;
     @BindView(R.id.bottom)
     RelativeLayout bottom;
+    @BindView(R.id.rlContent)
+    RelativeLayout rlContent;
+    @BindView(R.id.elEmotion)
+    EmotionLayout elEmotion;
     //输入框
     private EditText input_comment_input;
+    private ImageView input_comment_exp;
+
+    //表情键盘协调工具
+    private EmotionKeyboard mEmotionKeyboard;
 
     @Override
     public void initView() {
         TitleBarUtils.getInstance().setTitle(mView, "评论详情")
-                .setTitleFinish(mView, activity);
+                .setTitleFinish(mView, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        if (!onBackPressed()) {
+                            KeyEventUtil.sendKeyDownUp(KeyEvent.KEYCODE_BACK);
+                        }
+                    }
+                });
         smartRefreshLayout = refresh;
         refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
             @Override
@@ -83,26 +104,33 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         //尾部,在无数据时显示
         footerView = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.footer_user_comment_detail, null);
         //底部可发表评论
-        LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.include_input_comment, bottom);
+        LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.include_input_comment_exp, bottom);
         input_comment_input = bottom.findViewById(R.id.input_comment_input);
+        input_comment_exp = bottom.findViewById(R.id.input_comment_exp);
         bottom.findViewById(R.id.input_comment_commit).setOnClickListener(new View.OnClickListener() {
+
             @Override
             public void onClick(View view) {
                 String content = input_comment_input.getText().toString();
-                commitContent(content);
+                String changeContent = EmotionLayout.changeContent(content);
+                commitContent(changeContent, !TextUtils.equals(content, changeContent));
             }
         });
+        //初始化 表情键盘协调工具
+        initEmotionKeyboard();
+        initSticker();
 
     }
+
     //用户评论一个用户对游戏的评论
-    private void commitContent(String content) {
+    private void commitContent(String content, boolean expression) {
         if (TestUtil.isDev()) G.showToast("评论内容:" + content);
         if (content.isEmpty()) {
             G.showToast("评论内容不能为空");
             return;
         }
         // 发表评论
-        ApiJSONUtil.postGameUserUserComment(user_comment_id, false, content)
+        ApiJSONUtil.postGameUserUserComment(user_comment_id, expression, content)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
@@ -131,6 +159,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
     private View user_comment_detail_line1;
     private View user_comment_detail_line2;
     private TextView total_count_tv;
+
     //初始化headerView
     private void initHeaderView() {
         headerViewHelper = new UserCommentHelper(R.layout.header_user_comment_detail);
@@ -142,7 +171,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         user_comment_detail_game_ll.setVisibility(View.GONE);
         user_comment_detail_line1.setVisibility(View.GONE);
         user_comment_detail_line2.setVisibility(View.GONE);
-        if(total_count_tv != null){
+        if (total_count_tv != null) {
             ViewUtil.setText(total_count_tv, getString(R.string.total_x_comment, ViewUtil.BLOCK));
         }
     }
@@ -188,7 +217,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
         if (page == 1 && userCommentDetail != null) {//第一页才有下面的数据
             adapter.setUserComment(userCommentDetail.getUser_comment());
             headerViewHelper.loadHeaderViewData(userCommentDetail.getUser_comment());
-            if(!userCommentDetail.getUser_comment().isArticleUserComment()){
+            if (!userCommentDetail.getUser_comment().isArticleUserComment()) {
                 headerViewHelper.getUser_comment_detail_user_publish_score().setVisibility(View.VISIBLE);
                 user_comment_detail_game_ll.setVisibility(View.VISIBLE);
                 user_comment_detail_line1.setVisibility(View.VISIBLE);
@@ -229,4 +258,25 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> {
             }
         }
     }
+
+    private void initSticker() {
+        elEmotion.attachEditText(input_comment_input);
+    }
+
+    //初始化 表情键盘协调工具
+    private void initEmotionKeyboard() {
+        mEmotionKeyboard = EmotionKeyboard.with(activity);
+        mEmotionKeyboard.bindToContent(rlContent);
+        mEmotionKeyboard.bindToEmotionButton(input_comment_exp);
+        mEmotionKeyboard.bindToEditText(input_comment_input);
+        mEmotionKeyboard.setEmotionLayout(elEmotion);
+    }
+
+    //返回处理
+    public boolean onBackPressed() {
+        if (mEmotionKeyboard != null) {
+            return mEmotionKeyboard.interceptBackPress(true);
+        }
+        return false;
+    }
 }

+ 4 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -10,14 +10,18 @@ import android.support.multidex.MultiDex;
 import android.support.multidex.MultiDexApplication;
 import android.text.TextUtils;
 import android.util.DisplayMetrics;
+import android.widget.ImageView;
 
 import com.baidu.location.BDAbstractLocationListener;
 import com.baidu.location.BDLocation;
 import com.baidu.location.LocationClient;
 import com.baidu.location.LocationClientOption;
 import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
 import com.liulishuo.okdownload.OkDownload;
 import com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher;
+import com.lqr.emoji.EmotionLayout;
 import com.sheep.gamegroup.di.components.DaggerNetComponent;
 import com.sheep.gamegroup.di.components.NetComponent;
 import com.sheep.gamegroup.di.modules.NetModule;
@@ -264,7 +268,6 @@ public class SheepApp extends MultiDexApplication {
         DownloadDispatcher.setMaxParallelRunningCount(1000);//在这里,下载框架好像有个bug,如果设置为5,第一个下载会占4个,第二个下载就只有一个在下载,就会失败
 
 //        RemitStoreOnSQLite.setRemitToDBDelayMillis(3000);
-
     }
 
     private void initBdLocationOption() {

+ 5 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -122,6 +122,11 @@ public class TitleBarUtils {
                 });
         return mTitleBarUtils;
     }
+    public TitleBarUtils setTitleFinish(final View view, View.OnClickListener listener) {
+        view.findViewById(R.id.img_baseactivity_title)
+                .setOnClickListener(listener);
+        return mTitleBarUtils;
+    }
     public TitleBarUtils setTitleFinish(final Activity activity, View.OnClickListener listener) {
         activity.findViewById(R.id.img_baseactivity_title)
                 .setOnClickListener(listener);

+ 7 - 0
app/src/main/res/drawable/emotion_drawable_selector_dian.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/shape_circle_red_solid" android:state_enabled="true"/>
+    <item android:drawable="@drawable/shape_circle_red_stroke"/>
+
+</selector>

+ 5 - 0
app/src/main/res/drawable/shape_circle_red_solid.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#999" />
+</shape>

+ 7 - 0
app/src/main/res/drawable/shape_circle_red_stroke.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+    <stroke
+        android:width="2dp"
+        android:color="#999"/>
+</shape>

+ 61 - 47
app/src/main/res/layout/act_test_expression.xml

@@ -5,58 +5,72 @@
     android:background="@color/white"
     android:orientation="vertical">
 
-    <include layout="@layout/title" />
-
-    <TextView
-        android:id="@+id/test_content"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:onClick="onClickContent"
-        android:padding="16dp"
-        android:textColor="#ff666666"
-        android:textSize="13sp" />
-
-    <View
+    <LinearLayout
+        android:id="@+id/llContent"
         android:layout_width="match_parent"
-        android:layout_height="1dp"
-        android:layout_marginStart="16dp"
-        android:layout_marginEnd="16dp"
-        android:background="#fff5f5f5" />
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:orientation="vertical">
 
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        <include layout="@layout/title" />
 
-        <android.support.v7.widget.AppCompatAutoCompleteTextView
-            android:id="@+id/test_input_comment"
+        <TextView
+            android:id="@+id/test_content"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@null"
-            android:hint="写下您的看法"
-            android:lineSpacingMultiplier="1.3"
-            android:paddingStart="16dp"
-            android:paddingTop="20dp"
-            android:paddingEnd="16dp"
-            android:paddingBottom="20dp"
-            android:textColor="#333333"
-            android:textColorHint="#ffcccccc"
+            android:padding="16dp"
+            android:textColor="#ff666666"
             android:textSize="13sp" />
 
-        <ImageView
-            android:layout_width="50dp"
-            android:layout_height="wrap_content"
-            android:layout_alignBottom="@id/test_input_comment"
-            android:layout_alignParentEnd="true"
-            android:layout_marginEnd="2dp"
-            android:onClick="onClickXInput"
-            android:padding="20dp"
-            android:scaleType="fitCenter"
-            android:src="@mipmap/x" />
-    </RelativeLayout>
-    <!--这里是一个系统级别的bug吗,为什么上面的输入框不能自动弹出输入法,而必须添加下面的ListView来让整个界面充满才能自动弹出输入法(不能是View...)-->
-    <ListView
-        android:id="@+id/search_app_list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginStart="16dp"
+            android:layout_marginEnd="16dp"
+            android:background="#fff5f5f5" />
 
-</LinearLayout>
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <android.support.v7.widget.AppCompatAutoCompleteTextView
+                android:id="@+id/test_input_comment"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:hint="写下您的看法"
+                android:lineSpacingMultiplier="1.3"
+                android:paddingStart="16dp"
+                android:paddingTop="20dp"
+                android:paddingEnd="16dp"
+                android:paddingBottom="20dp"
+                android:textColor="#333333"
+                android:textColorHint="#ffcccccc"
+                android:textSize="13sp" />
+
+            <ImageView
+                android:layout_width="50dp"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@id/test_input_comment"
+                android:layout_alignParentEnd="true"
+                android:layout_marginEnd="2dp"
+                android:onClick="onClickXInput"
+                android:padding="20dp"
+                android:scaleType="fitCenter"
+                android:src="@mipmap/x" />
+        </RelativeLayout>
+        <!--这里是一个系统级别的bug吗,为什么上面的输入框不能自动弹出输入法,而必须添加下面的ListView来让整个界面充满才能自动弹出输入法(不能是View...)-->
+        <ListView
+            android:id="@+id/search_app_list"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+    </LinearLayout>
+    <!--表情区-->
+    <com.lqr.emoji.EmotionLayout
+        android:id="@+id/elEmotion"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone" />
+</LinearLayout>

+ 7 - 0
app/src/main/res/layout/emotion_dian.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="10dp"
+    android:layout_height="10dp"
+    android:background="@drawable/emotion_drawable_selector_dian">
+
+</View>

+ 6 - 0
app/src/main/res/layout/emotion_item.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/emotion_item_iv"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:src="@drawable/loading_01"/>

+ 12 - 0
app/src/main/res/layout/emotion_item_page.xml

@@ -0,0 +1,12 @@
+<?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">
+
+    <GridView
+        android:id="@+id/emotion_item_page_gv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:gravity="center" />
+</RelativeLayout>

+ 30 - 0
app/src/main/res/layout/emotion_layout.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+
+    <!--底部tab-->
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:background="#999" />
+    <!--内容显示区-->
+    <android.support.v4.view.ViewPager
+        android:id="@+id/vpEmotioin"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1" />
+
+    <!--页数小圆点-->
+    <LinearLayout
+        android:id="@+id/llPageNumber"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="15dp"
+        android:gravity="center"
+        android:orientation="horizontal" />
+
+
+</LinearLayout>

+ 53 - 0
app/src/main/res/layout/include_input_comment_exp.xml

@@ -0,0 +1,53 @@
+<?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="wrap_content"
+    android:background="@color/white">
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="#fff2f2f2" />
+
+    <TextView
+        android:id="@+id/input_comment_commit"
+        android:layout_width="60dp"
+        android:layout_height="26dp"
+        android:layout_alignParentEnd="true"
+        android:layout_centerVertical="true"
+        android:layout_marginTop="1dp"
+        android:layout_marginEnd="15dp"
+        android:background="@drawable/selector_button_full_main"
+        android:gravity="center"
+        android:text="评论"
+        android:textColor="@color/white"
+        android:textSize="13sp" />
+
+    <ImageView
+        android:id="@+id/input_comment_exp"
+        android:layout_width="45dp"
+        android:layout_height="45dp"
+        android:layout_centerVertical="true"
+        android:padding="9dp"
+        android:layout_toStartOf="@id/input_comment_commit"
+        android:src="@drawable/ic_face_image"/>
+
+    <EditText
+        android:id="@+id/input_comment_input"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginTop="9dp"
+        android:layout_marginBottom="8dp"
+        android:layout_toStartOf="@id/input_comment_exp"
+        android:background="@drawable/shape_f5_solid_rectangle_15"
+        android:gravity="center|start"
+        android:hint="输入优质评论哦~"
+        android:maxLength="100"
+        android:paddingStart="10dp"
+        android:paddingEnd="10dp"
+        android:textColor="#ff666666"
+        android:textColorHint="#aaaaaa"
+        android:textSize="14sp" />
+
+</RelativeLayout>

+ 60 - 0
app/src/main/res/layout/net_empty_smart_refresh_rv_exp.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:orientation="vertical">
+
+    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/rlContent"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:background="@color/white">
+
+        <include
+            android:id="@+id/title"
+            layout="@layout/title" />
+
+        <include
+            android:id="@+id/check_net_ll"
+            layout="@layout/check_net_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/title" />
+
+        <include
+            android:id="@+id/empty_view"
+            layout="@layout/empty_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_below="@+id/check_net_ll" />
+
+        <RelativeLayout
+            android:id="@+id/bottom"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true" />
+
+        <com.scwang.smartrefresh.layout.SmartRefreshLayout
+            android:id="@+id/refresh"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_above="@id/bottom"
+            android:layout_below="@+id/check_net_ll">
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/view_list"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:descendantFocusability="blocksDescendants" />
+        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+    </RelativeLayout>
+
+    <!--表情区-->
+    <com.lqr.emoji.EmotionLayout
+        android:id="@+id/elEmotion"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone" />
+</LinearLayout>