Search in sources :

Example 6 with AppData

use of io.virtualapp.home.models.AppData in project VirtualApp by asLody.

the class LaunchpadAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    AppData data = mList.get(position);
    holder.color = getColor(position);
    holder.iconView.setImageDrawable(data.getIcon());
    holder.nameView.setText(data.getName());
    if (data.isFirstOpen() && !data.isLoading()) {
        holder.firstOpenDot.setVisibility(View.VISIBLE);
    } else {
        holder.firstOpenDot.setVisibility(View.INVISIBLE);
    }
    holder.itemView.setBackgroundColor(holder.color);
    holder.itemView.setOnClickListener(v -> {
        if (mAppClickListener != null) {
            mAppClickListener.onAppClick(position, data);
        }
    });
    if (data instanceof MultiplePackageAppData) {
        MultiplePackageAppData multipleData = (MultiplePackageAppData) data;
        holder.spaceLabelView.setVisibility(View.VISIBLE);
        holder.spaceLabelView.setText(multipleData.userId + 1 + "");
    } else {
        holder.spaceLabelView.setVisibility(View.INVISIBLE);
    }
    if (data.isLoading()) {
        startLoadingAnimation(holder.iconView);
    } else {
        holder.iconView.setProgress(100, false);
    }
}
Also used : MultiplePackageAppData(io.virtualapp.home.models.MultiplePackageAppData) AppData(io.virtualapp.home.models.AppData) MultiplePackageAppData(io.virtualapp.home.models.MultiplePackageAppData)

Aggregations

AppData (io.virtualapp.home.models.AppData)6 MultiplePackageAppData (io.virtualapp.home.models.MultiplePackageAppData)4 PackageAppData (io.virtualapp.home.models.PackageAppData)4 InstalledAppInfo (com.lody.virtual.remote.InstalledAppInfo)2 EmptyAppData (io.virtualapp.home.models.EmptyAppData)2 Activity (android.app.Activity)1 Bitmap (android.graphics.Bitmap)1 AlertDialog (android.support.v7.app.AlertDialog)1 VirtualCore (com.lody.virtual.client.core.VirtualCore)1 VUserInfo (com.lody.virtual.os.VUserInfo)1 VUserManager (com.lody.virtual.os.VUserManager)1 InstallResult (com.lody.virtual.remote.InstallResult)1 VCommends (io.virtualapp.VCommends)1 VUiKit (io.virtualapp.abs.ui.VUiKit)1 AppInfoLite (io.virtualapp.home.models.AppInfoLite)1 AppRepository (io.virtualapp.home.repo.AppRepository)1 PackageAppDataStorage (io.virtualapp.home.repo.PackageAppDataStorage)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Once (jonathanfinerty.once.Once)1