use of cl.smartcities.isci.transportinspector.drawables.ActiveBusView 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();
}
use of cl.smartcities.isci.transportinspector.drawables.ActiveBusView in project androidApp by InspectorIncognito.
the class BusIconsBuilder method setBusIcons.
void setBusIcons(String id, ServerSentBus bus, LayoutInflater inflater, HashMap<String, Bitmap> imagesMap, HashMap<String, View> viewMap, boolean onBus) {
ActiveBusView busViewLeft = new ActiveBusView(inflater.getContext(), bus, true);
ActiveBusView busViewRight = new ActiveBusView(inflater.getContext(), bus, false);
imagesMap.put(id + "-left", busViewLeft.getBitmapDrawable().getBitmap());
imagesMap.put(id + "-right", busViewRight.getBitmapDrawable().getBitmap());
View view = inflater.inflate(R.layout.bus_bubble_with_events, null);
try {
setMaxInfoWindow(view, bus, onBus);
} catch (Exception ignored) {
}
imagesMap.put(id + "-max", GenerateViewIconTask.SymbolGenerator.generate(view));
viewMap.put("bus-max", view);
if (!bus.getEvents().isEmpty()) {
View viewMin = inflater.inflate(R.layout.bus_bubble_minimize, null);
setMinInfoWindow(viewMin, bus);
imagesMap.put(id + "-min", GenerateViewIconTask.SymbolGenerator.generate(viewMin));
}
}
Aggregations