From 4ffec48dec5da7bcf719ac0c37ee5e58f9ea2c1a Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 9 Feb 2016 11:28:52 -0800 Subject: Making some view properties exported. These will be visible in hierarchy viewer Change-Id: I940724a7f61d67b8502d77be203a94875bc92668 --- src/com/android/launcher3/BubbleTextView.java | 5 +++++ src/com/android/launcher3/CellLayout.java | 6 ++++++ src/com/android/launcher3/ClickShadowView.java | 3 +++ src/com/android/launcher3/Folder.java | 10 ++++++++++ src/com/android/launcher3/FolderPagedView.java | 6 ++++++ src/com/android/launcher3/Hotseat.java | 3 +++ src/com/android/launcher3/InsettableFrameLayout.java | 2 ++ src/com/android/launcher3/LauncherAppWidgetHostView.java | 3 +++ src/com/android/launcher3/LauncherRootView.java | 3 +++ src/com/android/launcher3/PageIndicator.java | 2 ++ src/com/android/launcher3/PagedView.java | 4 ++++ src/com/android/launcher3/SearchDropTargetBar.java | 2 ++ src/com/android/launcher3/Workspace.java | 2 ++ 13 files changed, 51 insertions(+) (limited to 'src/com') diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 8842d5cdd..ed1443954 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -36,6 +36,7 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; +import android.view.ViewDebug; import android.view.ViewParent; import android.widget.TextView; @@ -80,10 +81,14 @@ public class BubbleTextView extends TextView private final boolean mCustomShadowsEnabled; private final boolean mLayoutHorizontal; private final int mIconSize; + @ViewDebug.ExportedProperty(category = "launcher") private int mTextColor; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mStayPressed; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mIgnorePressedStateChange; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mDisableRelayout = false; private IconLoadRequest mIconLoadRequest; diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index b09723de5..40cdc8016 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -72,17 +72,23 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { private static final boolean LOGD = false; private Launcher mLauncher; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mCellWidth; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mCellHeight; private int mFixedCellWidth; private int mFixedCellHeight; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mCountX; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mCountY; private int mOriginalWidthGap; private int mOriginalHeightGap; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mWidthGap; + @ViewDebug.ExportedProperty(category = "launcher") @Thunk int mHeightGap; private int mMaxGap; private boolean mDropPending = false; diff --git a/src/com/android/launcher3/ClickShadowView.java b/src/com/android/launcher3/ClickShadowView.java index e31d7f7f6..e2bc6bac5 100644 --- a/src/com/android/launcher3/ClickShadowView.java +++ b/src/com/android/launcher3/ClickShadowView.java @@ -22,6 +22,7 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view.View; +import android.view.ViewDebug; import android.view.ViewGroup; public class ClickShadowView extends View { @@ -32,7 +33,9 @@ public class ClickShadowView extends View { private final Paint mPaint; + @ViewDebug.ExportedProperty(category = "launcher") private final float mShadowOffset; + @ViewDebug.ExportedProperty(category = "launcher") private final float mShadowPadding; private Bitmap mBitmap; diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index 5f080aa41..c42181542 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -42,6 +42,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; +import android.view.ViewDebug; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.animation.AccelerateInterpolator; @@ -135,7 +136,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList // Cell ranks used for drag and drop @Thunk int mTargetRank, mPrevTargetRank, mEmptyCellRank; + @ViewDebug.ExportedProperty(category = "launcher", + mapping = { + @ViewDebug.IntToString(from = STATE_NONE, to = "STATE_NONE"), + @ViewDebug.IntToString(from = STATE_SMALL, to = "STATE_SMALL"), + @ViewDebug.IntToString(from = STATE_ANIMATING, to = "STATE_ANIMATING"), + @ViewDebug.IntToString(from = STATE_OPEN, to = "STATE_OPEN"), + }) @Thunk int mState = STATE_NONE; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mRearrangeOnClose = false; boolean mItemsInvalidated = false; private ShortcutInfo mCurrentDragInfo; @@ -150,6 +159,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList @Thunk float mFolderIconPivotY; private boolean mIsEditingName = false; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mDestroyed; @Thunk Runnable mDeferredAction; diff --git a/src/com/android/launcher3/FolderPagedView.java b/src/com/android/launcher3/FolderPagedView.java index 796f56466..0d1103b8f 100644 --- a/src/com/android/launcher3/FolderPagedView.java +++ b/src/com/android/launcher3/FolderPagedView.java @@ -23,6 +23,7 @@ import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewDebug; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; @@ -69,12 +70,17 @@ public class FolderPagedView extends PagedView { @Thunk final HashMap mPendingAnimations = new HashMap<>(); + @ViewDebug.ExportedProperty(category = "launcher") private final int mMaxCountX; + @ViewDebug.ExportedProperty(category = "launcher") private final int mMaxCountY; + @ViewDebug.ExportedProperty(category = "launcher") private final int mMaxItemsPerPage; private int mAllocatedContentSize; + @ViewDebug.ExportedProperty(category = "launcher") private int mGridCountX; + @ViewDebug.ExportedProperty(category = "launcher") private int mGridCountY; private Folder mFolder; diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 3e838760e..052f7ac90 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -24,6 +24,7 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; +import android.view.ViewDebug; import android.widget.FrameLayout; import android.widget.TextView; @@ -34,8 +35,10 @@ public class Hotseat extends FrameLayout private Launcher mLauncher; + @ViewDebug.ExportedProperty(category = "launcher") private int mAllAppsButtonRank; + @ViewDebug.ExportedProperty(category = "launcher") private final boolean mHasVerticalHotseat; public Hotseat(Context context) { diff --git a/src/com/android/launcher3/InsettableFrameLayout.java b/src/com/android/launcher3/InsettableFrameLayout.java index 7343bf686..f4bfa4549 100644 --- a/src/com/android/launcher3/InsettableFrameLayout.java +++ b/src/com/android/launcher3/InsettableFrameLayout.java @@ -5,12 +5,14 @@ import android.content.res.TypedArray; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; +import android.view.ViewDebug; import android.view.ViewGroup; import android.widget.FrameLayout; public class InsettableFrameLayout extends FrameLayout implements ViewGroup.OnHierarchyChangeListener, Insettable { + @ViewDebug.ExportedProperty(category = "launcher") protected Rect mInsets = new Rect(); public InsettableFrameLayout(Context context, AttributeSet attrs) { diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java index 44cd8743d..96da18373 100644 --- a/src/com/android/launcher3/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java @@ -25,6 +25,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; +import android.view.ViewDebug; import android.view.ViewGroup; import android.widget.RemoteViews; @@ -43,11 +44,13 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc private CheckLongPressHelper mLongPressHelper; private StylusEventHelper mStylusEventHelper; private Context mContext; + @ViewDebug.ExportedProperty(category = "launcher") private int mPreviousOrientation; private DragLayer mDragLayer; private float mSlop; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mChildrenFocused; public LauncherAppWidgetHostView(Context context) { diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java index 55a512fb5..104af5280 100644 --- a/src/com/android/launcher3/LauncherRootView.java +++ b/src/com/android/launcher3/LauncherRootView.java @@ -9,11 +9,14 @@ import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; +import android.view.ViewDebug; public class LauncherRootView extends InsettableFrameLayout { private final Paint mOpaquePaint; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mDrawRightInsetBar; + @ViewDebug.ExportedProperty(category = "launcher") private int mRightInsetBarWidth; private View mAlignedView; diff --git a/src/com/android/launcher3/PageIndicator.java b/src/com/android/launcher3/PageIndicator.java index 62ea03bcc..8adbf8d01 100644 --- a/src/com/android/launcher3/PageIndicator.java +++ b/src/com/android/launcher3/PageIndicator.java @@ -21,6 +21,7 @@ import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.LayoutInflater; +import android.view.ViewDebug; import android.widget.LinearLayout; import java.util.ArrayList; @@ -37,6 +38,7 @@ public class PageIndicator extends LinearLayout { private ArrayList mMarkers = new ArrayList(); + @ViewDebug.ExportedProperty(category = "launcher") private int mActiveMarkerIndex; public static class PageMarkerResources { diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 51c1dbd13..7109895fd 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -42,6 +42,7 @@ import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; +import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewParent; import android.view.accessibility.AccessibilityEvent; @@ -92,10 +93,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc protected boolean mFirstLayout = true; private int mNormalChildHeight; + @ViewDebug.ExportedProperty(category = "launcher") protected int mCurrentPage; protected int mRestorePage = INVALID_RESTORE_PAGE; private int mChildCountOnLastLayout; + @ViewDebug.ExportedProperty(category = "launcher") protected int mNextPage = INVALID_PAGE; private int mMaxScrollX; protected LauncherScroller mScroller; @@ -153,6 +156,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc @Thunk PageIndicator mPageIndicator; // The viewport whether the pages are to be contained (the actual view may be larger than the // viewport) + @ViewDebug.ExportedProperty(category = "launcher") private Rect mViewport = new Rect(); // Reordering diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java index 9bda8b8f8..fed972c3a 100644 --- a/src/com/android/launcher3/SearchDropTargetBar.java +++ b/src/com/android/launcher3/SearchDropTargetBar.java @@ -22,6 +22,7 @@ import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; +import android.view.ViewDebug; import android.view.accessibility.AccessibilityManager; import com.android.launcher3.dragndrop.DragController; @@ -59,6 +60,7 @@ public class SearchDropTargetBar extends BaseDropTargetBar { private LauncherViewPropertyAnimator mQSBSearchBarAnimator; + @ViewDebug.ExportedProperty(category = "launcher") private State mState = State.SEARCH_BAR; @Thunk View mQSB; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index a881aa6d5..71c52345f 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -48,6 +48,7 @@ import android.util.Log; import android.util.SparseArray; import android.view.MotionEvent; import android.view.View; +import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.TextView; @@ -189,6 +190,7 @@ public class Workspace extends PagedView } }; + @ViewDebug.ExportedProperty(category = "launcher") private State mState = State.NORMAL; private boolean mIsSwitchingState = false; -- cgit v1.2.3