當前位置: 首頁>>代碼示例>>Java>>正文


Java Drawable.getAlpha方法代碼示例

本文整理匯總了Java中android.graphics.drawable.Drawable.getAlpha方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.getAlpha方法的具體用法?Java Drawable.getAlpha怎麽用?Java Drawable.getAlpha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.graphics.drawable.Drawable的用法示例。


在下文中一共展示了Drawable.getAlpha方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: StatusbarBattery

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public StatusbarBattery(View batteryView) {
        mBattery = batteryView;
        createHooks();
        try {
            Object drawable = getDrawable();
            final int[] colors = (int[]) XposedHelpers.getObjectField(drawable, "mColors");
            mDefaultColor = colors[colors.length - 1];
            if (Utils.isLineageOs()) {

                Drawable frameDrawable = (Drawable) XposedHelpers.getObjectField(drawable, "mFrameDrawable");
//                mDefaultFrameColor = frameDrawable.setTint();
                mFrameAlpha = frameDrawable.getAlpha();
            } else {
                final Paint framePaint = (Paint) XposedHelpers.getObjectField(drawable, "mFramePaint");
                mDefaultFrameColor = framePaint.getColor();
                mFrameAlpha = framePaint.getAlpha();
            }

            mDefaultChargeColor = XposedHelpers.getIntField(drawable, "mChargeColor");
        } catch (Throwable t) {
            log("Error backing up original colors: " + t.getMessage());
        }
        if (SysUiManagers.IconManager != null) {
            SysUiManagers.IconManager.registerListener(this);
        }
    }
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:27,代碼來源:StatusbarBattery.java

示例2: get

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@Override
public Integer get(View view) {
    Drawable background = view.getBackground();
    if (background instanceof LayerDrawable
            && ((LayerDrawable) background).getNumberOfLayers() > 0) {
        background = ((LayerDrawable) background).getDrawable(0);
    }
    return background.getAlpha();
}
 
開發者ID:SysdataSpA,項目名稱:FancyAccordionView,代碼行數:10,代碼來源:AnimatorUtils.java

示例3: getAlpha

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static int getAlpha(Drawable drawable) {
    return drawable.getAlpha();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:DrawableCompatKitKat.java


注:本文中的android.graphics.drawable.Drawable.getAlpha方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。