use of com.zimincom.mafiaonline.adapter.RoomAdapter in project 2017-01-HUDI-MAC-CHAR by NHNNEXT.
the class RoomListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_room_list);
mafiaRemoteService = ServiceGenerator.createService(MafiaRemoteService.class, context);
user = (User) getIntent().getSerializableExtra("user");
roomCreate = (Button) findViewById(R.id.create_room);
logout = (Button) findViewById(R.id.logout);
nickNameText = (TextView) findViewById(R.id.userName);
roomCreate.setOnClickListener(this);
logout.setOnClickListener(this);
nickNameText.setText(user.getNickName());
roomListView = (RecyclerView) findViewById(R.id.room_list);
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
RoomAdapter roomAdapter = new RoomAdapter(context, rooms, user, R.layout.item_room);
roomListView.setLayoutManager(layoutManager);
roomListView.setItemAnimator(new DefaultItemAnimator());
roomListView.setAdapter(roomAdapter);
roomUpdateTask = new RoomUpdateTask(handler);
timer = new Timer();
timer.schedule(roomUpdateTask, 0, 500);
}
Aggregations