Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ab4c729 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Change sharedElementName to viewName."

parents 4cf79657 abb352a9
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1021,7 +1021,6 @@ package android {
    field public static final int shadowRadius = 16843108; // 0x1010164
    field public static final int shape = 16843162; // 0x101019a
    field public static final int shareInterpolator = 16843195; // 0x10101bb
    field public static final int sharedElementName = 16843803; // 0x101041b
    field public static final int sharedUserId = 16842763; // 0x101000b
    field public static final int sharedUserLabel = 16843361; // 0x1010261
    field public static final int shouldDisableView = 16843246; // 0x10101ee
@@ -1266,6 +1265,7 @@ package android {
    field public static final int verticalGap = 16843328; // 0x1010240
    field public static final int verticalScrollbarPosition = 16843572; // 0x1010334
    field public static final int verticalSpacing = 16843029; // 0x1010115
    field public static final int viewName = 16843803; // 0x101041b
    field public static final int viewportHeight = 16843806; // 0x101041e
    field public static final int viewportWidth = 16843805; // 0x101041d
    field public static final int visibility = 16842972; // 0x10100dc
@@ -1627,7 +1627,7 @@ package android {
    field public static final int l_resource_pad8 = 16908345; // 0x1020039
    field public static final int l_resource_pad9 = 16908344; // 0x1020038
    field public static final int list = 16908298; // 0x102000a
    field public static final int mask = 16908354; // 0x1020042
    field public static final int mask = 16908353; // 0x1020041
    field public static final int message = 16908299; // 0x102000b
    field public static final int paste = 16908322; // 0x1020022
    field public static final int primary = 16908300; // 0x102000c
@@ -1636,8 +1636,7 @@ package android {
    field public static final int selectAll = 16908319; // 0x102001f
    field public static final int selectTextMode = 16908333; // 0x102002d
    field public static final int selectedIcon = 16908302; // 0x102000e
    field public static final int shared_element = 16908355; // 0x1020043
    field public static final int shared_element_name = 16908353; // 0x1020041
    field public static final int shared_element = 16908354; // 0x1020042
    field public static final int startSelectingText = 16908328; // 0x1020028
    field public static final int stopSelectingText = 16908329; // 0x1020029
    field public static final int summary = 16908304; // 0x1020010
@@ -31311,7 +31310,6 @@ package android.view {
    method public int getScrollBarStyle();
    method public final int getScrollX();
    method public final int getScrollY();
    method public java.lang.String getSharedElementName();
    method public int getSolidColor();
    method public android.animation.StateListAnimator getStateListAnimator();
    method protected int getSuggestedMinimumHeight();
@@ -31332,6 +31330,7 @@ package android.view {
    method public int getVerticalFadingEdgeLength();
    method public int getVerticalScrollbarPosition();
    method public int getVerticalScrollbarWidth();
    method public java.lang.String getViewName();
    method public android.view.ViewTreeObserver getViewTreeObserver();
    method public int getVisibility();
    method public final int getWidth();
@@ -31576,7 +31575,6 @@ package android.view {
    method public void setScrollY(int);
    method public void setScrollbarFadingEnabled(boolean);
    method public void setSelected(boolean);
    method public void setSharedElementName(java.lang.String);
    method public void setSoundEffectsEnabled(boolean);
    method public void setStateListAnimator(android.animation.StateListAnimator);
    method public void setSystemUiVisibility(int);
@@ -31592,6 +31590,7 @@ package android.view {
    method public void setVerticalFadingEdgeEnabled(boolean);
    method public void setVerticalScrollBarEnabled(boolean);
    method public void setVerticalScrollbarPosition(int);
    method public final void setViewName(java.lang.String);
    method public void setVisibility(int);
    method public void setWillNotCacheDrawing(boolean);
    method public void setWillNotDraw(boolean);
+3 −3
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
            if (getViewsTransition() != null) {
                setViewVisibility(mEnteringViews, View.VISIBLE);
            }
            getDecor().findSharedElements(map);
            getDecor().findNamedViews(map);
            if (getViewsTransition() != null) {
                setViewVisibility(mEnteringViews, View.INVISIBLE);
            }
@@ -712,7 +712,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {

        sharedElementBundle.putFloat(KEY_TRANSLATION_Z, view.getTranslationZ());

        sharedElementBundle.putString(KEY_NAME, view.getSharedElementName());
        sharedElementBundle.putString(KEY_NAME, view.getViewName());

        Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
@@ -882,7 +882,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
                imageView.setId(com.android.internal.R.id.shared_element);
                imageView.setScaleType(ImageView.ScaleType.CENTER);
                imageView.setImageBitmap(bitmap);
                imageView.setSharedElementName(name);
                imageView.setViewName(name);
                setSharedElementState(imageView, name, state, parentLoc);
                if (mTargetSharedNames.contains(name)) {
                    accepted.add(imageView);
+23 −27
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 * @attr ref android.R.styleable#View_scrollbarAlwaysDrawHorizontalTrack
 * @attr ref android.R.styleable#View_scrollbarAlwaysDrawVerticalTrack
 * @attr ref android.R.styleable#View_stateListAnimator
 * @attr ref android.R.styleable#View_sharedElementName
 * @attr ref android.R.styleable#View_viewName
 * @attr ref android.R.styleable#View_soundEffectsEnabled
 * @attr ref android.R.styleable#View_tag
 * @attr ref android.R.styleable#View_textAlignment
@@ -3185,6 +3185,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    private int mBackgroundResource;
    private boolean mBackgroundSizeChanged;
    private String mViewName;
    static class ListenerInfo {
        /**
         * Listener used to dispatch focus change events.
@@ -3997,8 +3999,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                case R.styleable.View_accessibilityLiveRegion:
                    setAccessibilityLiveRegion(a.getInt(attr, ACCESSIBILITY_LIVE_REGION_DEFAULT));
                    break;
                case R.styleable.View_sharedElementName:
                    setSharedElementName(a.getString(attr));
                case R.styleable.View_viewName:
                    setViewName(a.getString(attr));
                    break;
                case R.styleable.View_nestedScrollingEnabled:
                    setNestedScrollingEnabled(a.getBoolean(attr, false));
@@ -18839,15 +18841,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Adds all Views that have {@link #getSharedElementName()} non-null to sharedElements.
     * @param sharedElements Will contain all Views in the hierarchy having a shared element name.
     * Adds all Views that have {@link #getViewName()} non-null to namedElements.
     * @param namedElements Will contain all Views in the hierarchy having a view name.
     * @hide
     */
    public void findSharedElements(Map<String, View> sharedElements) {
    public void findNamedViews(Map<String, View> namedElements) {
        if (getVisibility() == VISIBLE) {
            String sharedElementName = getSharedElementName();
            if (sharedElementName != null) {
                sharedElements.put(sharedElementName, this);
            String viewName = getViewName();
            if (viewName != null) {
                namedElements.put(viewName, this);
            }
        }
    }
@@ -19247,32 +19249,26 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Specifies that the shared name of the View to be shared with another Activity.
     * When transitioning between Activities, the name links a UI element in the starting
     * Activity to UI element in the called Activity. Names should be unique in the
     * View hierarchy.
     * Sets the name of the View to be used to identify Views in Transitions.
     * Names should be unique in the View hierarchy.
     *
     * @param sharedElementName The cross-Activity View identifier. The called Activity will use
     *                 the name to match the location with a View in its layout.
     * @see android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle)
     * @param viewName The name of the View to uniquely identify it for Transitions.
     */
    public void setSharedElementName(String sharedElementName) {
        setTagInternal(com.android.internal.R.id.shared_element_name, sharedElementName);
    public final void setViewName(String viewName) {
        mViewName = viewName;
    }
    /**
     * Returns the shared name of the View to be shared with another Activity.
     * When transitioning between Activities, the name links a UI element in the starting
     * Activity to UI element in the called Activity. Names should be unique in the
     * View hierarchy.
     * Returns the name of the View to be used to identify Views in Transitions.
     * Names should be unique in the View hierarchy.
     *
     * <p>This returns null if the View is not a shared element or the name if it is.</p>
     * <p>This returns null if the View has not been given a name.</p>
     *
     * @return The name used for this View for cross-Activity transitions or null if
     * this View has not been identified as shared.
     * @return The name used of the View to be used to identify Views in Transitions or null
     * if no name has been given.
     */
    public String getSharedElementName() {
        return (String) getTag(com.android.internal.R.id.shared_element_name);
    public String getViewName() {
        return mViewName;
    }
    /**
+5 −5
Original line number Diff line number Diff line
@@ -2301,13 +2301,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * individually during the transition.
     * @return True if the ViewGroup should be acted on together during an Activity transition.
     * The default value is false when the background is null and true when the background
     * is not null or if {@link #getSharedElementName()} is not null.
     * is not null or if {@link #getViewName()} is not null.
     */
    public boolean isTransitionGroup() {
        if ((mGroupFlags & FLAG_IS_TRANSITION_GROUP_SET) != 0) {
            return ((mGroupFlags & FLAG_IS_TRANSITION_GROUP) != 0);
        } else {
            return getBackground() != null || getSharedElementName() != null;
            return getBackground() != null || getViewName() != null;
        }
    }

@@ -5956,15 +5956,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager

    /** @hide */
    @Override
    public void findSharedElements(Map<String, View> sharedElements) {
    public void findNamedViews(Map<String, View> namedElements) {
        if (getVisibility() != VISIBLE) {
            return;
        }
        super.findSharedElements(sharedElements);
        super.findNamedViews(namedElements);
        int count = getChildCount();
        for (int i = 0; i < count; i++) {
            View child = getChildAt(i);
            child.findSharedElements(sharedElements);
            child.findNamedViews(namedElements);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ the Action Bar enabled overlaying application content.
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        style="?android:attr/actionBarStyle"
        android:sharedElementName="android:action_bar"
        android:viewName="android:action_bar"
        android:gravity="top">
        <com.android.internal.widget.ActionBarView
            android:id="@+id/action_bar"
Loading