Sfoglia il codice sorgente

添加刮奖效果;
屏蔽签到中连续多次点击;
添加视频预览图的加载;
优化预览图加载效果

zengjiebin 7 anni fa
parent
commit
c2370c0dc1

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1326,6 +1326,11 @@ public interface ApiService {
     /**
      * 获取最后一次刮奖结果
      */
+    @GET("app/user_sign/scratch_amount")
+    Observable<BaseMessage> getUserSignScratch_amount();
+    /**
+     * 获取最后一次刮奖结果
+     */
     @GET("app/user_sign/last_scratch")
     Observable<BaseMessage> getUserSignLastScratch();
     /**

+ 10 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/NoviceGuidance.java

@@ -44,6 +44,7 @@ public class NoviceGuidance implements IContentTypeContainer<Integer, String> {
     private int updated_at;
 
     private String video_url;
+    private String pre_url;
 
     private String image_url;
 
@@ -106,7 +107,15 @@ public class NoviceGuidance implements IContentTypeContainer<Integer, String> {
         this.image_url = image_url;
     }
 
-//    //默认类型,服务器数据无此类型,只作为客户端自己直接添加使用,只包含内容
+    public String getPre_url() {
+        return pre_url;
+    }
+
+    public void setPre_url(String pre_url) {
+        this.pre_url = pre_url;
+    }
+
+    //    //默认类型,服务器数据无此类型,只作为客户端自己直接添加使用,只包含内容
 //    public static final int TYPE_MSG = 0;
 //    //标题与文本
 //    public static final int TYPE_CONTENT = 1;

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

@@ -79,7 +79,7 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
         recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         AdpTitleInfoList adpTitleInfoList = new AdpTitleInfoList(titleInfoListList);
         adpTitleInfoList.bindToRecyclerView(recyclerView);
-
+        title_search_input.setHint("搜索任务名称/游戏名称");
         title_search_input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
             @Override
             public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpNoviceGuidance.java

@@ -42,11 +42,11 @@ public class AdpNoviceGuidance extends RecyclerViewAdapter<NoviceGuidance> {
         ViewUtil.setVisibility(item_novice_guidance_image, !TextUtils.isEmpty(item.getImage_url()));
 //        ViewUtil.setVisibility(item_novice_guidance_video, !TextUtils.isEmpty(item.getVideo_url()));
         ViewUtil.setVisibility(item_novice_guidance_video_control, !TextUtils.isEmpty(item.getVideo_url()));
-        ViewUtil.setVisibility(item_novice_guidance_video_image, !TextUtils.isEmpty(item.getVideo_url()));
+        ViewUtil.setVisibility(item_novice_guidance_video_image, !TextUtils.isEmpty(item.getPre_url()));
         ViewUtil.setVisibility(item_novice_guidance_video_full, false);
 
         ViewUtil.setImage(item_novice_guidance_video_full, ViewUtil.getNetImgByName("fangda"));
-        ViewUtil.setImage(item_novice_guidance_video_image, item.getVideo_url());
+        ViewUtil.setImage(item_novice_guidance_video_image, item.getPre_url());
         ViewUtil.setImage(item_novice_guidance_image, item.getImage_url());
         ViewUtil.setText(item_novice_guidance_title, item.getTitle());
         ViewUtil.setText(item_novice_guidance_content, item, G.WIDTH - G.getRealPix(32));

+ 465 - 0
app/src/main/java/com/sheep/gamegroup/view/customview/ErasableTextView.java

@@ -0,0 +1,465 @@
+
+package com.sheep.gamegroup.view.customview;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.RectF;
+import android.support.v7.widget.AppCompatTextView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.util.LogUtil;
+
+import rx.functions.Action1;
+
+/**
+ * @ClassName: TextRubbler
+ * @Description: 可擦除的textview, 类似于刮刮乐的效果. 设计思路 : 在文字的上面绘制一层遮罩,当用户在该区域涂抹时,
+ *               会在该遮罩层上绘制一条曲线path, 此时该path下的文字就会显示出来,与mPaint设置的setXfermode有关.
+ * @author Honghui He
+ */
+public class ErasableTextView extends AppCompatTextView {
+
+    /**
+     * 
+     */
+    private Canvas mCanvas = null;
+    /**
+     * 
+     */
+    private Paint mPaint = null;
+    /**
+     * 整个用于遮罩的bitmap, 将文字遮住.当用户涂抹该view时,绘制一条透明的path到上面,这样path下的文字就显示出来.
+     */
+    private Bitmap mErasableBitmap = null;
+
+    /**
+     * 绘制可擦除范围内的路径,用户手指绘制的擦除路径
+     */
+    private Path mFingerPath;
+    /**
+     * 
+     */
+    private float mX;
+    private float mY;
+
+    /**
+     * 是否绘制颜色背景
+     */
+    private boolean canErase = false;
+
+    /**
+     * 触摸公差
+     */
+    private float mTouchTolerance;
+
+    /**
+     * 遮罩层的宽度
+     */
+    private int mErasableWidth = 0;
+    /**
+     * 遮罩层的高度
+     */
+    private int mErasableHeight = 0;
+    /**
+     * 擦除时的画笔大小
+     */
+    private int mStokeWidth = 8;
+    /**
+     * 默认可擦除颜色的背景为gray
+     */
+    private int mErasableColor = Color.GRAY;
+
+    private final String TAG = this.getClass().getSimpleName();
+
+    /**
+     * @Title: ErasableTextView
+     * @Description: ErasableTextView Constructor
+     * @param context
+     */
+    public ErasableTextView(Context context) {
+        super(context);
+
+    }
+
+    /**
+     * @Title: ErasableTextView
+     * @Description: ErasableTextView Constructor
+     * @param context
+     * @param attrs
+     * @param defStyle
+     */
+    public ErasableTextView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    /**
+     * @Title: ErasableTextView
+     * @Description: ErasableTextView Constructor
+     * @param context
+     * @param attrs
+     */
+    public ErasableTextView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    /**
+     * (非 Javadoc)
+     * 
+     * @Title: onDraw
+     * @Description: 首先绘制文本,再绘制遮罩层
+     * @param canvas
+     * @see TextView#onDraw(Canvas)
+     */
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        // 如果是可擦除状态则绘制背景色
+        if (canErase && mCanvas != null) {
+            // 绘制用户滑动的路径到擦除层, 即用户已经涂掉的区域
+            mCanvas.drawPath(mFingerPath, mPaint);
+            // 绘制整个擦除层
+            canvas.drawBitmap(mErasableBitmap, 0, 0, null);
+        }
+    }
+
+    /**
+     * @Title: setErasable
+     * @Description: 设置是否为可擦除textview
+     * @param enable
+     * @throws
+     */
+    public void setErasable(boolean enable) {
+        canErase = enable;
+
+        // 初始化画笔
+        initPaint();
+
+        // 创建路径
+        mFingerPath = new Path();
+
+        // 检测宽度和高度
+        checkErasableRect();
+
+        // 初始化画布
+        initCanvas();
+    }
+
+    /**
+     * @Title: initPaint
+     * @Description: 初始化画笔
+     * @throws
+     */
+    private void initPaint() {
+        mPaint = new Paint();
+        // 设置透明度为0
+        // 设置为透明的画笔,因此当用户用手涂时会绘制透明的路径,然后被遮住的文字就会显示出来
+        // 与setXfermode向协作即可实现擦除效果.
+        mPaint.setAlpha(0);
+        //
+        mPaint.setColor(Color.BLACK);
+        // 可以通过修改Paint的Xfermode来影响在Canvas已有的图像上面绘制新的颜色模式, 这里设置为显示新绘制的颜色
+        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
+
+        // 设置反锯齿
+        mPaint.setAntiAlias(true);
+        mPaint.setDither(true);
+        mPaint.setStyle(Paint.Style.STROKE);
+        // 设置圆角
+        mPaint.setStrokeJoin(Paint.Join.ROUND);
+        // 设置画笔的笔尖风格
+        mPaint.setStrokeCap(Paint.Cap.ROUND);
+        // 设置画笔stoke宽度
+        mPaint.setStrokeWidth(mStokeWidth);
+    }
+
+    /**
+     * @Title: initCanvas
+     * @Description: 初始化画布
+     * @throws
+     */
+    private void initCanvas() {
+        try {
+            // 以自身的宽和高创建bitmap对象, widht, height < 0则抛出异常
+            mErasableBitmap = Bitmap.createBitmap(mErasableWidth,
+                    mErasableHeight, Config.ARGB_8888);
+
+            // 以mBitmap创建画布
+            mCanvas = new Canvas(mErasableBitmap);
+            // 背景色
+            mCanvas.drawColor(mErasableColor);
+        } catch (IllegalArgumentException e) {
+            Log.e(TAG, "请在调用setErasable之前\n\n设置可擦除的宽度和高度, 调用方法为setErasableWidth, setErasableHeight");
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * @Title: checkErasableRect
+     * @Description: 检测开发者在xml设置的宽度和高度.
+     *               如果不是设置确切的高度值,而是设置match_parent等,则width和height都为-1
+     * @throws
+     */
+    private void checkErasableRect() {
+        int width = getLayoutParams().width;
+        int height = getLayoutParams().height;
+        if (width > 0 && height > 0) {
+            setErasableSize(width, height);
+        }
+    }
+
+    /**
+     * 获取 canErase
+     * 
+     * @return 返回 canErase
+     */
+    public boolean isErasable() {
+        return canErase;
+    }
+
+    /**
+     * @Title: setStokeWidth
+     * @Description:
+     * @throws
+     */
+    public void setStokeWidth(int stokeWidth) {
+        mStokeWidth = stokeWidth;
+    }
+
+    public int getStokeWidth() {
+        return mStokeWidth;
+    }
+
+    /**
+     * @Title: setErasableColor
+     * @Description: 设置可擦除的背景色
+     * @param color
+     * @throws
+     */
+    public void setErasableColor(int color) {
+        mErasableColor = color;
+    }
+
+    /**
+     * @Title: getErasableColor
+     * @Description: 获取可擦除的背景色
+     * @return
+     * @throws
+     */
+    public int getErasableColor() {
+        return mErasableColor;
+    }
+
+    /**
+     * @Title: setTouchTolerance
+     * @Description: 设置滑动多大距离为有效滑动
+     * @param tolerance
+     * @throws
+     */
+    public void setTouchTolerance(float tolerance) {
+        mTouchTolerance = tolerance;
+    }
+
+    /**
+     * @Title: getTouchTolerance
+     * @Description:
+     * @return
+     * @throws
+     */
+    public float getTouchTolerance() {
+        return mTouchTolerance;
+    }
+
+    /**
+     * 获取 mErasableWidth
+     * 
+     * @return 返回 mErasableWidth
+     */
+    public int getErasableWidth() {
+        return mErasableWidth;
+    }
+
+    /**
+     * 设置 mErasableWidth
+     * 
+     * @param width
+     * @param height
+     */
+    public void setErasableSize(int width, int height) {
+        this.mErasableWidth = width;
+        this.mErasableHeight = height;
+    }
+
+    /**
+     * 获取 mErasableHeight
+     * 
+     * @return 返回 mErasableHeight
+     */
+    public int getErasableHeight() {
+        return mErasableHeight;
+    }
+
+
+    /**
+     * (非 Javadoc)
+     * 
+     * @Title: onTouchEvent
+     * @Description: 触摸事件
+     * @param event
+     * @return
+     * @see TextView#onTouchEvent(MotionEvent)
+     */
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (!canErase) {
+            return true;
+        }
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_DOWN: // 手指按下
+                touchDown(event.getX(), event.getY());
+                invalidate();
+                break;
+            case MotionEvent.ACTION_MOVE: // 移动
+                touchMove(event.getX(), event.getY());
+                invalidate();
+                break;
+            case MotionEvent.ACTION_UP: // 抬起
+                touchUp(event.getX(), event.getY());
+                invalidate();
+                break;
+            default:
+                break;
+        }
+        return true;
+    }
+//    int lastX = -1;
+//    int lastY = -1;
+//    int direction = 0;
+//    public static final int NONE = 0;//无方向
+//    public static final int TOP_BOTTOM = 1;//上下
+//    public static final int LEFT_RIGHT = 2;//左右
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+//        int x = (int) ev.getRawX();
+//        int y = (int) ev.getRawY();
+//
+//        switch (ev.getAction()) {
+//            case MotionEvent.ACTION_DOWN:
+//                lastX = x;
+//                lastY = y;
+//                direction = NONE;
+//                // 保证子View能够接收到Action_move事件
+//                getParent().requestDisallowInterceptTouchEvent(true);
+//                break;
+//            case MotionEvent.ACTION_MOVE:
+//                if(direction == NONE) {
+//                    int dealtX = Math.abs(x - lastX);
+//                    int dealtY = Math.abs(y - lastY);
+//                    // 这里是够拦截的判断依据是上下滑动,读者可根据自己的逻辑进行是否拦截
+//                    if (dealtX <= dealtY) {
+//                        direction = TOP_BOTTOM;
+//                        getParent().requestDisallowInterceptTouchEvent(true);
+//                    } else {
+//                        direction = LEFT_RIGHT;
+//                        getParent().requestDisallowInterceptTouchEvent(false);
+//                    }
+//                }
+//                break;
+//            case MotionEvent.ACTION_CANCEL:
+//                break;
+//            case MotionEvent.ACTION_UP:
+//                break;
+//
+//        }
+        //拦截所有滑动事件
+        getParent().requestDisallowInterceptTouchEvent(true);
+        return super.dispatchTouchEvent(ev);
+    }
+
+    /**
+     * @Title: touchDown
+     * @Description:
+     * @param x
+     * @param y
+     * @throws
+     */
+    private void touchDown(float x, float y) {
+        mFingerPath.reset();
+        mFingerPath.moveTo(x, y);
+        mX = x;
+        mY = y;
+    }
+
+    /**
+     * @Title: touchMove
+     * @Description:
+     * @param x
+     * @param y
+     * @throws
+     */
+    private void touchMove(float x, float y) {
+        float dx = Math.abs(x - mX);
+        float dy = Math.abs(y - mY);
+        if (dx >= mTouchTolerance || dy >= mTouchTolerance) {
+            // quadTo这个方法将一条线段变成一个曲线
+            mFingerPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
+            mX = x;
+            mY = y;
+        }
+
+    }
+
+    /**
+     * @Title: touchUp
+     * @Description:
+     * @param x
+     * @param y
+     * @throws
+     */
+    private void touchUp(float x, float y) {
+        mFingerPath.lineTo(x, y);
+        mCanvas.drawPath(mFingerPath, mPaint);
+        RectF rectF = new RectF();
+        mFingerPath.computeBounds(rectF, true);
+        toCheckRectF(rectF);
+        mFingerPath.reset();
+    }
+
+    //检查擦除有效范围来更新次数
+    private void toCheckRectF(RectF rectF) {
+        if(rectF.right - rectF.left > mErasableWidth * 0.33f){
+            touchUpCount++;
+        }
+        if(rectF.right - rectF.left > mErasableWidth * 0.66f){
+            touchUpCount++;
+        }
+        if(rectF.bottom - rectF.top > mErasableHeight * 0.33f){
+            touchUpCount++;
+        }
+        if(rectF.bottom - rectF.top > mErasableHeight * 0.66f){
+            touchUpCount++;
+        }
+        if (onTouchUpCountChangeListener != null)
+            onTouchUpCountChangeListener.call(touchUpCount);
+        LogUtil.println(TAG, "checkRectF", touchUpCount);
+    }
+
+    //擦除次数
+    private int touchUpCount;
+    //擦除次数监听
+    private Action1<Integer> onTouchUpCountChangeListener;
+
+    public void setOnTouchUpCountChangeListener(Action1<Integer> onTouchUpCountChangeListener) {
+        this.onTouchUpCountChangeListener = onTouchUpCountChangeListener;
+    }
+}

+ 42 - 15
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SignActivity.java

@@ -27,6 +27,7 @@ import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
+import com.sheep.gamegroup.view.customview.ErasableTextView;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
@@ -60,7 +61,7 @@ public class SignActivity extends BaseActivity implements UMShareListener {
     @BindView(R.id.sign_day_list)
     LinearLayout signDayList;
     @BindView(R.id.sign_now_but)
-    TextView signNowBut;
+    TextView sign_now_but;
     @BindView(R.id.sign_card_num)
     TextView sign_card_num;
     @BindView(R.id.sheep_sign_machine)
@@ -77,6 +78,8 @@ public class SignActivity extends BaseActivity implements UMShareListener {
     TextView sheep_sign_egg_msg;//中奖的球的文本
     @BindView(R.id.sign_gua_jiang_qu)
     RelativeLayout signGuaJiang;
+    @BindView(R.id.sign_etv)
+    ErasableTextView sign_etv;
     /* 是否有漏签 */
     private boolean hasMissSign = false;
 
@@ -107,20 +110,19 @@ public class SignActivity extends BaseActivity implements UMShareListener {
         LayoutParamsUtil.resetLayoutParams(eggsView, new Lp(per).setTopMargin(600).setWidth(864).setHeight(608));
         LayoutParamsUtil.resetLayoutParams(sheep_sign_egg_rl, new Lp(per).setTopMargin(1290 - 184).setLeftMargin(974 + (218 - 182) / 2).setWidth(182).setHeight(184));
 //        ViewUtil.setEnabled(signNowBut, false);
+        sign_etv.setStokeWidth(G.getRealPix(20));
+        sign_etv.setErasable(true);
+        sign_etv.setOnTouchUpCountChangeListener(new Action1<Integer>() {
+            @Override
+            public void call(Integer count) {
+                if(count >= 4){
+                    onSignGuaJiangquClicked();
+                }
+            }
+        });
     }
 
-//    public static final int[] imageResources = {
-//            R.drawable.niudan1,
-//            R.drawable.niudan2,
-//            R.drawable.niudan3,
-//            R.drawable.niudan4,
-//            R.drawable.niudan5,
-//            R.drawable.niudan6,
-//            R.drawable.niudan7,
-//            R.drawable.niudan8};
-
     private void aEggGoOut(String msg, final Action1<Animation> animationAction1) {
-//        sheep_sign_egg.setImageResource(imageResources[(int) (Math.random() * imageResources.length) % imageResources.length]);
         ViewUtil.setText(sheep_sign_egg_msg, msg);
         ViewUtil.setVisibility(sheep_sign_egg_rl, true);
         Animation translateAnimation = new TranslateAnimation(0, 0, 0, per * 284);//平移动画  从0,0,平移到 0 , 284
@@ -155,9 +157,31 @@ public class SignActivity extends BaseActivity implements UMShareListener {
     @Override
     protected void onData() {
         initSigns();
+        initUserSignScratchAmount();
         initUserSignLastScratch();
         initSignCardData();
     }
+
+    private void initUserSignScratchAmount() {
+        SheepApp.getInstance().getNetComponent().getApiService().getUserSignScratch_amount()
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                Float result = baseMessage.getData(Float.class);
+                                if(result == null){
+                                    result = 0.01f;
+                                }
+                                sign_etv.setText(String.format(Locale.CHINA, "绵羊币:%s", NumberFormatUtils.retainMost2(result)));
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                            }
+                        });
+    }
+
     //是否完成最后一次刮奖数据的获取
     private boolean isFinishInitLastScratch = false;
     //最后一次刮奖数据
@@ -236,9 +260,9 @@ public class SignActivity extends BaseActivity implements UMShareListener {
                             hasMissSign = max > userSignList.size();
                             //设置今日签到状态
                             boolean isSignToday = lastUserSign != null && lastUserSign.isToday();
-                            ViewUtil.setText(signNowBut, isSignToday ? "已签到" : "签到");
+                            ViewUtil.setText(sign_now_but, isSignToday ? "已签到" : "签到");
                             if(canSignInSupplement())//今日已经签到,并且有漏签、且今日没有进行补签,就设置复活补签
-                                ViewUtil.setText(signNowBut, "复活补签");
+                                ViewUtil.setText(sign_now_but, "复活补签");
                             updateSignGuaJiang();
                         } else {
                             G.showToast(R.string.service_data_error);
@@ -332,11 +356,13 @@ public class SignActivity extends BaseActivity implements UMShareListener {
                             }
                         }
                         initSigns();
+                        ViewUtil.setEnabled(sign_now_but, true);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         G.showToast(baseMessage);
+                        ViewUtil.setEnabled(sign_now_but, true);
 //                                makeAndShowWindow("已签到", signDay.getData());
                     }
                 });
@@ -383,6 +409,7 @@ public class SignActivity extends BaseActivity implements UMShareListener {
 
     @OnClick(R.id.sign_now_but)
     public void onSignNowButClicked() {
+        ViewUtil.setEnabled(sign_now_but, false);
         if (canSignInSupplement()) {
             //该操作前提是lastUserSign是今天的数据,且没有进行过补签
             if(lastUserSign.signShared()){//可以进行补签且进行过分享操作,可以直接补签
@@ -412,7 +439,6 @@ public class SignActivity extends BaseActivity implements UMShareListener {
     //默认最小奖励
     public static final float DEFAULT_FLOAT = 0.01f;
 
-    @OnClick(R.id.sign_gua_jiang_qu)
     public void onSignGuaJiangquClicked() {
         SheepApp.getInstance().getNetComponent().getApiService().postUserSignScratchCard()
                 .subscribeOn(Schedulers.io())
@@ -425,6 +451,7 @@ public class SignActivity extends BaseActivity implements UMShareListener {
                             tryShowSignResultAndTask("刮奖成功", sheepSignResult.getAmount());
                         }
                         signGuaJiang.setVisibility(View.GONE);
+                        initUserSignLastScratch();
                     }
 
                     @Override

+ 8 - 7
app/src/main/res/layout/activity_sign.xml

@@ -231,14 +231,15 @@
                     android:layout_height="80dp"
                     android:layout_marginBottom="20dp"
                     android:background="@drawable/guajiang"
-                    android:contentDescription="@string/image_des"
-                    android:visibility="gone">
+                    android:visibility="gone"
+                    android:contentDescription="@string/image_des">
 
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_centerInParent="true"
-                        android:text="刮奖区"
+                    <com.sheep.gamegroup.view.customview.ErasableTextView
+                        android:id="@+id/sign_etv"
+                        android:layout_width="250dp"
+                        android:layout_height="80dp"
+                        android:gravity="center"
+                        android:text="绵羊币:0.01"
                         android:textColor="#999999"
                         android:textSize="30sp" />
                 </RelativeLayout>

+ 38 - 43
app/src/main/res/layout/item_novice_guidance.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
 
     <TextView
         android:id="@+id/item_novice_guidance_title"
@@ -14,10 +14,7 @@
         android:gravity="center"
         android:text="QQ好友、微信好友等邀请赢好礼"
         android:textColor="#2EC0F3"
-        android:textSize="15sp"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        android:textSize="15sp" />
 
 
     <!--<VideoView-->
@@ -39,43 +36,40 @@
         android:layout_marginTop="16dp"
         android:layout_marginEnd="16dp"
         android:adjustViewBounds="true"
-        android:scaleType="fitCenter"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />
-    <ImageView
-        android:id="@+id/item_novice_guidance_video_image"
+        android:scaleType="fitCenter" />
+
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
         android:layout_marginTop="16dp"
-        android:layout_marginEnd="16dp"
-        android:minHeight="190dp"
-        android:adjustViewBounds="true"
-        android:scaleType="fitCenter"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />
+        android:layout_marginEnd="16dp">
 
-    <ImageView
-        android:id="@+id/item_novice_guidance_video_control"
-        android:layout_width="51dp"
-        android:layout_height="51dp"
-        android:padding="8dp"
-        android:src="@drawable/ic_play_but_image"
-        app:layout_constraintBottom_toBottomOf="@id/item_novice_guidance_video_image"
-        app:layout_constraintEnd_toEndOf="@id/item_novice_guidance_video_image"
-        app:layout_constraintStart_toStartOf="@id/item_novice_guidance_video_image"
-        app:layout_constraintTop_toTopOf="@id/item_novice_guidance_video_image" />
+        <ImageView
+            android:id="@+id/item_novice_guidance_video_image"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:adjustViewBounds="true"
+            android:minHeight="190dp"
+            android:scaleType="fitCenter" />
 
-    <ImageView
-        android:id="@+id/item_novice_guidance_video_full"
-        android:layout_width="33dp"
-        android:layout_height="33dp"
-        android:padding="8dp"
-        android:src="@drawable/loading_01"
-        app:layout_constraintEnd_toEndOf="@id/item_novice_guidance_video_image"
-        app:layout_constraintTop_toTopOf="@id/item_novice_guidance_video_image" />
+        <ImageView
+            android:id="@+id/item_novice_guidance_video_control"
+            android:layout_width="51dp"
+            android:layout_height="51dp"
+            android:layout_centerInParent="true"
+            android:padding="8dp"
+            android:src="@drawable/ic_play_but_image" />
+
+        <ImageView
+            android:id="@+id/item_novice_guidance_video_full"
+            android:layout_width="33dp"
+            android:layout_height="33dp"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentEnd="true"
+            android:padding="8dp"
+            android:src="@drawable/loading_01" />
+    </RelativeLayout>
 
     <TextView
         android:id="@+id/item_novice_guidance_content"
@@ -86,8 +80,9 @@
         android:layout_marginEnd="16dp"
         android:text="首先,肯定要把赚钱这种好事推荐给身边,相信小伙伴会喜欢上我们的,通过你的分享朋友就能免费领取6.6元红包,从此踏上赚钱之路,对你感激"
         android:textColor="@color/black_666666"
-        android:textSize="13sp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_video_image" />
-</android.support.constraint.ConstraintLayout>
+        android:textSize="13sp" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="16dp" />
+</LinearLayout>

+ 93 - 0
app/src/main/res/layout/item_novice_guidance1.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <TextView
+        android:id="@+id/item_novice_guidance_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginRight="16dp"
+        android:gravity="center"
+        android:text="QQ好友、微信好友等邀请赢好礼"
+        android:textColor="#2EC0F3"
+        android:textSize="15sp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+
+    <!--<VideoView-->
+    <!--android:id="@+id/item_novice_guidance_video"-->
+    <!--android:layout_width="match_parent"-->
+    <!--android:layout_height="wrap_content"-->
+    <!--android:layout_marginStart="16dp"-->
+    <!--android:layout_marginTop="16dp"-->
+    <!--android:layout_marginEnd="16dp"-->
+    <!--app:layout_constraintEnd_toEndOf="parent"-->
+    <!--app:layout_constraintStart_toStartOf="parent"-->
+    <!--app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />-->
+
+    <ImageView
+        android:id="@+id/item_novice_guidance_image"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:adjustViewBounds="true"
+        android:scaleType="fitCenter"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />
+    <ImageView
+        android:id="@+id/item_novice_guidance_video_image"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:minHeight="190dp"
+        android:adjustViewBounds="true"
+        android:scaleType="fitCenter"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />
+
+    <ImageView
+        android:id="@+id/item_novice_guidance_video_control"
+        android:layout_width="51dp"
+        android:layout_height="51dp"
+        android:padding="8dp"
+        android:src="@drawable/ic_play_but_image"
+        app:layout_constraintBottom_toBottomOf="@id/item_novice_guidance_video_image"
+        app:layout_constraintEnd_toEndOf="@id/item_novice_guidance_video_image"
+        app:layout_constraintStart_toStartOf="@id/item_novice_guidance_video_image"
+        app:layout_constraintTop_toTopOf="@id/item_novice_guidance_video_image" />
+
+    <ImageView
+        android:id="@+id/item_novice_guidance_video_full"
+        android:layout_width="33dp"
+        android:layout_height="33dp"
+        android:padding="8dp"
+        android:src="@drawable/loading_01"
+        app:layout_constraintEnd_toEndOf="@id/item_novice_guidance_video_image"
+        app:layout_constraintTop_toTopOf="@id/item_novice_guidance_video_image" />
+
+    <TextView
+        android:id="@+id/item_novice_guidance_content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:text="首先,肯定要把赚钱这种好事推荐给身边,相信小伙伴会喜欢上我们的,通过你的分享朋友就能免费领取6.6元红包,从此踏上赚钱之路,对你感激"
+        android:textColor="@color/black_666666"
+        android:textSize="13sp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_video_image" />
+</android.support.constraint.ConstraintLayout>