Search in sources :

Example 1 with BusAvatarRowAdapter

use of cl.smartcities.isci.transportinspector.adapters.BusAvatarRowAdapter in project androidApp by InspectorIncognito.

the class AccountBusPickerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_user_bus_picker);
    mapView = findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    currentAccount = TranSappAccountManager.getCurrentAccount();
    if (currentAccount == null) {
        this.finish();
        return;
    }
    serverBusAvatarId = currentAccount.getBusAvatarId();
    busAvatarId = serverBusAvatarId;
    // new ActiveBusView(this, "506v", serverBusAvatarId, false);
    final ActiveBusView activeBusView = findViewById(R.id.active_bus);
    activeBusView.setAvatarId(serverBusAvatarId);
    RecyclerView recyclerView = findViewById(R.id.bus_picker_recycler_view);
    BusAvatarRowAdapter adapter = new BusAvatarRowAdapter(this, AvatarLists.BUS_AVATARS, new BusAvatarRowAdapter.AvatarClickListener() {

        @Override
        public void onNewAvatarSelected(int serverId) {
            busAvatarId = serverId;
            activeBusView.setAvatarId(serverId);
        }
    }, currentAccount.getLevelPosition(), currentAccount.getBusAvatarId());
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
    recyclerView.invalidate();
}
Also used : ActiveBusView(cl.smartcities.isci.transportinspector.drawables.ActiveBusView) BusAvatarRowAdapter(cl.smartcities.isci.transportinspector.adapters.BusAvatarRowAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 BusAvatarRowAdapter (cl.smartcities.isci.transportinspector.adapters.BusAvatarRowAdapter)1 ActiveBusView (cl.smartcities.isci.transportinspector.drawables.ActiveBusView)1