Java Code Examples for android.view.View#getLayoutDirection()
The following examples show how to use
android.view.View#getLayoutDirection() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutofillPopupWindow.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override protected void update(View anchor, WindowManager.LayoutParams params) { final int layoutDirection = anchor != null ? anchor.getLayoutDirection() : View.LAYOUT_DIRECTION_LOCALE; mWindowPresenter.show(params, getTransitionEpicenter(), isLayoutInsetDecor(), layoutDirection); }
Example 2
Source File: ViewUtils.java From Android-Next with Apache License 2.0 | 5 votes |
/** * 23 * Returns true if view's layout direction is right-to-left. * 24 * * 25 * @param view the View whose layout is being considered * 26 */ public static boolean isLayoutRtl(View view) { if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; } else { // All layouts are LTR before JB MR1. return false; } }
Example 3
Source File: StreamingTextView.java From adt-leanback-support with Apache License 2.0 | 5 votes |
public static boolean isLayoutRtl(View view) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) { return View.LAYOUT_DIRECTION_RTL == view.getLayoutDirection(); } else { return false; } }
Example 4
Source File: ViewHelper.java From WayHoo with Apache License 2.0 | 5 votes |
public static int getLayoutDirection(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return v.getLayoutDirection(); } return View.LAYOUT_DIRECTION_LTR; }
Example 5
Source File: MaterialProgressDrawable.java From 365browser with Apache License 2.0 | 5 votes |
private static boolean isLayoutRtl(View view) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; } else { // All layouts are LTR before JB MR1. return false; } }
Example 6
Source File: ApiCompatibilityUtils.java From 365browser with Apache License 2.0 | 5 votes |
/** * Returns true if view's layout direction is right-to-left. * * @param view the View whose layout is being considered */ public static boolean isLayoutRtl(View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; } else { // All layouts are LTR before JB MR1. return false; } }
Example 7
Source File: ViewHelper.java From SwipeBack with Apache License 2.0 | 5 votes |
@SuppressWarnings("") public static int getLayoutDirection(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return v.getLayoutDirection(); } return View.LAYOUT_DIRECTION_LTR; }
Example 8
Source File: LauncherAccessibilityDelegate.java From Trebuchet with GNU General Public License v3.0 | 5 votes |
@Thunk void performResizeAction(int action, View host, LauncherAppWidgetInfo info) { CellLayout.LayoutParams lp = (CellLayout.LayoutParams) host.getLayoutParams(); CellLayout layout = (CellLayout) host.getParent().getParent(); layout.markCellsAsUnoccupiedForView(host); if (action == R.string.action_increase_width) { if (((host.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) && layout.isRegionVacant(info.cellX - 1, info.cellY, 1, info.spanY)) || !layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY)) { lp.cellX --; info.cellX --; } lp.cellHSpan ++; info.spanX ++; } else if (action == R.string.action_decrease_width) { lp.cellHSpan --; info.spanX --; } else if (action == R.string.action_increase_height) { if (!layout.isRegionVacant(info.cellX, info.cellY + info.spanY, info.spanX, 1)) { lp.cellY --; info.cellY --; } lp.cellVSpan ++; info.spanY ++; } else if (action == R.string.action_decrease_height) { lp.cellVSpan --; info.spanY --; } layout.markCellsAsOccupiedForView(host); Rect sizeRange = new Rect(); AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, sizeRange); ((LauncherAppWidgetHostView) host).updateAppWidgetSize(null, sizeRange.left, sizeRange.top, sizeRange.right, sizeRange.bottom); host.requestLayout(); LauncherModel.updateItemInDatabase(mLauncher, info); announceConfirmation(mLauncher.getString(R.string.widget_resized, info.spanX, info.spanY)); }
Example 9
Source File: ViewHelper.java From Cybernet-VPN with GNU General Public License v3.0 | 5 votes |
@SuppressLint("NewApi") static int getLayoutDirection(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return v.getLayoutDirection(); } return View.LAYOUT_DIRECTION_LTR; }
Example 10
Source File: ApiCompatibilityUtils.java From cronet with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Returns true if view's layout direction is right-to-left. * * @param view the View whose layout is being considered */ public static boolean isLayoutRtl(View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; } else { // All layouts are LTR before JB MR1. return false; } }
Example 11
Source File: LauncherAccessibilityDelegate.java From LaunchEnr with GNU General Public License v3.0 | 5 votes |
@Thunk private void performResizeAction(int action, View host, LauncherAppWidgetInfo info) { CellLayout.LayoutParams lp = (CellLayout.LayoutParams) host.getLayoutParams(); CellLayout layout = (CellLayout) host.getParent().getParent(); layout.markCellsAsUnoccupiedForView(host); if (action == R.string.action_increase_width) { if (((host.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) && layout.isRegionVacant(info.cellX - 1, info.cellY, 1, info.spanY)) || !layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY)) { lp.cellX --; info.cellX --; } lp.cellHSpan ++; info.spanX ++; } else if (action == R.string.action_decrease_width) { lp.cellHSpan --; info.spanX --; } else if (action == R.string.action_increase_height) { if (!layout.isRegionVacant(info.cellX, info.cellY + info.spanY, info.spanX, 1)) { lp.cellY --; info.cellY --; } lp.cellVSpan ++; info.spanY ++; } else if (action == R.string.action_decrease_height) { lp.cellVSpan --; info.spanY --; } layout.markCellsAsOccupiedForView(host); Rect sizeRange = new Rect(); AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, sizeRange); ((LauncherAppWidgetHostView) host).updateAppWidgetSize(null, sizeRange.left, sizeRange.top, sizeRange.right, sizeRange.bottom); host.requestLayout(); mLauncher.getModelWriter().updateItemInDatabase(info); announceConfirmation(mLauncher.getString(R.string.widget_resized, info.spanX, info.spanY)); }
Example 12
Source File: ViewHelper.java From FlowingPager with Apache License 2.0 | 5 votes |
@SuppressLint("NewApi") static int getLayoutDirection(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return v.getLayoutDirection(); } return View.LAYOUT_DIRECTION_LTR; }
Example 13
Source File: ViewUtils.java From Transitions-Everywhere with Apache License 2.0 | 4 votes |
@Override public boolean isRtl(@NonNull View view) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; }
Example 14
Source File: DrawerLayout.java From Dashchan with Apache License 2.0 | 4 votes |
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private static int getLayoutDirection(View v) { return C.API_JELLY_BEAN_MR1 ? v.getLayoutDirection() : 0; }
Example 15
Source File: an.java From MiBandDecompiled with Apache License 2.0 | 4 votes |
public static int b(View view) { return view.getLayoutDirection(); }
Example 16
Source File: ViewCompat.java From SmartSwipe with Apache License 2.0 | 4 votes |
public static int getLayoutDirection(View view) { if (Build.VERSION.SDK_INT >= 17) { return view.getLayoutDirection(); } return View.LAYOUT_DIRECTION_LTR; }
Example 17
Source File: ViewCompatJellybeanMr1.java From CodenameOne with GNU General Public License v2.0 | 4 votes |
public static int getLayoutDirection(View view) { return view.getLayoutDirection(); }
Example 18
Source File: ViewCompatJellybeanMr1.java From adt-leanback-support with Apache License 2.0 | 4 votes |
public static int getLayoutDirection(View view) { return view.getLayoutDirection(); }
Example 19
Source File: ConversationItemSwipeCallback.java From mollyim-android with GNU General Public License v3.0 | 4 votes |
private static float getSignFromDirection(@NonNull View view) { return view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL ? -1f : 1f; }
Example 20
Source File: ViewCompatJellybeanMr1.java From guideshow with MIT License | 4 votes |
public static int getLayoutDirection(View view) { return view.getLayoutDirection(); }