├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── markdown-navigator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── siberiadante │ │ └── emotionapp │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── siberiadante │ │ │ └── emotionapp │ │ │ ├── EditEmotionActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyApplication.java │ │ │ ├── adapter │ │ │ ├── EmotionGridViewAdapter.java │ │ │ ├── EmotionPagerAdapter.java │ │ │ ├── HorizontalRecyclerviewAdapter.java │ │ │ └── NoHorizontalScrollerVPAdapter.java │ │ │ ├── fragments │ │ │ ├── BaseFragment.java │ │ │ ├── EmotionComplateFragment.java │ │ │ ├── EmotionMainFragment.java │ │ │ ├── FragmentFactory.java │ │ │ └── FragmentOther.java │ │ │ ├── model │ │ │ └── ImageModel.java │ │ │ ├── utils │ │ │ ├── DisplayUtils.java │ │ │ ├── EmotionUtils.java │ │ │ ├── GlobalOnItemClickManagerUtils.java │ │ │ ├── ScreenUtils.java │ │ │ ├── SharedPreferencedUtils.java │ │ │ └── SpanStringUtils.java │ │ │ └── widget │ │ │ ├── CenterAlignImageSpan.java │ │ │ ├── EmotionIndicatorView.java │ │ │ ├── EmotionKeyboard.java │ │ │ └── NoHorizontalScrollerViewPager.java │ └── res │ │ ├── drawable-hdpi │ │ ├── compose_emotion_delete.png │ │ ├── d_aini.png │ │ ├── d_aoteman.png │ │ ├── d_baibai.png │ │ ├── d_beishang.png │ │ ├── d_bishi.png │ │ ├── d_bizui.png │ │ ├── d_chanzui.png │ │ ├── d_chijing.png │ │ ├── d_dahaqi.png │ │ ├── d_dalian.png │ │ ├── d_ding.png │ │ ├── d_doge.png │ │ ├── d_fangdumianju.png │ │ ├── d_feizao.png │ │ ├── d_ganmao.png │ │ ├── d_guzhang.png │ │ ├── d_haha.png │ │ ├── d_haixiu.png │ │ ├── d_han.png │ │ ├── d_hehe.png │ │ ├── d_heixian.png │ │ ├── d_heng.png │ │ ├── d_huaxin.png │ │ ├── d_jiyan.png │ │ ├── d_keai.png │ │ ├── d_kelian.png │ │ ├── d_ku.png │ │ ├── d_kun.png │ │ ├── d_landelini.png │ │ ├── d_lang.png │ │ ├── d_lei.png │ │ ├── d_miao.png │ │ ├── d_nanhaier.png │ │ ├── d_nu.png │ │ ├── d_numa.png │ │ ├── d_nvhaier.png │ │ ├── d_qian.png │ │ ├── d_qinqin.png │ │ ├── d_shayan.png │ │ ├── d_shengbing.png │ │ ├── d_shenshou.png │ │ ├── d_shiwang.png │ │ ├── d_shuai.png │ │ ├── d_shuijiao.png │ │ ├── d_sikao.png │ │ ├── d_taikaixin.png │ │ ├── d_touxiao.png │ │ ├── d_travel.png │ │ ├── d_tu.png │ │ ├── d_tuzi.png │ │ ├── d_wabishi.png │ │ ├── d_weiqu.png │ │ ├── d_xiaoku.png │ │ ├── d_xiongmao.png │ │ ├── d_xixi.png │ │ ├── d_xu.png │ │ ├── d_yinxian.png │ │ ├── d_yiwen.png │ │ ├── d_youhengheng.png │ │ ├── d_yun.png │ │ ├── d_zhuakuang.png │ │ ├── d_zhutou.png │ │ ├── d_zuiyou.png │ │ ├── d_zuohengheng.png │ │ ├── face.jpg │ │ ├── ic_launcher.png │ │ ├── img.jpg │ │ └── key.jpg │ │ ├── drawable │ │ ├── checkbox_emotion_keyboard.xml │ │ ├── ic_emotion.png │ │ ├── ic_plus.png │ │ ├── shape_bg_button_reply.xml │ │ ├── shape_bg_indicator_point_nomal.xml │ │ ├── shape_bg_indicator_point_select.xml │ │ └── shape_bg_reply_edittext.xml │ │ ├── layout │ │ ├── activity_edit_emotion.xml │ │ ├── activity_main.xml │ │ ├── fragment1.xml │ │ ├── fragment_complate_emotion.xml │ │ ├── fragment_emotion_main.xml │ │ └── recyclerview_horizontal_item.xml │ │ ├── mipmap-hdpi │ │ ├── compose_emotion_delete.png │ │ ├── d_aini.png │ │ ├── d_aoteman.png │ │ ├── d_baibai.png │ │ ├── d_beishang.png │ │ ├── d_bishi.png │ │ ├── d_bizui.png │ │ ├── d_chanzui.png │ │ ├── d_chijing.png │ │ ├── d_dahaqi.png │ │ ├── d_dalian.png │ │ ├── d_ding.png │ │ ├── d_doge.png │ │ ├── d_fangdumianju.png │ │ ├── d_feizao.png │ │ ├── d_ganmao.png │ │ ├── d_guzhang.png │ │ ├── d_haha.png │ │ ├── d_haixiu.png │ │ ├── d_han.png │ │ ├── d_hehe.png │ │ ├── d_heixian.png │ │ ├── d_heng.png │ │ ├── d_huaxin.png │ │ ├── d_jiyan.png │ │ ├── d_keai.png │ │ ├── d_kelian.png │ │ ├── d_ku.png │ │ ├── d_kun.png │ │ ├── d_landelini.png │ │ ├── d_lang.png │ │ ├── d_lei.png │ │ ├── d_miao.png │ │ ├── d_nanhaier.png │ │ ├── d_nu.png │ │ ├── d_numa.png │ │ ├── d_nvhaier.png │ │ ├── d_qian.png │ │ ├── d_qinqin.png │ │ ├── d_shayan.png │ │ ├── d_shengbing.png │ │ ├── d_shenshou.png │ │ ├── d_shiwang.png │ │ ├── d_shuai.png │ │ ├── d_shuijiao.png │ │ ├── d_sikao.png │ │ ├── d_taikaixin.png │ │ ├── d_touxiao.png │ │ ├── d_travel.png │ │ ├── d_tu.png │ │ ├── d_tuzi.png │ │ ├── d_wabishi.png │ │ ├── d_weiqu.png │ │ ├── d_xiaoku.png │ │ ├── d_xiongmao.png │ │ ├── d_xixi.png │ │ ├── d_xu.png │ │ ├── d_yinxian.png │ │ ├── d_yiwen.png │ │ ├── d_youhengheng.png │ │ ├── d_yun.png │ │ ├── d_zhuakuang.png │ │ ├── d_zhutou.png │ │ ├── d_zuiyou.png │ │ ├── d_zuohengheng.png │ │ ├── face.jpg │ │ ├── ic_launcher.png │ │ ├── img.jpg │ │ └── key.jpg │ │ ├── mipmap-mdpi │ │ ├── emotion.png │ │ ├── ic_launcher.png │ │ └── keyboard.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ ├── ft01.gif │ │ ├── ft02.gif │ │ ├── ft03.gif │ │ ├── ft04.gif │ │ ├── ft05.gif │ │ ├── ft06.gif │ │ ├── ft07.gif │ │ ├── ft08.gif │ │ ├── ft09.gif │ │ ├── ft10.gif │ │ ├── ft11.gif │ │ ├── ft12.gif │ │ ├── ft13.gif │ │ ├── ft14.gif │ │ ├── ft15.gif │ │ ├── ft16.gif │ │ ├── ft17.gif │ │ ├── ft18.gif │ │ ├── ft19.gif │ │ ├── ft20.gif │ │ ├── ft21.gif │ │ ├── ft22.gif │ │ ├── ft23.gif │ │ ├── ft24.gif │ │ ├── ft25.gif │ │ ├── ft26.gif │ │ ├── ft27.gif │ │ ├── ft28.gif │ │ ├── ft29.gif │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── siberiadante │ └── emotionapp │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── image ├── 1.jpg ├── 2.jpg └── 3.jpg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 35 | 36 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.8 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EmotionApp 2 | Android表情软键盘切换 3 | 4 | ![Image](image/1.jpg) 5 | ![Image](image/2.jpg) 6 | ![Image](image/3.jpg) 7 | 8 | ---- 9 | ## 在你的项目中 10 | * 更换mipmap下的表情图 11 | * 在utils/EmotionUtils下更换对应的规则 12 | * 如果项目中需要多套表情,参考EmotionMainFragment类中的initData()方法和replaceFragment()方法,只需要一套注释replaceFragment()即可 13 | * 点击发送按钮获取表情+文字内容并做转换处理 14 | ``` 15 | ((TextView) contentView).setText(SpanStringUtils.getEmotionContent(EmotionUtils.EMOTION_CLASSIC_TYPE, 16 | getActivity(), ((TextView) contentView), mEdtContent.getText().toString())); 17 | mEdtContent.setText(""); 18 | ``` 19 | 参数说明: 20 | 1、表情的类型;2、上下文;3、控件;4、EditText中的内容; 21 | 22 | ---- 23 | *参考:[emotionkeyboard] 24 | 25 | [emotionkeyboard]:https://github.com/shinezejian/emotionkeyboard -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.siberiadante.emotionapp" 8 | minSdkVersion 17 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.3.1' 28 | compile 'com.android.support:design:23.1.1' 29 | compile 'com.android.support.constraint:constraint-layout:1.0.1' 30 | testCompile 'junit:junit:4.12' 31 | debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' 32 | } 33 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\shuinsen05\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/siberiadante/emotionapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.siberiadante.emotionapp", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/EditEmotionActivity.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp; 2 | 3 | import android.content.pm.ActivityInfo; 4 | import android.support.v4.app.FragmentTransaction; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.KeyEvent; 8 | import android.widget.TextView; 9 | 10 | import com.siberiadante.emotionapp.fragments.EmotionMainFragment; 11 | import com.siberiadante.emotionapp.widget.EmotionKeyboard; 12 | 13 | /** 14 | * Created by SiberiaDante 15 | * Describe: 表情加载类,可自己添加多种表情,分别建立不同的map存放和不同的标志符即可 16 | * Time: 2017/6/26 17 | * Email: 994537867@qq.com 18 | * GitHub: https://github.com/SiberiaDante 19 | * 博客园: http://www.cnblogs.com/shen-hua/ 20 | */ 21 | 22 | public class EditEmotionActivity extends AppCompatActivity { 23 | public static final String TAG = EditEmotionActivity.class.getSimpleName(); 24 | private TextView mTvContent; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 30 | 31 | setContentView(R.layout.activity_edit_emotion); 32 | initView(); 33 | initData(); 34 | } 35 | 36 | private void initView() { 37 | mTvContent = (TextView) findViewById(R.id.tv_input_content); 38 | } 39 | 40 | private void initData() { 41 | initEmotionMainFragment(); 42 | } 43 | 44 | EmotionMainFragment emotionMainFragment; 45 | 46 | private void initEmotionMainFragment() { 47 | emotionMainFragment = EmotionMainFragment.newInstance(EmotionMainFragment.class, null); 48 | emotionMainFragment.bindToContentView(mTvContent);//绑定当前页面控件 49 | FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); 50 | transaction.replace(R.id.fl_emotion_view_main, emotionMainFragment); 51 | // transaction.addToBackStack(null);//fragment添加至回退栈中 52 | transaction.commit(); 53 | } 54 | 55 | @Override 56 | public void onBackPressed() { 57 | /** 58 | * 按下返回键,如果表情显示,则隐藏,没有显示则回退页面 59 | */ 60 | if (!emotionMainFragment.isInterceptBackPress()) { 61 | super.onBackPressed(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | 8 | public class MainActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | findViewById(R.id.btn_emotion).setOnClickListener(new View.OnClickListener() { 15 | @Override 16 | public void onClick(View v) { 17 | startActivity(new Intent(MainActivity.this, EditEmotionActivity.class)); 18 | } 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp; 2 | 3 | import android.app.Application; 4 | 5 | import com.squareup.leakcanary.LeakCanary; 6 | 7 | /** 8 | * @Created SiberiaDante 9 | * @Describe: 10 | * @Time: 2017/9/8 11 | * @Email: 994537867@qq.com 12 | * @GitHub: https://github.com/SiberiaDante 13 | */ 14 | 15 | public class MyApplication extends Application { 16 | @Override 17 | public void onCreate() { 18 | super.onCreate(); 19 | if (LeakCanary.isInAnalyzerProcess(this)) { 20 | return; 21 | } 22 | LeakCanary.install(this); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/adapter/EmotionGridViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.AbsListView.LayoutParams; 7 | import android.widget.BaseAdapter; 8 | import android.widget.ImageView; 9 | 10 | 11 | import com.siberiadante.emotionapp.R; 12 | import com.siberiadante.emotionapp.utils.EmotionUtils; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @Created by SiberiaDante 18 | * @Describe: 19 | * @Time: 2017/6/26 20 | * @Email: 994537867@qq.com 21 | * @GitHub: https://github.com/SiberiaDante 22 | * @博客园: http://www.cnblogs.com/shen-hua/ 23 | */ 24 | public class EmotionGridViewAdapter extends BaseAdapter { 25 | 26 | private Context context; 27 | private List emotionNames; 28 | private int itemWidth; 29 | private int emotion_map_type; 30 | 31 | public EmotionGridViewAdapter(Context context, List emotionNames, int itemWidth, int emotion_map_type) { 32 | this.context = context; 33 | this.emotionNames = emotionNames; 34 | this.itemWidth = itemWidth; 35 | this.emotion_map_type=emotion_map_type; 36 | } 37 | 38 | @Override 39 | public int getCount() { 40 | // +1 最后一个为删除按钮 41 | return emotionNames.size() + 1; 42 | } 43 | 44 | @Override 45 | public String getItem(int position) { 46 | return emotionNames.get(position); 47 | } 48 | 49 | @Override 50 | public long getItemId(int position) { 51 | return position; 52 | } 53 | 54 | @Override 55 | public View getView(int position, View convertView, ViewGroup parent) { 56 | ImageView iv_emotion = new ImageView(context); 57 | // 设置内边距 58 | iv_emotion.setPadding(itemWidth/8, itemWidth/8, itemWidth/8, itemWidth/8); 59 | LayoutParams params = new LayoutParams(itemWidth, itemWidth); 60 | iv_emotion.setLayoutParams(params); 61 | 62 | //判断是否为最后一个item 63 | if(position == getCount() - 1) { 64 | iv_emotion.setImageResource(R.drawable.compose_emotion_delete); 65 | } else { 66 | String emotionName = emotionNames.get(position); 67 | iv_emotion.setImageResource(EmotionUtils.getImgByName(emotion_map_type,emotionName)); 68 | } 69 | 70 | return iv_emotion; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/adapter/EmotionPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.adapter; 2 | 3 | import android.support.v4.view.PagerAdapter; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.GridView; 8 | 9 | import java.util.List; 10 | /** 11 | * @Created by SiberiaDante 12 | * @Describe: 13 | * @Time: 2017/6/26 14 | * @Email: 994537867@qq.com 15 | * @GitHub: https://github.com/SiberiaDante 16 | * @博客园: http://www.cnblogs.com/shen-hua/ 17 | */ 18 | public class EmotionPagerAdapter extends PagerAdapter { 19 | 20 | private List gvs; 21 | 22 | public EmotionPagerAdapter(List gvs) { 23 | this.gvs = gvs; 24 | } 25 | 26 | @Override 27 | public int getCount() { 28 | return gvs.size(); 29 | } 30 | 31 | @Override 32 | public boolean isViewFromObject(View arg0, Object arg1) { 33 | return arg0 == arg1; 34 | } 35 | 36 | @Override 37 | public void destroyItem(ViewGroup container, int position, Object object) { 38 | ((ViewPager) container).removeView(gvs.get(position)); 39 | } 40 | 41 | @Override 42 | public Object instantiateItem(ViewGroup container, int position) { 43 | ((ViewPager) container).addView(gvs.get(position)); 44 | return gvs.get(position); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/adapter/HorizontalRecyclerviewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | 10 | 11 | import com.siberiadante.emotionapp.R; 12 | import com.siberiadante.emotionapp.model.ImageModel; 13 | import com.siberiadante.emotionapp.utils.ScreenUtils; 14 | 15 | import java.util.List; 16 | /** 17 | * @Created by SiberiaDante 18 | * @Describe: 19 | * @Time: 2017/6/26 20 | * @Email: 994537867@qq.com 21 | * @GitHub: https://github.com/SiberiaDante 22 | * @博客园: http://www.cnblogs.com/shen-hua/ 23 | */ 24 | public class HorizontalRecyclerviewAdapter extends RecyclerView.Adapter { 25 | 26 | private List datas; 27 | 28 | private LayoutInflater mInflater; 29 | 30 | private Context context; 31 | 32 | private OnClickItemListener onClickItemListener; 33 | 34 | public HorizontalRecyclerviewAdapter(Context context, List datas){ 35 | this.datas=datas; 36 | this.context=context; 37 | mInflater= LayoutInflater.from(context); 38 | } 39 | 40 | 41 | @Override 42 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 43 | View view =mInflater.inflate(R.layout.recyclerview_horizontal_item, parent, false); 44 | return new ViewHolder(view); 45 | } 46 | 47 | @Override 48 | public void onBindViewHolder(final ViewHolder holder, int position) { 49 | ImageModel model=datas.get(position); 50 | /** 51 | * 点击事件和长按事件 52 | */ 53 | if (onClickItemListener != null) { 54 | holder.itemView.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View v) { 57 | //使用该方法获取position,防止点击事件时pos未刷新问题 58 | int pos = holder.getLayoutPosition(); 59 | onClickItemListener.onItemClick(holder.itemView, pos,datas); 60 | } 61 | }); 62 | 63 | holder.itemView.setOnLongClickListener(new View.OnLongClickListener() { 64 | @Override 65 | public boolean onLongClick(View v) { 66 | //使用该方法获取position,防止点击事件时pos未刷新问题 67 | int pos = holder.getLayoutPosition(); 68 | onClickItemListener.onItemLongClick(holder.itemView, pos,datas); 69 | return false; 70 | } 71 | }); 72 | 73 | } 74 | /** 75 | * 动态计算底部tab的宽度。 76 | */ 77 | int width= ScreenUtils.getScreenWidth(context); 78 | float itemW=width/6; 79 | ViewGroup.LayoutParams lp= holder.imageBtn.getLayoutParams(); 80 | lp.width= (int) itemW; 81 | 82 | //设置icon 83 | holder.imageBtn.setImageDrawable(model.icon); 84 | if(model.isSelected){ 85 | holder.imageBtn.setBackgroundColor(context.getResources().getColor(R.color.bg_horizontal_btn_selected)); 86 | }else { 87 | holder.imageBtn.setBackgroundColor(context.getResources().getColor(R.color.bg_horizontal_btn_normal)); 88 | } 89 | 90 | } 91 | 92 | @Override 93 | public int getItemCount() { 94 | return datas.size(); 95 | } 96 | 97 | class ViewHolder extends RecyclerView.ViewHolder{ 98 | public ImageView imageBtn; 99 | public ViewHolder(View itemView) { 100 | super(itemView); 101 | imageBtn= (ImageView) itemView.findViewById(R.id.image_btn); 102 | } 103 | } 104 | 105 | 106 | 107 | 108 | 109 | /** 110 | * 设置监听器 111 | * @param listener 112 | */ 113 | public void setOnClickItemListener(OnClickItemListener listener){ 114 | this.onClickItemListener=listener; 115 | } 116 | 117 | 118 | 119 | /** 120 | * Created by zejian 121 | * Time 16/1/6 下午3:15 122 | * Email shinezejian@163.com 123 | * Description:RecyclerView点击事件接口 124 | */ 125 | public interface OnClickItemListener { 126 | 127 | void onItemClick(View view, int position, List datas); 128 | 129 | void onItemLongClick(View view, int position, List datas); 130 | 131 | } 132 | 133 | } 134 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/adapter/NoHorizontalScrollerVPAdapter.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | import android.view.ViewGroup; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @Created by SiberiaDante 12 | * @Describe: 13 | * @Time: 2017/6/26 14 | * @Email: 994537867@qq.com 15 | * @GitHub: https://github.com/SiberiaDante 16 | * @博客园: http://www.cnblogs.com/shen-hua/ 17 | */ 18 | public class NoHorizontalScrollerVPAdapter extends FragmentPagerAdapter { 19 | 20 | private List datas = null; 21 | 22 | public NoHorizontalScrollerVPAdapter(FragmentManager fm, List datas) { 23 | super(fm); 24 | this.datas = datas; 25 | 26 | } 27 | 28 | 29 | @Override 30 | public Fragment getItem(int position) { 31 | return datas.get(position); 32 | } 33 | 34 | @Override 35 | public int getCount() { 36 | return datas.size(); 37 | } 38 | 39 | @Override 40 | public void destroyItem(ViewGroup container, int position, Object object) { 41 | // 这里Destroy的是Fragment的视图层次,并不是Destroy Fragment对象 42 | super.destroyItem(container, position, object); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/fragments/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | /** 12 | * Created by SiberiaDante 13 | * Describe: 基类BaseFragment中的传递参数args可以供子类选择性使用 14 | * Time: 2017/6/26 15 | * Email: 994537867@qq.com 16 | * GitHub: https://github.com/SiberiaDante 17 | * 博客园: http://www.cnblogs.com/shen-hua/ 18 | */ 19 | public class BaseFragment extends Fragment { 20 | 21 | private static final String TAG = BaseFragment.class.getSimpleName(); 22 | //传递过来的参数Bundle,供子类使用 23 | protected Bundle args; 24 | 25 | /** 26 | * 创建fragment的静态方法,方便传递参数 27 | * 28 | * @param args 传递的参数 29 | * @return 30 | */ 31 | public static T newInstance(Class clazz, Bundle args) { 32 | T mFragment = null; 33 | try { 34 | mFragment = (T) clazz.newInstance(); 35 | } catch (java.lang.InstantiationException e) { 36 | e.printStackTrace(); 37 | } catch (IllegalAccessException e) { 38 | e.printStackTrace(); 39 | } 40 | mFragment.setArguments(args); 41 | return mFragment; 42 | } 43 | 44 | /** 45 | * 初始创建Fragment对象时调用 46 | * 47 | * @param savedInstanceState 48 | */ 49 | @Override 50 | public void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | args = getArguments(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/fragments/EmotionComplateFragment.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.GridView; 9 | import android.widget.LinearLayout; 10 | 11 | 12 | import com.siberiadante.emotionapp.R; 13 | import com.siberiadante.emotionapp.adapter.EmotionGridViewAdapter; 14 | import com.siberiadante.emotionapp.adapter.EmotionPagerAdapter; 15 | import com.siberiadante.emotionapp.utils.DisplayUtils; 16 | import com.siberiadante.emotionapp.utils.EmotionUtils; 17 | import com.siberiadante.emotionapp.utils.GlobalOnItemClickManagerUtils; 18 | import com.siberiadante.emotionapp.widget.EmotionIndicatorView; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | 24 | /** 25 | * Created by SiberiaDante 26 | * Describe: 可替换的模板表情,gridview实现 27 | * Time: 2017/6/26 28 | * Email: 994537867@qq.com 29 | * GitHub: https://github.com/SiberiaDante 30 | * 博客园: http://www.cnblogs.com/shen-hua/ 31 | */ 32 | 33 | public class EmotionComplateFragment extends BaseFragment { 34 | private EmotionPagerAdapter emotionPagerGvAdapter; 35 | private ViewPager vp_complate_emotion_layout; 36 | private EmotionIndicatorView ll_point_group;//表情面板对应的点列表 37 | private int emotion_map_type; 38 | 39 | /** 40 | * 创建与Fragment对象关联的View视图时调用 41 | * @param inflater 42 | * @param container 43 | * @param savedInstanceState 44 | * @return 45 | */ 46 | @Override 47 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 48 | View rootView = inflater.inflate(R.layout.fragment_complate_emotion, container, false); 49 | initView(rootView); 50 | initListener(); 51 | return rootView; 52 | } 53 | 54 | /** 55 | * 初始化view控件 56 | */ 57 | protected void initView(View rootView){ 58 | vp_complate_emotion_layout = (ViewPager) rootView.findViewById(R.id.vp_complate_emotion_layout); 59 | ll_point_group= (EmotionIndicatorView) rootView.findViewById(R.id.ll_point_group); 60 | //获取map的类型 61 | emotion_map_type=args.getInt(FragmentFactory.EMOTION_MAP_TYPE); 62 | initEmotion(); 63 | } 64 | 65 | /** 66 | * 初始化监听器 67 | */ 68 | protected void initListener(){ 69 | 70 | vp_complate_emotion_layout.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { 71 | int oldPagerPos=0; 72 | @Override 73 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { 74 | 75 | } 76 | 77 | @Override 78 | public void onPageSelected(int position) { 79 | ll_point_group.playByStartPointToNext(oldPagerPos,position); 80 | oldPagerPos=position; 81 | } 82 | 83 | @Override 84 | public void onPageScrollStateChanged(int state) { 85 | 86 | } 87 | }); 88 | } 89 | 90 | /** 91 | * 初始化表情面板 92 | * 思路:获取表情的总数,按每行存放7个表情,动态计算出每个表情所占的宽度大小(包含间距), 93 | * 而每个表情的高与宽应该是相等的,这里我们约定只存放3行 94 | * 每个面板最多存放7*3=21个表情,再减去一个删除键,即每个面板包含20个表情 95 | * 根据表情总数,循环创建多个容量为20的List,存放表情,对于大小不满20进行特殊 96 | * 处理即可。 97 | */ 98 | private void initEmotion() { 99 | // 获取屏幕宽度 100 | int screenWidth = DisplayUtils.getScreenWidthPixels(getActivity()); 101 | // item的间距 102 | int spacing = DisplayUtils.dp2px(getActivity(), 12); 103 | // 动态计算item的宽度和高度 104 | int itemWidth = (screenWidth - spacing * 8) / 7; 105 | //动态计算gridview的总高度 106 | int gvHeight = itemWidth * 3 + spacing * 6; 107 | 108 | List emotionViews = new ArrayList<>(); 109 | List emotionNames = new ArrayList<>(); 110 | // 遍历所有的表情的key 111 | for (String emojiName : EmotionUtils.getEmotionMap(emotion_map_type).keySet()) { 112 | emotionNames.add(emojiName); 113 | // 每20个表情作为一组,同时添加到ViewPager对应的view集合中 114 | if (emotionNames.size() == 20) { 115 | GridView gv = createEmotionGridView(emotionNames, screenWidth, spacing, itemWidth, gvHeight); 116 | emotionViews.add(gv); 117 | // 添加完一组表情,重新创建一个表情名字集合 118 | emotionNames = new ArrayList<>(); 119 | } 120 | } 121 | 122 | // 判断最后是否有不足20个表情的剩余情况 123 | if (emotionNames.size() > 0) { 124 | GridView gv = createEmotionGridView(emotionNames, screenWidth, spacing, itemWidth, gvHeight); 125 | emotionViews.add(gv); 126 | } 127 | 128 | //初始化指示器 129 | ll_point_group.initIndicator(emotionViews.size()); 130 | // 将多个GridView添加显示到ViewPager中 131 | emotionPagerGvAdapter = new EmotionPagerAdapter(emotionViews); 132 | vp_complate_emotion_layout.setAdapter(emotionPagerGvAdapter); 133 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(screenWidth, gvHeight); 134 | vp_complate_emotion_layout.setLayoutParams(params); 135 | 136 | 137 | } 138 | 139 | /** 140 | * 创建显示表情的GridView 141 | */ 142 | private GridView createEmotionGridView(List emotionNames, int gvWidth, int padding, int itemWidth, int gvHeight) { 143 | // 创建GridView 144 | GridView gv = new GridView(getActivity()); 145 | //设置点击背景透明 146 | gv.setSelector(android.R.color.transparent); 147 | //设置7列 148 | gv.setNumColumns(7); 149 | gv.setPadding(padding, padding, padding, padding); 150 | gv.setHorizontalSpacing(padding); 151 | gv.setVerticalSpacing(padding * 2); 152 | //设置GridView的宽高 153 | ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(gvWidth, gvHeight); 154 | gv.setLayoutParams(params); 155 | // 给GridView设置表情图片 156 | EmotionGridViewAdapter adapter = new EmotionGridViewAdapter(getActivity(), emotionNames, itemWidth,emotion_map_type); 157 | gv.setAdapter(adapter); 158 | //设置全局点击事件 159 | gv.setOnItemClickListener(GlobalOnItemClickManagerUtils.getInstance().getOnItemClickListener(getActivity(),emotion_map_type)); 160 | return gv; 161 | } 162 | 163 | 164 | 165 | } 166 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/fragments/EmotionMainFragment.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.GridLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.util.Log; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.Button; 13 | import android.widget.CheckBox; 14 | import android.widget.EditText; 15 | import android.widget.TextView; 16 | 17 | import com.siberiadante.emotionapp.R; 18 | import com.siberiadante.emotionapp.adapter.HorizontalRecyclerviewAdapter; 19 | import com.siberiadante.emotionapp.adapter.NoHorizontalScrollerVPAdapter; 20 | import com.siberiadante.emotionapp.model.ImageModel; 21 | import com.siberiadante.emotionapp.utils.EmotionUtils; 22 | import com.siberiadante.emotionapp.utils.GlobalOnItemClickManagerUtils; 23 | import com.siberiadante.emotionapp.utils.SharedPreferencedUtils; 24 | import com.siberiadante.emotionapp.utils.SpanStringUtils; 25 | import com.siberiadante.emotionapp.widget.EmotionKeyboard; 26 | import com.siberiadante.emotionapp.widget.NoHorizontalScrollerViewPager; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * Created by SiberiaDante 33 | * Describe: 34 | * Time: 2017/6/26 35 | * Email: 994537867@qq.com 36 | * GitHub: https://github.com/SiberiaDante 37 | * 博客园: http://www.cnblogs.com/shen-hua/ 38 | */ 39 | public class EmotionMainFragment extends BaseFragment implements View.OnClickListener { 40 | private static final String TAG = EmotionMainFragment.class.getSimpleName(); 41 | private CheckBox mCBEmotionBtn; 42 | private EditText mEdtContent; 43 | private Button mBtnSend; 44 | private NoHorizontalScrollerViewPager mNoHorizontalVP; 45 | //底部水平tab 46 | private RecyclerView mBottomRecyclerView; 47 | private HorizontalRecyclerviewAdapter horizontalRecyclerviewAdapter; 48 | //当前被选中底部tab 49 | private static final String CURRENT_POSITION_FLAG = "CURRENT_POSITION_FLAG"; 50 | private int CurrentPosition = 0; 51 | private List fragments = new ArrayList<>(); 52 | 53 | private View contentView; 54 | private EmotionKeyboard mEmotionKeyboard; 55 | private GlobalOnItemClickManagerUtils globalOnItemClickManager; 56 | 57 | @Nullable 58 | @Override 59 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 60 | View layout = inflater.inflate(R.layout.fragment_emotion_main, container, false); 61 | initView(layout); 62 | //初始化EmotionKeyboard 63 | mEmotionKeyboard = EmotionKeyboard.with(getActivity()) 64 | .setEmotionView(layout.findViewById(R.id.ll_emotion_layout))//绑定表情面板 65 | .bindToContent(contentView)//绑定内容view 66 | .bindToEditText(((EditText) layout.findViewById(R.id.bar_edit_text)))//判断绑定那种EditView 67 | .bindToEmotionButton(layout.findViewById(R.id.emotion_button))//绑定表情按钮 68 | .build(); 69 | initData(); 70 | // 点击表情的全局监听管理类 71 | globalOnItemClickManager = GlobalOnItemClickManagerUtils.getInstance(); 72 | //绑定EditText 73 | globalOnItemClickManager.attachToEditText(mEdtContent); 74 | return layout; 75 | } 76 | 77 | /** 78 | * 绑定内容view 79 | * 80 | * @param contentView 81 | * @return 82 | */ 83 | public void bindToContentView(View contentView) { 84 | this.contentView = contentView; 85 | } 86 | 87 | private void initView(View layout) { 88 | 89 | mCBEmotionBtn = ((CheckBox) layout.findViewById(R.id.emotion_button)); 90 | mEdtContent = ((EditText) layout.findViewById(R.id.bar_edit_text)); 91 | mBtnSend = ((Button) layout.findViewById(R.id.bar_btn_send)); 92 | mNoHorizontalVP = ((NoHorizontalScrollerViewPager) layout.findViewById(R.id.vp_emotionview_layout)); 93 | mBottomRecyclerView = ((RecyclerView) layout.findViewById(R.id.recyclerview_horizontal)); 94 | mBtnSend.setOnClickListener(this); 95 | } 96 | 97 | @Override 98 | public void onClick(View v) { 99 | switch (v.getId()) { 100 | case R.id.bar_btn_send: 101 | Log.d(TAG, "onClick: " + mEdtContent.getText().toString()); 102 | 103 | ((TextView) contentView).setText(SpanStringUtils.getEmotionContent(EmotionUtils.EMOTION_CLASSIC_TYPE, 104 | getActivity(), ((TextView) contentView), mEdtContent.getText().toString())); 105 | mEdtContent.setText(""); 106 | break; 107 | } 108 | } 109 | 110 | private void initData() { 111 | replaceFragment(); 112 | List list = new ArrayList<>(); 113 | for (int i = 0; i < fragments.size(); i++) { 114 | if (i == 0) { 115 | ImageModel model1 = new ImageModel(); 116 | model1.icon = getResources().getDrawable(R.drawable.ic_emotion); 117 | model1.flag = "经典笑脸"; 118 | model1.isSelected = true; 119 | list.add(model1); 120 | } else {//创建其他的表情fragment,不需要可以注释 121 | ImageModel model = new ImageModel(); 122 | model.icon = getResources().getDrawable(R.drawable.ic_plus); 123 | model.flag = "其他笑脸" + i; 124 | model.isSelected = false; 125 | list.add(model); 126 | } 127 | } 128 | 129 | 130 | //记录底部默认选中第一个 131 | CurrentPosition = 0; 132 | SharedPreferencedUtils.setInteger(getActivity(), CURRENT_POSITION_FLAG, CurrentPosition); 133 | 134 | //底部tab 135 | horizontalRecyclerviewAdapter = new HorizontalRecyclerviewAdapter(getActivity(), list); 136 | mBottomRecyclerView.setHasFixedSize(true);//使RecyclerView保持固定的大小,这样会提高RecyclerView的性能 137 | mBottomRecyclerView.setAdapter(horizontalRecyclerviewAdapter); 138 | mBottomRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 1, GridLayoutManager.HORIZONTAL, false)); 139 | //初始化recyclerview_horizontal监听器 140 | horizontalRecyclerviewAdapter.setOnClickItemListener(new HorizontalRecyclerviewAdapter.OnClickItemListener() { 141 | @Override 142 | public void onItemClick(View view, int position, List datas) { 143 | //获取先前被点击tab 144 | int oldPosition = SharedPreferencedUtils.getInteger(getActivity(), CURRENT_POSITION_FLAG, 0); 145 | //修改背景颜色的标记 146 | datas.get(oldPosition).isSelected = false; 147 | //记录当前被选中tab下标 148 | CurrentPosition = position; 149 | datas.get(CurrentPosition).isSelected = true; 150 | SharedPreferencedUtils.setInteger(getActivity(), CURRENT_POSITION_FLAG, CurrentPosition); 151 | //通知更新,这里我们选择性更新就行了 152 | horizontalRecyclerviewAdapter.notifyItemChanged(oldPosition); 153 | horizontalRecyclerviewAdapter.notifyItemChanged(CurrentPosition); 154 | //viewpager界面切换 155 | mNoHorizontalVP.setCurrentItem(position, false); 156 | } 157 | 158 | @Override 159 | public void onItemLongClick(View view, int position, List datas) { 160 | } 161 | }); 162 | 163 | 164 | } 165 | 166 | /** 167 | * 创建其他的表情fragment,不需要可以注释 168 | */ 169 | private void replaceFragment() { 170 | //创建fragment的工厂类 171 | FragmentFactory factory = FragmentFactory.getSingleFactoryInstance(); 172 | //创建修改实例 173 | EmotionComplateFragment f1 = (EmotionComplateFragment) factory.getFragment(EmotionUtils.EMOTION_CLASSIC_TYPE); 174 | fragments.add(f1); 175 | Bundle b = null; 176 | for (int i = 0; i < 7; i++) { 177 | b = new Bundle(); 178 | b.putString("Interge", "Fragment-" + i); 179 | FragmentOther fg = FragmentOther.newInstance(FragmentOther.class, b); 180 | fragments.add(fg); 181 | } 182 | 183 | NoHorizontalScrollerVPAdapter adapter = new NoHorizontalScrollerVPAdapter(getActivity().getSupportFragmentManager(), fragments); 184 | mNoHorizontalVP.setAdapter(adapter); 185 | } 186 | 187 | /** 188 | * 是否拦截返回键操作,如果此时表情布局未隐藏,先隐藏表情布局 189 | * 190 | * @return true则隐藏表情布局,拦截返回键操作 191 | * false 则不拦截返回键操作 192 | */ 193 | public boolean isInterceptBackPress() { 194 | return mEmotionKeyboard.interceptBackPress(); 195 | } 196 | 197 | @Override 198 | public void onDestroy() { 199 | super.onDestroy(); 200 | globalOnItemClickManager.unAttachToEditText(); 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/fragments/FragmentFactory.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | 6 | 7 | /** 8 | * Created by SiberiaDante 9 | * Describe: 10 | * Time: 2017/6/26 11 | * Email: 994537867@qq.com 12 | * GitHub: https://github.com/SiberiaDante 13 | * 博客园: http://www.cnblogs.com/shen-hua/ 14 | */ 15 | public class FragmentFactory { 16 | 17 | public static final String EMOTION_MAP_TYPE="EMOTION_MAP_TYPE"; 18 | private static FragmentFactory factory; 19 | 20 | private FragmentFactory(){ 21 | 22 | } 23 | 24 | /** 25 | * 双重检查锁定,获取工厂单例对象 26 | * @return 27 | */ 28 | public static FragmentFactory getSingleFactoryInstance(){ 29 | if(factory==null){ 30 | synchronized (FragmentFactory.class){ 31 | if(factory==null){ 32 | factory = new FragmentFactory(); 33 | } 34 | } 35 | } 36 | return factory; 37 | } 38 | 39 | /** 40 | * 获取fragment的方法 41 | * @param emotionType 表情类型,用于判断使用哪个map集合的表情 42 | */ 43 | public Fragment getFragment(int emotionType){ 44 | Bundle bundle = new Bundle(); 45 | 46 | bundle.putInt(FragmentFactory.EMOTION_MAP_TYPE,emotionType); 47 | 48 | EmotionComplateFragment fragment= EmotionComplateFragment.newInstance(EmotionComplateFragment.class,bundle); 49 | 50 | return fragment; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/fragments/FragmentOther.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | 9 | import com.siberiadante.emotionapp.R; 10 | 11 | /** 12 | * Created by SiberiaDante 13 | * Describe: 14 | * Time: 2017/6/26 15 | * Email: 994537867@qq.com 16 | * GitHub: https://github.com/SiberiaDante 17 | * 博客园: http://www.cnblogs.com/shen-hua/ 18 | */ 19 | public class FragmentOther extends BaseFragment { 20 | @Override 21 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 22 | View rootView= LayoutInflater.from(getActivity()).inflate(R.layout.fragment1,null); 23 | TextView tv= (TextView) rootView.findViewById(R.id.tv); 24 | 25 | tv.setText(args.getString("Integer")); 26 | return rootView ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/model/ImageModel.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.model; 2 | 3 | import android.graphics.drawable.Drawable; 4 | 5 | /** 6 | * Created by SiberiaDante 7 | * Describe: 底部切换表情的图片对象 8 | * Time: 2017/6/26 9 | * Email: 994537867@qq.com 10 | * GitHub: https://github.com/SiberiaDante 11 | * 博客园: http://www.cnblogs.com/shen-hua/ 12 | */ 13 | public class ImageModel { 14 | 15 | public String flag=null;//说明文本 16 | public Drawable icon=null;//图标 17 | public boolean isSelected=false;//是否被选中 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/DisplayUtils.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | 7 | 8 | /** 9 | * Created by SiberiaDante 10 | * Describe: 11 | * Time: 2017/6/26 12 | * Email: 994537867@qq.com 13 | * GitHub: https://github.com/SiberiaDante 14 | * 博客园: http://www.cnblogs.com/shen-hua/ 15 | */ 16 | public class DisplayUtils { 17 | /** 18 | * 将px值转换为dp值 19 | */ 20 | public static int px2dp(Context context, float pxValue) { 21 | final float scale = context.getResources().getDisplayMetrics().density; 22 | return (int) (pxValue / scale + 0.5f); 23 | } 24 | 25 | /** 26 | * 将dp值转换为px值 27 | */ 28 | public static int dp2px(Context context, float dpValue) { 29 | final float scale = context.getResources().getDisplayMetrics().density; 30 | return (int) (dpValue * scale + 0.5f); 31 | } 32 | 33 | /** 34 | * 将px值转换为sp值 35 | */ 36 | public static int px2sp(Context context, float pxValue) { 37 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 38 | return (int) (pxValue / fontScale + 0.5f); 39 | } 40 | 41 | /** 42 | * 将sp值转换为px值 43 | */ 44 | public static int sp2px(Context context, float spValue) { 45 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 46 | return (int) (spValue * fontScale + 0.5f); 47 | } 48 | 49 | /** 50 | * 获取屏幕宽度 51 | */ 52 | public static int getScreenWidthPixels(Activity context) { 53 | DisplayMetrics metric = new DisplayMetrics(); 54 | context.getWindowManager().getDefaultDisplay().getMetrics(metric); 55 | return metric.widthPixels; 56 | } 57 | 58 | /** 59 | * 获取屏幕高度 60 | */ 61 | public static int getScreenHeightPixels(Activity context) { 62 | DisplayMetrics metric = new DisplayMetrics(); 63 | context.getWindowManager().getDefaultDisplay().getMetrics(metric); 64 | return metric.heightPixels; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/EmotionUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.siberiadante.emotionapp.utils; 3 | 4 | import android.support.v4.util.ArrayMap; 5 | import android.util.Log; 6 | 7 | import com.siberiadante.emotionapp.R; 8 | 9 | 10 | /** 11 | * Created by SiberiaDante 12 | * Describe: 表情加载类,可自己添加多种表情,分别建立不同的map存放和不同的标志符即可 13 | * Time: 2017/6/26 14 | * Email: 994537867@qq.com 15 | * GitHub: https://github.com/SiberiaDante 16 | * 博客园: http://www.cnblogs.com/shen-hua/ 17 | */ 18 | public class EmotionUtils { 19 | 20 | /** 21 | * 表情类型标志符 22 | */ 23 | public static final int EMOTION_CLASSIC_TYPE = 0x0001;//经典表情 24 | private static final String TAG = EmotionUtils.class.getSimpleName(); 25 | 26 | /** 27 | * key-表情文字; 28 | * value-表情图片资源 29 | */ 30 | public static ArrayMap EMPTY_MAP; 31 | public static ArrayMap EMOTION_CLASSIC_MAP; 32 | 33 | 34 | static { 35 | EMPTY_MAP = new ArrayMap<>(); 36 | EMOTION_CLASSIC_MAP = new ArrayMap<>(); 37 | 38 | EMOTION_CLASSIC_MAP.put("[呵呵]", R.drawable.d_hehe); 39 | EMOTION_CLASSIC_MAP.put("[嘻嘻]", R.drawable.d_xixi); 40 | EMOTION_CLASSIC_MAP.put("[哈哈]", R.drawable.d_haha); 41 | EMOTION_CLASSIC_MAP.put("[爱你]", R.drawable.d_aini); 42 | EMOTION_CLASSIC_MAP.put("[挖鼻屎]", R.drawable.d_wabishi); 43 | EMOTION_CLASSIC_MAP.put("[吃惊]", R.drawable.d_chijing); 44 | EMOTION_CLASSIC_MAP.put("[晕]", R.drawable.d_yun); 45 | EMOTION_CLASSIC_MAP.put("[泪]", R.drawable.d_lei); 46 | EMOTION_CLASSIC_MAP.put("[馋嘴]", R.drawable.d_chanzui); 47 | EMOTION_CLASSIC_MAP.put("[抓狂]", R.drawable.d_zhuakuang); 48 | EMOTION_CLASSIC_MAP.put("[哼]", R.drawable.d_heng); 49 | EMOTION_CLASSIC_MAP.put("[可爱]", R.drawable.d_keai); 50 | EMOTION_CLASSIC_MAP.put("[怒]", R.drawable.d_nu); 51 | EMOTION_CLASSIC_MAP.put("[汗]", R.drawable.d_han); 52 | EMOTION_CLASSIC_MAP.put("[害羞]", R.drawable.d_haixiu); 53 | EMOTION_CLASSIC_MAP.put("[睡觉]", R.drawable.d_shuijiao); 54 | EMOTION_CLASSIC_MAP.put("[钱]", R.drawable.d_qian); 55 | EMOTION_CLASSIC_MAP.put("[偷笑]", R.drawable.d_touxiao); 56 | EMOTION_CLASSIC_MAP.put("[笑cry]", R.drawable.d_xiaoku); 57 | EMOTION_CLASSIC_MAP.put("[doge]", R.drawable.d_doge); 58 | EMOTION_CLASSIC_MAP.put("[喵喵]", R.drawable.d_miao); 59 | EMOTION_CLASSIC_MAP.put("[酷]", R.drawable.d_ku); 60 | EMOTION_CLASSIC_MAP.put("[衰]", R.drawable.d_shuai); 61 | EMOTION_CLASSIC_MAP.put("[闭嘴]", R.drawable.d_bizui); 62 | EMOTION_CLASSIC_MAP.put("[鄙视]", R.drawable.d_bishi); 63 | EMOTION_CLASSIC_MAP.put("[花心]", R.drawable.d_huaxin); 64 | EMOTION_CLASSIC_MAP.put("[鼓掌]", R.drawable.d_guzhang); 65 | EMOTION_CLASSIC_MAP.put("[悲伤]", R.drawable.d_beishang); 66 | EMOTION_CLASSIC_MAP.put("[思考]", R.drawable.d_sikao); 67 | EMOTION_CLASSIC_MAP.put("[生病]", R.drawable.d_shengbing); 68 | EMOTION_CLASSIC_MAP.put("[亲亲]", R.drawable.d_qinqin); 69 | EMOTION_CLASSIC_MAP.put("[怒骂]", R.drawable.d_numa); 70 | EMOTION_CLASSIC_MAP.put("[太开心]", R.drawable.d_taikaixin); 71 | EMOTION_CLASSIC_MAP.put("[懒得理你]", R.drawable.d_landelini); 72 | EMOTION_CLASSIC_MAP.put("[右哼哼]", R.drawable.d_youhengheng); 73 | EMOTION_CLASSIC_MAP.put("[左哼哼]", R.drawable.d_zuohengheng); 74 | EMOTION_CLASSIC_MAP.put("[嘘]", R.drawable.d_xu); 75 | EMOTION_CLASSIC_MAP.put("[委屈]", R.drawable.d_weiqu); 76 | EMOTION_CLASSIC_MAP.put("[吐]", R.drawable.d_tu); 77 | EMOTION_CLASSIC_MAP.put("[可怜]", R.drawable.d_kelian); 78 | EMOTION_CLASSIC_MAP.put("[打哈气]", R.drawable.d_dahaqi); 79 | EMOTION_CLASSIC_MAP.put("[挤眼]", R.drawable.d_jiyan); 80 | EMOTION_CLASSIC_MAP.put("[失望]", R.drawable.d_shiwang); 81 | EMOTION_CLASSIC_MAP.put("[顶]", R.drawable.d_ding); 82 | EMOTION_CLASSIC_MAP.put("[疑问]", R.drawable.d_yiwen); 83 | EMOTION_CLASSIC_MAP.put("[困]", R.drawable.d_kun); 84 | EMOTION_CLASSIC_MAP.put("[感冒]", R.drawable.d_ganmao); 85 | EMOTION_CLASSIC_MAP.put("[拜拜]", R.drawable.d_baibai); 86 | EMOTION_CLASSIC_MAP.put("[黑线]", R.drawable.d_heixian); 87 | EMOTION_CLASSIC_MAP.put("[阴险]", R.drawable.d_yinxian); 88 | EMOTION_CLASSIC_MAP.put("[打脸]", R.drawable.d_dalian); 89 | EMOTION_CLASSIC_MAP.put("[傻眼]", R.drawable.d_shayan); 90 | EMOTION_CLASSIC_MAP.put("[猪头]", R.drawable.d_zhutou); 91 | EMOTION_CLASSIC_MAP.put("[熊猫]", R.drawable.d_xiongmao); 92 | EMOTION_CLASSIC_MAP.put("[兔子]", R.drawable.d_tuzi); 93 | 94 | 95 | EMOTION_CLASSIC_MAP.put("[001]", R.mipmap.ft01); 96 | EMOTION_CLASSIC_MAP.put("[002]", R.mipmap.ft02); 97 | EMOTION_CLASSIC_MAP.put("[003]", R.mipmap.ft03); 98 | EMOTION_CLASSIC_MAP.put("[004]", R.mipmap.ft04); 99 | EMOTION_CLASSIC_MAP.put("[005]", R.mipmap.ft05); 100 | EMOTION_CLASSIC_MAP.put("[006]", R.mipmap.ft06); 101 | EMOTION_CLASSIC_MAP.put("[007]", R.mipmap.ft07); 102 | EMOTION_CLASSIC_MAP.put("[008]", R.mipmap.ft08); 103 | EMOTION_CLASSIC_MAP.put("[009]", R.mipmap.ft09); 104 | EMOTION_CLASSIC_MAP.put("[010]", R.mipmap.ft10); 105 | EMOTION_CLASSIC_MAP.put("[011]", R.mipmap.ft11); 106 | EMOTION_CLASSIC_MAP.put("[012]", R.mipmap.ft12); 107 | EMOTION_CLASSIC_MAP.put("[013]", R.mipmap.ft13); 108 | EMOTION_CLASSIC_MAP.put("[014]", R.mipmap.ft14); 109 | EMOTION_CLASSIC_MAP.put("[015]", R.mipmap.ft15); 110 | EMOTION_CLASSIC_MAP.put("[016]", R.mipmap.ft16); 111 | EMOTION_CLASSIC_MAP.put("[017]", R.mipmap.ft17); 112 | EMOTION_CLASSIC_MAP.put("[018]", R.mipmap.ft18); 113 | EMOTION_CLASSIC_MAP.put("[019]", R.mipmap.ft19); 114 | EMOTION_CLASSIC_MAP.put("[020]", R.mipmap.ft20); 115 | EMOTION_CLASSIC_MAP.put("[021]", R.mipmap.ft21); 116 | EMOTION_CLASSIC_MAP.put("[022]", R.mipmap.ft22); 117 | EMOTION_CLASSIC_MAP.put("[023]", R.mipmap.ft23); 118 | EMOTION_CLASSIC_MAP.put("[024]", R.mipmap.ft24); 119 | EMOTION_CLASSIC_MAP.put("[025]", R.mipmap.ft25); 120 | EMOTION_CLASSIC_MAP.put("[026]", R.mipmap.ft26); 121 | EMOTION_CLASSIC_MAP.put("[027]", R.mipmap.ft27); 122 | EMOTION_CLASSIC_MAP.put("[028]", R.mipmap.ft28); 123 | EMOTION_CLASSIC_MAP.put("[029]", R.mipmap.ft29); 124 | 125 | } 126 | 127 | /** 128 | * 根据名称获取当前表情图标R值 129 | * 130 | * @param EmotionType 表情类型标志符 131 | * @param imgName 名称 132 | * @return 133 | */ 134 | public static int getImgByName(int EmotionType, String imgName) { 135 | Integer integer = null; 136 | switch (EmotionType) { 137 | case EMOTION_CLASSIC_TYPE: 138 | integer = EMOTION_CLASSIC_MAP.get(imgName); 139 | break; 140 | default: 141 | Log.e(TAG, "getImgByName: the emotionMap is null!! Handle Yourself "); 142 | break; 143 | } 144 | return integer == null ? -1 : integer; 145 | } 146 | 147 | /** 148 | * 根据类型获取表情数据 149 | * 150 | * @param EmotionType 151 | * @return 152 | */ 153 | public static ArrayMap getEmotionMap(int EmotionType) { 154 | ArrayMap EmojiMap = null; 155 | switch (EmotionType) { 156 | case EMOTION_CLASSIC_TYPE: 157 | EmojiMap = EMOTION_CLASSIC_MAP; 158 | break; 159 | default: 160 | EmojiMap = EMPTY_MAP; 161 | break; 162 | } 163 | return EmojiMap; 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/GlobalOnItemClickManagerUtils.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.utils; 2 | 3 | import android.content.Context; 4 | import android.view.KeyEvent; 5 | import android.view.View; 6 | import android.widget.AdapterView; 7 | import android.widget.EditText; 8 | 9 | import com.siberiadante.emotionapp.adapter.EmotionGridViewAdapter; 10 | 11 | /** 12 | * Created by SiberiaDante 13 | * Describe: 点击表情的全局监听管理类 14 | * Time: 2017/6/26 15 | * Email: 994537867@qq.com 16 | * GitHub: https://github.com/SiberiaDante 17 | * 博客园: http://www.cnblogs.com/shen-hua/ 18 | */ 19 | public class GlobalOnItemClickManagerUtils { 20 | 21 | private static GlobalOnItemClickManagerUtils instance; 22 | private EditText mEditText;//输入框 23 | // private static Context mContext; 24 | 25 | public static GlobalOnItemClickManagerUtils getInstance() { 26 | // mContext=context; 27 | if (instance == null) { 28 | synchronized (GlobalOnItemClickManagerUtils.class) { 29 | if (instance == null) { 30 | instance = new GlobalOnItemClickManagerUtils(); 31 | } 32 | } 33 | } 34 | return instance; 35 | } 36 | 37 | /* 38 | 绑定EditText 39 | */ 40 | public void attachToEditText(EditText editText) { 41 | mEditText = editText; 42 | } 43 | 44 | /* 45 | 46 | */ 47 | public void unAttachToEditText() { 48 | mEditText = null; 49 | } 50 | 51 | public AdapterView.OnItemClickListener getOnItemClickListener(final Context context, final int emotion_map_type) { 52 | return new AdapterView.OnItemClickListener() { 53 | @Override 54 | public void onItemClick(AdapterView parent, View view, int position, long id) { 55 | Object itemAdapter = parent.getAdapter(); 56 | 57 | if (itemAdapter instanceof EmotionGridViewAdapter) { 58 | // 点击的是表情 59 | EmotionGridViewAdapter emotionGvAdapter = (EmotionGridViewAdapter) itemAdapter; 60 | 61 | if (position == emotionGvAdapter.getCount() - 1) { 62 | // 如果点击了最后一个回退按钮,则调用删除键事件 63 | mEditText.dispatchKeyEvent(new KeyEvent( 64 | KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); 65 | } else { 66 | // 如果点击了表情,则添加到输入框中 67 | String emotionName = emotionGvAdapter.getItem(position); 68 | 69 | // 获取当前光标位置,在指定位置上添加表情图片文本 70 | int curPosition = mEditText.getSelectionStart(); 71 | StringBuilder sb = new StringBuilder(mEditText.getText().toString()); 72 | sb.insert(curPosition, emotionName); 73 | 74 | // 特殊文字处理,将表情等转换一下 75 | mEditText.setText(SpanStringUtils.getEmotionContent(emotion_map_type, 76 | context, mEditText, sb.toString())); 77 | 78 | // 将光标设置到新增完表情的右侧 79 | mEditText.setSelection(curPosition + emotionName.length()); 80 | } 81 | 82 | } 83 | } 84 | }; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.Bitmap; 6 | import android.graphics.Rect; 7 | import android.util.DisplayMetrics; 8 | import android.view.View; 9 | import android.view.WindowManager; 10 | 11 | /** 12 | * Created by SiberiaDante 13 | * Describe: 获得屏幕相关的辅助类 14 | * Time: 2017/6/26 15 | * Email: 994537867@qq.com 16 | * GitHub: https://github.com/SiberiaDante 17 | * 博客园: http://www.cnblogs.com/shen-hua/ 18 | */ 19 | public class ScreenUtils { 20 | private ScreenUtils() 21 | { 22 | /* cannot be instantiated */ 23 | throw new UnsupportedOperationException("cannot be instantiated"); 24 | } 25 | 26 | /** 27 | * 获得屏幕宽度 28 | * 29 | * @param context 30 | * @return 31 | */ 32 | public static int getScreenWidth(Context context) 33 | { 34 | WindowManager wm = (WindowManager) context 35 | .getSystemService(Context.WINDOW_SERVICE); 36 | 37 | DisplayMetrics outMetrics = new DisplayMetrics(); 38 | wm.getDefaultDisplay().getMetrics(outMetrics);//将当前窗口的信息放在DisplayMetrics类中 39 | return outMetrics.widthPixels; 40 | } 41 | 42 | /** 43 | * 获得屏幕高度 44 | * 45 | * @param context 46 | * @return 47 | */ 48 | public static int getScreenHeight(Context context) 49 | { 50 | WindowManager wm = (WindowManager) context 51 | .getSystemService(Context.WINDOW_SERVICE); 52 | DisplayMetrics outMetrics = new DisplayMetrics(); 53 | wm.getDefaultDisplay().getMetrics(outMetrics); 54 | return outMetrics.heightPixels; 55 | } 56 | 57 | /** 58 | * 获取分辨率 59 | * 60 | * @param context 61 | * @return 62 | */ 63 | public static int getScreenResolution(Context context) 64 | { 65 | WindowManager wm = (WindowManager) context 66 | .getSystemService(Context.WINDOW_SERVICE); 67 | DisplayMetrics outMetrics = new DisplayMetrics(); 68 | wm.getDefaultDisplay().getMetrics(outMetrics); 69 | int width = outMetrics.widthPixels; 70 | int height = outMetrics.heightPixels; 71 | return width*height; 72 | } 73 | 74 | /** 75 | * 获得状态栏的高度 76 | * 77 | * @param context 78 | * @return 79 | */ 80 | public static int getStatusHeight(Context context) 81 | { 82 | 83 | int statusHeight = -1; 84 | try 85 | { 86 | Class clazz = Class.forName("com.android.internal.R$dimen"); 87 | Object object = clazz.newInstance(); 88 | int height = Integer.parseInt(clazz.getField("status_bar_height") 89 | .get(object).toString()); 90 | statusHeight = context.getResources().getDimensionPixelSize(height); 91 | } catch (Exception e) 92 | { 93 | e.printStackTrace(); 94 | } 95 | return statusHeight; 96 | } 97 | 98 | /** 99 | * 获取当前屏幕截图,包含状态栏 100 | * 101 | * @param activity 102 | * @return 103 | */ 104 | public static Bitmap snapShotWithStatusBar(Activity activity) 105 | { 106 | View view = activity.getWindow().getDecorView(); 107 | view.setDrawingCacheEnabled(true); 108 | view.buildDrawingCache(); 109 | Bitmap bmp = view.getDrawingCache(); 110 | int width = getScreenWidth(activity); 111 | int height = getScreenHeight(activity); 112 | Bitmap bp = null; 113 | bp = Bitmap.createBitmap(bmp, 0, 0, width, height); 114 | view.destroyDrawingCache(); 115 | return bp; 116 | 117 | } 118 | 119 | /** 120 | * 获取当前屏幕截图,不包含状态栏 121 | * 122 | * @param activity 123 | * @return 124 | */ 125 | public static Bitmap snapShotWithoutStatusBar(Activity activity) 126 | { 127 | View view = activity.getWindow().getDecorView(); 128 | view.setDrawingCacheEnabled(true); 129 | view.buildDrawingCache(); 130 | Bitmap bmp = view.getDrawingCache(); 131 | Rect frame = new Rect(); 132 | activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); 133 | int statusBarHeight = frame.top; 134 | 135 | int width = getScreenWidth(activity); 136 | int height = getScreenHeight(activity); 137 | Bitmap bp = null; 138 | bp = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height 139 | - statusBarHeight); 140 | view.destroyDrawingCache(); 141 | return bp; 142 | 143 | } 144 | 145 | 146 | } 147 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/SharedPreferencedUtils.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.utils; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.preference.PreferenceManager; 6 | 7 | 8 | /** 9 | * Created by SiberiaDante 10 | * Describe: SharedPreferenced工具类 11 | * Time: 2017/6/26 12 | * Email: 994537867@qq.com 13 | * GitHub: https://github.com/SiberiaDante 14 | * 博客园: http://www.cnblogs.com/shen-hua/ 15 | */ 16 | public class SharedPreferencedUtils { 17 | public static SharedPreferences mPreference; 18 | 19 | public static SharedPreferences getPreference(Context context) { 20 | if (mPreference == null) 21 | mPreference = PreferenceManager 22 | .getDefaultSharedPreferences(context); 23 | return mPreference; 24 | } 25 | 26 | public static void setInteger(Context context, String name, int value) { 27 | getPreference(context).edit().putInt(name, value).commit(); 28 | } 29 | 30 | public static int getInteger(Context context, String name, int default_i) { 31 | return getPreference(context).getInt(name, default_i); 32 | } 33 | 34 | /** 35 | * 设置字符串类型的配置 36 | */ 37 | public static void setString(Context context, String name, String value) { 38 | getPreference(context).edit().putString(name, value).commit(); 39 | } 40 | 41 | public static String getString(Context context, String name) { 42 | return getPreference(context).getString(name, null); 43 | } 44 | 45 | /** 46 | * 获取字符串类型的配置 47 | */ 48 | public static String getString(Context context, String name, String defalt) { 49 | return getPreference(context).getString(name, defalt); 50 | } 51 | 52 | /** 53 | * 获取boolean类型的配置 54 | * 55 | * @param context 56 | * @param name 57 | * @param defaultValue 58 | * @return 59 | */ 60 | public static boolean getBoolean(Context context, String name, 61 | boolean defaultValue) { 62 | return getPreference(context).getBoolean(name, defaultValue); 63 | } 64 | 65 | /** 66 | * 设置boolean类型的配置 67 | * 68 | * @param context 69 | * @param name 70 | * @param value 71 | */ 72 | public static void setBoolean(Context context, String name, boolean value) { 73 | getPreference(context).edit().putBoolean(name, value).commit(); 74 | } 75 | 76 | public static void setFloat(Context context, String name, Float value) { 77 | getPreference(context).edit().putFloat(name, value).commit(); 78 | } 79 | 80 | public static Float getFloat(Context context, String name, Float value) { 81 | return getPreference(context).getFloat(name, 0); 82 | } 83 | 84 | public static void setLong(Context context, String name, Long value) { 85 | getPreference(context).edit().putLong(name, value).commit(); 86 | } 87 | 88 | public static Long getLong(Context context, String name, Long defaultValue) { 89 | return getPreference(context).getLong(name, defaultValue); 90 | } 91 | 92 | 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/utils/SpanStringUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.siberiadante.emotionapp.utils; 5 | 6 | import android.content.Context; 7 | import android.content.res.Resources; 8 | import android.graphics.Bitmap; 9 | import android.graphics.BitmapFactory; 10 | import android.text.Spannable; 11 | import android.text.SpannableString; 12 | import android.text.style.ImageSpan; 13 | import android.widget.TextView; 14 | 15 | import com.siberiadante.emotionapp.widget.CenterAlignImageSpan; 16 | 17 | import java.util.regex.Matcher; 18 | import java.util.regex.Pattern; 19 | 20 | /** 21 | * Created by SiberiaDante 22 | * Describe: 文本中的emojb字符处理为表情图片 23 | * Time: 2017/6/26 24 | * Email: 994537867@qq.com 25 | * GitHub: https://github.com/SiberiaDante 26 | * 博客园: http://www.cnblogs.com/shen-hua/ 27 | */ 28 | 29 | public class SpanStringUtils { 30 | 31 | public static SpannableString getEmotionContent(int emotion_map_type, final Context context, final TextView tv, String source) { 32 | SpannableString spannableString = new SpannableString(source); 33 | Resources res = context.getResources(); 34 | 35 | String regexEmotion = "\\[([\u4e00-\u9fa5\\w])+\\]"; 36 | Pattern patternEmotion = Pattern.compile(regexEmotion); 37 | Matcher matcherEmotion = patternEmotion.matcher(spannableString); 38 | 39 | while (matcherEmotion.find()) { 40 | // 获取匹配到的具体字符 41 | String key = matcherEmotion.group(); 42 | // 匹配字符串的开始位置 43 | int start = matcherEmotion.start(); 44 | // 利用表情名字获取到对应的图片 45 | Integer imgRes = EmotionUtils.getImgByName(emotion_map_type, key); 46 | if (imgRes != -1) {//-1代表纯文本,没有图片 47 | // 压缩表情图片 48 | int size = (int) tv.getTextSize() * 13 / 10; 49 | Bitmap bitmap = BitmapFactory.decodeResource(res, imgRes); 50 | Bitmap scaleBitmap = Bitmap.createScaledBitmap(bitmap, size, size, true); 51 | 52 | // ImageSpan span = new ImageSpan(context, scaleBitmap); 53 | final CenterAlignImageSpan span = new CenterAlignImageSpan(context, scaleBitmap, ImageSpan.ALIGN_BASELINE); 54 | spannableString.setSpan(span, start, start + key.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); 55 | } 56 | } 57 | return spannableString; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/widget/CenterAlignImageSpan.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.graphics.Rect; 8 | import android.graphics.drawable.Drawable; 9 | import android.text.style.ImageSpan; 10 | 11 | import java.lang.ref.WeakReference; 12 | 13 | /** 14 | * @Created SiberiaDante 15 | * @Describe: 16 | * @Time: 2017/8/18 17 | * @Email: 994537867@qq.com 18 | * @GitHub: https://github.com/SiberiaDante 19 | */ 20 | 21 | public class CenterAlignImageSpan extends ImageSpan { 22 | 23 | private WeakReference mDrawableRef; 24 | 25 | public CenterAlignImageSpan(Context context, Bitmap bitmap, int verticalAlignment) { 26 | super(context, bitmap, verticalAlignment); 27 | } 28 | 29 | public CenterAlignImageSpan(Context context, int resId, int verticalAlignment) { 30 | super(context, resId, verticalAlignment); 31 | } 32 | 33 | @Override 34 | public int getSize(Paint paint, CharSequence text, int start, int end, 35 | Paint.FontMetricsInt fontMetricsInt) { 36 | Drawable drawable = getDrawable(); 37 | Rect rect = drawable.getBounds(); 38 | if (fontMetricsInt != null) { 39 | Paint.FontMetricsInt fmPaint = paint.getFontMetricsInt(); 40 | int fontHeight = fmPaint.descent - fmPaint.ascent; 41 | int drHeight = rect.bottom - rect.top; 42 | int centerY = fmPaint.ascent + fontHeight / 2; 43 | 44 | fontMetricsInt.ascent = centerY - drHeight / 2; 45 | fontMetricsInt.top = fontMetricsInt.ascent; 46 | fontMetricsInt.bottom = centerY + drHeight / 2; 47 | fontMetricsInt.descent = fontMetricsInt.bottom; 48 | } 49 | return rect.right; 50 | } 51 | 52 | @Override 53 | public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, 54 | int bottom, Paint paint) { 55 | Drawable drawable = getCachedDrawable(); 56 | canvas.save(); 57 | Paint.FontMetricsInt fmPaint = paint.getFontMetricsInt(); 58 | int fontHeight = fmPaint.descent - fmPaint.ascent; 59 | int centerY = y + fmPaint.descent - fontHeight / 2; 60 | int transY = centerY - (drawable.getBounds().bottom - drawable.getBounds().top) / 2; 61 | canvas.translate(x, transY); 62 | drawable.draw(canvas); 63 | canvas.restore(); 64 | } 65 | 66 | private Drawable getCachedDrawable() { 67 | WeakReference wr = mDrawableRef; 68 | Drawable d = null; 69 | if (wr != null) { 70 | d = wr.get(); 71 | } 72 | 73 | if (d == null) { 74 | d = getDrawable(); 75 | mDrawableRef = new WeakReference<>(d); 76 | } 77 | 78 | return d; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/widget/EmotionIndicatorView.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.View; 6 | import android.widget.LinearLayout; 7 | 8 | 9 | import com.siberiadante.emotionapp.R; 10 | import com.siberiadante.emotionapp.utils.DisplayUtils; 11 | 12 | import java.util.ArrayList; 13 | 14 | /** 15 | * Created by SiberiaDante 16 | * Describe: 自定义表情底部指示器 17 | * Time: 2017/6/26 18 | * Email: 994537867@qq.com 19 | * GitHub: https://github.com/SiberiaDante 20 | * 博客园: http://www.cnblogs.com/shen-hua/ 21 | */ 22 | 23 | public class EmotionIndicatorView extends LinearLayout { 24 | 25 | private Context mContext; 26 | private ArrayList mImageViews ;//所有指示器集合 27 | private int size = 6; 28 | private int marginSize=15; 29 | private int pointSize ;//指示器的大小 30 | private int marginLeft;//间距 31 | 32 | public EmotionIndicatorView(Context context) { 33 | this(context,null); 34 | } 35 | 36 | public EmotionIndicatorView(Context context, AttributeSet attrs) { 37 | this(context, attrs, 0); 38 | } 39 | 40 | public EmotionIndicatorView(Context context, AttributeSet attrs, int defStyleAttr) { 41 | super(context, attrs, defStyleAttr); 42 | mContext=context; 43 | pointSize= DisplayUtils.dp2px(context,size); 44 | marginLeft=DisplayUtils.dp2px(context,marginSize); 45 | } 46 | 47 | /** 48 | * 初始化指示器 49 | * @param count 指示器的数量 50 | */ 51 | public void initIndicator(int count){ 52 | mImageViews = new ArrayList<>(); 53 | this.removeAllViews(); 54 | LinearLayout.LayoutParams lp ; 55 | for (int i = 0 ; i= 20) { 257 | // When SDK Level >= 20 (Android L), the softInputHeight will contain the height of softButtonsBar (if has) 258 | softInputHeight = softInputHeight - getSoftButtonsBarHeight(); 259 | } 260 | 261 | if (softInputHeight < 0) { 262 | Log.d(TAG, "getSupportSoftInputHeight: EmotionKeyboard--Warning: value of softInputHeight is below zero!"); 263 | } 264 | //存一份到本地 265 | if (softInputHeight > 0) { 266 | sp.edit().putInt(SHARE_PREFERENCE_SOFT_INPUT_HEIGHT, softInputHeight).apply(); 267 | } 268 | return softInputHeight; 269 | } 270 | 271 | 272 | /** 273 | * 底部虚拟按键栏的高度 274 | * 275 | * @return 276 | */ 277 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) 278 | private int getSoftButtonsBarHeight() { 279 | DisplayMetrics metrics = new DisplayMetrics(); 280 | //这个方法获取可能不是真实屏幕的高度 281 | mActivity.getWindowManager().getDefaultDisplay().getMetrics(metrics); 282 | int usableHeight = metrics.heightPixels; 283 | //获取当前屏幕的真实高度 284 | mActivity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics); 285 | int realHeight = metrics.heightPixels; 286 | if (realHeight > usableHeight) { 287 | return realHeight - usableHeight; 288 | } else { 289 | return 0; 290 | } 291 | } 292 | 293 | /** 294 | * 获取软键盘高度,由于第一次直接弹出表情时会出现小问题,787是一个均值,作为临时解决方案 295 | * 296 | * @return 297 | */ 298 | public int getKeyBoardHeight() { 299 | return sp.getInt(SHARE_PREFERENCE_SOFT_INPUT_HEIGHT, 787); 300 | 301 | } 302 | 303 | } 304 | -------------------------------------------------------------------------------- /app/src/main/java/com/siberiadante/emotionapp/widget/NoHorizontalScrollerViewPager.java: -------------------------------------------------------------------------------- 1 | package com.siberiadante.emotionapp.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | /** 9 | * Created by SiberiaDante 10 | * Describe: 不可横向滑动的ViewPager 11 | * Time: 2017/6/26 12 | * Email: 994537867@qq.com 13 | * GitHub: https://github.com/SiberiaDante 14 | * 博客园: http://www.cnblogs.com/shen-hua/ 15 | */ 16 | 17 | public class NoHorizontalScrollerViewPager extends ViewPager { 18 | 19 | public NoHorizontalScrollerViewPager(Context context) { 20 | super(context); 21 | } 22 | 23 | public NoHorizontalScrollerViewPager(Context context, AttributeSet attrs) { 24 | super(context, attrs); 25 | } 26 | 27 | /** 28 | * 重写拦截事件,返回值设置为false,这时便不会横向滑动了。 29 | * 30 | * @param ev 31 | * @return 32 | */ 33 | @Override 34 | public boolean onInterceptTouchEvent(MotionEvent ev) { 35 | return false; 36 | } 37 | 38 | /** 39 | * 重写拦截事件,返回值设置为false,这时便不会横向滑动了。 40 | * 41 | * @param ev 42 | * @return 43 | */ 44 | @Override 45 | public boolean onTouchEvent(MotionEvent ev) { 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/compose_emotion_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/compose_emotion_delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_aini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_aini.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_aoteman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_aoteman.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_baibai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_baibai.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_beishang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_beishang.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_bishi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_bishi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_bizui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_bizui.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_chanzui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_chanzui.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_chijing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_chijing.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_dahaqi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_dahaqi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_dalian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_dalian.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_ding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_ding.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_doge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_doge.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_fangdumianju.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_fangdumianju.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_feizao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_feizao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_ganmao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_ganmao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_guzhang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_guzhang.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_haha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_haha.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_haixiu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_haixiu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_han.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_han.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_hehe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_hehe.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_heixian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_heixian.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_heng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_heng.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_huaxin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_huaxin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_jiyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_jiyan.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_keai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_keai.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_kelian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_kelian.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_ku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_ku.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_kun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_kun.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_landelini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_landelini.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_lang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_lang.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_lei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_lei.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_miao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_miao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_nanhaier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_nanhaier.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_nu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_nu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_numa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_numa.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_nvhaier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_nvhaier.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_qian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_qian.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_qinqin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_qinqin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shayan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shayan.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shengbing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shengbing.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shenshou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shenshou.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shiwang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shiwang.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shuai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shuai.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_shuijiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_shuijiao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_sikao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_sikao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_taikaixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_taikaixin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_touxiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_touxiao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_travel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_travel.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_tu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_tu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_tuzi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_tuzi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_wabishi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_wabishi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_weiqu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_weiqu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_xiaoku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_xiaoku.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_xiongmao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_xiongmao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_xixi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_xixi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_xu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_xu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_yinxian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_yinxian.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_yiwen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_yiwen.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_youhengheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_youhengheng.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_yun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_yun.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_zhuakuang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_zhuakuang.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_zhutou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_zhutou.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_zuiyou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_zuiyou.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/d_zuohengheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/d_zuohengheng.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/face.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/img.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/key.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable-hdpi/key.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkbox_emotion_keyboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_emotion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable/ic_emotion.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiberiaDante/EmotionApp/e6953c8ec4bfa53b78340f26b1f3a6ae0c578e9b/app/src/main/res/drawable/ic_plus.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_bg_button_reply.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_bg_indicator_point_nomal.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_bg_indicator_point_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_bg_reply_edittext.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 15 | 16 | 17 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_edit_emotion.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 14 | 15 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |