FileDocCategorySizeDatePackage
PreviewPageFrame.javaAPI DocAndroid 5.1 API3235Thu Mar 12 22:22:42 GMT 2015com.android.printspooler.widget

PreviewPageFrame

public final class PreviewPageFrame extends android.widget.LinearLayout
This class represents the frame of page in the print preview list that contains the page and a footer.

Fields Summary
private final float
mSelectedElevation
private final float
mNotSelectedElevation
private final float
mSelectedPageAlpha
private final float
mNotSelectedAlpha
Constructors Summary
public PreviewPageFrame(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
        mSelectedElevation = mContext.getResources().getDimension(
                R.dimen.selected_page_elevation);
        mNotSelectedElevation = mContext.getResources().getDimension(
                R.dimen.unselected_page_elevation);
        mSelectedPageAlpha = mContext.getResources().getFraction(
                R.fraction.page_selected_alpha, 1, 1);
        mNotSelectedAlpha = mContext.getResources().getFraction(
                R.fraction.page_unselected_alpha, 1, 1);
    
Methods Summary
public voidonInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)

        super.onInitializeAccessibilityEvent(event);
        event.setClassName(CompoundButton.class.getName());
        event.setChecked(isSelected());
    
public voidonInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)

        super.onInitializeAccessibilityNodeInfo(info);
        info.setClassName(CompoundButton.class.getName());
        info.setSelected(false);
        info.setCheckable(true);
        info.setChecked(isSelected());
    
public voidsetSelected(boolean selected, boolean animate)

        if (isSelected() == selected) {
            return;
        }
        setSelected(selected);
        if (selected) {
            if (animate) {
                animate().translationZ(mSelectedElevation)
                        .alpha(mSelectedPageAlpha);
            } else {
                setTranslationZ(mSelectedElevation);
                setAlpha(mSelectedPageAlpha);
            }
        } else {
            if (animate) {
                animate().translationZ(mNotSelectedElevation)
                        .alpha(mNotSelectedAlpha);
            } else {
                setTranslationZ(mNotSelectedElevation);
                setAlpha(mNotSelectedAlpha);
            }
        }