├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── widget │ │ └── praisewidget │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── widget │ │ │ ├── Demo.java │ │ │ └── praisewidget │ │ │ ├── bean │ │ │ └── PraiseBean.java │ │ │ ├── clickable │ │ │ └── PraiseClick.java │ │ │ └── widget │ │ │ ├── CustomImageSpan.java │ │ │ ├── PraiseWidget.java │ │ │ └── SpannableStringBuilderAllVer.java │ └── res │ │ ├── drawable │ │ └── ic_moment_liked.png │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── widget │ └── praisewidget │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── img └── praise widget.gif └── 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 | .idea 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PraiseWidget 2 | // 这个是点赞控件哦,适用于社交类app
3 | ### 实际效果可以看看我在[朋友圈项目](https://github.com/razerdp/FriendCircle)的使用 4 | 5 | 实现流程:http://blog.csdn.net/mkfrank/article/details/49963779 6 |
7 | ## 效果图:
8 | ![image](https://github.com/razerdp/PraiseWidget/blob/master/img/praise%20widget.gif) 9 | ## 使用方法:
10 | 在xml定义控件,findViewById后,使用setDataByArray传入数据(本例子用的是PraiseBean),您可以改成你需要用的
11 | 正因为如此,我并没有抽取为一个Library
12 | 如果需要跟显示图一样超过5行就显示“等xx人”,**请跟TextView一样给定android:maxLines="5"** 13 |
14 | ## 可定义的属性:(attrs.xml)
15 | ```html 16 | 17 | 18 | //点击的背景色,默认全透明 19 | //文字颜色,默认蓝 20 | //文字大小,默认16sp 21 | //第一个点赞的图标,默认一个蓝色的心心 22 | 23 | ``` 24 | ## 注意事项:
25 | 因为使用了缓存,所以如果在activity引用了,请务必在onDestroy里面调用PraiseWidget.clearPraiseWidgetCache清掉context引用,避免无法回收 26 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "widget.praisewidget" 9 | minSdkVersion 14 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 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 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.1.1' 26 | } 27 | -------------------------------------------------------------------------------- /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 E:\AndroidSDK/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/widget/praisewidget/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/widget/Demo.java: -------------------------------------------------------------------------------- 1 | package widget; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import widget.praisewidget.widget.PraiseWidget; 10 | import widget.praisewidget.R; 11 | import widget.praisewidget.bean.PraiseBean; 12 | 13 | public class Demo extends AppCompatActivity implements View.OnClickListener{ 14 | private List testBeans; 15 | 16 | private PraiseWidget mPraiseWidget; 17 | private Button mAddButton; 18 | private Button mSubButton; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_main); 24 | initData(); 25 | initView(); 26 | 27 | mPraiseWidget.setDataByArray(testBeans); 28 | } 29 | 30 | private void initView() { 31 | mPraiseWidget= (PraiseWidget) findViewById(R.id.praise_widget); 32 | mAddButton= (Button) findViewById(R.id.btn_add); 33 | mSubButton= (Button) findViewById(R.id.btn_sub); 34 | 35 | mAddButton.setOnClickListener(this); 36 | mSubButton.setOnClickListener(this); 37 | } 38 | 39 | private void initData() { 40 | testBeans=new ArrayList(); 41 | for (int i=0;i<50;i++){ 42 | PraiseBean bean=new PraiseBean(); 43 | bean.userNick="测试点赞 "+i+" 号"; 44 | bean.userId=i; 45 | testBeans.add(bean); 46 | } 47 | } 48 | 49 | @Override 50 | protected void onDestroy() { 51 | super.onDestroy(); 52 | PraiseWidget.clearPraiseWidgetCache(); 53 | } 54 | 55 | @Override 56 | public void onClick(View v) { 57 | switch (v.getId()){ 58 | case R.id.btn_add: 59 | add(); 60 | break; 61 | case R.id.btn_sub: 62 | sub(); 63 | break; 64 | default: 65 | break; 66 | } 67 | 68 | } 69 | 70 | private void sub() { 71 | if (testBeans!=null&&testBeans.size()>0){ 72 | testBeans.remove(testBeans.size()-1); 73 | } 74 | mPraiseWidget.setDataByArray(testBeans); 75 | } 76 | 77 | private void add() { 78 | if (testBeans!=null){ 79 | PraiseBean newBean=new PraiseBean(); 80 | newBean.userId=testBeans.size()+1; 81 | newBean.userNick="新加入的哦"; 82 | testBeans.add(newBean); 83 | } 84 | mPraiseWidget.setDataByArray(testBeans); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/widget/praisewidget/bean/PraiseBean.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by 大灯泡 on 2015/11/21. 7 | */ 8 | public class PraiseBean implements Serializable { 9 | public String userNick;//点赞用户的名字 10 | public int userId;//点赞用户的ID 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/widget/praisewidget/clickable/PraiseClick.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget.clickable; 2 | 3 | import android.content.Context; 4 | import android.text.TextPaint; 5 | import android.text.style.ClickableSpan; 6 | import android.view.View; 7 | import android.widget.Toast; 8 | 9 | /** 10 | * Created by 大灯泡 on 2015/11/21. 11 | */ 12 | public class PraiseClick extends ClickableSpan{ 13 | private static final int DEFAULT_COLOR=0xff517fae; 14 | 15 | private int color; 16 | private int userID; 17 | private String userNick; 18 | private Context mContext; 19 | private int textSize; 20 | 21 | public PraiseClick(Context context, String userNick, int userID, int color) { 22 | mContext = context; 23 | this.userNick = userNick; 24 | this.userID = userID; 25 | this.color = color; 26 | } 27 | 28 | public PraiseClick(Context context, int userID, int color) { 29 | this(context,"",userID,color); 30 | } 31 | 32 | public PraiseClick(Context context, int userID) { 33 | this(context,"",userID,0); 34 | } 35 | 36 | public PraiseClick(Context context, String userNick, int userID) { 37 | this(context,userNick,userID,0); 38 | } 39 | public PraiseClick(Context context, String userNick, int userID, int color,int textSize) { 40 | this(context,userNick,userID,color); 41 | this.textSize=textSize; 42 | } 43 | @Override 44 | public void onClick(View widget) { 45 | Toast.makeText(mContext,"当前用户名是: "+userNick+" 它的ID是: "+userID,Toast.LENGTH_SHORT).show(); 46 | 47 | } 48 | 49 | @Override 50 | public void updateDrawState(TextPaint ds) { 51 | super.updateDrawState(ds); 52 | //去掉下划线 53 | if (color == 0) { 54 | ds.setColor(DEFAULT_COLOR); 55 | } else { 56 | ds.setColor(color); 57 | } 58 | ds.setTextSize(textSize); 59 | ds.setUnderlineText(false); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/widget/praisewidget/widget/CustomImageSpan.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget.widget; 2 | 3 | /** 4 | * Created by 大灯泡 on 2015/9/28. 5 | */ 6 | 7 | import android.content.Context; 8 | import android.graphics.Canvas; 9 | import android.graphics.Paint; 10 | import android.graphics.Rect; 11 | import android.graphics.drawable.Drawable; 12 | import android.text.style.ImageSpan; 13 | 14 | public class CustomImageSpan extends ImageSpan { 15 | 16 | public CustomImageSpan(Drawable drawable) { 17 | super(drawable); 18 | } 19 | public CustomImageSpan(Context context, int resID){ 20 | super(context,resID, ALIGN_BASELINE); 21 | } 22 | 23 | public int getSize(Paint paint, CharSequence text, int start, int end, 24 | Paint.FontMetricsInt fontMetricsInt) { 25 | Drawable drawable = getDrawable(); 26 | Rect rect = drawable.getBounds(); 27 | if (fontMetricsInt != null) { 28 | Paint.FontMetricsInt fmPaint = paint.getFontMetricsInt(); 29 | int fontHeight = fmPaint.bottom - fmPaint.top; 30 | int drHeight = rect.bottom - rect.top; 31 | 32 | int top = drHeight / 2 - fontHeight / 4; 33 | int bottom = drHeight / 2 + fontHeight / 4; 34 | 35 | fontMetricsInt.ascent = -bottom; 36 | fontMetricsInt.top = -bottom; 37 | fontMetricsInt.bottom = top; 38 | fontMetricsInt.descent = top; 39 | } 40 | return rect.right; 41 | } 42 | 43 | @Override 44 | public void draw(Canvas canvas, CharSequence text, int start, int end, 45 | float x, int top, int y, int bottom, Paint paint) { 46 | Drawable drawable = getDrawable(); 47 | canvas.save(); 48 | int transY = 0; 49 | //居中 50 | transY = ((bottom - top) - drawable.getBounds().bottom) / 2 + top; 51 | canvas.translate(x, transY); 52 | drawable.draw(canvas); 53 | canvas.restore(); 54 | } 55 | } -------------------------------------------------------------------------------- /app/src/main/java/widget/praisewidget/widget/PraiseWidget.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget.widget; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.os.Build; 6 | import android.text.DynamicLayout; 7 | import android.text.Layout; 8 | import android.text.Spannable; 9 | import android.text.SpannableString; 10 | import android.text.method.LinkMovementMethod; 11 | import android.util.AttributeSet; 12 | import android.util.LruCache; 13 | import android.widget.TextView; 14 | import java.lang.reflect.Field; 15 | import java.util.List; 16 | import widget.praisewidget.R; 17 | import widget.praisewidget.bean.PraiseBean; 18 | import widget.praisewidget.clickable.PraiseClick; 19 | 20 | /** 21 | * Created by 大灯泡 on 2015/9/25. 22 | * 这是实现点赞显示的控件
23 | * 请用setDataByArray(PraiseBean数组)来绑定数据 24 | *
25 | * 26 | *
27 | * 28 | * smaple:
29 | *
30 | *

31 | * < com.weijuba.widget.moment.PraiseWidget
32 | * android:id="@+id/test_friend"
33 | * android:layout_width="250dp"//可以是match
34 | * android:maxLines="3"//最大显示行数
35 | * android:lineSpacingExtra="2.5px" //行距
36 | * android:lineSpacingMultiplier="1"//行距倍数
37 | * android:layout_height="wrap_content"
38 | * app:font_size="@dimen/sp_16"//内部字体大小
39 | * app:font_color="#ff259cf8"//内部字体颜色
40 | * app:zan_icon="@drawable/ba_zan"//赞图标
41 | *

42 | * />
43 | */ 44 | public class PraiseWidget extends TextView { 45 | private static final String TAG = "PraiseWidget"; 46 | 47 | //===================参数定义==================== 48 | private int color = 0xff517fae; 49 | private int size = 16; 50 | private Context mContext; 51 | private int iconID = R.drawable.ic_moment_liked; 52 | private List mBeans; 53 | private int curLine;//渲染当前文本的行数 54 | private int mMaxLine = 3; 55 | float LineSpacingMultiplier = 0.0f; 56 | float LineSpacingExtra = 0.0f; 57 | private int clickBgColor=0x00000000; 58 | 59 | //缓存 60 | private static LruCache mCache = 61 | new LruCache(50) { 62 | @Override 63 | protected int sizeOf(String key, SpannableStringBuilderAllVer value) { 64 | return 1; 65 | } 66 | }; 67 | 68 | //销毁窗口记得清除缓存,清掉对context的引用 69 | public static void clearPraiseWidgetCache() { 70 | if (mCache != null) mCache.evictAll(); 71 | } 72 | 73 | public static int getPraiseWidgetCacheEvictionCount() { 74 | if (mCache != null) { 75 | return mCache.evictionCount(); 76 | } else { 77 | return -1; 78 | } 79 | } 80 | 81 | public PraiseWidget(Context context) { 82 | this(context, null); 83 | } 84 | 85 | public PraiseWidget(Context context, AttributeSet attrs) { 86 | this(context, attrs, 0); 87 | } 88 | 89 | public PraiseWidget(Context context, AttributeSet attrs, int defStyleAttr) { 90 | super(context, attrs, defStyleAttr); 91 | this.mContext = context; 92 | 93 | TypedArray attr = context.obtainStyledAttributes(attrs, R.styleable.PraiseWidget); 94 | this.color = attr.getColor(R.styleable.PraiseWidget_font_color, 0xff517fae); 95 | this.size = attr.getDimensionPixelSize(R.styleable.PraiseWidget_font_size, 16); 96 | this.iconID = 97 | attr.getResourceId(R.styleable.PraiseWidget_zan_icon, R.drawable.ic_moment_liked); 98 | TypedArray systemAttr = 99 | context.obtainStyledAttributes(attrs, new int[] { android.R.attr.maxLines }); 100 | this.mMaxLine=systemAttr.getInt(0,3); 101 | this.clickBgColor=attr.getColor(R.styleable.PraiseWidget_click_bg_color,0x00000000); 102 | attr.recycle(); 103 | systemAttr.recycle(); 104 | //如果不设置,clickableSpan不能响应点击事件 105 | this.setMovementMethod(LinkMovementMethod.getInstance()); 106 | this.setHighlightColor(0x00000000); 107 | } 108 | 109 | @Override 110 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 111 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 112 | if (getMeasuredWidth() > 0) { 113 | renderView(); 114 | } 115 | } 116 | 117 | //------------------------------------------传参----------------------------------------------- 118 | public void setDataByArray(List list) { 119 | this.mBeans = list; 120 | if (getMeasuredWidth() > 0) { 121 | renderView(); 122 | } else { 123 | requestLayout(); 124 | } 125 | } 126 | 127 | private void renderView() { 128 | if (mBeans == null || mBeans.size() == 0) { 129 | setText(""); 130 | return; 131 | } 132 | 133 | int textTotalWidth = getMeasuredWidth(); 134 | //从缓存读取,避免重复测量导致的过多对象被创建问题 135 | String key = Integer.toString(mBeans.hashCode()) + mBeans.size() + textTotalWidth; 136 | SpannableStringBuilderAllVer spannable = mCache.get(key); 137 | if (spannable != null) { 138 | setText(spannable); 139 | } else { 140 | int lastPos = 0;//最后一个位置 141 | curLine = 0; 142 | int maxLine = mMaxLine; 143 | int beanSize = mBeans.size(); 144 | String peopleCount = 145 | mContext.getResources().getString(R.string.praise_zan, mBeans.size()); 146 | StringBuilder stringBuilder = new StringBuilder(); 147 | stringBuilder.append("like ");//预留位置给点赞的心,防止超出指定行数行 148 | for (int i = 0; i < beanSize && curLine <= maxLine; i++) { 149 | stringBuilder.append(mBeans.get(i).userNick); 150 | /**测量当前文字的所属行数(加上“等xxx人测量,保证最后一个可以被顶替掉”)*/ 151 | curLine = createWorkingLayout(stringBuilder.toString() + peopleCount, 152 | textTotalWidth).getLineCount(); 153 | if (curLine <= maxLine) { 154 | lastPos = i; 155 | stringBuilder.append(", "); 156 | } else { 157 | break; 158 | } 159 | } 160 | spannable = addClickablePart(lastPos); 161 | setText(spannable); 162 | mCache.put(key, spannable); 163 | } 164 | } 165 | 166 | private SpannableStringBuilderAllVer addClickablePart(int LastPos) { 167 | // 第一个心心图标 168 | CustomImageSpan span = new CustomImageSpan(mContext, iconID); 169 | //空字符,保证有一个位置 170 | SpannableString spanStr = new SpannableString(" "); 171 | spanStr.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE); 172 | // 构建 builder 173 | SpannableStringBuilderAllVer spanBuilder = new SpannableStringBuilderAllVer(spanStr); 174 | 175 | for (int i = 0; i <= LastPos; i++) { 176 | PraiseBean bean = mBeans.get(i); 177 | if (i == 0) { 178 | spanBuilder.append(" " + bean.userNick, 179 | new PraiseClick(mContext, bean.userNick, bean.userId,color,size), 0); 180 | } else { 181 | spanBuilder.append(mBeans.get(i).userNick, 182 | new PraiseClick(mContext, bean.userNick, bean.userId,color,size), 0); 183 | } 184 | if (i != LastPos) spanBuilder.append(", "); 185 | } 186 | if (LastPos < mBeans.size() - 1) { 187 | //等xxx人 188 | return spanBuilder.append( 189 | mContext.getResources().getString(R.string.praise_zan, mBeans.size()-LastPos)); 190 | } else { 191 | return spanBuilder; 192 | } 193 | } 194 | 195 | private Layout createWorkingLayout(String workingText, int textTotalWidth) { 196 | 197 | /** 198 | * float spacingmult:相对行间距,相对字体大小,1.5f表示行间距为1.5倍的字体高度。 199 | * float spacingadd:在基础行距上添加多少 200 | */ 201 | 202 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { 203 | LineSpacingMultiplier = getLineSpacingMultiplier(); 204 | LineSpacingExtra = getLineSpacingExtra(); 205 | } else { 206 | if (LineSpacingMultiplier == 0.0f && LineSpacingExtra == 0.0f) { 207 | try { 208 | Field Multiplier = TextView.class.getDeclaredField("mSpacingMult"); 209 | Multiplier.setAccessible(true); 210 | LineSpacingMultiplier = Multiplier.getFloat(this); 211 | 212 | Field SpacingExtra = TextView.class.getDeclaredField("mSpacingAdd"); 213 | SpacingExtra.setAccessible(true); 214 | LineSpacingExtra = SpacingExtra.getFloat(this); 215 | } catch (Exception e) { 216 | e.printStackTrace(); 217 | LineSpacingMultiplier = 1.0f; 218 | LineSpacingExtra = 3.0f; 219 | } 220 | } 221 | } 222 | return new DynamicLayout(workingText, getPaint(), 223 | (textTotalWidth == 0 ? getScreenPixWidth(mContext) : textTotalWidth), 224 | Layout.Alignment.ALIGN_NORMAL, LineSpacingMultiplier, LineSpacingExtra, false); 225 | } 226 | 227 | /** 获取屏幕分辨率:宽 */ 228 | public int getScreenPixWidth(Context context) { 229 | return context.getResources().getDisplayMetrics().widthPixels; 230 | } 231 | } -------------------------------------------------------------------------------- /app/src/main/java/widget/praisewidget/widget/SpannableStringBuilderAllVer.java: -------------------------------------------------------------------------------- 1 | package widget.praisewidget.widget; 2 | 3 | import android.text.SpannableStringBuilder; 4 | 5 | /** 6 | * Created by 大灯泡 on 2015/9/30. 7 | */ 8 | public class SpannableStringBuilderAllVer extends SpannableStringBuilder { 9 | public SpannableStringBuilderAllVer() { 10 | super(""); 11 | } 12 | public SpannableStringBuilderAllVer(CharSequence text) { 13 | super(text, 0, text.length()); 14 | } 15 | public SpannableStringBuilderAllVer(CharSequence text, int start, int end){ 16 | super(text,start,end); 17 | } 18 | 19 | public SpannableStringBuilderAllVer append(CharSequence text) { 20 | if (text == null) return this; 21 | int length = length(); 22 | return (SpannableStringBuilderAllVer)replace(length, length, text, 0, text.length()); 23 | } 24 | 25 | 26 | /**该方法在原API里面只支持API21或者以上,这里抽取出来以适应低版本*/ 27 | public SpannableStringBuilderAllVer append(CharSequence text, Object what, int flags) { 28 | if (text == null) return this; 29 | int start = length(); 30 | append(text); 31 | setSpan(what, start, length(), flags); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_moment_liked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/razerdp/PraiseWidget/06c07739b1717c51b428b6b0736e00055201677d/app/src/main/res/drawable/ic_moment_liked.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 23 | 31 |