| package com.doumee.lib_coremodel.base.livedata; | 
|   | 
| import androidx.annotation.IntDef; | 
| import androidx.lifecycle.LifecycleOwner; | 
| import androidx.lifecycle.Observer; | 
|   | 
| import com.doumee.lib_coremodel.bean.event.ActionEventData; | 
|   | 
| import java.lang.annotation.Retention; | 
| import java.lang.annotation.RetentionPolicy; | 
|   | 
| public class ActionEvent extends SingleLiveEvent<ActionEventData>{ | 
|   | 
|     public void observe(LifecycleOwner owner, ActionObserver observer) { | 
|         super.observe(owner, new Observer<ActionEventData>() { | 
|             @Override | 
|             public void onChanged(ActionEventData actionEventData) { | 
|                 observer.onStatusChanged(actionEventData); | 
|             } | 
|         }); | 
|     } | 
|   | 
|     public interface ActionObserver{ | 
|         void onStatusChanged(ActionEventData data); | 
|     } | 
|   | 
|     /** | 
|      * 状态 | 
|      */ | 
|     @IntDef({ActionEvent.Action.START_ACTIVITY, ActionEvent.Action.FINISH, | 
|             ActionEvent.Action.DO, ActionEvent.Action.TOAST}) | 
|     @Retention(RetentionPolicy.SOURCE) | 
|     public @interface Action { | 
|         int START_ACTIVITY = 0; | 
|         int FINISH = 1; | 
|         int DO=2; | 
|         int TOAST=3; | 
|     } | 
|   | 
|     public static final class ParameterField { | 
|         public static String CLASS = "CLASS"; | 
|         public static String CANONICAL_NAME = "CANONICAL_NAME"; | 
|         public static String BUNDLE = "BUNDLE"; | 
|     } | 
| } |