小礼物逻辑第一次上传
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class QuickGiftingEvent extends BaseModel {
|
||||
private int index;
|
||||
private String svgaName;
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSvgaName() {
|
||||
return svgaName;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setSvgaName(String svgaName) {
|
||||
this.svgaName = svgaName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SlideEvent extends BaseModel {
|
||||
private boolean isSlide;
|
||||
|
||||
public boolean isSlide() {
|
||||
return isSlide;
|
||||
}
|
||||
public SlideEvent setSlide(boolean slide) {
|
||||
isSlide = slide;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class CircleProgress2 extends View {
|
||||
private Paint mPaint;
|
||||
private RectF mRectF;
|
||||
private int mCurrent = 1, mMax = 100;
|
||||
//圆弧(也可以说是圆环)的宽度
|
||||
private float mArcWidth =8;
|
||||
//控件的宽度
|
||||
private float mWidth;
|
||||
|
||||
public CircleProgress2(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mPaint = new Paint();
|
||||
mPaint.setAntiAlias(true);
|
||||
mRectF = new RectF();
|
||||
}
|
||||
|
||||
public void setCurrent(int mCurrent) {
|
||||
this.mCurrent = mCurrent;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setMax(int mMax) {
|
||||
this.mMax = mMax;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
//getMeasuredWidth获取的是view的原始大小,也就是xml中配置或者代码中设置的大小
|
||||
//getWidth获取的是view最终显示的大小,这个大小不一定等于原始大小
|
||||
mWidth = getMeasuredWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
//设置圆弧的宽度(圆环的宽度)
|
||||
mPaint.setStrokeWidth(mArcWidth);
|
||||
mPaint.setColor(Color.parseColor("#FEC51B"));
|
||||
//大圆的半径
|
||||
float bigCircleRadius = mWidth / 2;
|
||||
//小圆的半径
|
||||
float smallCircleRadius = bigCircleRadius - mArcWidth;
|
||||
//绘制小圆
|
||||
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
|
||||
mPaint.setColor(Color.parseColor("#46433F"));
|
||||
mRectF.set(mArcWidth, mArcWidth, mWidth - mArcWidth, mWidth - mArcWidth);
|
||||
//绘制圆弧
|
||||
canvas.drawArc(mRectF, -90, mCurrent * 360 / mMax, false, mPaint);
|
||||
setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
}
|
||||
5
common/src/main/res/drawable/backgroud_panda_time.xml
Normal file
5
common/src/main/res/drawable/backgroud_panda_time.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#9946433F" />
|
||||
<corners android:radius="200dp" />
|
||||
</shape>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/icon_combo.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_combo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -1389,4 +1389,5 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="room_sill0_100">0-100 coins</string>
|
||||
<string name="room_sill100_500">100-500 coins</string>
|
||||
<string name="room_sill500_m">Above 500 coins</string>
|
||||
<string name="combo">連擊×</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user