use of io.virtualapp.home.models.EmptyAppData in project VirtualApp by asLody.
the class HomeActivity method addAppToLauncher.
@Override
public void addAppToLauncher(AppData model) {
List<AppData> dataList = mLaunchpadAdapter.getList();
boolean replaced = false;
for (int i = 0; i < dataList.size(); i++) {
AppData data = dataList.get(i);
if (data instanceof EmptyAppData) {
mLaunchpadAdapter.replace(i, model);
replaced = true;
break;
}
}
if (!replaced) {
mLaunchpadAdapter.add(model);
mLauncherView.smoothScrollToPosition(mLaunchpadAdapter.getItemCount() - 1);
}
}
Aggregations