Jetpack學(xué)習(xí)-DataBinding

個人博客

http://www.milovetingting.cn

Jetpack學(xué)習(xí)-DataBinding

簡單使用

在需要使用DataBinding的模塊的build.gradle中增加

android {
    //...
    defaultConfig {
        //...
        dataBinding{
            enabled true
        }
    }
}

然后同步

新建一個繼承自BaseObservable的類

public class User extends BaseObservable {

    private String name;

    private int age;

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Bindable
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(com.wangyz.jetpack.BR.name);
    }

    @Bindable
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        notifyPropertyChanged(com.wangyz.jetpack.BR.age);
    }
}

在需要綁定的字段的get方法上增加@Bindable注解,在set方法里增加notifyPropertyChanged(com.wangyz.jetpack.BR.name)

build工程

新建布局文件嗓节,在布局最外層的節(jié)點(diǎn)上按alt+enter催首,在彈出的選項(xiàng)中選擇Convert to data binding layout,布局就會轉(zhuǎn)換成DataBinding格式的布局归斤。

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <data>

        <variable
            name="user"
            type="com.wangyz.jetpack.databinding.User" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <Button
            android:onClick="update"
            android:text="更新"
            android:layout_width="match_parent"
            android:layout_height="50dp"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:gravity="center_vertical"
            android:text="@{user.name}" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:gravity="center_vertical"
            android:text="@{String.valueOf(user.age)}" />

    </LinearLayout>
</layout>

轉(zhuǎn)換后的布局磁玉,會將layout作為最外層的節(jié)點(diǎn)贞盯,還會在里面增加一個data節(jié)點(diǎn)。我們需要在這個data節(jié)點(diǎn)中增加variable節(jié)點(diǎn)伤哺,并配置nametype屬性纸巷。name命名隨意贞绵,type輸入前面定義的User類厉萝。

對需要綁定的控件屬性,如text賦值為@{user.name}榨崩,意思是給text屬性賦值為前面綁定的User類的name冀泻。這樣當(dāng)User的name發(fā)生改變時,控件的text屬性就會自動改變蜡饵。

在Activity中綁定User和布局

public class DataBindingActivity extends AppCompatActivity {

    User user;

    ActivityDatabindingBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_databinding);
        user = new User("張三", 18);
        binding.setUser(user);
    }

    public void update(View view) {
        user.setName(user.getName() + "$");
        user.setAge(user.getAge() + 1);
        binding.setVariable(com.wangyz.jetpack.BR.user, user);
    }
}

通過DataBindingUtil.setContentView(this, R.layout.activity_databinding)來綁定,并返回Binding胳施,然后通過Binding的setUser方法溯祸,就可以給布局設(shè)置數(shù)據(jù)。

原理

布局文件

下面來看下原理舞肆。DataBinding相比前面的LifecycleLiveData要復(fù)雜焦辅。

我們將應(yīng)用運(yùn)行到手機(jī)上,這個在開發(fā)者看來是很簡單的一件事椿胯,但是Android Studio卻為我們做了很多事筷登。

首先,布局文件會分為兩個xml文件哩盲。

databinding-layout.png

app/buil/intermediates/data_binding_layout_info_type_merge/debug/mergeDebugResources/out/目錄下前方,可以看到生成了一個activity_databinding-layout.xml文件狈醉,這個文件名稱是在我們原來的布局名稱后加上了-layout。它的內(nèi)容如上圖右側(cè)所示惠险。在最外層的節(jié)點(diǎn)里記錄了對應(yīng)的布局文件苗傅,然后通過定義Variables節(jié)點(diǎn),記錄了對應(yīng)的數(shù)據(jù)類班巩。在Targets節(jié)點(diǎn)中渣慕,記錄了原布局的tag,及使用了DataBinding的控件的tag,然后通過Expression節(jié)點(diǎn),記錄對應(yīng)的數(shù)據(jù)抱慌。

databinding-activity.png

app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/目錄下逊桦,可以看到activity_databinding.xml文件,這個文件就是我們原來的文件名抑进,不過里面稍作了一些變動强经,增加了一些tag,這些tag的值和前面的activity_databinding-layout.xml記錄的是對應(yīng)的单匣。

DataBindingUtil.setContentView

我們從DataBindingUtil.setContentView(this, R.layout.activity_databinding)這個方法看起夕凝。

public static <T extends ViewDataBinding> T setContentView(@NonNull Activity activity,
            int layoutId) {
        return setContentView(activity, layoutId, sDefaultComponent);
    }

這個方法里又調(diào)用了setContentView方法

public static <T extends ViewDataBinding> T setContentView(@NonNull Activity activity,
            int layoutId, @Nullable DataBindingComponent bindingComponent) {
        activity.setContentView(layoutId);
        View decorView = activity.getWindow().getDecorView();
        ViewGroup contentView = (ViewGroup) decorView.findViewById(android.R.id.content);
        return bindToAddedViews(bindingComponent, contentView, 0, layoutId);
    }

這個方法里調(diào)用了bindToAddedViews方法

private static <T extends ViewDataBinding> T bindToAddedViews(DataBindingComponent component,
            ViewGroup parent, int startChildren, int layoutId) {
        final int endChildren = parent.getChildCount();
        final int childrenAdded = endChildren - startChildren;
        if (childrenAdded == 1) {
            final View childView = parent.getChildAt(endChildren - 1);
            return bind(component, childView, layoutId);
        } else {
            final View[] children = new View[childrenAdded];
            for (int i = 0; i < childrenAdded; i++) {
                children[i] = parent.getChildAt(i + startChildren);
            }
            return bind(component, children, layoutId);
        }
    }

然后調(diào)用bind方法

static <T extends ViewDataBinding> T bind(DataBindingComponent bindingComponent, View root,
            int layoutId) {
        return (T) sMapper.getDataBinder(bindingComponent, root, layoutId);
    }

這里調(diào)用了sMappergetDataBinder方法,sMapper其實(shí)就是自動生成的DataBinderMapperImpl文件

databinding-databindermapperimpl.png
public ViewDataBinding getDataBinder(DataBindingComponent component, View view, int layoutId) {
    int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
    if(localizedLayoutId > 0) {
      final Object tag = view.getTag();
      if(tag == null) {
        throw new RuntimeException("view must have a tag");
      }
      switch(localizedLayoutId) {
        case  LAYOUT_ACTIVITYDATABINDING: {
          if ("layout/activity_databinding_0".equals(tag)) {
            return new ActivityDatabindingBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for activity_databinding is invalid. Received: " + tag);
        }
      }
    }
    return null;
  }

在這里調(diào)用了ActivityDatabindingBindingImpl的構(gòu)造方法

public ActivityDatabindingBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 3, sIncludes, sViewsWithIds));
    }

這里調(diào)用了ViewDataBindingmapBindings方法

protected static Object[] mapBindings(DataBindingComponent bindingComponent, View root, int numBindings, ViewDataBinding.IncludedLayouts includes, SparseIntArray viewsWithIds) {
        Object[] bindings = new Object[numBindings];
        mapBindings(bindingComponent, root, bindings, includes, viewsWithIds, true);
        return bindings;
    }

這里調(diào)用mapBindings方法

private static void mapBindings(DataBindingComponent bindingComponent, View view, Object[] bindings, ViewDataBinding.IncludedLayouts includes, SparseIntArray viewsWithIds, boolean isRoot) {
        ViewDataBinding existingBinding = getBinding(view);
        if (existingBinding == null) {
            Object objTag = view.getTag();
            String tag = objTag instanceof String ? (String)objTag : null;
            boolean isBound = false;
            int indexInIncludes;
            int id;
            int count;
            if (isRoot && tag != null && tag.startsWith("layout")) {
                id = tag.lastIndexOf(95);
                if (id > 0 && isNumeric(tag, id + 1)) {
                    count = parseTagInt(tag, id + 1);
                    if (bindings[count] == null) {
                        bindings[count] = view;
                    }

                    indexInIncludes = includes == null ? -1 : count;
                    isBound = true;
                } else {
                    indexInIncludes = -1;
                }
            } else if (tag != null && tag.startsWith("binding_")) {
                id = parseTagInt(tag, BINDING_NUMBER_START);
                if (bindings[id] == null) {
                    bindings[id] = view;
                }

                isBound = true;
                indexInIncludes = includes == null ? -1 : id;
            } else {
                indexInIncludes = -1;
            }

            if (!isBound) {
                id = view.getId();
                if (id > 0 && viewsWithIds != null && (count = viewsWithIds.get(id, -1)) >= 0 && bindings[count] == null) {
                    bindings[count] = view;
                }
            }

            if (view instanceof ViewGroup) {
                ViewGroup viewGroup = (ViewGroup)view;
                count = viewGroup.getChildCount();
                int minInclude = 0;

                for(int i = 0; i < count; ++i) {
                    View child = viewGroup.getChildAt(i);
                    boolean isInclude = false;
                    if (indexInIncludes >= 0 && child.getTag() instanceof String) {
                        String childTag = (String)child.getTag();
                        if (childTag.endsWith("_0") && childTag.startsWith("layout") && childTag.indexOf(47) > 0) {
                            int includeIndex = findIncludeIndex(childTag, minInclude, includes, indexInIncludes);
                            if (includeIndex >= 0) {
                                isInclude = true;
                                minInclude = includeIndex + 1;
                                int index = includes.indexes[indexInIncludes][includeIndex];
                                int layoutId = includes.layoutIds[indexInIncludes][includeIndex];
                                int lastMatchingIndex = findLastMatching(viewGroup, i);
                                if (lastMatchingIndex == i) {
                                    bindings[index] = DataBindingUtil.bind(bindingComponent, child, layoutId);
                                } else {
                                    int includeCount = lastMatchingIndex - i + 1;
                                    View[] included = new View[includeCount];

                                    for(int j = 0; j < includeCount; ++j) {
                                        included[j] = viewGroup.getChildAt(i + j);
                                    }

                                    bindings[index] = DataBindingUtil.bind(bindingComponent, included, layoutId);
                                    i += includeCount - 1;
                                }
                            }
                        }
                    }

                    if (!isInclude) {
                        mapBindings(bindingComponent, child, bindings, includes, viewsWithIds, false);
                    }
                }
            }

        }
    }

這個方法其實(shí)就是解析前面的兩個xml文件户秤,將綁定的控件保存起來码秉。

DataBindingUtil.setContentView方法執(zhí)行完成后,就可以獲取到對應(yīng)的DataBinding對象。

來一張簡單的時序圖

databinding-setcontentview.png

binding.setUser

binding.setUser對應(yīng)的是ActivityDatabindingBindingImpl的setUser方法

public void setUser(@Nullable com.wangyz.jetpack.databinding.User User) {
        updateRegistration(0, User);
        this.mUser = User;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.user);
        super.requestRebind();
    }

updateRegistration

先來看updateRegistration鸡号,這里就是注冊過程转砖。調(diào)用ViewDataBinding的updateRegistration方法

protected boolean updateRegistration(int localFieldId, Observable observable) {
        return updateRegistration(localFieldId, observable, CREATE_PROPERTY_LISTENER);
    }

然后調(diào)用updateRegistration方法

private boolean updateRegistration(int localFieldId, Object observable,
            CreateWeakListener listenerCreator) {
        if (observable == null) {
            return unregisterFrom(localFieldId);
        }
        WeakListener listener = mLocalFieldObservers[localFieldId];
        if (listener == null) {
            registerTo(localFieldId, observable, listenerCreator);
            return true;
        }
        if (listener.getTarget() == observable) {
            return false;//nothing to do, same object
        }
        unregisterFrom(localFieldId);
        registerTo(localFieldId, observable, listenerCreator);
        return true;
    }

調(diào)用registerTo方法

protected void registerTo(int localFieldId, Object observable,
            CreateWeakListener listenerCreator) {
        if (observable == null) {
            return;
        }
        WeakListener listener = mLocalFieldObservers[localFieldId];
        if (listener == null) {
            listener = listenerCreator.create(this, localFieldId);
            mLocalFieldObservers[localFieldId] = listener;
            if (mLifecycleOwner != null) {
                listener.setLifecycleOwner(mLifecycleOwner);
            }
        }
        listener.setTarget(observable);
    }

這個方法將傳進(jìn)來的數(shù)據(jù)保存到WeakListener

notifyPropertyChanged

執(zhí)行完成updateRegistration方法后,需要執(zhí)行notifyPropertyChanged方法鲸伴,通知更新,這個方法在BaseObservable里

public void notifyPropertyChanged(int fieldId) {
        synchronized (this) {
            if (mCallbacks == null) {
                return;
            }
        }
        mCallbacks.notifyCallbacks(this, fieldId, null);
    }

然后調(diào)用CallbackRegistrynotifyCallbacks方法

public synchronized void notifyCallbacks(T sender, int arg, A arg2) {
        mNotificationLevel++;
        notifyRecurse(sender, arg, arg2);
        mNotificationLevel--;
        if (mNotificationLevel == 0) {
            if (mRemainderRemoved != null) {
                for (int i = mRemainderRemoved.length - 1; i >= 0; i--) {
                    final long removedBits = mRemainderRemoved[i];
                    if (removedBits != 0) {
                        removeRemovedCallbacks((i + 1) * Long.SIZE, removedBits);
                        mRemainderRemoved[i] = 0;
                    }
                }
            }
            if (mFirst64Removed != 0) {
                removeRemovedCallbacks(0, mFirst64Removed);
                mFirst64Removed = 0;
            }
        }
    }

這里調(diào)用了notifyRecurse方法去遞歸通知

private void notifyRecurse(T sender, int arg, A arg2) {
        final int callbackCount = mCallbacks.size();
        final int remainderIndex = mRemainderRemoved == null ? -1 : mRemainderRemoved.length - 1;

        // Now we've got all callbakcs that have no mRemainderRemoved value, so notify the
        // others.
        notifyRemainder(sender, arg, arg2, remainderIndex);

        // notifyRemainder notifies all at maxIndex, so we'd normally start at maxIndex + 1
        // However, we must also keep track of those in mFirst64Removed, so we add 2 instead:
        final int startCallbackIndex = (remainderIndex + 2) * Long.SIZE;

        // The remaining have no bit set
        notifyCallbacks(sender, arg, arg2, startCallbackIndex, callbackCount, 0);
    }

這個方法里調(diào)用notifyCallbacks方法

private void notifyCallbacks(T sender, int arg, A arg2, final int startIndex,
            final int endIndex, final long bits) {
        long bitMask = 1;
        for (int i = startIndex; i < endIndex; i++) {
            if ((bits & bitMask) == 0) {
                mNotifier.onNotifyCallback(mCallbacks.get(i), sender, arg, arg2);
            }
            bitMask <<= 1;
        }
    }

調(diào)用NotifierCallbackonNotifyCallback方法,它的具體回調(diào)在PropertyChangeRegistry

private static final NotifierCallback<OnPropertyChangedCallback, Observable, Void> NOTIFIER_CALLBACK = new NotifierCallback<OnPropertyChangedCallback, Observable, Void>() {
        public void onNotifyCallback(OnPropertyChangedCallback callback, Observable sender, int arg, Void notUsed) {
            callback.onPropertyChanged(sender, arg);
        }
    };

然后回調(diào)Observable的內(nèi)部類OnPropertyChangedCallbackonPropertyChanged方法府蔗,而這個方法的實(shí)現(xiàn)是ViewDataBinding的內(nèi)部類WeakPropertyListener

public void onPropertyChanged(Observable sender, int propertyId) {
            ViewDataBinding binder = mListener.getBinder();
            if (binder == null) {
                return;
            }
            Observable obj = mListener.getTarget();
            if (obj != sender) {
                return; // notification from the wrong object?
            }
            binder.handleFieldChange(mListener.mLocalFieldId, sender, propertyId);
        }

然后調(diào)用handleFieldChange方法

private void handleFieldChange(int mLocalFieldId, Object object, int fieldId) {
        if (mInLiveDataRegisterObserver) {
            // We're in LiveData registration, which always results in a field change
            // that we can ignore. The value will be read immediately after anyway, so
            // there is no need to be dirty.
            return;
        }
        boolean result = onFieldChange(mLocalFieldId, object, fieldId);
        if (result) {
            requestRebind();
        }
    }

調(diào)用onFieldChange方法,它的具體實(shí)現(xiàn)是ActivityDatabindingBindingImpl

protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeUser((com.wangyz.jetpack.databinding.User) object, fieldId);
        }
        return false;
    }

調(diào)用onChangeUser

private boolean onChangeUser(com.wangyz.jetpack.databinding.User User, int fieldId) {
        if (fieldId == BR._all) {
            synchronized(this) {
                    mDirtyFlags |= 0x1L;
            }
            return true;
        }
        else if (fieldId == BR.name) {
            synchronized(this) {
                    mDirtyFlags |= 0x2L;
            }
            return true;
        }
        else if (fieldId == BR.age) {
            synchronized(this) {
                    mDirtyFlags |= 0x4L;
            }
            return true;
        }
        return false;
    }

在執(zhí)行完onFieldChange方法后汞窗,會再執(zhí)行requestRebind方法

protected void requestRebind() {
        if (mContainingBinding != null) {
            mContainingBinding.requestRebind();
        } else {
            final LifecycleOwner owner = this.mLifecycleOwner;
            if (owner != null) {
                Lifecycle.State state = owner.getLifecycle().getCurrentState();
                if (!state.isAtLeast(Lifecycle.State.STARTED)) {
                    return; // wait until lifecycle owner is started
                }
            }
            synchronized (this) {
                if (mPendingRebind) {
                    return;
                }
                mPendingRebind = true;
            }
            if (USE_CHOREOGRAPHER) {
                mChoreographer.postFrameCallback(mFrameCallback);
            } else {
                mUIThreadHandler.post(mRebindRunnable);
            }
        }
    }

在這里post了一個mRebindRunnable到主線程中,看下mRebindRunnable

private final Runnable mRebindRunnable = new Runnable() {
        @Override
        public void run() {
            synchronized (this) {
                mPendingRebind = false;
            }
            processReferenceQueue();

            if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
                // Nested so that we don't get a lint warning in IntelliJ
                if (!mRoot.isAttachedToWindow()) {
                    // Don't execute the pending bindings until the View
                    // is attached again.
                    mRoot.removeOnAttachStateChangeListener(ROOT_REATTACHED_LISTENER);
                    mRoot.addOnAttachStateChangeListener(ROOT_REATTACHED_LISTENER);
                    return;
                }
            }
            executePendingBindings();
        }
    };

在這個方法里執(zhí)行了executePendingBindings方法

public void executePendingBindings() {
        if (mContainingBinding == null) {
            executeBindingsInternal();
        } else {
            mContainingBinding.executePendingBindings();
        }
    }

然后執(zhí)行executeBindingsInternal方法

private void executeBindingsInternal() {
        if (mIsExecutingPendingBindings) {
            requestRebind();
            return;
        }
        if (!hasPendingBindings()) {
            return;
        }
        mIsExecutingPendingBindings = true;
        mRebindHalted = false;
        if (mRebindCallbacks != null) {
            mRebindCallbacks.notifyCallbacks(this, REBIND, null);

            // The onRebindListeners will change mPendingHalted
            if (mRebindHalted) {
                mRebindCallbacks.notifyCallbacks(this, HALTED, null);
            }
        }
        if (!mRebindHalted) {
            executeBindings();
            if (mRebindCallbacks != null) {
                mRebindCallbacks.notifyCallbacks(this, REBOUND, null);
            }
        }
        mIsExecutingPendingBindings = false;
    }

這個方法里執(zhí)行了executeBindings方法姓赤,它在實(shí)現(xiàn)是ActivityDatabindingBindingImpl

protected void executeBindings() {
        long dirtyFlags = 0;
        synchronized(this) {
            dirtyFlags = mDirtyFlags;
            mDirtyFlags = 0;
        }
        java.lang.String userName = null;
        int userAge = 0;
        com.wangyz.jetpack.databinding.User user = mUser;
        java.lang.String stringValueOfUserAge = null;

        if ((dirtyFlags & 0xfL) != 0) {


            if ((dirtyFlags & 0xbL) != 0) {

                    if (user != null) {
                        // read user.name
                        userName = user.getName();
                    }
            }
            if ((dirtyFlags & 0xdL) != 0) {

                    if (user != null) {
                        // read user.age
                        userAge = user.getAge();
                    }


                    // read String.valueOf(user.age)
                    stringValueOfUserAge = java.lang.String.valueOf(userAge);
            }
        }
        // batch finished
        if ((dirtyFlags & 0xbL) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView1, userName);
        }
        if ((dirtyFlags & 0xdL) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, stringValueOfUserAge);
        }
    }

可以看到,是通過androidx.databinding.adapters.TextViewBindingAdapter.setText來實(shí)現(xiàn)的

public static void setText(TextView view, CharSequence text) {
        final CharSequence oldText = view.getText();
        if (text == oldText || (text == null && oldText.length() == 0)) {
            return;
        }
        if (text instanceof Spanned) {
            if (text.equals(oldText)) {
                return; // No change in the spans, so don't set anything.
            }
        } else if (!haveContentsChanged(text, oldText)) {
            return; // No content changes, so don't set anything.
        }
        view.setText(text);
    }

這里我們界面就發(fā)生了變更仲吏。

來一張簡單的時序圖

databinding-setVariable.png

setVariable

public boolean setVariable(int variableId, @Nullable Object variable)  {
        boolean variableSet = true;
        if (BR.user == variableId) {
            setUser((com.wangyz.jetpack.databinding.User) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

最終還是通過setUser來實(shí)現(xiàn)的不铆。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市裹唆,隨后出現(xiàn)的幾起案子誓斥,更是在濱河造成了極大的恐慌,老刑警劉巖许帐,帶你破解...
    沈念sama閱讀 219,589評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件劳坑,死亡現(xiàn)場離奇詭異,居然都是意外死亡成畦,警方通過查閱死者的電腦和手機(jī)距芬,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,615評論 3 396
  • 文/潘曉璐 我一進(jìn)店門涝开,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人蔑穴,你說我怎么就攤上這事忠寻。” “怎么了存和?”我有些...
    開封第一講書人閱讀 165,933評論 0 356
  • 文/不壞的土叔 我叫張陵奕剃,是天一觀的道長。 經(jīng)常有香客問我捐腿,道長纵朋,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,976評論 1 295
  • 正文 為了忘掉前任茄袖,我火速辦了婚禮操软,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘宪祥。我一直安慰自己聂薪,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,999評論 6 393
  • 文/花漫 我一把揭開白布蝗羊。 她就那樣靜靜地躺著藏澳,像睡著了一般。 火紅的嫁衣襯著肌膚如雪耀找。 梳的紋絲不亂的頭發(fā)上翔悠,一...
    開封第一講書人閱讀 51,775評論 1 307
  • 那天,我揣著相機(jī)與錄音野芒,去河邊找鬼蓄愁。 笑死,一個胖子當(dāng)著我的面吹牛狞悲,可吹牛的內(nèi)容都是我干的撮抓。 我是一名探鬼主播,決...
    沈念sama閱讀 40,474評論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼摇锋,長吁一口氣:“原來是場噩夢啊……” “哼丹拯!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起乱投,我...
    開封第一講書人閱讀 39,359評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎顷编,沒想到半個月后戚炫,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,854評論 1 317
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡媳纬,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,007評論 3 338
  • 正文 我和宋清朗相戀三年双肤,在試婚紗的時候發(fā)現(xiàn)自己被綠了施掏。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,146評論 1 351
  • 序言:一個原本活蹦亂跳的男人離奇死亡茅糜,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情枪眉,我是刑警寧澤乡摹,帶...
    沈念sama閱讀 35,826評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站缩赛,受9級特大地震影響耙箍,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜酥馍,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,484評論 3 331
  • 文/蒙蒙 一辩昆、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧旨袒,春花似錦汁针、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,029評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至尉辑,卻和暖如春帆精,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背隧魄。 一陣腳步聲響...
    開封第一講書人閱讀 33,153評論 1 272
  • 我被黑心中介騙來泰國打工卓练, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人购啄。 一個月前我還...
    沈念sama閱讀 48,420評論 3 373
  • 正文 我出身青樓襟企,卻偏偏與公主長得像,于是被迫代替她去往敵國和親狮含。 傳聞我的和親對象是個殘疾皇子顽悼,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,107評論 2 356

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