当前位置: 首页>>代码示例>>Java>>正文


Java Utilities.isRtl方法代码示例

本文整理汇总了Java中com.android.launcher3.Utilities.isRtl方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.isRtl方法的具体用法?Java Utilities.isRtl怎么用?Java Utilities.isRtl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.launcher3.Utilities的用法示例。


在下文中一共展示了Utilities.isRtl方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AllAppsGridAdapter

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public AllAppsGridAdapter(Launcher launcher, AlphabeticalAppsList apps, View.OnClickListener
        iconClickListener, View.OnLongClickListener iconLongClickListener) {
    Resources res = launcher.getResources();
    mLauncher = launcher;
    mApps = apps;
    mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
    mGridSizer = new GridSpanSizer();
    mGridLayoutMgr = new AppsGridLayoutManager(launcher);
    mGridLayoutMgr.setSpanSizeLookup(mGridSizer);
    mItemDecoration = new GridItemDecoration();
    mLayoutInflater = LayoutInflater.from(launcher);
    mIconClickListener = iconClickListener;
    mIconLongClickListener = iconLongClickListener;
    mSectionNamesMargin = res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
    mSectionHeaderOffset = res.getDimensionPixelSize(R.dimen.all_apps_grid_section_y_offset);
    mIsRtl = Utilities.isRtl(res);

    mSectionTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mSectionTextPaint.setTextSize(res.getDimensionPixelSize(
            R.dimen.all_apps_grid_section_text_size));
    mSectionTextPaint.setColor(Utilities.getColorAccent(launcher));
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:23,代码来源:AllAppsGridAdapter.java

示例2: DragLayer

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Used to create a new DragLayer from XML.
 *
 * @param context The application's context.
 * @param attrs The attributes set containing the Workspace's customization values.
 */
public DragLayer(Context context, AttributeSet attrs) {
    super(context, attrs);

    // Disable multitouch across the workspace/all apps/customize tray
    setMotionEventSplittingEnabled(false);
    setChildrenDrawingOrderEnabled(true);

    final Resources res = getResources();
    mLeftHoverDrawable = res.getDrawable(R.drawable.page_hover_left);
    mRightHoverDrawable = res.getDrawable(R.drawable.page_hover_right);
    mLeftHoverDrawableActive = res.getDrawable(R.drawable.page_hover_left_active);
    mRightHoverDrawableActive = res.getDrawable(R.drawable.page_hover_right_active);
    mIsRtl = Utilities.isRtl(res);
    mFocusIndicatorHelper = new ViewGroupFocusHelper(this);
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:22,代码来源:DragLayer.java

示例3: getScaleAndPosition

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
@Override
public float getScaleAndPosition(Bitmap preview, int[] outPos) {
    Launcher launcher = Launcher.getLauncher(mView.getContext());
    int iconSize = getDrawableBounds(mView.getBackground()).width();
    float scale = launcher.getDragLayer().getLocationInDragLayer(mView, outPos);

    int iconLeft = mView.getPaddingStart();
    if (Utilities.isRtl(mView.getResources())) {
        iconLeft = mView.getWidth() - iconSize - iconLeft;
    }

    outPos[0] += Math.round(scale * iconLeft + (scale * iconSize - preview.getWidth()) / 2 +
            mPositionShift.x);
    outPos[1] += Math.round((scale * mView.getHeight() - preview.getHeight()) / 2
            + mPositionShift.y);
    float size = launcher.getDeviceProfile().iconSizePx;
    return scale * iconSize / size;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:19,代码来源:ShortcutDragPreviewProvider.java

示例4: FolderPagedView

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public FolderPagedView(Context context, AttributeSet attrs) {
    super(context, attrs);
    LauncherAppState app = LauncherAppState.getInstance();

    InvariantDeviceProfile profile = app.getInvariantDeviceProfile();
    mMaxCountX = profile.numFolderColumns;
    mMaxCountY = profile.numFolderRows;

    mMaxItemsPerPage = mMaxCountX * mMaxCountY;

    mInflater = LayoutInflater.from(context);
    mIconCache = app.getIconCache();

    mIsRtl = Utilities.isRtl(getResources());
    setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);

    setEdgeGlowColor(getResources().getColor(R.color.folder_edge_effect_color));
    mFocusIndicatorHelper = new ViewGroupFocusHelper(this);
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:20,代码来源:FolderPagedView.java

示例5: PageIndicatorDots

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public PageIndicatorDots(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mCirclePaint.setStyle(Style.FILL);
    mDotRadius = getResources().getDimension(R.dimen.page_indicator_dot_size) / 2;
    setOutlineProvider(new MyOutlineProver());

    mActiveColor = Utilities.getColorAccent(context);
    mInActiveColor = getResources().getColor(R.color.page_indicator_dot_color);

    mIsRtl = Utilities.isRtl(getResources());
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:14,代码来源:PageIndicatorDots.java

示例6: getIconCenter

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Returns the position of the center of the icon relative to the container.
 */
public Point getIconCenter() {
    sTempPoint.y = sTempPoint.x = getMeasuredHeight() / 2;
    if (Utilities.isRtl(getResources())) {
        sTempPoint.x = getMeasuredWidth() - sTempPoint.x;
    }
    return sTempPoint;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:11,代码来源:DeepShortcutView.java

示例7: onMeasure

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);

    mDragHandleBounds.set(0, 0, mDragHandleWidth, getMeasuredHeight());
    if (!Utilities.isRtl(getResources())) {
        mDragHandleBounds.offset(getMeasuredWidth() - mDragHandleBounds.width(), 0);
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:10,代码来源:DeepShortcutTextView.java

示例8: DeepShortcutsContainer

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public DeepShortcutsContainer(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mLauncher = Launcher.getLauncher(context);
    mDeepShortcutsManager = LauncherAppState.getInstance().getShortcutManager();

    mStartDragThreshold = getResources().getDimensionPixelSize(
            R.dimen.deep_shortcuts_start_drag_threshold);
    mAccessibilityDelegate = new ShortcutMenuAccessibilityDelegate(mLauncher);
    mIsRtl = Utilities.isRtl(getResources());
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:11,代码来源:DeepShortcutsContainer.java

示例9: OverviewScreenAccessibilityDelegate

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public OverviewScreenAccessibilityDelegate(Workspace workspace) {
    mWorkspace = workspace;

    Context context = mWorkspace.getContext();
    boolean isRtl = Utilities.isRtl(context.getResources());
    mActions.put(MOVE_BACKWARD, new AccessibilityAction(MOVE_BACKWARD,
            context.getText(isRtl ? R.string.action_move_screen_right :
                R.string.action_move_screen_left)));
    mActions.put(MOVE_FORWARD, new AccessibilityAction(MOVE_FORWARD,
            context.getText(isRtl ? R.string.action_move_screen_left :
                R.string.action_move_screen_right)));
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:13,代码来源:OverviewScreenAccessibilityDelegate.java

示例10: WallpaperOffsetInterpolator

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public WallpaperOffsetInterpolator(Workspace workspace) {
    mChoreographer = Choreographer.getInstance();
    mInterpolator = new DecelerateInterpolator(1.5f);

    mWorkspace = workspace;
    mWallpaperManager = WallpaperManager.getInstance(workspace.getContext());
    mIsRtl = Utilities.isRtl(workspace.getResources());
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:9,代码来源:WallpaperOffsetInterpolator.java

示例11: DragController

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Used to create a new DragLayer from XML.
 */
public DragController(Launcher launcher) {
    Resources r = launcher.getResources();
    mLauncher = launcher;
    mHandler = new Handler();
    mScrollZone = r.getDimensionPixelSize(R.dimen.scroll_zone);
    mVelocityTracker = VelocityTracker.obtain();

    mFlingToDeleteThresholdVelocity =
            r.getDimensionPixelSize(R.dimen.drag_flingToDeleteMinVelocity);
    mIsRtl = Utilities.isRtl(r);
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:15,代码来源:DragController.java

示例12: updatePaddingsAndMargins

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Update the background and padding of the Apps view and children.  Instead of insetting the
 * container view, we inset the background and padding of the recycler view to allow for the
 * recycler view to handle touch events (for fast scrolling) all the way to the edge.
 */
private void updatePaddingsAndMargins(int widthPx, int heightPx) {
    Rect bgPadding = new Rect();
    getRevealView().getBackground().getPadding(bgPadding);

    mAppsRecyclerView.updateBackgroundPadding(bgPadding);
    mAdapter.updateBackgroundPadding(bgPadding);
    mElevationController.updateBackgroundPadding(bgPadding);

    // Pad the recycler view by the background padding plus the start margin (for the section
    // names)
    int maxScrollBarWidth = mAppsRecyclerView.getMaxScrollbarWidth();
    int startInset = Math.max(mSectionNamesMargin, maxScrollBarWidth);
    if (Utilities.isRtl(getResources())) {
        mAppsRecyclerView.setPadding(bgPadding.left + maxScrollBarWidth, 0, bgPadding.right
                + startInset, mRecyclerViewBottomPadding);
    } else {
        mAppsRecyclerView.setPadding(bgPadding.left + startInset, 0, bgPadding.right +
                maxScrollBarWidth, mRecyclerViewBottomPadding);
    }

    MarginLayoutParams lp = (MarginLayoutParams) mSearchContainer.getLayoutParams();
    lp.leftMargin = bgPadding.left;
    lp.rightMargin = bgPadding.right;

    // Clip the view to the left and right edge of the background to
    // to prevent shadows from rendering beyond the edges
    final Rect newClipBounds = new Rect(
            bgPadding.left, 0, widthPx - bgPadding.right, heightPx);
    setClipBounds(newClipBounds);

    // Allow the overscroll effect to reach the edges of the view
    mAppsRecyclerView.setClipToPadding(false);

    DeviceProfile grid = mLauncher.getDeviceProfile();
    if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
        if (!grid.isVerticalBarLayout()) {
            MarginLayoutParams mlp = (MarginLayoutParams) mAppsRecyclerView.getLayoutParams();

            Rect insets = mLauncher.getDragLayer().getInsets();
            getContentView().setPadding(0, 0, 0, 0);
            int height = insets.top + grid.hotseatCellHeightPx;

            mlp.topMargin = height;
            mAppsRecyclerView.setLayoutParams(mlp);

            mSearchContainer.setPadding(
                    mSearchContainer.getPaddingLeft(),
                    insets.top + mSearchContainerOffsetTop,
                    mSearchContainer.getPaddingRight(),
                    mSearchContainer.getPaddingBottom());
            lp.height = height;

            View navBarBg = findViewById(R.id.nav_bar_bg);
            ViewGroup.LayoutParams params = navBarBg.getLayoutParams();
            params.height = insets.bottom;
            navBarBg.setLayoutParams(params);
            navBarBg.setVisibility(View.VISIBLE);
        }
    }
    mSearchContainer.setLayoutParams(lp);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:67,代码来源:AllAppsContainerView.java


注:本文中的com.android.launcher3.Utilities.isRtl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。