自定义钟表

简介

最近一直在学习自定义控件,为了巩固所学实现了一个“钟表”。以此来记录下,免得以后忘掉。
很多时候我自定义控件都是选择集成view或者已经存在的原生控件,然后进行扩展重写其中的方法。今天我们要实现的钟表,因为考虑到时动态的,所以打算用SurfaceView来实现。

效果图

钟表.gif

实现

根据效果图可以看到,整个view就可以分为几步走,首先刚才已经说了,是用SurfaceView进行实现,所以需要继承SurfaceView,然后设置holder回调,并且要实现个线程进行刷新。其次就是钟表的绘图,最后就是一些对方的方法扩展。

  1. 继承SurfaceView
  2. 钟表绘制
  3. 扩展方法
  4. 调用展示

一、继承SurfaceView

废话就不多说了,和继承activity一样,然后设置回调,并实现线程,初始化画笔等一些初始化操作,直接展示代码:

public ClockView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        //获取当前时分秒
        hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
        minute = Calendar.getInstance().get(Calendar.MINUTE);
        second = Calendar.getInstance().get(Calendar.SECOND);

        //获取holder对象,并设置回调
        holder = getHolder();
        holder.addCallback(this);
        //初始化画笔
        paint = new Paint();
        pointerPaint = new Paint();

        paint.setColor(Color.BLACK);
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.STROKE);

        pointerPaint.setColor(Color.BLACK);
        pointerPaint.setAntiAlias(true);
        pointerPaint.setStyle(Paint.Style.FILL_AND_STROKE);
        pointerPaint.setTextSize(22);
        pointerPaint.setTextAlign(Paint.Align.CENTER);

        //设置不可获取焦点
        setFocusable(false);
        setFocusableInTouchMode(false);
    }

@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        int heightSize = MeasureSpec.getSize(heightMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        int desiredWidth, desiredHeight;
        if (widthMode == MeasureSpec.EXACTLY) {
            desiredWidth = widthSize;
        } else {
            desiredWidth = radius * 2 + getPaddingLeft() + getPaddingRight();
            if (widthMode == MeasureSpec.AT_MOST) {
                desiredWidth = Math.min(widthSize, desiredWidth);
            }
        }

        if (heightMode == MeasureSpec.EXACTLY) {
            desiredHeight = heightSize;
        } else {
            desiredHeight = radius * 2 + getPaddingTop() + getPaddingBottom();
            if (heightMode == MeasureSpec.AT_MOST) {
                desiredHeight = Math.min(heightSize, desiredHeight);
            }
        }

        // +4是为了设置默认的2px的内边距,因为绘制时钟的圆的画笔设置的宽度是2px
        setMeasuredDimension(canvasWidth = desiredWidth + 4, canvasHeight = desiredHeight + 4);

        radius = (int) (Math.min(desiredWidth - getPaddingLeft() - getPaddingRight(), desiredHeight - getPaddingTop() - getPaddingBottom()) * 1.0f / 2);
        calculateLengths();
    }


    @Override
    public void surfaceCreated(SurfaceHolder surfaceHolder) {
        flag = true;
        new Thread(this).start();
    }

二、钟表的绘制

相信都会这些基本操作,复杂点的就是对角度的计算。下面一起来看看绘制的过程。

  1. 获取画布并锁定,移动坐标原点到画布中心,
//获取画布,并锁定
            canvas = holder.lockCanvas();
            if (canvas != null) {
                //开始绘制,刷屏
                canvas.drawColor(Color.WHITE);
                //将坐标原点移动到去掉内边距的画布中心
                canvas.translate(canvasWidth * 1.0f / 2 + getPaddingLeft() - getPaddingRight(), canvasHeight * 1.0f / 2 + getPaddingTop() - getPaddingBottom());
  1. 绘制圆形
//设置画笔为2个宽度,绘制圆形
paint.setStrokeWidth(2f);canvas.drawCircle(0, 0, radius, paint);
  1. 绘制时秒刻度,其中绘制秒刻度的时候,时刻度要忽略掉,绘制数字。
//绘制时刻度,0-12个时刻,圆为360度,那么每个为30度
for (int i = 0; i < 12; i++) {
    canvas.drawLine(0, radius, 0, radius - hourDegreeLength, paint);
    canvas.rotate(30);
}
//绘制秒刻度,一共60秒,那么没秒6度,并且时刻度已经绘制过了就不需要再绘制了
paint.setStrokeWidth(1.5f);
for (int i = 0; i < 60; i++) {
    if (i % 5 != 0) {
        canvas.drawLine(0, radius, 0, radius - secondDegreeLength, paint);
    }
    canvas.rotate(6);
}

//绘制数字
pointerPaint.setColor(Color.BLACK);
for (int i = 0; i < 12; i++) {
    String number = (6 + i) < 12 ? String.valueOf(6 + i) : (6 + i) > 12 ? String.valueOf(i - 6) : "12";
    canvas.drawText(number, 0, radius * 5.5f / 7, pointerPaint);
    canvas.rotate(30);
}
//绘制上下午,判断当前时间是否大于小于12
canvas.drawText(hour < 12 ? "AM" : "PM", 0, radius * 1.5f / 4, pointerPaint);
  1. 绘制时分秒指针
    //绘制时针
    Path path = new Path();
    path.moveTo(0, 0);
    int[] hourPointerCoordinates = getPointerCoordinates(hourPointerLength);
    path.lineTo(hourPointerCoordinates[0], hourPointerCoordinates[1]);
    path.lineTo(hourPointerCoordinates[2], hourPointerCoordinates[3]);
    path.lineTo(hourPointerCoordinates[4], hourPointerCoordinates[5]);
    path.close();
    canvas.save();
    canvas.rotate(180 + hour % 12 * 30 + minute * 1.0f / 60 * 30);
    canvas.drawPath(path, pointerPaint);
    canvas.restore();
    //绘制分针
    path.reset();
    path.moveTo(0, 0);
    int[] minutePointerCoordinates = getPointerCoordinates(minutePointerLength);
    path.lineTo(minutePointerCoordinates[0], minutePointerCoordinates[1]);
    path.lineTo(minutePointerCoordinates[2], minutePointerCoordinates[3]);
    path.lineTo(minutePointerCoordinates[4], minutePointerCoordinates[5]);
    path.close();
    canvas.save();
    canvas.rotate(180 + minute * 6);
    canvas.drawPath(path, pointerPaint);
    canvas.restore();
    //绘制秒针
    pointerPaint.setColor(Color.RED);
    path.reset();
    path.moveTo(0, 0);
    int[] secondPointerCoordinates = getPointerCoordinates(secondPointerLength);
    path.lineTo(secondPointerCoordinates[0], secondPointerCoordinates[1]);
    path.lineTo(secondPointerCoordinates[2], secondPointerCoordinates[3]);
    path.lineTo(secondPointerCoordinates[4], secondPointerCoordinates[5]);
    path.close();
    canvas.save();
    canvas.rotate(180 + (second+1) * 6);
    canvas.drawPath(path, pointerPaint);
    canvas.restore();

三、扩展方法

public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        hour = Math.abs(hour) % 24;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this, hour, minute, second);
        }
    }

    public int getMinute() {
        return minute;
    }

    public void setMinute(int minute) {
        minute = Math.abs(minute) % 60;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this,  hour, minute, second);
        }
    }

    public int getSecond() {
        return second;
    }

    public void setSecond(int second) {
        second = Math.abs(second) % 60;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this,  hour, minute, second);
        }
    }

    public void setTime(Integer... time) {
        if (time.length > 3) {
            throw new IllegalArgumentException("the length of argument should bo less than 3");
        }
        if (time.length > 2)
            setSecond(time[2]);
        if (time.length > 1)
            setMinute(time[1]);
        if (time.length > 0)
            setHour(time[0]);
    }
    //-----------------Setter and Getter end-------------------//

    //************* interface *************

    public void setOnTimeChangeListener(OnTimeChangeListener onTimeChangeListener) {
        this.onTimeChangeListener = onTimeChangeListener;
    }

    /**
     * 当时间改变的时候提供回调的接口
     */
    public interface OnTimeChangeListener {
        /**
         * 时间发生改变时调用
         *
         * @param view   时间正在改变的view
         * @param hour   改变后的小时时刻
         * @param minute 改变后的分钟时刻
         * @param second 改变后的秒时刻
         */
        void onTimeChange(View view, int hour, int minute, int second);
    }

四、调用展示

xml就不在展示了,调用和其他的控件是一样的。时间的改变可以通过OnTimeChangeListener 接口进行获取。

clockView.setOnTimeChangeListener(new ClockView.OnTimeChangeListener() {
    @Override
    public void onTimeChange(View view, int hour, int minute, int second) {
        time.setText(hour+":"+minute+":"+second);
    }
});

最后奉上整个View的代码。

/**
 * 作者: Sunshine
 * 时间: 2016/10/20.
 * 邮箱: 44493547@qq.com
 * 描述: 自定义钟表,因为是动态view所以选择集成SurfaceView比较好
 */

public class ClockView extends SurfaceView implements SurfaceHolder.Callback, Runnable {

    private final static int DEFAULT_RADIUS = 200;

    /**
     * 半径
     */
    private int radius = DEFAULT_RADIUS;

    /**
     * 当前时间的时、分、秒
     */
    private int hour, minute, second;
    /**
     * holder对象
     */
    private SurfaceHolder holder;
    /**
     * 是否开始绘制
     */
    private boolean flag;
    /**
     * 圆和刻度的画笔
     */
    private Paint paint;
    /**
     * 指针的画笔
     */
    private Paint pointerPaint;
    /**
     * 画布的宽和高
     */
    private int canvasWidth, canvasHeight;

    /**
     * 时、分刻度的长度
     */
    private int hourDegreeLength, secondDegreeLength;
    /**
     * 时分秒指针的长度
     */
    private int minutePointerLength, secondPointerLength, hourPointerLength;

    private OnTimeChangeListener onTimeChangeListener;
    private Canvas canvas;

    public ClockView(Context context) {
        this(context, null);
    }

    public ClockView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ClockView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        //获取当前时分秒
        hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
        minute = Calendar.getInstance().get(Calendar.MINUTE);
        second = Calendar.getInstance().get(Calendar.SECOND);

        //获取holder对象,并设置回调
        holder = getHolder();
        holder.addCallback(this);
        //初始化画笔
        paint = new Paint();
        pointerPaint = new Paint();

        paint.setColor(Color.BLACK);
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.STROKE);

        pointerPaint.setColor(Color.BLACK);
        pointerPaint.setAntiAlias(true);
        pointerPaint.setStyle(Paint.Style.FILL_AND_STROKE);
        pointerPaint.setTextSize(22);
        pointerPaint.setTextAlign(Paint.Align.CENTER);

        //设置不可获取焦点
        setFocusable(false);
        setFocusableInTouchMode(false);

    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        int heightSize = MeasureSpec.getSize(heightMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        int desiredWidth, desiredHeight;
        if (widthMode == MeasureSpec.EXACTLY) {
            desiredWidth = widthSize;
        } else {
            desiredWidth = radius * 2 + getPaddingLeft() + getPaddingRight();
            if (widthMode == MeasureSpec.AT_MOST) {
                desiredWidth = Math.min(widthSize, desiredWidth);
            }
        }

        if (heightMode == MeasureSpec.EXACTLY) {
            desiredHeight = heightSize;
        } else {
            desiredHeight = radius * 2 + getPaddingTop() + getPaddingBottom();
            if (heightMode == MeasureSpec.AT_MOST) {
                desiredHeight = Math.min(heightSize, desiredHeight);
            }
        }

        // +4是为了设置默认的2px的内边距,因为绘制时钟的圆的画笔设置的宽度是2px
        setMeasuredDimension(canvasWidth = desiredWidth + 4, canvasHeight = desiredHeight + 4);

        radius = (int) (Math.min(desiredWidth - getPaddingLeft() - getPaddingRight(), desiredHeight - getPaddingTop() - getPaddingBottom()) * 1.0f / 2);
        calculateLengths();
    }


    @Override
    public void surfaceCreated(SurfaceHolder surfaceHolder) {
        flag = true;
        new Thread(this).start();
    }

    @Override
    public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {

    }

    @Override
    public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
        flag = false;
    }

    @Override
    public void run() {
        long start, end;
        while (flag) {
            start = System.currentTimeMillis();
            draw();
            logic();
            end = System.currentTimeMillis();

            try {
                if (end - start < 1000) {
                    Thread.sleep(1000 - (end - start));
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * 时间进度的逻辑
     */
    private void logic() {
        second++;
        if (second == 60) {
            second = 0;
            minute++;
            if (minute == 60) {
                minute = 0;
                hour++;
                if (hour == 24) {
                    hour = 0;
                }
            }
        }
        handler.sendEmptyMessage(0);

    }

    /**
     * 绘制
     */
    private void draw() {
        try {
            //获取画布,并锁定
            canvas = holder.lockCanvas();
            if (canvas != null) {
                //开始绘制,刷屏
                canvas.drawColor(Color.WHITE);
                //将坐标原点移动到去掉内边距的画布中心
                canvas.translate(canvasWidth * 1.0f / 2 + getPaddingLeft() - getPaddingRight(), canvasHeight * 1.0f / 2 + getPaddingTop() - getPaddingBottom());
                //设置画笔为2个宽度,绘制圆形
                paint.setStrokeWidth(2f);
                canvas.drawCircle(0, 0, radius, paint);
                //绘制时刻度,0-12个时刻,圆为360度,那么每个为30度
                for (int i = 0; i < 12; i++) {
                    canvas.drawLine(0, radius, 0, radius - hourDegreeLength, paint);
                    canvas.rotate(30);
                }
                //绘制秒刻度,一共60秒,那么没秒6度,并且时刻度已经绘制过了就不需要再绘制了
                paint.setStrokeWidth(1.5f);
                for (int i = 0; i < 60; i++) {
                    if (i % 5 != 0) {
                        canvas.drawLine(0, radius, 0, radius - secondDegreeLength, paint);
                    }
                    canvas.rotate(6);
                }
                //绘制数字
                pointerPaint.setColor(Color.BLACK);
                for (int i = 0; i < 12; i++) {
                    String number = (6 + i) < 12 ? String.valueOf(6 + i) : (6 + i) > 12 ? String.valueOf(i - 6) : "12";
                    canvas.drawText(number, 0, radius * 5.5f / 7, pointerPaint);
                    canvas.rotate(30);
                }
                //绘制上下午,判断当前时间是否大于小于12
                canvas.drawText(hour < 12 ? "AM" : "PM", 0, radius * 1.5f / 4, pointerPaint);
                //绘制指针
                Path path = new Path();
                path.moveTo(0, 0);
                int[] hourPointerCoordinates = getPointerCoordinates(hourPointerLength);
                path.lineTo(hourPointerCoordinates[0], hourPointerCoordinates[1]);
                path.lineTo(hourPointerCoordinates[2], hourPointerCoordinates[3]);
                path.lineTo(hourPointerCoordinates[4], hourPointerCoordinates[5]);
                path.close();
                canvas.save();
                canvas.rotate(180 + hour % 12 * 30 + minute * 1.0f / 60 * 30);
                canvas.drawPath(path, pointerPaint);
                canvas.restore();
                //绘制分针
                path.reset();
                path.moveTo(0, 0);
                int[] minutePointerCoordinates = getPointerCoordinates(minutePointerLength);
                path.lineTo(minutePointerCoordinates[0], minutePointerCoordinates[1]);
                path.lineTo(minutePointerCoordinates[2], minutePointerCoordinates[3]);
                path.lineTo(minutePointerCoordinates[4], minutePointerCoordinates[5]);
                path.close();
                canvas.save();
                canvas.rotate(180 + minute * 6);
                canvas.drawPath(path, pointerPaint);
                canvas.restore();
                //绘制秒针
                pointerPaint.setColor(Color.RED);
                path.reset();
                path.moveTo(0, 0);
                int[] secondPointerCoordinates = getPointerCoordinates(secondPointerLength);
                path.lineTo(secondPointerCoordinates[0], secondPointerCoordinates[1]);
                path.lineTo(secondPointerCoordinates[2], secondPointerCoordinates[3]);
                path.lineTo(secondPointerCoordinates[4], secondPointerCoordinates[5]);
                path.close();
                canvas.save();
                canvas.rotate(180 + (second+1) * 6);
                canvas.drawPath(path, pointerPaint);
                canvas.restore();
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (canvas != null) {
                holder.unlockCanvasAndPost(canvas);
            }
        }


    }

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case 0://改变时间
                    if (onTimeChangeListener != null) {

                        onTimeChangeListener.onTimeChange(ClockView.this, hour, minute, second);
                    }
                    break;
            }
        }
    };

    /**
     * 获取指针坐标
     *
     * @param pointerLength 指针长度
     * @return int[]{x1,y1,x2,y2,x3,y3}
     */
    private int[] getPointerCoordinates(int pointerLength) {
        int y = (int) (pointerLength * 3.0f / 4);
        int x = (int) (y * Math.tan(Math.PI / 180 * 5));
        return new int[]{-x, y, 0, pointerLength, x, y};
    }

    /**
     * 计算指针和刻度的长度
     */
    private void calculateLengths() {
        hourDegreeLength = (int) (radius * 1.0f / 7);
        secondDegreeLength = (int) (hourDegreeLength * 1.0f / 2);

        // hour : minute : second = 1 : 1.25 : 1.5
        hourPointerLength = (int) (radius * 1.0 / 2);
        minutePointerLength = (int) (hourPointerLength * 1.25f);
        secondPointerLength = (int) (hourPointerLength * 1.5f);
    }


    //-----------------Setter and Getter start-----------------//
    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        hour = Math.abs(hour) % 24;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this, hour, minute, second);
        }
    }

    public int getMinute() {
        return minute;
    }

    public void setMinute(int minute) {
        minute = Math.abs(minute) % 60;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this,  hour, minute, second);
        }
    }

    public int getSecond() {
        return second;
    }

    public void setSecond(int second) {
        second = Math.abs(second) % 60;
        if (onTimeChangeListener != null) {
            onTimeChangeListener.onTimeChange(this,  hour, minute, second);
        }
    }

    public void setTime(Integer... time) {
        if (time.length > 3) {
            throw new IllegalArgumentException("the length of argument should bo less than 3");
        }
        if (time.length > 2)
            setSecond(time[2]);
        if (time.length > 1)
            setMinute(time[1]);
        if (time.length > 0)
            setHour(time[0]);
    }
    //-----------------Setter and Getter end-------------------//

    //************* interface *************

    public void setOnTimeChangeListener(OnTimeChangeListener onTimeChangeListener) {
        this.onTimeChangeListener = onTimeChangeListener;
    }

    /**
     * 当时间改变的时候提供回调的接口
     */
    public interface OnTimeChangeListener {
        /**
         * 时间发生改变时调用
         *
         * @param view   时间正在改变的view
         * @param hour   改变后的小时时刻
         * @param minute 改变后的分钟时刻
         * @param second 改变后的秒时刻
         */
        void onTimeChange(View view, int hour, int minute, int second);
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 205,033评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,725评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,473评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,846评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,848评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,691评论 1 282
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,053评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,700评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,856评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,676评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,787评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,430评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,034评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,990评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,218评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,174评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,526评论 2 343

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 171,464评论 25 707
  • android自定义钟表 首先看看效果图先 然后看看自定义的属性 自定义各参数的初始化 接下来就是设定这个自定义V...
    Jack921阅读 2,163评论 1 23
  • 闪电鸟逃了以后,龙发誓不捉住不走,结果…… 闪电鸟来了N次,不是被打死就是逃了,龙气红眼了,一堆神奇宝贝拿着“...
    阿团SAMA阅读 288评论 0 2
  • 练瑜伽的时候一定要静心了,如果不能关注自己的呼吸,关注自己的身体变化,好像就没什么效果。练的就是心境。哑铃的训练还...
    饮雨秋寒阅读 181评论 0 0
  • 五一在家的时候和妈妈去公园,路上邂逅了一个多年未见的儿时玩伴,我们本应热情拥抱嘘寒问暖,却在遇到的那一刻十分默契却...
    peek_a_boo阅读 290评论 0 0