Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Build a event calendar UI. What components should I use?

Tags:

android

I'm working on the app for event. I want to add calendar activity with columns as room, rows as time, and cells as attraction. I tried to use Android Week View package, but it has some limitations (columns as day, cannot set max/min date) and that's why I can't use it.

I'm going to do something like this: Goal

I'm thinking how can I do that. Building on scratch using View class it's too hard for me (and I think exists a better idea). So, can you enlighten me what component could I use? TableView, RecyclerView? I'm looking for a solution with visible only 4 rooms (on smartphones), but by scrolling horizontal you can show more.

like image 546
Siper Avatar asked Jul 28 '16 18:07

Siper


1 Answers

Use RecyclerView with GridLayoutManager.

It would be simple if you add RecyclerView in your xml and in java code just say

GridLayoutManager lLayout = new GridLayoutManager(MainActivity.this, NO_OF_COLUMNS);
RecyclerView rView = (RecyclerView)findViewById(R.id.recycler_view);
        rView.setHasFixedSize(true);
        rView.setLayoutManager(lLayout);

        RecyclerViewAdapter rcAdapter = new RecyclerViewAdapter(MainActivity.this, rowListItem);
        rView.setAdapter(rcAdapter);
like image 86
Nayan Srivastava Avatar answered Oct 16 '22 05:10

Nayan Srivastava