diff --git a/app/src/main/java/com/example/sprout/refactor/activity/RoomListActivity.java b/app/src/main/java/com/example/sprout/refactor/activity/RoomListActivity.java index 8871446..2284c06 100644 --- a/app/src/main/java/com/example/sprout/refactor/activity/RoomListActivity.java +++ b/app/src/main/java/com/example/sprout/refactor/activity/RoomListActivity.java @@ -3,11 +3,14 @@ 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.RfActivityRoomListBinding; import com.example.sprout.refactor.adapter.RoomListAdapter; +import com.example.sprout.refactor.common.ActivityEvent; +import com.example.sprout.refactor.contract.ViewContract; import com.example.sprout.refactor.viewmodel.RoomListViewModel; /** @@ -15,14 +18,34 @@ * * @author matsumoto_k */ -public class RoomListActivity extends AppCompatActivity { +public class RoomListActivity extends AppCompatActivity implements ViewContract { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RfActivityRoomListBinding binding = DataBindingUtil.setContentView(this, R.layout.rf_activity_room_list); - RoomListViewModel roomMainViewModel = new RoomListViewModel(Sprout.get().getRoomRepository(), new RoomListAdapter(this)); + RoomListViewModel roomMainViewModel = new RoomListViewModel(Sprout.get().getRoomRepository(), new RoomListAdapter(this), (ViewContract) this); binding.setViewModel(roomMainViewModel); getLifecycle().addObserver(roomMainViewModel); } + + @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(); + } }