Loading res/flag(com.android.documentsui.flags.use_material3)/drawable/ic_sort_arrow_m3.xml +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ --> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/ic_arrow_upward" android:drawable="@drawable/ic_arrow_upward_m3" android:fromDegrees="0" android:toDegrees="180" android:pivotX="50%" Loading src/com/android/documentsui/DragShadowBuilder.java +14 −8 Original line number Diff line number Diff line Loading @@ -58,10 +58,12 @@ class DragShadowBuilder extends View.DragShadowBuilder { private final int mShadowYOffset; DragShadowBuilder(Context context) { mWidth = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_width); mHeight = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_height); mShadowRadius = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_radius); mPadding = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_padding); mWidth = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_width)); mHeight = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_height)); mShadowRadius = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_radius)); mPadding = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_padding)); mShadowView = LayoutInflater.from(context).inflate(getRes(R.layout.drag_shadow_layout), null); Loading @@ -72,16 +74,20 @@ class DragShadowBuilder extends View.DragShadowBuilder { LayoutInflater.from(context) .inflate(getRes(R.layout.additional_drag_shadow), null); mDragContentRadius = context.getResources().getDimensionPixelSize(R.dimen.drag_content_radius); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_content_radius)); mAdditionalLayerOffset = context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_additional_layer_offset)); mDragFileCounterOffset = context.getResources().getDimensionPixelSize(R.dimen.drag_file_counter_offset); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_file_counter_offset)); mShadow2Radius = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_2_radius); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_shadow_2_radius)); mShadowYOffset = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_y_offset); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_shadow_y_offset)); } else { mAdditionalShadowView = null; mDragContentRadius = 0; Loading src/com/android/documentsui/DrawerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public abstract class DrawerController implements DrawerListener { // Material design specification for navigation drawer: // https://www.google.com/design/spec/patterns/navigation-drawer.html float width = Display.screenWidth(activity) - Display.actionBarHeight(activity); float maxWidth = activity.getResources().getDimension(R.dimen.max_drawer_width); float maxWidth = activity.getResources().getDimension(getRes(R.dimen.max_drawer_width)); int finalWidth = (int) ((width > maxWidth ? maxWidth : width)); if (DEBUG) Loading src/com/android/documentsui/DropBadgeView.java +11 −7 Original line number Diff line number Diff line Loading @@ -32,22 +32,26 @@ import com.android.documentsui.base.MimeTypes; * Provides a way to encapsulate droppable badge toggling logic into a single class. */ public final class DropBadgeView extends ImageView { private static final int[] STATE_REJECT_DROP = {getRes(R.attr.state_reject_drop)}; private static final int[] STATE_COPY = {getRes(R.attr.state_copy)}; private final int[] mStateRejectDrop; private final int[] mStateCopy; private @State int mState; private LayerDrawable mBackground; public DropBadgeView(Context context, AttributeSet attrs) { super(context, attrs); mStateRejectDrop = new int[] {getRes(R.attr.state_reject_drop)}; mStateCopy = new int[] {getRes(R.attr.state_copy)}; final int badgeHeight = context.getResources().getDimensionPixelSize(getRes(R.dimen.drop_icon_height)); final int badgeWidth = context.getResources().getDimensionPixelSize(getRes(R.dimen.drop_icon_width)); final int iconSize = context.getResources().getDimensionPixelSize(R.dimen.root_icon_size); final int iconSize = context.getResources().getDimensionPixelSize(getRes(R.dimen.root_icon_size)); Drawable okBadge = context.getResources().getDrawable(R.drawable.drop_badge_states, null); Drawable okBadge = context.getResources().getDrawable(getRes(R.drawable.drop_badge_states), null); Drawable defaultIcon = IconUtils.loadMimeIcon(context, MimeTypes.GENERIC_TYPE); Drawable[] list = {defaultIcon, okBadge}; Loading @@ -68,10 +72,10 @@ public final class DropBadgeView extends ImageView { switch (mState) { case DragAndDropManager.STATE_NOT_ALLOWED: mergeDrawableStates(drawableState, STATE_REJECT_DROP); mergeDrawableStates(drawableState, mStateRejectDrop); break; case DragAndDropManager.STATE_COPY: mergeDrawableStates(drawableState, STATE_COPY); mergeDrawableStates(drawableState, mStateCopy); break; } Loading src/com/android/documentsui/NavigationViewManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -358,7 +358,8 @@ public class NavigationViewManager implements AppBarLayout.OnOffsetChangedListen searchBarMargin); mToolbar.setLayoutParams(toolbarLayoutParams); mToolbar.setElevation( mToolbar.getResources().getDimensionPixelSize(R.dimen.search_bar_elevation)); mToolbar.getResources() .getDimensionPixelSize(getRes(R.dimen.search_bar_elevation))); headerTopOffset = toolbarLayoutParams.height + searchBarMargin * 2; } else { mToolbar.setBackground(mDefaultActionBarBackground); Loading @@ -369,7 +370,8 @@ public class NavigationViewManager implements AppBarLayout.OnOffsetChangedListen toolbarLayoutParams.setMargins(0, 0, 0, /* bottom= */ actionBarMargin); mToolbar.setLayoutParams(toolbarLayoutParams); mToolbar.setElevation( mToolbar.getResources().getDimensionPixelSize(R.dimen.action_bar_elevation)); mToolbar.getResources() .getDimensionPixelSize(getRes(R.dimen.action_bar_elevation))); headerTopOffset = toolbarLayoutParams.height + actionBarMargin; } Loading Loading
res/flag(com.android.documentsui.flags.use_material3)/drawable/ic_sort_arrow_m3.xml +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ --> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/ic_arrow_upward" android:drawable="@drawable/ic_arrow_upward_m3" android:fromDegrees="0" android:toDegrees="180" android:pivotX="50%" Loading
src/com/android/documentsui/DragShadowBuilder.java +14 −8 Original line number Diff line number Diff line Loading @@ -58,10 +58,12 @@ class DragShadowBuilder extends View.DragShadowBuilder { private final int mShadowYOffset; DragShadowBuilder(Context context) { mWidth = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_width); mHeight = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_height); mShadowRadius = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_radius); mPadding = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_padding); mWidth = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_width)); mHeight = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_height)); mShadowRadius = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_radius)); mPadding = context.getResources().getDimensionPixelSize(getRes(R.dimen.drag_shadow_padding)); mShadowView = LayoutInflater.from(context).inflate(getRes(R.layout.drag_shadow_layout), null); Loading @@ -72,16 +74,20 @@ class DragShadowBuilder extends View.DragShadowBuilder { LayoutInflater.from(context) .inflate(getRes(R.layout.additional_drag_shadow), null); mDragContentRadius = context.getResources().getDimensionPixelSize(R.dimen.drag_content_radius); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_content_radius)); mAdditionalLayerOffset = context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_additional_layer_offset)); mDragFileCounterOffset = context.getResources().getDimensionPixelSize(R.dimen.drag_file_counter_offset); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_file_counter_offset)); mShadow2Radius = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_2_radius); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_shadow_2_radius)); mShadowYOffset = context.getResources().getDimensionPixelSize(R.dimen.drag_shadow_y_offset); context.getResources() .getDimensionPixelSize(getRes(R.dimen.drag_shadow_y_offset)); } else { mAdditionalShadowView = null; mDragContentRadius = 0; Loading
src/com/android/documentsui/DrawerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public abstract class DrawerController implements DrawerListener { // Material design specification for navigation drawer: // https://www.google.com/design/spec/patterns/navigation-drawer.html float width = Display.screenWidth(activity) - Display.actionBarHeight(activity); float maxWidth = activity.getResources().getDimension(R.dimen.max_drawer_width); float maxWidth = activity.getResources().getDimension(getRes(R.dimen.max_drawer_width)); int finalWidth = (int) ((width > maxWidth ? maxWidth : width)); if (DEBUG) Loading
src/com/android/documentsui/DropBadgeView.java +11 −7 Original line number Diff line number Diff line Loading @@ -32,22 +32,26 @@ import com.android.documentsui.base.MimeTypes; * Provides a way to encapsulate droppable badge toggling logic into a single class. */ public final class DropBadgeView extends ImageView { private static final int[] STATE_REJECT_DROP = {getRes(R.attr.state_reject_drop)}; private static final int[] STATE_COPY = {getRes(R.attr.state_copy)}; private final int[] mStateRejectDrop; private final int[] mStateCopy; private @State int mState; private LayerDrawable mBackground; public DropBadgeView(Context context, AttributeSet attrs) { super(context, attrs); mStateRejectDrop = new int[] {getRes(R.attr.state_reject_drop)}; mStateCopy = new int[] {getRes(R.attr.state_copy)}; final int badgeHeight = context.getResources().getDimensionPixelSize(getRes(R.dimen.drop_icon_height)); final int badgeWidth = context.getResources().getDimensionPixelSize(getRes(R.dimen.drop_icon_width)); final int iconSize = context.getResources().getDimensionPixelSize(R.dimen.root_icon_size); final int iconSize = context.getResources().getDimensionPixelSize(getRes(R.dimen.root_icon_size)); Drawable okBadge = context.getResources().getDrawable(R.drawable.drop_badge_states, null); Drawable okBadge = context.getResources().getDrawable(getRes(R.drawable.drop_badge_states), null); Drawable defaultIcon = IconUtils.loadMimeIcon(context, MimeTypes.GENERIC_TYPE); Drawable[] list = {defaultIcon, okBadge}; Loading @@ -68,10 +72,10 @@ public final class DropBadgeView extends ImageView { switch (mState) { case DragAndDropManager.STATE_NOT_ALLOWED: mergeDrawableStates(drawableState, STATE_REJECT_DROP); mergeDrawableStates(drawableState, mStateRejectDrop); break; case DragAndDropManager.STATE_COPY: mergeDrawableStates(drawableState, STATE_COPY); mergeDrawableStates(drawableState, mStateCopy); break; } Loading
src/com/android/documentsui/NavigationViewManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -358,7 +358,8 @@ public class NavigationViewManager implements AppBarLayout.OnOffsetChangedListen searchBarMargin); mToolbar.setLayoutParams(toolbarLayoutParams); mToolbar.setElevation( mToolbar.getResources().getDimensionPixelSize(R.dimen.search_bar_elevation)); mToolbar.getResources() .getDimensionPixelSize(getRes(R.dimen.search_bar_elevation))); headerTopOffset = toolbarLayoutParams.height + searchBarMargin * 2; } else { mToolbar.setBackground(mDefaultActionBarBackground); Loading @@ -369,7 +370,8 @@ public class NavigationViewManager implements AppBarLayout.OnOffsetChangedListen toolbarLayoutParams.setMargins(0, 0, 0, /* bottom= */ actionBarMargin); mToolbar.setLayoutParams(toolbarLayoutParams); mToolbar.setElevation( mToolbar.getResources().getDimensionPixelSize(R.dimen.action_bar_elevation)); mToolbar.getResources() .getDimensionPixelSize(getRes(R.dimen.action_bar_elevation))); headerTopOffset = toolbarLayoutParams.height + actionBarMargin; } Loading