老司機帶你重構(gòu)Android的v4包的部分源碼

版權(quán)聲明:本文為博主原創(chuàng)文章姜性,未經(jīng)博主允許不得轉(zhuǎn)載恐锣。http://www.reibang.com/p/a08d754944c4

轉(zhuǎn)載請標明出處:
http://www.reibang.com/p/a08d754944c4
本文出自 AWeiLoveAndroid的博客


【前言】過年回家忙著干活茅主,忙著給親戚的孩子發(fā)紅包诀姚,好累,忙里偷閑打開studio看了一下v4包赫段,之前看過幾個類矢赁,這次是每個類都看了一下糯笙,原來Android的v4包的源碼也有一些是寫的不是那么友好的,還有很多改善空間坯台。

下面就拿其中的android.support.v4.text這個包里面的 TextUtilsCompatTextUtilsCompatJellybeanMr1 這兩個類來做一個具體講解炬丸。

本文源碼同步發(fā)布在github瘫寝,詳情請點擊 https://github.com/AweiLoveAndroid/refactor-android-support-v4

一蜒蕾、首先看一下Androidv4包下面的 TextUtilsCompatTextUtilsCompatJellybeanMr1 源碼:

(一)TextUtilsCompat 源碼:
public final class TextUtilsCompat {
    private static class TextUtilsCompatImpl {
        TextUtilsCompatImpl() {
        }

        @NonNull
        public String htmlEncode(@NonNull String s) {
            StringBuilder sb = new StringBuilder();
            char c;
            for (int i = 0; i < s.length(); i++) {
                c = s.charAt(i);
                switch (c) {
                    case '<':
                        sb.append("&lt;"); //$NON-NLS-1$
                        break;
                    case '>':
                        sb.append("&gt;"); //$NON-NLS-1$
                        break;
                    case '&':
                        sb.append("&amp;"); //$NON-NLS-1$
                        break;
                    case '\'':
                        //http://www.w3.org/TR/xhtml1
                        // The named character reference &apos; (the apostrophe, U+0027) was
                        // introduced in XML 1.0 but does not appear in HTML. Authors should
                        // therefore use &#39; instead of &apos; to work as expected in HTML 4
                        // user agents.
                        sb.append("&#39;"); //$NON-NLS-1$
                        break;
                    case '"':
                        sb.append("&quot;"); //$NON-NLS-1$
                        break;
                    default:
                        sb.append(c);
                }
            }
            return sb.toString();
        }

        public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
            if (locale != null && !locale.equals(ROOT)) {
                final String scriptSubtag = ICUCompat.maximizeAndGetScript(locale);
                if (scriptSubtag == null) return getLayoutDirectionFromFirstChar(locale);

                // This is intentionally limited to Arabic and Hebrew scripts, since older
                // versions of Android platform only considered those scripts to be right-to-left.
                if (scriptSubtag.equalsIgnoreCase(ARAB_SCRIPT_SUBTAG) ||
                        scriptSubtag.equalsIgnoreCase(HEBR_SCRIPT_SUBTAG)) {
                    return ViewCompat.LAYOUT_DIRECTION_RTL;
                }
            }
            return ViewCompat.LAYOUT_DIRECTION_LTR;
        }

        /**
         * Fallback algorithm to detect the locale direction. Rely on the first char of the
         * localized locale name. This will not work if the localized locale name is in English
         * (this is the case for ICU 4.4 and "Urdu" script)
         *
         * @param locale
         * @return the layout direction. This may be one of:
         * {@link ViewCompat#LAYOUT_DIRECTION_LTR} or
         * {@link ViewCompat#LAYOUT_DIRECTION_RTL}.
         *
         * Be careful: this code will need to be updated when vertical scripts will be supported
         */
        private static int getLayoutDirectionFromFirstChar(@NonNull Locale locale) {
            switch(Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) {
                case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
                case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
                    return ViewCompat.LAYOUT_DIRECTION_RTL;

                case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
                default:
                    return ViewCompat.LAYOUT_DIRECTION_LTR;
            }
        }
    }

    private static class TextUtilsCompatJellybeanMr1Impl extends TextUtilsCompatImpl {
        TextUtilsCompatJellybeanMr1Impl() {
        }

        @Override
        @NonNull
        public String htmlEncode(@NonNull String s) {
            return TextUtilsCompatJellybeanMr1.htmlEncode(s);
        }

        @Override
        public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
            return TextUtilsCompatJellybeanMr1.getLayoutDirectionFromLocale(locale);
        }
    }

    private static final TextUtilsCompatImpl IMPL;
    static {
        final int version = Build.VERSION.SDK_INT;
        if (version >= 17) { // JellyBean MR1
            IMPL = new TextUtilsCompatJellybeanMr1Impl();
        } else {
            IMPL = new TextUtilsCompatImpl();
        }
    }

    /**
     * Html-encode the string.
     * @param s the string to be encoded
     * @return the encoded string
     */
    @NonNull
    public static String htmlEncode(@NonNull String s) {
        return IMPL.htmlEncode(s);
    }

    /**
     * Return the layout direction for a given Locale
     *
     * @param locale the Locale for which we want the layout direction. Can be null.
     * @return the layout direction. This may be one of:
     * {@link ViewCompat#LAYOUT_DIRECTION_LTR} or
     * {@link ViewCompat#LAYOUT_DIRECTION_RTL}.
     *
     * Be careful: this code will need to be updated when vertical scripts will be supported
     */
    public static int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        return IMPL.getLayoutDirectionFromLocale(locale);
    }

    public static final Locale ROOT = new Locale("", "");

    static String ARAB_SCRIPT_SUBTAG = "Arab";
    static String HEBR_SCRIPT_SUBTAG = "Hebr";

    private TextUtilsCompat() {}
}
(二)TextUtilsCompatJellybeanMr1 源碼:
/**
 * Jellybean MR1 - specific TextUtils API access.
 */
@RequiresApi(17)
@TargetApi(17)
class TextUtilsCompatJellybeanMr1 {
    @NonNull
    public static String htmlEncode(@NonNull String s) {
        return TextUtils.htmlEncode(s);
    }

    public static int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        return TextUtils.getLayoutDirectionFromLocale(locale);
    }
}

二、分析一下以上源碼的一些需要改進的問題(僅個人理解焕阿,如有不同意見咪啡,歡迎提出):

通過以上源碼來看,看起來確實有點不是很舒服暮屡。

(一)排列順序有點亂撤摸,我格式化了一下,如下褒纲,看的稍微清楚了一些:
/**
 * 格式化之后的TextUtilsCompat類
 */
public class TextUtilsCompat {

    private static final TextUtilsCompatImpl IMPL;

    public static final Locale ROOT = new Locale("", "");

    static String ARAB_SCRIPT_SUBTAG = "Arab";
    static String HEBR_SCRIPT_SUBTAG = "Hebr";

    private TextUtilsCompat() {}

    static {
        final int version = Build.VERSION.SDK_INT;
        if (version >= 17) { // JellyBean MR1
            IMPL = new TextUtilsCompatJellybeanMr1Impl();
        } else {
            IMPL = new TextUtilsCompatImpl();
        }
    }

    /**
     * Html-encode the string.
     * @param s the string to be encoded
     * @return the encoded string
     */
    @NonNull
    public static String htmlEncode(@NonNull String s) {
        return IMPL.htmlEncode(s);
    }

    /**
     * Return the layout direction for a given Locale
     *
     * @param locale the Locale for which we want the layout direction. Can be null.
     * @return the layout direction. This may be one of:
     * {@link ViewCompat#LAYOUT_DIRECTION_LTR} or
     * {@link ViewCompat#LAYOUT_DIRECTION_RTL}.
     *
     * Be careful: this code will need to be updated when vertical scripts will be supported
     */
    public static int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        return IMPL.getLayoutDirectionFromLocale(locale);
    }


    private static class TextUtilsCompatImpl {

        TextUtilsCompatImpl() {}

        @NonNull
        public String htmlEncode(@NonNull String s) {
            StringBuilder sb = new StringBuilder();
            char c;
            for (int i = 0; i < s.length(); i++) {
                c = s.charAt(i);
                switch (c) {
                    case '<':
                        sb.append("&lt;"); //$NON-NLS-1$
                        break;
                    case '>':
                        sb.append("&gt;"); //$NON-NLS-1$
                        break;
                    case '&':
                        sb.append("&amp;"); //$NON-NLS-1$
                        break;
                    case '\'':
                        //http://www.w3.org/TR/xhtml1
                        // The named character reference &apos; (the apostrophe, U+0027) was
                        // introduced in XML 1.0 but does not appear in HTML. Authors should
                        // therefore use &#39; instead of &apos; to work as expected in HTML 4
                        // user agents.
                        sb.append("&#39;"); //$NON-NLS-1$
                        break;
                    case '"':
                        sb.append("&quot;"); //$NON-NLS-1$
                        break;
                    default:
                        sb.append(c);
                }
            }
            return sb.toString();
        }

        public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
            if (locale != null && !locale.equals(ROOT)) {
                final String scriptSubtag = ICUCompat.maximizeAndGetScript(locale);
                if (scriptSubtag == null) {
                    return getLayoutDirectionFromFirstChar(locale);
                }

                // This is intentionally limited to Arabic and Hebrew scripts, since older
                // versions of Android platform only considered those scripts to be right-to-left.
                if (scriptSubtag.equalsIgnoreCase(ARAB_SCRIPT_SUBTAG) ||
                        scriptSubtag.equalsIgnoreCase(HEBR_SCRIPT_SUBTAG)) {
                    return ViewCompat.LAYOUT_DIRECTION_RTL;
                }
            }
            return ViewCompat.LAYOUT_DIRECTION_LTR;
        }

        /**
         * Fallback algorithm to detect the locale direction. Rely on the first char of the
         * localized locale name. This will not work if the localized locale name is in English
         * (this is the case for ICU 4.4 and "Urdu" script)
         *
         * @param locale
         * @return the layout direction. This may be one of:
         * {@link ViewCompat#LAYOUT_DIRECTION_LTR} or
         * {@link ViewCompat#LAYOUT_DIRECTION_RTL}.
         *
         * Be careful: this code will need to be updated when vertical scripts will be supported
         */
        private static int getLayoutDirectionFromFirstChar(@NonNull Locale locale) {
            switch(Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) {
                case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
                case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
                    return ViewCompat.LAYOUT_DIRECTION_RTL;

                case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
                default:
                    return ViewCompat.LAYOUT_DIRECTION_LTR;
            }
        }
    }

    private static class TextUtilsCompatJellybeanMr1Impl extends TextUtilsCompatImpl {
        TextUtilsCompatJellybeanMr1Impl() {
        }

        @Override
        @NonNull
        public String htmlEncode(@NonNull String s) {
            return TextUtilsCompatJellybeanMr1.htmlEncode(s);
        }

        @Override
        public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
            return TextUtilsCompatJellybeanMr1.getLayoutDirectionFromLocale(locale);
        }
    }

}
(二)TextUtilsCompat 這個類里面有兩個內(nèi)部類准夷,一個是TextUtilsCompatImpl,一個是TextUtilsCompatJellybeanMr1Impl,TextUtilsCompatJellybeanMr1Impl是繼承自TextUtilsCompatImpl的莺掠。
(三)從靜態(tài)代碼塊看出衫嵌,api 大于17 使用 new TextUtilsCompatJellybeanMr1Impl(); api小于17 使用TextUtilsCompatImpl。TextUtilsCompat彻秆,TextUtilsCompatImpl和TextUtilsCompatJellybeanMr1Impl里面都有 htmlEncode 方法和 getLayoutDirectionFromLocale 方法楔绞。

靜態(tài)代碼塊里面通過TextUtilsCompatImpl IMPL這個常量來判斷,當(dāng)api大于17用TextUtilsCompatJellybeanMr1Impl唇兑,否則用TextUtilsCompatImpl酒朵,然后htmlEncode方法調(diào)用了對應(yīng)內(nèi)部類里面的htmlEncode方法,getLayoutDirectionFromLocale調(diào)用了對應(yīng)內(nèi)部類里面的getLayoutDirectionFromLocale方法扎附。

(四)TextUtilsCompatImpl和TextUtilsCompatJellybeanMr1Impl里面都有 htmlEncode 方法和 getLayoutDirectionFromLocale 方法蔫耽,看看它們的區(qū)別针肥。

(1)TextUtilsCompatJellybeanMr1Impl這個內(nèi)部類的方法解析:

  • htmlEncode(@NonNull String s) 方法 返回的是:
TextUtilsCompatJellybeanMr1.htmlEncode(s); ==> 調(diào)用了TextUtils.htmlEncode(s);
  • getLayoutDirectionFromLocale(@Nullable Locale locale) 方法返回的是:
TextUtilsCompatJellybeanMr1.getLayoutDirectionFromLocale(locale); ==> 調(diào)用了TextUtils.getLayoutDirectionFromLocale(locale);

(2)TextUtilsCompatImpl這個內(nèi)部類的方法解析:

  • htmlEncode(@NonNull String s) 方法 返回的是:
在這個方法內(nèi)部寫了一遍,跟TextUtils.htmlEncode(s);方法里面的一模一樣。
  • getLayoutDirectionFromLocale(@Nullable Locale locale) 方法返回的是:
重新寫了一遍,這個方法是真正有所區(qū)別的地方汪厨。

三蜂厅、根據(jù)我做過項目用到的MVP的開發(fā)模式掘猿,我把共同的htmlEncode方法和getLayoutDirectionFromLocale方法抽取出一個接口,然后分別用兩個實現(xiàn)類去實現(xiàn)接口衬衬,然后用TextUtilsCompat這個類去判斷調(diào)用哪個實現(xiàn)類的方法滋尉,這樣看起來更直觀一些狮惜。具體步驟如下:

(一)抽取公共接口ITextUtilsCompat
/**
 * 抽取公用的接口
 */
public interface ITextUtilsCompat {

    /**
     * Html-encode the string.
     * @param s the string to be encoded
     * @return the encoded string
     */
    public String htmlEncode(@NonNull String s);

    /**
     * Return the layout direction for a given Locale
     *
     * @param locale the Locale for which we want the layout direction. Can be null.
     * @return the layout direction. This may be one of:
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_LTR} or
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_RTL}.
     *
     * Be careful: this code will need to be updated when vertical scripts will be supported
     */
    public int getLayoutDirectionFromLocale(@Nullable Locale locale);
}
(二)寫一個TextUtilsCompatJellybeanMr1實現(xiàn)ITextUtilsCompat 接口碾篡,然后把之前TextUtilsCompatJellybeanMr1類里面的復(fù)制過來开泽,具體如下:
/**
 * 兼容Android 17+ 版本
 * Jellybean MR1 - specific TextUtils API access.
 */
@RequiresApi(17)
@TargetApi(17)
class TextUtilsCompatJellybeanMr1 implements ITextUtilsCompat{

    @Override
    @NonNull
    public String htmlEncode(@NonNull String s) {
        return TextUtils.htmlEncode(s);
    }

    @Override
    public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        return TextUtils.getLayoutDirectionFromLocale(locale);
    }
}
(三)寫一個類TextUtilsCompatImpl實現(xiàn)ITextUtilsCompat 接口眼姐,然后把之前TextUtilsCompat類里面的有關(guān)代碼復(fù)制過來佩番,具體如下:
/**
 * Android 17以下版本使用這個類
 */
class TextUtilsCompatImpl implements ITextUtilsCompat{

    public static final Locale ROOT = new Locale("", "");

    static String ARAB_SCRIPT_SUBTAG = "Arab";
    static String HEBR_SCRIPT_SUBTAG = "Hebr";


    @Override
    @NonNull
    public String htmlEncode(@NonNull String s) {
        StringBuilder sb = new StringBuilder();
        char c;
        for (int i = 0; i < s.length(); i++) {
            c = s.charAt(i);
            switch (c) {
                case '<':
                    sb.append("&lt;"); //$NON-NLS-1$
                    break;
                case '>':
                    sb.append("&gt;"); //$NON-NLS-1$
                    break;
                case '&':
                    sb.append("&amp;"); //$NON-NLS-1$
                    break;
                case '\'':
                    //http://www.w3.org/TR/xhtml1
                    // The named character reference &apos; (the apostrophe, U+0027) was
                    // introduced in XML 1.0 but does not appear in HTML. Authors should
                    // therefore use &#39; instead of &apos; to work as expected in HTML 4
                    // user agents.
                    sb.append("&#39;"); //$NON-NLS-1$
                    break;
                case '"':
                    sb.append("&quot;"); //$NON-NLS-1$
                    break;
                default:
                    sb.append(c);
            }
        }
        return sb.toString();
    }


    @Override
    public int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        if (locale != null && !locale.equals(ROOT)) {
            final String scriptSubtag = ICUCompat.maximizeAndGetScript(locale);
            if (scriptSubtag == null) {
                return getLayoutDirectionFromFirstChar(locale);
            }

            // This is intentionally limited to Arabic and Hebrew scripts, since older
            // versions of Android platform only considered those scripts to be right-to-left.
            if (scriptSubtag.equalsIgnoreCase(ARAB_SCRIPT_SUBTAG) ||
                    scriptSubtag.equalsIgnoreCase(HEBR_SCRIPT_SUBTAG)) {
                return ViewCompat.LAYOUT_DIRECTION_RTL;
            }
        }
        return ViewCompat.LAYOUT_DIRECTION_LTR;
    }

    /**
     * Fallback algorithm to detect the locale direction. Rely on the first char of the
     * localized locale name. This will not work if the localized locale name is in English
     * (this is the case for ICU 4.4 and "Urdu" script)
     *
     * @param locale
     * @return the layout direction. This may be one of:
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_LTR} or
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_RTL}.
     *
     * Be careful: this code will need to be updated when vertical scripts will be supported
     */
    private static int getLayoutDirectionFromFirstChar(@NonNull Locale locale) {
        switch(Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) {
            case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
            case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
                return ViewCompat.LAYOUT_DIRECTION_RTL;

            case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
            default:
                return ViewCompat.LAYOUT_DIRECTION_LTR;
        }
    }
}
(四)封裝TextUtilsCompat給調(diào)用者使用,具體如下:
/**
 * v4包下面的TextUtilsCompat的簡單優(yōu)化
 * 這里使用的是策略模式利朵,根據(jù)不同api版本調(diào)用不同的接口實現(xiàn)類
 * 這樣寫更好維護。
 */
public final class TextUtilsCompat {

    private static final ITextUtilsCompat IMPL;

    private TextUtilsCompat() {}

    static {
        final int version = Build.VERSION.SDK_INT;
        // JellyBean MR1 大于等于17
        if (version >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            IMPL = new TextUtilsCompatJellybeanMr1();
        } else {
            IMPL = new TextUtilsCompatImpl();
        }
    }

    /**
     * Html-encode the string.
     * @param s the string to be encoded
     * @return the encoded string
     */
    @NonNull
    public static String htmlEncode(@NonNull String s) {
        return IMPL.htmlEncode(s);
    }

    /**
     * Return the layout direction for a given Locale
     *
     * @param locale the Locale for which we want the layout direction. Can be null.
     * @return the layout direction. This may be one of:
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_LTR} or
     * {@link android.support.v4.view.ViewCompat#LAYOUT_DIRECTION_RTL}.
     *
     * Be careful: this code will need to be updated when vertical scripts will be supported
     */
    public static int getLayoutDirectionFromLocale(@Nullable Locale locale) {
        return IMPL.getLayoutDirectionFromLocale(locale);
    }
    
}

到此,TextUtilsCompat 這個類就封裝完了樟遣”看完之后是不是很清爽?其實還有很多類似的類都可以根據(jù)類似的方式做一下改進的脱篙。源碼不是完美的绊困,只要掌握以上示例代碼的思想還是很容易的讓代碼更好理解响迂,更簡潔清晰的细疚。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末疯兼,一起剝皮案震驚了整個濱河市吧彪,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌秧倾,老刑警劉巖那先,帶你破解...
    沈念sama閱讀 206,126評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件售淡,死亡現(xiàn)場離奇詭異,居然都是意外死亡揍堕,警方通過查閱死者的電腦和手機衩茸,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評論 2 382
  • 文/潘曉璐 我一進店門递瑰,熙熙樓的掌柜王于貴愁眉苦臉地迎上來隙畜,“玉大人,你說我怎么就攤上這事慎颗「┪” “怎么了运杭?”我有些...
    開封第一講書人閱讀 152,445評論 0 341
  • 文/不壞的土叔 我叫張陵辆憔,是天一觀的道長虱咧。 經(jīng)常有香客問我,道長玄坦,這世上最難降的妖魔是什么绘沉? 我笑而不...
    開封第一講書人閱讀 55,185評論 1 278
  • 正文 為了忘掉前任车伞,我火速辦了婚禮帖世,結(jié)果婚禮上沸枯,老公的妹妹穿的比我還像新娘绑榴。我一直安慰自己盈魁,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,178評論 5 371
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著珊膜,像睡著了一般。 火紅的嫁衣襯著肌膚如雪剔氏。 梳的紋絲不亂的頭發(fā)上谈跛,一...
    開封第一講書人閱讀 48,970評論 1 284
  • 那天感憾,我揣著相機與錄音令花,去河邊找鬼。 笑死鳍刷,一個胖子當(dāng)著我的面吹牛俯抖,可吹牛的內(nèi)容都是我干的芬萍。 我是一名探鬼主播搔啊,決...
    沈念sama閱讀 38,276評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼负芋,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了莽龟?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 36,927評論 0 259
  • 序言:老撾萬榮一對情侶失蹤剃毒,失蹤者是張志新(化名)和其女友劉穎赘阀,沒想到半個月后基公,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體宋欺,經(jīng)...
    沈念sama閱讀 43,400評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡迄靠,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,883評論 2 323
  • 正文 我和宋清朗相戀三年掌挚,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片陡厘。...
    茶點故事閱讀 37,997評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡糙置,死狀恐怖是目,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情揉抵,我是刑警寧澤冤今,帶...
    沈念sama閱讀 33,646評論 4 322
  • 正文 年R本政府宣布茂缚,位于F島的核電站,受9級特大地震影響龟糕,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜所意,卻給世界環(huán)境...
    茶點故事閱讀 39,213評論 3 307
  • 文/蒙蒙 一扶踊、第九天 我趴在偏房一處隱蔽的房頂上張望郎任。 院中可真熱鬧,春花似錦分井、人聲如沸霉猛。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,204評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽伐厌。三九已至挣轨,卻和暖如春轩猩,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背画饥。 一陣腳步聲響...
    開封第一講書人閱讀 31,423評論 1 260
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留热鞍,地道東北人衔彻。 一個月前我還...
    沈念sama閱讀 45,423評論 2 352
  • 正文 我出身青樓艰额,卻偏偏與公主長得像柄沮,于是被迫代替她去往敵國和親废岂。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,722評論 2 345

推薦閱讀更多精彩內(nèi)容