diff --git a/app/src/main/java/com/example/sprout/refactor/activity/RoomCreateActivity.java b/app/src/main/java/com/example/sprout/refactor/activity/RoomCreateActivity.java index 0465b5b..0f862a6 100644 --- a/app/src/main/java/com/example/sprout/refactor/activity/RoomCreateActivity.java +++ b/app/src/main/java/com/example/sprout/refactor/activity/RoomCreateActivity.java @@ -3,10 +3,13 @@ import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; +import android.widget.Toast; import com.example.sprout.R; import com.example.sprout.Sprout; import com.example.sprout.databinding.RfActivityRoomCreateBinding; +import com.example.sprout.refactor.common.ActivityEvent; +import com.example.sprout.refactor.contract.ViewContract; import com.example.sprout.refactor.viewmodel.RoomCreateViewModel; /** @@ -14,14 +17,34 @@ * * @author matsumoto_k */ -public class RoomCreateActivity extends AppCompatActivity { +public class RoomCreateActivity extends AppCompatActivity implements ViewContract { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RfActivityRoomCreateBinding binding = DataBindingUtil.setContentView(this, R.layout.rf_activity_room_create); - RoomCreateViewModel roomCreateViewModel = new RoomCreateViewModel(Sprout.get().getRoomRepository()); + RoomCreateViewModel roomCreateViewModel = new RoomCreateViewModel(Sprout.get().getRoomRepository(), (ViewContract) this); binding.setViewModel(roomCreateViewModel); getLifecycle().addObserver(roomCreateViewModel); } + + @Override + public void startActivity(ActivityEvent event) { + + } + + @Override + public void finishActivity() { + + } + + @Override + public void showShortToast(String message) { + Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); + } + + @Override + public void showLongToast(String message) { + Toast.makeText(this, message, Toast.LENGTH_LONG).show(); + } }