android:自定义开关按钮--SwitchButton

安卓app项目的设置中经常会用到开关按钮,记录下来。

效果截图如下:

image.png

image.png

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.CompoundButton;



public class SwitchButton extends CompoundButton {
    private static boolean SHOW_RECT = false;

    private boolean mIsChecked = false;

    private Configuration mConf;

    private Rect mSafeZone;

    private Rect mBackZone;
    private Rect mThumbZone;
    private RectF mSaveLayerZone;

    private AnimationController mAnimationController;
    private SBAnimationListener mOnAnimateListener = new SBAnimationListener();
    private boolean isAnimating = false;

    private float mStartX, mStartY, mLastX;
    private float mCenterPos;

    private int mTouchSlop;
    private int mClickTimeout;

    private Paint mRectPaint;

    private Rect mBounds = null;

    private OnCheckedChangeListener mOnCheckedChangeListener;

    @SuppressLint("NewApi")
    public SwitchButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initView();

        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SwitchButton);

        mConf.setThumbMarginInPixel(ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_margin, mConf.getDefaultThumbMarginInPixel()));
        mConf.setThumbMarginInPixel(ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_marginTop, mConf.getThumbMarginTop()),
                ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_marginBottom, mConf.getThumbMarginBottom()),
                ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_marginLeft, mConf.getThumbMarginLeft()),
                ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_marginRight, mConf.getThumbMarginRight()));
        mConf.setRadius(ta.getInt(R.styleable.SwitchButton_radius, Configuration.Default.DEFAULT_RADIUS));

        mConf.setThumbWidthAndHeightInPixel(ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_width, -1), ta.getDimensionPixelSize(R.styleable.SwitchButton_thumb_height, -1));

        mConf.setMeasureFactor(ta.getFloat(R.styleable.SwitchButton_measureFactor, -1));

        mConf.setInsetBounds(ta.getDimensionPixelSize(R.styleable.SwitchButton_insetLeft, 0), ta.getDimensionPixelSize(R.styleable.SwitchButton_insetTop, 0),
                ta.getDimensionPixelSize(R.styleable.SwitchButton_insetRight, 0), ta.getDimensionPixelSize(R.styleable.SwitchButton_insetBottom, 0));

        int velocity = ta.getInteger(R.styleable.SwitchButton_animationVelocity, -1);
        mAnimationController.setVelocity(velocity);

        fetchDrawableFromAttr(ta);
        ta.recycle();

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
            this.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }
    }

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

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

    private void initView() {
        mConf = Configuration.getDefault(getContext().getResources().getDisplayMetrics().density);
        mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
        mClickTimeout = ViewConfiguration.getPressedStateDuration() + ViewConfiguration.getTapTimeout();
        mAnimationController = AnimationController.getDefault().init(mOnAnimateListener);
        mBounds = new Rect();
        if (SHOW_RECT) {
            mRectPaint = new Paint();
            mRectPaint.setStyle(Paint.Style.STROKE);
        }
    }

   
    private void fetchDrawableFromAttr(TypedArray ta) {
        if (mConf == null) {
            return;
        }
        mConf.setOffDrawable(fetchDrawable(ta, R.styleable.SwitchButton_offDrawable, R.styleable.SwitchButton_offColor, Configuration.Default.DEFAULT_OFF_COLOR));
        mConf.setOnDrawable(fetchDrawable(ta, R.styleable.SwitchButton_onDrawable, R.styleable.SwitchButton_onColor, Configuration.Default.DEFAULT_ON_COLOR));
        mConf.setThumbDrawable(fetchThumbDrawable(ta));
    }

    private Drawable fetchDrawable(TypedArray ta, int attrId, int alterColorId, int defaultColor) {
        Drawable tempDrawable = ta.getDrawable(attrId);
        if (tempDrawable == null) {
            int tempColor = ta.getColor(alterColorId, defaultColor);
            tempDrawable = new GradientDrawable();
            ((GradientDrawable) tempDrawable).setCornerRadius(this.mConf.getRadius());
            ((GradientDrawable) tempDrawable).setColor(tempColor);
        }
        return tempDrawable;
    }

    private Drawable fetchThumbDrawable(TypedArray ta) {

        Drawable tempDrawable = ta.getDrawable(R.styleable.SwitchButton_thumbDrawable);
        if (tempDrawable != null) {
            return tempDrawable;
        }

        int normalColor = ta.getColor(R.styleable.SwitchButton_thumbColor, Configuration.Default.DEFAULT_THUMB_COLOR);
        int pressedColor = ta.getColor(R.styleable.SwitchButton_thumbPressedColor, Configuration.Default.DEFAULT_THUMB_PRESSED_COLOR);

        StateListDrawable drawable = new StateListDrawable();
        GradientDrawable normalDrawable = new GradientDrawable();
        normalDrawable.setCornerRadius(this.mConf.getRadius());
        normalDrawable.setColor(normalColor);
        GradientDrawable pressedDrawable = new GradientDrawable();
        pressedDrawable.setCornerRadius(this.mConf.getRadius());
        pressedDrawable.setColor(pressedColor);
        drawable.addState(View.PRESSED_ENABLED_STATE_SET, pressedDrawable);
        drawable.addState(new int[] {}, normalDrawable);

        return drawable;
    }

    public void setConfiguration(Configuration conf) {
        if (mConf == null) {
            mConf = Configuration.getDefault(conf.getDensity());
        }
        mConf.setOffDrawable(conf.getOffDrawableWithFix());
        mConf.setOnDrawable(conf.getOnDrawableWithFix());
        mConf.setThumbDrawable(conf.getThumbDrawableWithFix());
        mConf.setThumbMarginInPixel(conf.getThumbMarginTop(), conf.getThumbMarginBottom(), conf.getThumbMarginLeft(), conf.getThumbMarginRight());
        mConf.setThumbWidthAndHeightInPixel(conf.getThumbWidth(), conf.getThumbHeight());
        mConf.setVelocity(conf.getVelocity());
        mConf.setMeasureFactor(conf.getMeasureFactor());
        mAnimationController.setVelocity(mConf.getVelocity());
        this.requestLayout();
        setup();
        setChecked(mIsChecked);
    }

  
    public Configuration getConfiguration() {
        return mConf;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec));
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        setup();
    }

    private void setup() {
        setupBackZone();
        setupSafeZone();
        setupThumbZone();

        setupDrawableBounds();
        if (this.getMeasuredWidth() > 0 && this.getMeasuredHeight() > 0) {
            mSaveLayerZone = new RectF(0, 0, this.getMeasuredWidth(), this.getMeasuredHeight());
        }

        ViewGroup parent = (ViewGroup) this.getParent();
        if (parent != null) {
            parent.setClipChildren(false);
        }
    }

    private void setupSafeZone() {
        int w = getMeasuredWidth();
        int h = getMeasuredHeight();
        if (w > 0 && h > 0) {
            if (mSafeZone == null) {
                mSafeZone = new Rect();
            }
            int left, right, top, bottom;
            left = getPaddingLeft() + (mConf.getThumbMarginLeft() > 0 ? mConf.getThumbMarginLeft() : 0);
            right = w - getPaddingRight() - (mConf.getThumbMarginRight() > 0 ? mConf.getThumbMarginRight() : 0) + (-mConf.getShrinkX());
            top = getPaddingTop() + (mConf.getThumbMarginTop() > 0 ? mConf.getThumbMarginTop() : 0);
            bottom = h - getPaddingBottom() - (mConf.getThumbMarginBottom() > 0 ? mConf.getThumbMarginBottom() : 0) + (-mConf.getShrinkY());
            mSafeZone.set(left, top, right, bottom);

            mCenterPos = mSafeZone.left + (mSafeZone.right - mSafeZone.left - mConf.getThumbWidth()) / 2;
        } else {
            mSafeZone = null;
        }
    }

    private void setupBackZone() {
        int w = getMeasuredWidth();
        int h = getMeasuredHeight();
        if (w > 0 && h > 0) {
            if (mBackZone == null) {
                mBackZone = new Rect();
            }
            int left, right, top, bottom;
            left = getPaddingLeft() + (mConf.getThumbMarginLeft() > 0 ? 0 : -mConf.getThumbMarginLeft());
            right = w - getPaddingRight() - (mConf.getThumbMarginRight() > 0 ? 0 : -mConf.getThumbMarginRight()) + (-mConf.getShrinkX());
            top = getPaddingTop() + (mConf.getThumbMarginTop() > 0 ? 0 : -mConf.getThumbMarginTop());
            bottom = h - getPaddingBottom() - (mConf.getThumbMarginBottom() > 0 ? 0 : -mConf.getThumbMarginBottom()) + (-mConf.getShrinkY());
            mBackZone.set(left, top, right, bottom);
        } else {
            mBackZone = null;
        }
    }

    private void setupThumbZone() {
        int w = getMeasuredWidth();
        int h = getMeasuredHeight();
        if (w > 0 && h > 0) {
            if (mThumbZone == null) {
                mThumbZone = new Rect();
            }
            int left, right, top, bottom;
            left = mIsChecked ? (mSafeZone.right - mConf.getThumbWidth()) : mSafeZone.left;
            right = left + mConf.getThumbWidth();
            top = mSafeZone.top;
            bottom = top + mConf.getThumbHeight();
            mThumbZone.set(left, top, right, bottom);
        } else {
            mThumbZone = null;
        }
    }

    private void setupDrawableBounds() {
        if (mBackZone != null) {
            mConf.getOnDrawable().setBounds(mBackZone);
            mConf.getOffDrawable().setBounds(mBackZone);
        }
        if (mThumbZone != null) {
            mConf.getThumbDrawable().setBounds(mThumbZone);
        }
    }

    private int measureWidth(int measureSpec) {
        int measuredWidth = 0;

        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);

        int minWidth = (int) (mConf.getThumbWidth() * mConf.getMeasureFactor() + getPaddingLeft() + getPaddingRight());
        int innerMarginWidth = mConf.getThumbMarginLeft() + mConf.getThumbMarginRight();
        if (innerMarginWidth > 0) {
            minWidth += innerMarginWidth;
        }

        if (specMode == MeasureSpec.EXACTLY) {
            measuredWidth = Math.max(specSize, minWidth);
        } else {
            measuredWidth = minWidth;
            if (specMode == MeasureSpec.AT_MOST) {
                measuredWidth = Math.min(specSize, minWidth);
            }
        }

        measuredWidth += (mConf.getInsetBounds().left + mConf.getInsetBounds().right);

        return measuredWidth;
    }

    private int measureHeight(int measureSpec) {
        int measuredHeight = 0;

        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);

        int minHeight = mConf.getThumbHeight() + getPaddingTop() + getPaddingBottom();
        int innerMarginHeight = mConf.getThumbMarginTop() + mConf.getThumbMarginBottom();

        if (innerMarginHeight > 0) {
            minHeight += innerMarginHeight;
        }

        if (specMode == MeasureSpec.EXACTLY) {
            measuredHeight = Math.max(specSize, minHeight);
        } else {
            measuredHeight = minHeight;
            if (specMode == MeasureSpec.AT_MOST) {
                measuredHeight = Math.min(specSize, minHeight);
            }
        }

        measuredHeight += (mConf.getInsetBounds().top + mConf.getInsetBounds().bottom);

        return measuredHeight;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        canvas.getClipBounds(mBounds);
        if (mBounds != null && mConf.needShrink()) {
            mBounds.inset(mConf.getInsetX(), mConf.getInsetY());
            canvas.clipRect(mBounds, Region.Op.REPLACE);
            canvas.translate(mConf.getInsetBounds().left, mConf.getInsetBounds().top);
        }

        boolean useGeneralDisableEffect = !isEnabled() && this.notStatableDrawable();
        if (useGeneralDisableEffect) {
            canvas.saveLayerAlpha(mSaveLayerZone, 255 / 2, Canvas.MATRIX_SAVE_FLAG | Canvas.CLIP_SAVE_FLAG | Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.FULL_COLOR_LAYER_SAVE_FLAG
                    | Canvas.CLIP_TO_LAYER_SAVE_FLAG);
        }

        mConf.getOffDrawable().draw(canvas);
        mConf.getOnDrawable().setAlpha(calcAlpha());
        mConf.getOnDrawable().draw(canvas);
        mConf.getThumbDrawable().draw(canvas);

        if (useGeneralDisableEffect) {
            canvas.restore();
        }

        if (SHOW_RECT) {
            mRectPaint.setColor(Color.parseColor("#AA0000"));
            canvas.drawRect(mBackZone, mRectPaint);
            mRectPaint.setColor(Color.parseColor("#00FF00"));
            canvas.drawRect(mSafeZone, mRectPaint);
            mRectPaint.setColor(Color.parseColor("#0000FF"));
            canvas.drawRect(mThumbZone, mRectPaint);
        }
    }

    private boolean notStatableDrawable() {
        boolean thumbStatable = (mConf.getThumbDrawable() instanceof StateListDrawable);
        boolean onStatable = (mConf.getOnDrawable() instanceof StateListDrawable);
        boolean offStatable = (mConf.getOffDrawable() instanceof StateListDrawable);
        return !thumbStatable || !onStatable || !offStatable;
    }

  
    private int calcAlpha() {
        int alpha = 255;
        if (mSafeZone == null || mSafeZone.right == mSafeZone.left) {

        } else {
            int backWidth = mSafeZone.right - mConf.getThumbWidth() - mSafeZone.left;
            if (backWidth > 0) {
                alpha = (mThumbZone.left - mSafeZone.left) * 255 / backWidth;
            }
        }

        return alpha;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {

        if (isAnimating || !isEnabled()) {
            return false;
        }
        int action = event.getAction();

        float deltaX = event.getX() - mStartX;
        float deltaY = event.getY() - mStartY;

        boolean nextStatus = mIsChecked;

        switch (action) {
            case MotionEvent.ACTION_DOWN:
                catchView();
                mStartX = event.getX();
                mStartY = event.getY();
                mLastX = mStartX;
                setPressed(true);
                break;

            case MotionEvent.ACTION_MOVE:
                float x = event.getX();
                moveThumb((int) (x - mLastX));
                mLastX = x;
                break;

            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_UP:
                setPressed(false);

                nextStatus = getStatusBasedOnPos();

                float time = event.getEventTime() - event.getDownTime();

                if (deltaX < mTouchSlop && deltaY < mTouchSlop && time < mClickTimeout) {
                    performClick();
                } else {
                    slideToChecked(nextStatus);
                }

                break;

            default:
                break;
        }
        invalidate();
        return true;
    }


    private boolean getStatusBasedOnPos() {
        return mThumbZone.left > mCenterPos;
    }

    @Override
    public void invalidate() {
        if (mBounds != null && mConf.needShrink()) {
            invalidate(mBounds);
        } else {
            super.invalidate();
        }
    }

    @Override
    public boolean performClick() {
        return super.performClick();
    }

    private void catchView() {
        ViewParent parent = getParent();
        if (parent != null) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }

    @Override
    public void setChecked(final boolean checked) {
        setChecked(checked, true);
    }

    public void setChecked(final boolean checked, boolean trigger) {
        if (mThumbZone != null) {
            moveThumb(checked ? getMeasuredWidth() : -getMeasuredWidth());
        }
        setCheckedInClass(checked, trigger);
    }

    @Override
    public boolean isChecked() {
        return mIsChecked;
    }

    @Override
    public void toggle() {
        toggle(true);
    }

    public void toggle(boolean animated) {
        if (animated) {
            slideToChecked(!mIsChecked);
        } else {
            setChecked(!mIsChecked);
        }
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        if (mConf == null) {
            return;
        }
        setDrawableState(mConf.getThumbDrawable());
        setDrawableState(mConf.getOnDrawable());
        setDrawableState(mConf.getOffDrawable());
    }

    private void setDrawableState(Drawable drawable) {
        if (drawable != null) {
            int[] myDrawableState = getDrawableState();
            drawable.setState(myDrawableState);
            invalidate();
        }
    }

    public void setOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) {
        if (onCheckedChangeListener == null) {
            return;
//          throw new IllegalArgumentException("onCheckedChangeListener can not be null");
        }
        mOnCheckedChangeListener = onCheckedChangeListener;
    }

    private void setCheckedInClass(boolean checked) {
        setCheckedInClass(checked, true);
    }

    private void setCheckedInClass(boolean checked, boolean trigger) {
        if (mIsChecked == checked) {
            return;
        }
        mIsChecked = checked;

        refreshDrawableState();

        if (mOnCheckedChangeListener != null && trigger) {
            mOnCheckedChangeListener.onCheckedChanged(this, mIsChecked);
        }
    }

    public void slideToChecked(boolean checked) {
        if (isAnimating) {
            return;
        }
        int from = mThumbZone.left;
        int to = checked ? mSafeZone.right - mConf.getThumbWidth() : mSafeZone.left;
        mAnimationController.startAnimation(from, to);
    }

    private void moveThumb(int delta) {

        int newLeft = mThumbZone.left + delta;
        int newRight = mThumbZone.right + delta;
        if (newLeft < mSafeZone.left) {
            newLeft = mSafeZone.left;
            newRight = newLeft + mConf.getThumbWidth();
        }
        if (newRight > mSafeZone.right) {
            newRight = mSafeZone.right;
            newLeft = newRight - mConf.getThumbWidth();
        }

        moveThumbTo(newLeft, newRight);
    }

    private void moveThumbTo(int newLeft, int newRight) {
        mThumbZone.set(newLeft, mThumbZone.top, newRight, mThumbZone.bottom);
        mConf.getThumbDrawable().setBounds(mThumbZone);
    }

    class SBAnimationListener implements AnimationController.OnAnimateListener {

        @Override
        public void onAnimationStart() {
            isAnimating = true;
        }

        @Override
        public boolean continueAnimating() {
            return mThumbZone.right < mSafeZone.right && mThumbZone.left > mSafeZone.left;
        }

        @Override
        public void onFrameUpdate(int frame) {
            moveThumb(frame);
            postInvalidate();
        }

        @Override
        public void onAnimateComplete() {
            setCheckedInClass(getStatusBasedOnPos());
            isAnimating = false;
        }

    }
}


switch_button_attrs.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="SwitchButton">
        <attr name="onDrawable" format="reference" />
        <attr name="offDrawable" format="reference" />
        <attr name="thumbDrawable" format="reference" />
        <attr name="thumb_margin" format="dimension|reference" />
        <attr name="thumb_marginTop" format="dimension|reference" />
        <attr name="thumb_marginBottom" format="dimension|reference" />
        <attr name="thumb_marginLeft" format="dimension|reference" />
        <attr name="thumb_marginRight" format="dimension|reference" />
        <attr name="thumb_width" format="dimension|reference" />
        <attr name="thumb_height" format="dimension|reference" />
        <attr name="onColor" format="color|reference" />
        <attr name="offColor" format="color|reference" />
        <attr name="thumbColor" format="color|reference" />
        <attr name="thumbPressedColor" format="color|reference" />
        <attr name="animationVelocity" format="integer" />
        <attr name="radius" format="integer" />
        <attr name="measureFactor" format="float" />
        <attr name="insetLeft" format="dimension|reference" />
        <attr name="insetRight" format="dimension|reference" />
        <attr name="insetTop" format="dimension|reference" />
        <attr name="insetBottom" format="dimension|reference" />
    </declare-styleable>

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

推荐阅读更多精彩内容