Search in sources :

Example 1 with EmptyAppData

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);
    }
}
Also used : PackageAppData(io.virtualapp.home.models.PackageAppData) EmptyAppData(io.virtualapp.home.models.EmptyAppData) MultiplePackageAppData(io.virtualapp.home.models.MultiplePackageAppData) AppData(io.virtualapp.home.models.AppData) EmptyAppData(io.virtualapp.home.models.EmptyAppData) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 AppData (io.virtualapp.home.models.AppData)1 EmptyAppData (io.virtualapp.home.models.EmptyAppData)1 MultiplePackageAppData (io.virtualapp.home.models.MultiplePackageAppData)1 PackageAppData (io.virtualapp.home.models.PackageAppData)1