FileDocCategorySizeDatePackage
StatusBarIconList.javaAPI DocAndroid 5.1 API4341Thu Mar 12 22:22:10 GMT 2015com.android.internal.statusbar

StatusBarIconList

public class StatusBarIconList extends Object implements android.os.Parcelable

Fields Summary
private String[]
mSlots
private StatusBarIcon[]
mIcons
public static final Parcelable.Creator
CREATOR
Parcelable.Creator that instantiates StatusBarIconList objects
Constructors Summary
public StatusBarIconList()

    
public StatusBarIconList(android.os.Parcel in)

        readFromParcel(in);
    
Methods Summary
public voidcopyFrom(com.android.internal.statusbar.StatusBarIconList that)

        if (that.mSlots == null) {
            this.mSlots = null;
            this.mIcons = null;
        } else {
            final int N = that.mSlots.length;
            this.mSlots = new String[N];
            this.mIcons = new StatusBarIcon[N];
            for (int i=0; i<N; i++) {
                this.mSlots[i] = that.mSlots[i];
                this.mIcons[i] = that.mIcons[i] != null ? that.mIcons[i].clone() : null;
            }
        }
    
public voiddefineSlots(java.lang.String[] slots)


        
        final int N = slots.length;
        String[] s = mSlots = new String[N];
        for (int i=0; i<N; i++) {
            s[i] = slots[i];
        }
        mIcons = new StatusBarIcon[N];
    
public intdescribeContents()

        return 0;
    
public voiddump(java.io.PrintWriter pw)

        final int N = mSlots.length;
        pw.println("Icon list:");
        for (int i=0; i<N; i++) {
            pw.printf("  %2d: (%s) %s\n", i, mSlots[i], mIcons[i]);
        }
    
public StatusBarIcongetIcon(int index)

        return mIcons[index];
    
public java.lang.StringgetSlot(int index)

        return mSlots[index];
    
public intgetSlotIndex(java.lang.String slot)

        final int N = mSlots.length;
        for (int i=0; i<N; i++) {
            if (slot.equals(mSlots[i])) {
                return i;
            }
        }
        return -1;
    
public intgetViewIndex(int index)

        int count = 0;
        for (int i=0; i<index; i++) {
            if (mIcons[i] != null) {
                count++;
            }
        }
        return count;
    
public voidreadFromParcel(android.os.Parcel in)

        this.mSlots = in.readStringArray();
        final int N = in.readInt();
        if (N < 0) {
            mIcons = null;
        } else {
            mIcons = new StatusBarIcon[N];
            for (int i=0; i<N; i++) {
                if (in.readInt() != 0) {
                    mIcons[i] = new StatusBarIcon(in);
                }
            }
        }
    
public voidremoveIcon(int index)

        mIcons[index] = null;
    
public voidsetIcon(int index, StatusBarIcon icon)

        mIcons[index] = icon.clone();
    
public intsize()

        return mSlots.length;
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeStringArray(mSlots);
        if (mIcons == null) {
            out.writeInt(-1);
        } else {
            final int N = mIcons.length;
            out.writeInt(N);
            for (int i=0; i<N; i++) {
                StatusBarIcon ic = mIcons[i];
                if (ic == null) {
                    out.writeInt(0);
                } else {
                    out.writeInt(1);
                    ic.writeToParcel(out, flags);
                }
            }
        }