@Override protected void onFinishInflate() { super.onFinishInflate(); // Get the drawable mOriginalTextColor = getTextColors(); // Get the hover color Resources r = getResources(); mHoverColor = r.getColor(R.color.delete_target_hover_tint); mHoverPaint.setColorFilter(new PorterDuffColorFilter(mHoverColor, PorterDuff.Mode.SRC_ATOP)); mUninstallDrawable = (TransitionDrawable) r.getDrawable(R.drawable.uninstall_target_selector); mRemoveDrawable = (TransitionDrawable) r.getDrawable(R.drawable.remove_target_selector); mRemoveDrawable.setCrossFadeEnabled(true); mUninstallDrawable.setCrossFadeEnabled(true); // The current drawable is set to either the remove drawable or the uninstall drawable // and is initially set to the remove drawable, as set in the layout xml. mCurrentDrawable = (TransitionDrawable) getCompoundDrawables()[0]; // Remove the text in the Phone UI in landscape int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { if (!LauncherApplication.isScreenLarge()) { setText(""); } } }
@Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (mInScrollArea && !LauncherApplication.isScreenLarge()) { Workspace workspace = mLauncher.getWorkspace(); int width = workspace.getWidth(); Rect childRect = new Rect(); getDescendantRectRelativeToSelf(workspace.getChildAt(0), childRect); int page = workspace.getNextPage(); final boolean isRtl = isLayoutDirectionRtl(); CellLayout leftPage = (CellLayout) workspace.getChildAt(isRtl ? page + 1 : page - 1); CellLayout rightPage = (CellLayout) workspace.getChildAt(isRtl ? page - 1 : page + 1); if (leftPage != null && leftPage.getIsDragOverlapping()) { mLeftHoverDrawable.setBounds( 0, childRect.top, mLeftHoverDrawable.getIntrinsicWidth(), childRect.bottom); mLeftHoverDrawable.draw(canvas); } else if (rightPage != null && rightPage.getIsDragOverlapping()) { mRightHoverDrawable.setBounds( width - mRightHoverDrawable.getIntrinsicWidth(), childRect.top, width, childRect.bottom); mRightHoverDrawable.draw(canvas); } } }
@Override public void onReceive(Context context, Intent intent) { final LauncherApplication app = (LauncherApplication) context.getApplicationContext(); final LauncherProvider provider = app.getLauncherProvider(); if (provider != null) { String name = intent.getStringExtra(EXTRA_WORKSPACE_NAME); final int workspaceResId = !TextUtils.isEmpty(name) ? context.getResources().getIdentifier(name, "xml", "com.android.launcher") : 0; if (LOGD) { Log.d(TAG, "workspace name: " + name + " id: " + workspaceResId); } new Thread( new Runnable() { @Override public void run() { provider.loadDefaultFavoritesIfNecessary(workspaceResId); } }) .start(); } }
static { final float scale = LauncherApplication.getScreenDensity(); MIN_OUTER_BLUR_RADIUS = (int) (scale * 1.0f); MAX_OUTER_BLUR_RADIUS = (int) (scale * 12.0f); sExtraThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 12.0f, BlurMaskFilter.Blur.OUTER); sThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.OUTER); sMediumOuterBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.OUTER); sThinOuterBlurMaskFilter = new BlurMaskFilter(scale * 1.0f, BlurMaskFilter.Blur.OUTER); sExtraThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.NORMAL); sThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL); sMediumInnerBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.NORMAL); }
@Override protected void onFinishInflate() { super.onFinishInflate(); mOriginalTextColor = getTextColors(); // Get the hover color Resources r = getResources(); mHoverColor = r.getColor(R.color.info_target_hover_tint); // mDrawable = (TransitionDrawable) getCurrentDrawable(); // mDrawable.setCrossFadeEnabled(true); // Remove the text in the Phone UI in landscape int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { if (!LauncherApplication.isScreenLarge()) { setText(""); } } }
@Override protected void onFinishInflate() { super.onFinishInflate(); // Get the drawable mOriginalTextColor = getTextColors(); // Get the hover color Resources r = getResources(); mHoverColor = r.getColor(R.color.delete_target_hover_tint); mHoverPaint.setColorFilter(new PorterDuffColorFilter(mHoverColor, PorterDuff.Mode.SRC_ATOP)); mUninstallActiveDrawable = r.getDrawable(R.drawable.ic_launcher_trashcan_active_holo); mRemoveActiveDrawable = r.getDrawable(R.drawable.ic_launcher_clear_active_holo); mRemoveNormalDrawable = r.getDrawable(R.drawable.ic_launcher_clear_normal_holo); // Remove the text in the Phone UI in landscape int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { if (!LauncherApplication.isScreenLarge()) { setText(""); } } }
@Override protected int getChildDrawingOrder(int childCount, int i) { // TODO: We have turned off this custom drawing order because it now effects touch // dispatch order. We need to sort that issue out and then decide how to go about this. if (true || LauncherApplication.isScreenLandscape(getContext()) || mWorkspaceIndex == -1 || mQsbIndex == -1 || mLauncher.getWorkspace().isDrawingBackgroundGradient()) { return i; } // This ensures that the workspace is drawn above the hotseat and qsb, // except when the workspace is drawing a background gradient, in which // case we want the workspace to stay behind these elements. if (i == mQsbIndex) { return mWorkspaceIndex; } else if (i == mWorkspaceIndex) { return mQsbIndex; } else { return i; } }
public IconCache(LauncherApplication context) { mContext = context; mPackageManager = context.getPackageManager(); mBubble = new Utilities.BubbleText(context); mDefaultIcon = makeDefaultIcon(); }