Jetpack--LifeCycle听想、ViewModel、LiveData

Jetpack是google官方的安卓開發(fā)工具集马胧,目的是為了標(biāo)準(zhǔn)化和加快開發(fā)效率汉买,并且之后會持續(xù)更新

安卓開發(fā)中,google推薦使用MVVM架構(gòu)佩脊,Jetpack集成了構(gòu)建MVVM架構(gòu)的幾種工具蛙粘,相比于以前的MVVM,組合使用這些工具會更加高效威彰、簡潔出牧、安全⌒危可以說你的安卓項(xiàng)目沒有升級使用這套架構(gòu)舔痕,那么你的架構(gòu)就已經(jīng)過時(shí)了

JetPack與AndroidX

  • AndroidX命名空間中包含Jetpack庫
  • AndroidX代替Android Support Library
  • AAC(Android Architect Component)中的組件并入AndroidX
  • 其他一些需要頻繁更新和迭代的特性也并入AndroidX

一、LifeCycle

LifeCycle會自動(dòng)綁定組件的生命周期豹缀,省去了我們以前在onResume伯复,onPause等方法中的操作
1.LifeCycle解耦頁面與組件

我們有一個(gè)Activity,布局文件如下:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <Chronometer
        android:id="@+id/chronometer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="(0):(0)"
        android:textSize="24sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

這是一個(gè)簡單的計(jì)時(shí)器邢笙,我們想要在Activity處于前臺時(shí)計(jì)時(shí)啸如,退到后臺暫停計(jì)時(shí),那么Activity中寫法如下:

package com.aruba.jetpackapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.SystemClock;
import android.widget.Chronometer;

public class MainActivity extends AppCompatActivity {

    private Chronometer chronometer;
    private long countTime;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        chronometer = findViewById(R.id.chronometer);
    }

    @Override
    protected void onResume() {
        super.onResume();
        //恢復(fù)計(jì)時(shí)氮惯,基于休息的時(shí)間作一個(gè)偏移
        chronometer.setBase(SystemClock.elapsedRealtime() - countTime);
        chronometer.start();
    }


    @Override
    protected void onPause() {
        super.onPause();
        //記錄下計(jì)時(shí)時(shí)間
        countTime = SystemClock.elapsedRealtime() - chronometer.getBase();
        chronometer.stop();
    }
}

效果:


接下來是使用LifeCycle方式:

1.實(shí)現(xiàn)LifecycleObserver接口
2.在方法上添加注解叮雳,指定在什么時(shí)候執(zhí)行

package com.aruba.lifecycle;

import android.content.Context;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.widget.Chronometer;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * Created by aruba on 2021/9/9.
 */
class MyChronometer extends Chronometer implements LifecycleObserver {//實(shí)現(xiàn)LifecycleObserver接口

    private long countTime;

    public MyChronometer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    //對應(yīng)生命周期的注解
    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    private void startCount() {
        //恢復(fù)計(jì)時(shí),基于休息的時(shí)間作一個(gè)偏移
        setBase(SystemClock.elapsedRealtime() - countTime);
        start();
    }

    //對應(yīng)生命周期的注解
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    private void stopCount() {
        //記錄下計(jì)時(shí)時(shí)間
        countTime = SystemClock.elapsedRealtime() - getBase();
        stop();
    }

}

把布局文件改為MyChronometer 后筐骇,在Activity中添加一行監(jiān)聽代碼

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        MyChronometer chronometer = findViewById(R.id.chronometer);
        getLifecycle().addObserver(chronometer);
    }
}

效果:


2.使用LifecycleService解耦Service與組件

首先需要添加下依賴

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

定義一個(gè)類债鸡,實(shí)現(xiàn)LifecycleObserve接口江滨,并實(shí)現(xiàn)gps數(shù)據(jù)獲取

package com.aruba.lifecycle;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * Created by aruba on 2021/9/9.
 */
public class MyLocationObserver implements LifecycleObserver {

    private Context context;
    private LocationManager locationManager;
    private MyLocation listener;

    public MyLocationObserver(Context context) {
        this.context = context;
    }

    /**
     * 開啟gps
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    private void startGetLocation() {
        locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        listener = new MyLocation();
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 300, 1, listener);
    }

    /**
     * 關(guān)閉gps
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    private void stopGetLocation() {
        locationManager.removeUpdates(listener);
    }

    static class MyLocation implements LocationListener {

        private static final String TAG = MyLocation.class.getSimpleName();

        @Override
        public void onLocationChanged(@NonNull Location location) {
            Log.i(TAG, location.toString());
        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {
            
        }

        @Override
        public void onProviderEnabled(@NonNull String provider) {

        }

        @Override
        public void onProviderDisabled(@NonNull String provider) {

        }
    }
}

權(quán)限在manifests.xml里也要添加
使用一個(gè)service來獲取gps數(shù)據(jù)铛纬,繼承于LifecycleService,并在相關(guān)方法上寫上注解

package com.aruba.lifecycle;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import androidx.lifecycle.LifecycleService;

public class GpsService extends LifecycleService {
    public GpsService() {
        MyLocationObserver myLocationObserver = new MyLocationObserver(this);
        getLifecycle().addObserver(myLocationObserver);
    }
}

模擬器可以使用adb命令修改下gps位置

adb -s  Pixel2:5554 emu geo fix 121.4961236714487 31.24010934431376
adb -s  Pixel2:5554 emu geo fix 122.4961236714487 31.24010934431376

Activity中開啟測試下效果:

2021-09-09 17:05:03.316 3046-3046/com.aruba.lifecycle I/MyLocation: Location[gps 37.421998,-122.084000 acc=20 et=+1m13s108ms alt=0.0 {Bundle[EMPTY_PARCEL]}]

3.ProcessLifecycleOwner監(jiān)聽?wèi)?yīng)用程序生命周期

新建一個(gè)類實(shí)現(xiàn)LifecycleObserve唬滑,在方法上加上注解告唆,指定想要監(jiān)聽的生命周期

package com.aruba.lifecycle;

import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * Created by aruba on 2021/9/9.
 */
class AppLifeObserve implements LifecycleObserver {

    private static final String TAG = AppLifeObserve.class.getSimpleName();

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    private void onCreate() {
        Log.i(TAG, "onCreate");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    private void onStart() {
        Log.i(TAG, "onCreate");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    private void onResume() {
        Log.i(TAG, "onResume");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    private void onPause() {
        Log.i(TAG, "onPause");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    private void onStop() {
        Log.i(TAG, "onStop");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    private void onDestroy() {
        Log.i(TAG, "onDestroy");
    }

}

在Application中棺弊,使用ProcessLifecycleOwner注冊觀察

package com.aruba.lifecycle;

import android.app.Application;

import androidx.lifecycle.ProcessLifecycleOwner;

/**
 * Created by aruba on 2021/9/9.
 */
class MyApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ProcessLifecycleOwner.get().getLifecycle().addObserver(new AppLifeObserve());
    }
}

其中onCreate只會調(diào)用一次,onDestroy不會調(diào)用

Lifecycle可以使我們不必在原來組件的生命周期中進(jìn)行管理擒悬,降低了模塊的耦合度模她,一定程度上避免了沒有及時(shí)銷毀資源的情況,降低了內(nèi)存泄漏的發(fā)生

二懂牧、ViewModel

Jetpack中侈净,官方提供了ViewModel組件,我們應(yīng)該繼承它實(shí)現(xiàn)我們的ViewModel層業(yè)務(wù)
1.瞬態(tài)數(shù)據(jù)保存

例如以前我們手機(jī)屏幕旋轉(zhuǎn)時(shí)僧凤,如果沒有配置畜侦,那么Activity會重新創(chuàng)建,數(shù)據(jù)就會丟失
使用ViewModel躯保,我們可以什么都不做就解決這個(gè)問題
現(xiàn)在來創(chuàng)建一個(gè)Activity旋膳,點(diǎn)擊按鈕讓一個(gè)數(shù)字不斷加一,布局文件如下:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="0"
        android:textSize="30sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.287" />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="add"
        android:onClick="addCount"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView"
        app:layout_constraintVertical_bias="0.133" />

</androidx.constraintlayout.widget.ConstraintLayout>

創(chuàng)建一個(gè)類繼承ViewModel

package com.aruba.viewmodel;

import androidx.lifecycle.ViewModel;

/**
 * Created by aruba on 2021/9/10.
 */
class NumberViewModel extends ViewModel {
    public int number;
}

在Activity中使用ViewModelProvider通過反射獲取ViewModel途事,并實(shí)現(xiàn)點(diǎn)擊方法

package com.aruba.viewmodel;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    private TextView textView;
    private NumberViewModel numberViewModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        numberViewModel = new ViewModelProvider(this, ViewModelProvider.AndroidViewModelFactory.getInstance(getApplication())).get(NumberViewModel.class);

        textView = findViewById(R.id.textView);
        textView.setText(String.valueOf(numberViewModel.number));
    }

    public void addCount(View view) {
        numberViewModel.number++;
        textView.setText(String.valueOf(numberViewModel.number));
    }
}

效果:

如果要在ViewModel中使用Context验懊,不要手動(dòng)傳入,而是繼承至AndroidViewModel

package com.aruba.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.ViewModel;

/**
 * Created by aruba on 2021/9/10.
 */
public class NumberViewModel extends AndroidViewModel {
    public int number;

    public NumberViewModel(@NonNull Application application) {
        super(application);
    }
}

2.除了瞬態(tài)數(shù)據(jù)自動(dòng)保存外尸变,ViewModel還具有異步調(diào)用不會造成內(nèi)存泄漏的優(yōu)點(diǎn)义图,需要結(jié)合LiveData使用,ViewModel的生命周期是獨(dú)立于Activity的

三召烂、LiveData

LiveData對象提供了可觀測方法歌溉,當(dāng)數(shù)據(jù)發(fā)送改變時(shí),觀測方能夠觀測到骑晶,并且線程安全痛垛,集成了LifeCycle的綁定生命周期特性
1.來實(shí)現(xiàn)一個(gè)定時(shí)器,線程中更新定時(shí)時(shí)間桶蛔,使用LiveData使得ui上進(jìn)行更新

布局文件很簡單匙头,一個(gè)TextView

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/countTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="0"
        android:textSize="30sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

定義ViewModel,并使用LiveData

package com.aruba.livedata;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

/**
 * Created by aruba on 2021/9/10.
 */
public class CountViewModel extends ViewModel {
    private MutableLiveData<Integer> count;

    public MutableLiveData<Integer> getCount() {
        if (count == null) {
            count = new MutableLiveData<>();
            count.setValue(0);
        }
        return count;
    }
}

在Activity中使用ViewModel仔雷,并觀測LiveData的值蹂析,ui線程中使用setValue方法設(shè)置LiveData的值,非ui線程使用postValue方法

package com.aruba.livedata;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import java.sql.Time;
import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity {
    private TextView countTextView;
    private CountViewModel countViewModel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        countViewModel = new ViewModelProvider(this, ViewModelProvider.AndroidViewModelFactory.getInstance(getApplication())).get(CountViewModel.class);

        countTextView = findViewById(R.id.countTextView);
        countViewModel.getCount().observe(this, new Observer<Integer>() {
            @Override
            public void onChanged(Integer integer) {
                countTextView.setText(String.valueOf(integer));
            }
        });
        
        startTimer();
    }

    private void startTimer() {
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                //setValue:ui線程中使用
                //postValue:非ui線程中使用
                countViewModel.getCount().postValue(countViewModel.getCount().getValue() + 1);
            }
        }, 0, 1000);
    }

}

效果:


四碟婆、ViewModel+LiveData电抚,實(shí)現(xiàn)Fragment間通信

先看效果:



定義兩個(gè)fragment,布局是一樣的

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".FirstFragment">

    <SeekBar
        android:id="@+id/seekbar"
        android:layout_width="0dp"
        android:layout_height="100dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
    
</androidx.constraintlayout.widget.ConstraintLayout>

創(chuàng)建ViewModel竖共,定義要聯(lián)動(dòng)的進(jìn)度值

package com.aruba.livedata2;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

/**
 * Created by aruba on 2021/9/10.
 */
public class MyViewModel extends ViewModel {
    private MutableLiveData<Integer> progress;

    public MutableLiveData<Integer> getProgress() {
        if (progress == null) {
            progress = new MutableLiveData<>();
            progress.setValue(0);
        }

        return progress;
    }
}

實(shí)現(xiàn)兩個(gè)fragment中對ViewModel進(jìn)度值的觀察蝙叛,注意這邊獲取ViewModel時(shí)Owner要用Activity的上下文,因?yàn)閷?shí)現(xiàn)聯(lián)動(dòng)需要使用同一個(gè)ViewModel公给,不同Owner會生成不同的實(shí)例

package com.aruba.livedata2;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;

public class FirstFragment extends Fragment {

    private SeekBar seekbar;
    private MyViewModel myViewModel;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_first, container, false);
        seekbar = root.findViewById(R.id.seekbar);

        myViewModel = new ViewModelProvider(getActivity(), new ViewModelProvider.AndroidViewModelFactory(getActivity().getApplication())).get(MyViewModel.class);

        myViewModel.getProgress().observe(this, new Observer<Integer>() {
            @Override
            public void onChanged(Integer integer) {
                seekbar.setProgress(integer);
            }
        });

        seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
                myViewModel.getProgress().setValue(i);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
        return root;
    }
}

第二個(gè)fragment代碼是一樣的借帘。然后在Activity中加載兩個(gè)fragment

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.5" />

    <fragment
        android:id="@+id/fragmentContainerView"
        android:name="com.aruba.livedata2.FirstFragment"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/guideline2"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <fragment
        android:id="@+id/fragmentContainerView2"
        android:name="com.aruba.livedata2.SecondFragment"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/guideline2" />

</androidx.constraintlayout.widget.ConstraintLayout>
Demo地址:https://gitee.com/aruba/my-jetpack-application.git
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末蜘渣,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子肺然,更是在濱河造成了極大的恐慌蔫缸,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,590評論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件际起,死亡現(xiàn)場離奇詭異拾碌,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)街望,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,157評論 3 399
  • 文/潘曉璐 我一進(jìn)店門倦沧,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人它匕,你說我怎么就攤上這事展融。” “怎么了豫柬?”我有些...
    開封第一講書人閱讀 169,301評論 0 362
  • 文/不壞的土叔 我叫張陵告希,是天一觀的道長。 經(jīng)常有香客問我烧给,道長燕偶,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 60,078評論 1 300
  • 正文 為了忘掉前任础嫡,我火速辦了婚禮指么,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘榴鼎。我一直安慰自己伯诬,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,082評論 6 398
  • 文/花漫 我一把揭開白布巫财。 她就那樣靜靜地躺著盗似,像睡著了一般。 火紅的嫁衣襯著肌膚如雪平项。 梳的紋絲不亂的頭發(fā)上赫舒,一...
    開封第一講書人閱讀 52,682評論 1 312
  • 那天,我揣著相機(jī)與錄音闽瓢,去河邊找鬼接癌。 笑死,一個(gè)胖子當(dāng)著我的面吹牛扣讼,可吹牛的內(nèi)容都是我干的缺猛。 我是一名探鬼主播,決...
    沈念sama閱讀 41,155評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼枯夜!你這毒婦竟也來了弯汰?” 一聲冷哼從身側(cè)響起艰山,我...
    開封第一講書人閱讀 40,098評論 0 277
  • 序言:老撾萬榮一對情侶失蹤湖雹,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后曙搬,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體摔吏,經(jīng)...
    沈念sama閱讀 46,638評論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,701評論 3 342
  • 正文 我和宋清朗相戀三年纵装,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了征讲。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,852評論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡橡娄,死狀恐怖诗箍,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情挽唉,我是刑警寧澤滤祖,帶...
    沈念sama閱讀 36,520評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站瓶籽,受9級特大地震影響匠童,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜塑顺,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,181評論 3 335
  • 文/蒙蒙 一汤求、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧严拒,春花似錦扬绪、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,674評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至巧骚,卻和暖如春赊颠,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背劈彪。 一陣腳步聲響...
    開封第一講書人閱讀 33,788評論 1 274
  • 我被黑心中介騙來泰國打工竣蹦, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人沧奴。 一個(gè)月前我還...
    沈念sama閱讀 49,279評論 3 379
  • 正文 我出身青樓痘括,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子纲菌,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,851評論 2 361

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