Merge "Revert "Allow MediaBrowser be connect to MediaBrowserServiceCompat"" into mnc-ub-dev
diff --git a/apicheck.mk b/apicheck.mk
index 1638607..739cfb3 100644
--- a/apicheck.mk
+++ b/apicheck.mk
@@ -20,6 +20,7 @@
# $(support_module_java_libraries) - dependent libraries
# $(support_module_java_packages) - list of package names containing public classes
# $(support_module_src_files) - list of source files
+# $(support_module_aidl_includes) - list of aidl files
# $(api_check_current_msg_file) - file containing error message for current API check
# $(api_check_last_msg_file) - file containing error message for last SDK API check
# ---------------------------------------------
@@ -39,6 +40,7 @@
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(support_module_src_files)
+LOCAL_AIDL_INCLUDES := $(support_module_aidl_includes)
LOCAL_JAVA_LIBRARIES := $(support_module_java_libraries)
LOCAL_ADDITIONAL_JAVA_DIR := \
$(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(support_module),,COMMON)/src
@@ -117,6 +119,7 @@
support_module :=
support_module_api_dir :=
support_module_src_files :=
+support_module_aidl_includes :=
support_module_java_libraries :=
support_module_java_packages :=
support_module_api_file :=
diff --git a/design/Android.mk b/design/Android.mk
index f2fc797..6f4ac3b 100644
--- a/design/Android.mk
+++ b/design/Android.mk
@@ -32,6 +32,8 @@
LOCAL_JAR_EXCLUDE_FILES := none
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+
# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
# implementations
include $(CLEAR_VARS)
@@ -44,6 +46,8 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of Eclair MR1 APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-design-eclair-mr1
@@ -56,6 +60,8 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of Honeycomb APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-design-honeycomb
@@ -68,6 +74,8 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of Honeycomb MR1 APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-design-honeycomb-mr1
@@ -80,11 +88,13 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
-# A helper sub-library that makes direct use of Lollipop APIs
+support_module_src_files += $(LOCAL_SRC_FILES)
+
+# A helper sub-library that makes direct use of ICS APIs
include $(CLEAR_VARS)
-LOCAL_MODULE := android-support-design-lollipop
-LOCAL_SDK_VERSION := 21
-LOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
+LOCAL_MODULE := android-support-design-ics
+LOCAL_SDK_VERSION := 14
+LOCAL_SRC_FILES := $(call all-java-files-under, ics)
LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
LOCAL_JAVA_LIBRARIES := android-support-design-res \
android-support-v4 \
@@ -92,6 +102,22 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
+# A helper sub-library that makes direct use of Lollipop APIs
+include $(CLEAR_VARS)
+LOCAL_MODULE := android-support-design-lollipop
+LOCAL_SDK_VERSION := 21
+LOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-ics
+LOCAL_JAVA_LIBRARIES := android-support-design-res \
+ android-support-v4 \
+ android-support-v7-appcompat \
+ android-support-v7-recyclerview
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# Here is the final static library that apps can link against.
# The R class is automatically excluded from the generated library.
# Applications that use this library must specify LOCAL_RESOURCE_DIR
@@ -107,11 +133,12 @@
android-support-v7-recyclerview
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# API Check
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
-support_module_src_files := $(LOCAL_SRC_FILES)
support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
support_module_java_packages := android.support.design.*
include $(SUPPORT_API_CHECK)
diff --git a/design/api/current.txt b/design/api/current.txt
index 167faa6..9201897 100644
--- a/design/api/current.txt
+++ b/design/api/current.txt
@@ -98,6 +98,10 @@
method public android.graphics.Typeface getCollapsedTitleTypeface();
method public android.graphics.drawable.Drawable getContentScrim();
method public int getExpandedTitleGravity();
+ method public int getExpandedTitleMarginBottom();
+ method public int getExpandedTitleMarginEnd();
+ method public int getExpandedTitleMarginStart();
+ method public int getExpandedTitleMarginTop();
method public android.graphics.Typeface getExpandedTitleTypeface();
method public android.graphics.drawable.Drawable getStatusBarScrim();
method public java.lang.CharSequence getTitle();
@@ -111,6 +115,11 @@
method public void setContentScrimResource(int);
method public void setExpandedTitleColor(int);
method public void setExpandedTitleGravity(int);
+ method public void setExpandedTitleMargin(int, int, int, int);
+ method public void setExpandedTitleMarginBottom(int);
+ method public void setExpandedTitleMarginEnd(int);
+ method public void setExpandedTitleMarginStart(int);
+ method public void setExpandedTitleMarginTop(int);
method public void setExpandedTitleTextAppearance(int);
method public void setExpandedTitleTypeface(android.graphics.Typeface);
method public void setScrimsShown(boolean);
@@ -209,7 +218,7 @@
field public static final android.os.Parcelable.Creator<android.support.design.widget.CoordinatorLayout.SavedState> CREATOR;
}
- public class FloatingActionButton extends android.widget.ImageButton {
+ public class FloatingActionButton extends android.support.design.widget.VisibilityAwareImageButton {
ctor public FloatingActionButton(android.content.Context);
ctor public FloatingActionButton(android.content.Context, android.util.AttributeSet);
ctor public FloatingActionButton(android.content.Context, android.util.AttributeSet, int);
@@ -249,6 +258,8 @@
ctor public NavigationView(android.content.Context, android.util.AttributeSet);
ctor public NavigationView(android.content.Context, android.util.AttributeSet, int);
method public void addHeaderView(android.view.View);
+ method public int getHeaderCount();
+ method public android.view.View getHeaderView(int);
method public android.graphics.drawable.Drawable getItemBackground();
method public android.content.res.ColorStateList getItemIconTintList();
method public android.content.res.ColorStateList getItemTextColor();
@@ -311,6 +322,7 @@
public class SwipeDismissBehavior extends android.support.design.widget.CoordinatorLayout.Behavior {
ctor public SwipeDismissBehavior();
+ method public boolean canSwipeDismissView(android.view.View);
method public int getDragState();
method public void setDragDismissDistance(float);
method public void setEndAlphaSwipeDistance(float);
@@ -436,5 +448,11 @@
method public boolean setTopAndBottomOffset(int);
}
+ class VisibilityAwareImageButton extends android.support.v7.widget.AppCompatImageButton {
+ ctor public VisibilityAwareImageButton(android.content.Context);
+ ctor public VisibilityAwareImageButton(android.content.Context, android.util.AttributeSet);
+ ctor public VisibilityAwareImageButton(android.content.Context, android.util.AttributeSet, int);
+ }
+
}
diff --git a/design/base/android/support/design/widget/FloatingActionButtonImpl.java b/design/base/android/support/design/widget/FloatingActionButtonImpl.java
index b61bf15..8c9e0ab 100644
--- a/design/base/android/support/design/widget/FloatingActionButtonImpl.java
+++ b/design/base/android/support/design/widget/FloatingActionButtonImpl.java
@@ -18,11 +18,12 @@
import android.content.res.ColorStateList;
import android.content.res.Resources;
+import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable;
import android.support.annotation.Nullable;
import android.support.design.R;
-import android.view.View;
import android.view.ViewTreeObserver;
abstract class FloatingActionButtonImpl {
@@ -40,17 +41,18 @@
android.R.attr.state_enabled};
static final int[] EMPTY_STATE_SET = new int[0];
- final View mView;
+ final VisibilityAwareImageButton mView;
final ShadowViewDelegate mShadowViewDelegate;
private ViewTreeObserver.OnPreDrawListener mPreDrawListener;
- FloatingActionButtonImpl(View view, ShadowViewDelegate shadowViewDelegate) {
+ FloatingActionButtonImpl(VisibilityAwareImageButton view,
+ ShadowViewDelegate shadowViewDelegate) {
mView = view;
mShadowViewDelegate = shadowViewDelegate;
}
- abstract void setBackgroundDrawable(Drawable originalBackground, ColorStateList backgroundTint,
+ abstract void setBackgroundDrawable(ColorStateList backgroundTint,
PorterDuff.Mode backgroundTintMode, int rippleColor, int borderWidth);
abstract void setBackgroundTintList(ColorStateList tint);
@@ -67,9 +69,9 @@
abstract void jumpDrawableToCurrentState();
- abstract void hide(@Nullable InternalVisibilityChangedListener listener);
+ abstract void hide(@Nullable InternalVisibilityChangedListener listener, boolean fromUser);
- abstract void show(@Nullable InternalVisibilityChangedListener listener);
+ abstract void show(@Nullable InternalVisibilityChangedListener listener, boolean fromUser);
void onAttachedToWindow() {
if (requirePreDrawListener()) {
@@ -120,4 +122,11 @@
};
}
}
+
+ GradientDrawable createShapeDrawable() {
+ GradientDrawable d = new GradientDrawable();
+ d.setShape(GradientDrawable.OVAL);
+ d.setColor(Color.WHITE);
+ return d;
+ }
}
diff --git a/design/base/android/support/design/widget/VisibilityAwareImageButton.java b/design/base/android/support/design/widget/VisibilityAwareImageButton.java
new file mode 100644
index 0000000..15bf685
--- /dev/null
+++ b/design/base/android/support/design/widget/VisibilityAwareImageButton.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.support.design.widget;
+
+import android.content.Context;
+import android.support.v7.widget.AppCompatImageButton;
+import android.util.AttributeSet;
+
+class VisibilityAwareImageButton extends AppCompatImageButton {
+
+ private int mUserSetVisibility;
+
+ public VisibilityAwareImageButton(Context context) {
+ this(context, null);
+ }
+
+ public VisibilityAwareImageButton(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public VisibilityAwareImageButton(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mUserSetVisibility = getVisibility();
+ }
+
+ @Override
+ public void setVisibility(int visibility) {
+ internalSetVisibility(visibility, true);
+ }
+
+ final void internalSetVisibility(int visibility, boolean fromUser) {
+ super.setVisibility(visibility);
+ if (fromUser) {
+ mUserSetVisibility = visibility;
+ }
+ }
+
+ final int getUserSetVisibility() {
+ return mUserSetVisibility;
+ }
+}
diff --git a/design/build.gradle b/design/build.gradle
index af46827..401ec8e 100644
--- a/design/build.gradle
+++ b/design/build.gradle
@@ -13,7 +13,7 @@
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
- main.java.srcDirs = ['base', 'eclair-mr1', 'honeycomb', 'honeycomb-mr1', 'lollipop', 'src']
+ main.java.srcDirs = ['base', 'eclair-mr1', 'honeycomb', 'honeycomb-mr1', 'ics', 'lollipop', 'src']
main.res.srcDirs 'res', 'res-public'
main.assets.srcDir 'assets'
main.resources.srcDir 'src'
diff --git a/design/eclair-mr1/android/support/design/widget/FloatingActionButtonEclairMr1.java b/design/eclair-mr1/android/support/design/widget/FloatingActionButtonEclairMr1.java
index 42e2e9d..577682f 100644
--- a/design/eclair-mr1/android/support/design/widget/FloatingActionButtonEclairMr1.java
+++ b/design/eclair-mr1/android/support/design/widget/FloatingActionButtonEclairMr1.java
@@ -48,7 +48,8 @@
private boolean mIsHiding;
- FloatingActionButtonEclairMr1(View view, ShadowViewDelegate shadowViewDelegate) {
+ FloatingActionButtonEclairMr1(VisibilityAwareImageButton view,
+ ShadowViewDelegate shadowViewDelegate) {
super(view, shadowViewDelegate);
mAnimationDuration = view.getResources().getInteger(android.R.integer.config_shortAnimTime);
@@ -67,22 +68,18 @@
}
@Override
- void setBackgroundDrawable(Drawable originalBackground, ColorStateList backgroundTint,
+ void setBackgroundDrawable(ColorStateList backgroundTint,
PorterDuff.Mode backgroundTintMode, int rippleColor, int borderWidth) {
// Now we need to tint the original background with the tint, using
// an InsetDrawable if we have a border width
- mShapeDrawable = DrawableCompat.wrap(mutateDrawable(originalBackground));
+ mShapeDrawable = DrawableCompat.wrap(createShapeDrawable());
DrawableCompat.setTintList(mShapeDrawable, backgroundTint);
if (backgroundTintMode != null) {
DrawableCompat.setTintMode(mShapeDrawable, backgroundTintMode);
}
// Now we created a mask Drawable which will be used for touch feedback.
- // As we don't know the actual outline of mShapeDrawable, we'll just guess that it's a
- // circle
- GradientDrawable touchFeedbackShape = new GradientDrawable();
- touchFeedbackShape.setShape(GradientDrawable.OVAL);
- touchFeedbackShape.setColor(Color.WHITE);
+ GradientDrawable touchFeedbackShape = createShapeDrawable();
// We'll now wrap that touch feedback mask drawable with a ColorStateList. We do not need
// to inset for any border here as LayerDrawable will nest the padding for us
@@ -112,15 +109,6 @@
updatePadding();
}
- private static Drawable mutateDrawable(Drawable drawable) {
- if (Build.VERSION.SDK_INT < 14 && drawable instanceof GradientDrawable) {
- // GradientDrawable pre-ICS does not copy over it's color when mutated. We just skip
- // the mutate and hope for the best.
- return drawable;
- }
- return drawable.mutate();
- }
-
@Override
void setBackgroundTintList(ColorStateList tint) {
DrawableCompat.setTintList(mShapeDrawable, tint);
@@ -168,7 +156,7 @@
}
@Override
- void hide(@Nullable final InternalVisibilityChangedListener listener) {
+ void hide(@Nullable final InternalVisibilityChangedListener listener, final boolean fromUser) {
if (mIsHiding || mView.getVisibility() != View.VISIBLE) {
// A hide animation is in progress, or we're already hidden. Skip the call
if (listener != null) {
@@ -190,7 +178,7 @@
@Override
public void onAnimationEnd(Animation animation) {
mIsHiding = false;
- mView.setVisibility(View.GONE);
+ mView.internalSetVisibility(View.GONE, fromUser);
if (listener != null) {
listener.onHidden();
}
@@ -200,12 +188,12 @@
}
@Override
- void show(@Nullable final InternalVisibilityChangedListener listener) {
+ void show(@Nullable final InternalVisibilityChangedListener listener, final boolean fromUser) {
if (mView.getVisibility() != View.VISIBLE || mIsHiding) {
// If the view is not visible, or is visible and currently being hidden, run
// the show animation
mView.clearAnimation();
- mView.setVisibility(View.VISIBLE);
+ mView.internalSetVisibility(View.VISIBLE, fromUser);
Animation anim = android.view.animation.AnimationUtils.loadAnimation(
mView.getContext(), R.anim.design_fab_in);
anim.setDuration(SHOW_HIDE_ANIM_DURATION);
diff --git a/design/honeycomb-mr1/android/support/design/widget/FloatingActionButtonHoneycombMr1.java b/design/ics/android/support/design/widget/FloatingActionButtonIcs.java
similarity index 74%
rename from design/honeycomb-mr1/android/support/design/widget/FloatingActionButtonHoneycombMr1.java
rename to design/ics/android/support/design/widget/FloatingActionButtonIcs.java
index 4749d59..4c256bc 100644
--- a/design/honeycomb-mr1/android/support/design/widget/FloatingActionButtonHoneycombMr1.java
+++ b/design/ics/android/support/design/widget/FloatingActionButtonIcs.java
@@ -22,11 +22,12 @@
import android.support.v4.view.ViewCompat;
import android.view.View;
-class FloatingActionButtonHoneycombMr1 extends FloatingActionButtonEclairMr1 {
+class FloatingActionButtonIcs extends FloatingActionButtonEclairMr1 {
private boolean mIsHiding;
- FloatingActionButtonHoneycombMr1(View view, ShadowViewDelegate shadowViewDelegate) {
+ FloatingActionButtonIcs(VisibilityAwareImageButton view,
+ ShadowViewDelegate shadowViewDelegate) {
super(view, shadowViewDelegate);
}
@@ -41,7 +42,7 @@
}
@Override
- void hide(@Nullable final InternalVisibilityChangedListener listener) {
+ void hide(@Nullable final InternalVisibilityChangedListener listener, final boolean fromUser) {
if (mIsHiding || mView.getVisibility() != View.VISIBLE) {
// A hide animation is in progress, or we're already hidden. Skip the call
if (listener != null) {
@@ -52,11 +53,12 @@
if (!ViewCompat.isLaidOut(mView) || mView.isInEditMode()) {
// If the view isn't laid out, or we're in the editor, don't run the animation
- mView.setVisibility(View.GONE);
+ mView.internalSetVisibility(View.GONE, fromUser);
if (listener != null) {
listener.onHidden();
}
} else {
+ mView.animate().cancel();
mView.animate()
.scaleX(0f)
.scaleY(0f)
@@ -64,23 +66,29 @@
.setDuration(SHOW_HIDE_ANIM_DURATION)
.setInterpolator(AnimationUtils.FAST_OUT_LINEAR_IN_INTERPOLATOR)
.setListener(new AnimatorListenerAdapter() {
+ private boolean mCancelled;
+
@Override
public void onAnimationStart(Animator animation) {
mIsHiding = true;
- mView.setVisibility(View.VISIBLE);
+ mCancelled = false;
+ mView.internalSetVisibility(View.VISIBLE, fromUser);
}
@Override
public void onAnimationCancel(Animator animation) {
mIsHiding = false;
+ mCancelled = true;
}
@Override
public void onAnimationEnd(Animator animation) {
mIsHiding = false;
- mView.setVisibility(View.GONE);
- if (listener != null) {
- listener.onHidden();
+ if (!mCancelled) {
+ mView.internalSetVisibility(View.GONE, fromUser);
+ if (listener != null) {
+ listener.onHidden();
+ }
}
}
});
@@ -88,12 +96,16 @@
}
@Override
- void show(@Nullable final InternalVisibilityChangedListener listener) {
- if (mView.getVisibility() != View.VISIBLE) {
+ void show(@Nullable final InternalVisibilityChangedListener listener, final boolean fromUser) {
+ if (mIsHiding || mView.getVisibility() != View.VISIBLE) {
if (ViewCompat.isLaidOut(mView) && !mView.isInEditMode()) {
- mView.setAlpha(0f);
- mView.setScaleY(0f);
- mView.setScaleX(0f);
+ mView.animate().cancel();
+ if (mView.getVisibility() != View.VISIBLE) {
+ // If the view isn't visible currently, we'll animate it from a single pixel
+ mView.setAlpha(0f);
+ mView.setScaleY(0f);
+ mView.setScaleX(0f);
+ }
mView.animate()
.scaleX(1f)
.scaleY(1f)
@@ -103,7 +115,7 @@
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- mView.setVisibility(View.VISIBLE);
+ mView.internalSetVisibility(View.VISIBLE, fromUser);
}
@Override
@@ -114,7 +126,7 @@
}
});
} else {
- mView.setVisibility(View.VISIBLE);
+ mView.internalSetVisibility(View.VISIBLE, fromUser);
mView.setAlpha(1f);
mView.setScaleY(1f);
mView.setScaleX(1f);
diff --git a/design/lollipop/android/support/design/widget/FloatingActionButtonLollipop.java b/design/lollipop/android/support/design/widget/FloatingActionButtonLollipop.java
index 7dc2df0..e68102d 100644
--- a/design/lollipop/android/support/design/widget/FloatingActionButtonLollipop.java
+++ b/design/lollipop/android/support/design/widget/FloatingActionButtonLollipop.java
@@ -28,16 +28,16 @@
import android.os.Build;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.view.ViewCompat;
-import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
-class FloatingActionButtonLollipop extends FloatingActionButtonHoneycombMr1 {
+class FloatingActionButtonLollipop extends FloatingActionButtonIcs {
private Interpolator mInterpolator;
- FloatingActionButtonLollipop(View view, ShadowViewDelegate shadowViewDelegate) {
+ FloatingActionButtonLollipop(VisibilityAwareImageButton view,
+ ShadowViewDelegate shadowViewDelegate) {
super(view, shadowViewDelegate);
if (!view.isInEditMode()) {
@@ -47,10 +47,10 @@
}
@Override
- void setBackgroundDrawable(Drawable originalBackground, ColorStateList backgroundTint,
+ void setBackgroundDrawable(ColorStateList backgroundTint,
PorterDuff.Mode backgroundTintMode, int rippleColor, int borderWidth) {
- // Now we need to tint the original background with the tint
- mShapeDrawable = DrawableCompat.wrap(originalBackground.mutate());
+ // Now we need to tint the shape background with the tint
+ mShapeDrawable = DrawableCompat.wrap(createShapeDrawable());
DrawableCompat.setTintList(mShapeDrawable, backgroundTint);
if (backgroundTintMode != null) {
DrawableCompat.setTintMode(mShapeDrawable, backgroundTintMode);
diff --git a/design/res/layout/design_navigation_item.xml b/design/res/layout/design_navigation_item.xml
index 3a6a90c..ccd42de 100644
--- a/design/res/layout/design_navigation_item.xml
+++ b/design/res/layout/design_navigation_item.xml
@@ -20,4 +20,5 @@
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingRight="?attr/listPreferredItemPaddingRight"
- android:foreground="?attr/selectableItemBackground"/>
+ android:foreground="?attr/selectableItemBackground"
+ android:focusable="true"/>
diff --git a/design/res/values/attrs.xml b/design/res/values/attrs.xml
index dd8e64f..0179ec7 100644
--- a/design/res/values/attrs.xml
+++ b/design/res/values/attrs.xml
@@ -18,7 +18,6 @@
<declare-styleable name="FloatingActionButton">
<!-- Background for the FloatingActionButton -->
- <attr name="android:background"/>
<attr name="backgroundTint"/>
<attr name="backgroundTintMode"/>
diff --git a/design/src/android/support/design/internal/NavigationMenuPresenter.java b/design/src/android/support/design/internal/NavigationMenuPresenter.java
index f238bcb..766b8b4 100644
--- a/design/src/android/support/design/internal/NavigationMenuPresenter.java
+++ b/design/src/android/support/design/internal/NavigationMenuPresenter.java
@@ -205,6 +205,14 @@
}
}
+ public int getHeaderCount() {
+ return mHeaderLayout.getChildCount();
+ }
+
+ public View getHeaderView(int index) {
+ return mHeaderLayout.getChildAt(index);
+ }
+
@Nullable
public ColorStateList getItemTintList() {
return mIconTintList;
diff --git a/design/src/android/support/design/widget/AppBarLayout.java b/design/src/android/support/design/widget/AppBarLayout.java
index f0cfe34..4b910ba 100644
--- a/design/src/android/support/design/widget/AppBarLayout.java
+++ b/design/src/android/support/design/widget/AppBarLayout.java
@@ -646,6 +646,7 @@
* scroll handling with offsetting.
*/
public static class Behavior extends HeaderBehavior<AppBarLayout> {
+ private static final int ANIMATE_OFFSET_DIPS_PER_SECOND = 300;
private static final int INVALID_POSITION = -1;
/**
@@ -803,7 +804,15 @@
}
private void animateOffsetTo(final CoordinatorLayout coordinatorLayout,
- final AppBarLayout child, int offset) {
+ final AppBarLayout child, final int offset) {
+ final int currentOffset = getTopBottomOffsetForScrollingSibling();
+ if (currentOffset == offset) {
+ if (mAnimator != null && mAnimator.isRunning()) {
+ mAnimator.cancel();
+ }
+ return;
+ }
+
if (mAnimator == null) {
mAnimator = ViewUtils.createAnimator();
mAnimator.setInterpolator(AnimationUtils.DECELERATE_INTERPOLATOR);
@@ -818,7 +827,12 @@
mAnimator.cancel();
}
- mAnimator.setIntValues(getTopBottomOffsetForScrollingSibling(), offset);
+ // Set the duration based on the amount of dips we're travelling in
+ final float distanceDp = Math.abs(currentOffset - offset) /
+ coordinatorLayout.getResources().getDisplayMetrics().density;
+ mAnimator.setDuration(Math.round(distanceDp * 1000 / ANIMATE_OFFSET_DIPS_PER_SECOND));
+
+ mAnimator.setIntValues(currentOffset, offset);
mAnimator.start();
}
@@ -839,10 +853,19 @@
final LayoutParams lp = (LayoutParams) offsetChild.getLayoutParams();
if ((lp.getScrollFlags() & LayoutParams.FLAG_SNAP) == LayoutParams.FLAG_SNAP) {
// We're set the snap, so animate the offset to the nearest edge
- final int childTop = -offsetChild.getTop();
- final int childBottom = -offsetChild.getBottom();
+ int childTop = -offsetChild.getTop();
+ int childBottom = -offsetChild.getBottom();
+
+ // If the view is set only exit until it is collapsed, we'll abide by that
+ if ((lp.getScrollFlags() & LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED)
+ == LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED) {
+ childBottom += ViewCompat.getMinimumHeight(offsetChild);
+ }
+
+ final int newOffset = offset < (childBottom + childTop) / 2
+ ? childBottom : childTop;
animateOffsetTo(coordinatorLayout, abl,
- offset < (childBottom + childTop) / 2 ? childBottom : childTop);
+ MathUtils.constrain(newOffset, -abl.getTotalScrollRange(), 0));
}
}
}
diff --git a/design/src/android/support/design/widget/CollapsingToolbarLayout.java b/design/src/android/support/design/widget/CollapsingToolbarLayout.java
index af53b7b..7a77743 100644
--- a/design/src/android/support/design/widget/CollapsingToolbarLayout.java
+++ b/design/src/android/support/design/widget/CollapsingToolbarLayout.java
@@ -96,9 +96,9 @@
private Toolbar mToolbar;
private View mDummyView;
- private int mExpandedMarginLeft;
+ private int mExpandedMarginStart;
private int mExpandedMarginTop;
- private int mExpandedMarginRight;
+ private int mExpandedMarginEnd;
private int mExpandedMarginBottom;
private final Rect mTmpRect = new Rect();
@@ -145,28 +145,16 @@
a.getInt(R.styleable.CollapsingToolbarLayout_collapsedTitleGravity,
GravityCompat.START | Gravity.CENTER_VERTICAL));
- mExpandedMarginLeft = mExpandedMarginTop = mExpandedMarginRight = mExpandedMarginBottom =
+ mExpandedMarginStart = mExpandedMarginTop = mExpandedMarginEnd = mExpandedMarginBottom =
a.getDimensionPixelSize(R.styleable.CollapsingToolbarLayout_expandedTitleMargin, 0);
- final boolean isRtl = ViewCompat.getLayoutDirection(this)
- == ViewCompat.LAYOUT_DIRECTION_RTL;
if (a.hasValue(R.styleable.CollapsingToolbarLayout_expandedTitleMarginStart)) {
- final int marginStart = a.getDimensionPixelSize(
+ mExpandedMarginStart = a.getDimensionPixelSize(
R.styleable.CollapsingToolbarLayout_expandedTitleMarginStart, 0);
- if (isRtl) {
- mExpandedMarginRight = marginStart;
- } else {
- mExpandedMarginLeft = marginStart;
- }
}
if (a.hasValue(R.styleable.CollapsingToolbarLayout_expandedTitleMarginEnd)) {
- final int marginEnd = a.getDimensionPixelSize(
+ mExpandedMarginEnd = a.getDimensionPixelSize(
R.styleable.CollapsingToolbarLayout_expandedTitleMarginEnd, 0);
- if (isRtl) {
- mExpandedMarginLeft = marginEnd;
- } else {
- mExpandedMarginRight = marginEnd;
- }
}
if (a.hasValue(R.styleable.CollapsingToolbarLayout_expandedTitleMarginTop)) {
mExpandedMarginTop = a.getDimensionPixelSize(
@@ -197,7 +185,6 @@
mCollapsingTextHelper.setCollapsedTextAppearance(
a.getResourceId(
R.styleable.CollapsingToolbarLayout_collapsedTitleTextAppearance, 0));
-
}
setContentScrim(a.getDrawable(R.styleable.CollapsingToolbarLayout_contentScrim));
@@ -376,11 +363,14 @@
ViewGroupUtils.getDescendantRect(this, mDummyView, mTmpRect);
mCollapsingTextHelper.setCollapsedBounds(mTmpRect.left, bottom - mTmpRect.height(),
mTmpRect.right, bottom);
+
+ final boolean isRtl = ViewCompat.getLayoutDirection(this)
+ == ViewCompat.LAYOUT_DIRECTION_RTL;
// Update the expanded bounds
mCollapsingTextHelper.setExpandedBounds(
- mExpandedMarginLeft,
+ isRtl ? mExpandedMarginEnd : mExpandedMarginStart,
mTmpRect.bottom + mExpandedMarginTop,
- right - left - mExpandedMarginRight,
+ right - left - (isRtl ? mExpandedMarginStart : mExpandedMarginEnd),
bottom - top - mExpandedMarginBottom);
// Now recalculate using the new bounds
mCollapsingTextHelper.recalculate();
@@ -777,6 +767,113 @@
}
/**
+ * Sets the expanded title margins.
+ *
+ * @param start the starting title margin in pixels
+ * @param top the top title margin in pixels
+ * @param end the ending title margin in pixels
+ * @param bottom the bottom title margin in pixels
+ *
+ * @see #getExpandedTitleMarginStart()
+ * @see #getExpandedTitleMarginTop()
+ * @see #getExpandedTitleMarginEnd()
+ * @see #getExpandedTitleMarginBottom()
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMargin
+ */
+ public void setExpandedTitleMargin(int start, int top, int end, int bottom) {
+ mExpandedMarginStart = start;
+ mExpandedMarginTop = top;
+ mExpandedMarginEnd = end;
+ mExpandedMarginBottom = bottom;
+ requestLayout();
+ }
+
+ /**
+ * @return the starting expanded title margin in pixels
+ *
+ * @see #setExpandedTitleMarginStart(int)
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginStart
+ */
+ public int getExpandedTitleMarginStart() {
+ return mExpandedMarginStart;
+ }
+
+ /**
+ * Sets the starting expanded title margin in pixels.
+ *
+ * @param margin the starting title margin in pixels
+ * @see #getExpandedTitleMarginStart()
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginStart
+ */
+ public void setExpandedTitleMarginStart(int margin) {
+ mExpandedMarginStart = margin;
+ requestLayout();
+ }
+
+ /**
+ * @return the top expanded title margin in pixels
+ * @see #setExpandedTitleMarginTop(int)
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginTop
+ */
+ public int getExpandedTitleMarginTop() {
+ return mExpandedMarginTop;
+ }
+
+ /**
+ * Sets the top expanded title margin in pixels.
+ *
+ * @param margin the top title margin in pixels
+ * @see #getExpandedTitleMarginTop()
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginTop
+ */
+ public void setExpandedTitleMarginTop(int margin) {
+ mExpandedMarginTop = margin;
+ requestLayout();
+ }
+
+ /**
+ * @return the ending expanded title margin in pixels
+ * @see #setExpandedTitleMarginEnd(int)
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginEnd
+ */
+ public int getExpandedTitleMarginEnd() {
+ return mExpandedMarginEnd;
+ }
+
+ /**
+ * Sets the ending expanded title margin in pixels.
+ *
+ * @param margin the ending title margin in pixels
+ * @see #getExpandedTitleMarginEnd()
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginEnd
+ */
+ public void setExpandedTitleMarginEnd(int margin) {
+ mExpandedMarginEnd = margin;
+ requestLayout();
+ }
+
+ /**
+ * @return the bottom expanded title margin in pixels
+ * @see #setExpandedTitleMarginBottom(int)
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginBottom
+ */
+ public int getExpandedTitleMarginBottom() {
+ return mExpandedMarginBottom;
+ }
+
+ /**
+ * Sets the bottom expanded title margin in pixels.
+ *
+ * @param margin the bottom title margin in pixels
+ * @see #getExpandedTitleMarginBottom()
+ * @attr ref android.support.design.R.styleable#CollapsingToolbarLayout_expandedTitleMarginBottom
+ */
+ public void setExpandedTitleMarginBottom(int margin) {
+ mExpandedMarginBottom = margin;
+ requestLayout();
+ }
+
+ /**
* The additional offset used to define when to trigger the scrim visibility change.
*/
final int getScrimTriggerOffset() {
diff --git a/design/src/android/support/design/widget/CoordinatorLayout.java b/design/src/android/support/design/widget/CoordinatorLayout.java
index 7338a3a..3d16ac9 100644
--- a/design/src/android/support/design/widget/CoordinatorLayout.java
+++ b/design/src/android/support/design/widget/CoordinatorLayout.java
@@ -2461,9 +2461,18 @@
* Determine the anchor view for the child view this LayoutParams is assigned to.
* Assumes mAnchorId is valid.
*/
- private void resolveAnchorView(View forChild, CoordinatorLayout parent) {
+ private void resolveAnchorView(final View forChild, final CoordinatorLayout parent) {
mAnchorView = parent.findViewById(mAnchorId);
if (mAnchorView != null) {
+ if (mAnchorView == parent) {
+ if (parent.isInEditMode()) {
+ mAnchorView = mAnchorDirectChild = null;
+ return;
+ }
+ throw new IllegalStateException(
+ "View can not be anchored to the the parent CoordinatorLayout");
+ }
+
View directChild = mAnchorView;
for (ViewParent p = mAnchorView.getParent();
p != parent && p != null;
diff --git a/design/src/android/support/design/widget/FloatingActionButton.java b/design/src/android/support/design/widget/FloatingActionButton.java
index 6f80498..337f865 100644
--- a/design/src/android/support/design/widget/FloatingActionButton.java
+++ b/design/src/android/support/design/widget/FloatingActionButton.java
@@ -31,8 +31,8 @@
import android.support.design.widget.FloatingActionButtonImpl.InternalVisibilityChangedListener;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.View;
-import android.widget.ImageButton;
import android.widget.ImageView;
import java.util.List;
@@ -55,7 +55,9 @@
* @attr ref android.support.design.R.styleable#FloatingActionButton_fabSize
*/
@CoordinatorLayout.DefaultBehavior(FloatingActionButton.Behavior.class)
-public class FloatingActionButton extends ImageButton {
+public class FloatingActionButton extends VisibilityAwareImageButton {
+
+ private static final String LOG_TAG = "FloatingActionButton";
/**
* Callback to be invoked when the visibility of a FloatingActionButton changes.
@@ -112,7 +114,6 @@
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.FloatingActionButton, defStyleAttr,
R.style.Widget_Design_FloatingActionButton);
- Drawable background = a.getDrawable(R.styleable.FloatingActionButton_android_background);
mBackgroundTint = a.getColorStateList(R.styleable.FloatingActionButton_backgroundTint);
mBackgroundTintMode = parseTintMode(a.getInt(
R.styleable.FloatingActionButton_backgroundTintMode, -1), null);
@@ -147,8 +148,8 @@
final int sdk = Build.VERSION.SDK_INT;
if (sdk >= 21) {
mImpl = new FloatingActionButtonLollipop(this, delegate);
- } else if (sdk >= 12) {
- mImpl = new FloatingActionButtonHoneycombMr1(this, delegate);
+ } else if (sdk >= 14) {
+ mImpl = new FloatingActionButtonIcs(this, delegate);
} else {
mImpl = new FloatingActionButtonEclairMr1(this, delegate);
}
@@ -157,8 +158,8 @@
R.dimen.design_fab_content_size);
mContentPadding = (getSizeDimension() - maxContentSize) / 2;
- mImpl.setBackgroundDrawable(background, mBackgroundTint,
- mBackgroundTintMode, mRippleColor, mBorderWidth);
+ mImpl.setBackgroundDrawable(mBackgroundTint, mBackgroundTintMode,
+ mRippleColor, mBorderWidth);
mImpl.setElevation(elevation);
mImpl.setPressedTranslationZ(pressedTranslationZ);
}
@@ -250,11 +251,18 @@
}
@Override
- public void setBackgroundDrawable(@NonNull Drawable background) {
- if (mImpl != null) {
- mImpl.setBackgroundDrawable(
- background, mBackgroundTint, mBackgroundTintMode, mRippleColor, mBorderWidth);
- }
+ public void setBackgroundDrawable(Drawable background) {
+ Log.i(LOG_TAG, "Setting a custom background is not supported.");
+ }
+
+ @Override
+ public void setBackgroundResource(int resid) {
+ Log.i(LOG_TAG, "Setting a custom background is not supported.");
+ }
+
+ @Override
+ public void setBackgroundColor(int color) {
+ Log.i(LOG_TAG, "Setting a custom background is not supported.");
}
/**
@@ -262,7 +270,7 @@
* <p>This method will animate the button show if the view has already been laid out.</p>
*/
public void show() {
- mImpl.show(null);
+ show(null);
}
/**
@@ -272,7 +280,11 @@
* @param listener the listener to notify when this view is shown
*/
public void show(@Nullable final OnVisibilityChangedListener listener) {
- mImpl.show(wrapOnVisibilityChangedListener(listener));
+ show(listener, true);
+ }
+
+ private void show(OnVisibilityChangedListener listener, boolean fromUser) {
+ mImpl.show(wrapOnVisibilityChangedListener(listener), fromUser);
}
/**
@@ -280,7 +292,7 @@
* <p>This method will animate the button hide if the view has already been laid out.</p>
*/
public void hide() {
- mImpl.hide(null);
+ hide(null);
}
/**
@@ -290,7 +302,11 @@
* @param listener the listener to notify when this view is hidden
*/
public void hide(@Nullable OnVisibilityChangedListener listener) {
- mImpl.hide(wrapOnVisibilityChangedListener(listener));
+ hide(listener, true);
+ }
+
+ private void hide(@Nullable OnVisibilityChangedListener listener, boolean fromUser) {
+ mImpl.hide(wrapOnVisibilityChangedListener(listener), fromUser);
}
@Nullable
@@ -432,6 +448,11 @@
return false;
}
+ if (child.getUserSetVisibility() != VISIBLE) {
+ // The view isn't set to be visible so skip changing it's visibility
+ return false;
+ }
+
if (mTmpRect == null) {
mTmpRect = new Rect();
}
@@ -442,10 +463,10 @@
if (rect.bottom <= appBarLayout.getMinimumHeightForVisibleOverlappingContent()) {
// If the anchor's bottom is below the seam, we'll animate our FAB out
- child.hide();
+ child.hide(null, false);
} else {
// Else, we'll animate our FAB back in
- child.show();
+ child.show(null, false);
}
return true;
}
diff --git a/design/src/android/support/design/widget/NavigationView.java b/design/src/android/support/design/widget/NavigationView.java
index d76e919..cb52fe9 100644
--- a/design/src/android/support/design/widget/NavigationView.java
+++ b/design/src/android/support/design/widget/NavigationView.java
@@ -269,6 +269,26 @@
}
/**
+ * Gets the number of headers in this NavigationView.
+ *
+ * @return A positive integer representing the number of headers.
+ */
+ public int getHeaderCount() {
+ return mPresenter.getHeaderCount();
+ }
+
+ /**
+ * Gets the header view at the specified position.
+ *
+ * @param index The position at which to get the view from.
+ * @return The header view the specified position or null if the position does not exist in this
+ * NavigationView.
+ */
+ public View getHeaderView(int index) {
+ return mPresenter.getHeaderView(index);
+ }
+
+ /**
* Returns the tint which is applied to our item's icons.
*
* @see #setItemIconTintList(ColorStateList)
diff --git a/design/src/android/support/design/widget/Snackbar.java b/design/src/android/support/design/widget/Snackbar.java
index eb2c4ef..a328d98 100644
--- a/design/src/android/support/design/widget/Snackbar.java
+++ b/design/src/android/support/design/widget/Snackbar.java
@@ -596,17 +596,17 @@
}
private void onViewHidden(int event) {
- // First remove the view from the parent (if attached)
- final ViewParent parent = mView.getParent();
- if (parent instanceof ViewGroup) {
- ((ViewGroup) parent).removeView(mView);
- }
+ // First tell the SnackbarManager that it has been dismissed
+ SnackbarManager.getInstance().onDismissed(mManagerCallback);
// Now call the dismiss listener (if available)
if (mCallback != null) {
mCallback.onDismissed(this, event);
}
- // Finally, tell the SnackbarManager that it has been dismissed
- SnackbarManager.getInstance().onDismissed(mManagerCallback);
+ // Lastly, remove the view from the parent (if attached)
+ final ViewParent parent = mView.getParent();
+ if (parent instanceof ViewGroup) {
+ ((ViewGroup) parent).removeView(mView);
+ }
}
/**
@@ -810,6 +810,11 @@
final class Behavior extends SwipeDismissBehavior<SnackbarLayout> {
@Override
+ public boolean canSwipeDismissView(View child) {
+ return child instanceof SnackbarLayout;
+ }
+
+ @Override
public boolean onInterceptTouchEvent(CoordinatorLayout parent, SnackbarLayout child,
MotionEvent event) {
// We want to make sure that we disable any Snackbar timeouts if the user is
diff --git a/design/src/android/support/design/widget/SwipeDismissBehavior.java b/design/src/android/support/design/widget/SwipeDismissBehavior.java
index fc29201..e059fe5 100644
--- a/design/src/android/support/design/widget/SwipeDismissBehavior.java
+++ b/design/src/android/support/design/widget/SwipeDismissBehavior.java
@@ -17,6 +17,7 @@
package android.support.design.widget;
import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.ViewDragHelper;
@@ -198,13 +199,27 @@
return false;
}
+ /**
+ * Called when the user's input indicates that they want to swipe the given view.
+ *
+ * @param view View the user is attempting to swipe
+ * @return true if the view can be dismissed via swiping, false otherwise
+ */
+ public boolean canSwipeDismissView(@NonNull View view) {
+ return true;
+ }
+
private final ViewDragHelper.Callback mDragCallback = new ViewDragHelper.Callback() {
private int mOriginalCapturedViewLeft;
@Override
public boolean tryCaptureView(View child, int pointerId) {
- mOriginalCapturedViewLeft = child.getLeft();
- return true;
+ return canSwipeDismissView(child);
+ }
+
+ @Override
+ public void onViewCaptured(View capturedChild, int activePointerId) {
+ mOriginalCapturedViewLeft = capturedChild.getLeft();
}
@Override
diff --git a/design/src/android/support/design/widget/TabLayout.java b/design/src/android/support/design/widget/TabLayout.java
index 89ca383..67add43 100755
--- a/design/src/android/support/design/widget/TabLayout.java
+++ b/design/src/android/support/design/widget/TabLayout.java
@@ -680,12 +680,16 @@
}
private void updateTab(int position) {
- final TabView view = (TabView) mTabStrip.getChildAt(position);
+ final TabView view = getTabView(position);
if (view != null) {
view.update();
}
}
+ private TabView getTabView(int position) {
+ return (TabView) mTabStrip.getChildAt(position);
+ }
+
private void addTabView(Tab tab, boolean setSelected) {
final TabView tabView = createTabView(tab);
mTabStrip.addView(tabView, createLayoutParamsForTabs());
@@ -1005,13 +1009,14 @@
* the value given to {@link #setIcon(Drawable)}.
* </p>
*
- * @param layoutResId A layout resource to inflate and use as a custom tab view
+ * @param resId A layout resource to inflate and use as a custom tab view
* @return The current instance for call chaining
*/
@NonNull
- public Tab setCustomView(@LayoutRes int layoutResId) {
- return setCustomView(
- LayoutInflater.from(mParent.getContext()).inflate(layoutResId, null));
+ public Tab setCustomView(@LayoutRes int resId) {
+ final TabView tabView = mParent.getTabView(mPosition);
+ final LayoutInflater inflater = LayoutInflater.from(tabView.getContext());
+ return setCustomView(inflater.inflate(resId, tabView, false));
}
/**
diff --git a/v17/leanback/Android.mk b/v17/leanback/Android.mk
index 57b54e0..2dc78a7 100644
--- a/v17/leanback/Android.mk
+++ b/v17/leanback/Android.mk
@@ -28,6 +28,8 @@
LOCAL_JAR_EXCLUDE_FILES := none
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# Base sub-library contains classes both needed by api-level specific libraries
@@ -38,6 +40,8 @@
LOCAL_SRC_FILES := $(call all-java-files-under, common)
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of API 23.
@@ -48,6 +52,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of API 21.
@@ -58,6 +64,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of KitKat APIs.
@@ -68,6 +76,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of JBMR2 APIs.
@@ -78,6 +88,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# Here is the final static library that apps can link against.
@@ -97,6 +109,7 @@
android-support-v17-leanback-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
# ===========================================================
# Common Droiddoc vars
@@ -142,7 +155,6 @@
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
-support_module_src_files := $(leanback.docs.src_files)
support_module_java_libraries := $(leanback.docs.java_libraries)
support_module_java_packages := android.support.v17.leanback*
include $(SUPPORT_API_CHECK)
diff --git a/v17/leanback/api/current.txt b/v17/leanback/api/current.txt
index 962367d..69081a2 100644
--- a/v17/leanback/api/current.txt
+++ b/v17/leanback/api/current.txt
@@ -205,6 +205,8 @@
method public static int add(android.app.FragmentManager, android.support.v17.leanback.app.GuidedStepFragment);
method public static int add(android.app.FragmentManager, android.support.v17.leanback.app.GuidedStepFragment, int);
method public static int addAsRoot(android.app.Activity, android.support.v17.leanback.app.GuidedStepFragment, int);
+ method public android.support.v17.leanback.widget.GuidedAction findActionById(long);
+ method public int findActionPositionById(long);
method public android.view.View getActionItemView(int);
method public java.util.List<android.support.v17.leanback.widget.GuidedAction> getActions();
method protected int getContainerIdForBackground();
@@ -213,12 +215,14 @@
method public android.support.v17.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
method public int getSelectedActionPosition();
method public int getUiStyle();
+ method public void notifyActionChanged(int);
method public void onCreateActions(java.util.List<android.support.v17.leanback.widget.GuidedAction>, android.os.Bundle);
method public android.support.v17.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
method public android.support.v17.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
method public android.support.v17.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
method public void onGuidedActionClicked(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionEdited(android.support.v17.leanback.widget.GuidedAction);
+ method public long onGuidedActionEditedAndProceed(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionFocused(android.support.v17.leanback.widget.GuidedAction);
method protected android.app.Fragment onProvideBackgroundFragment();
method protected void onProvideFragmentTransitions();
@@ -242,6 +246,8 @@
method public static int add(android.support.v4.app.FragmentManager, android.support.v17.leanback.app.GuidedStepSupportFragment);
method public static int add(android.support.v4.app.FragmentManager, android.support.v17.leanback.app.GuidedStepSupportFragment, int);
method public static int addAsRoot(android.support.v4.app.FragmentActivity, android.support.v17.leanback.app.GuidedStepSupportFragment, int);
+ method public android.support.v17.leanback.widget.GuidedAction findActionById(long);
+ method public int findActionPositionById(long);
method public android.view.View getActionItemView(int);
method public java.util.List<android.support.v17.leanback.widget.GuidedAction> getActions();
method protected int getContainerIdForBackground();
@@ -250,12 +256,14 @@
method public android.support.v17.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
method public int getSelectedActionPosition();
method public int getUiStyle();
+ method public void notifyActionChanged(int);
method public void onCreateActions(java.util.List<android.support.v17.leanback.widget.GuidedAction>, android.os.Bundle);
method public android.support.v17.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
method public android.support.v17.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
method public android.support.v17.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
method public void onGuidedActionClicked(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionEdited(android.support.v17.leanback.widget.GuidedAction);
+ method public long onGuidedActionEditedAndProceed(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionFocused(android.support.v17.leanback.widget.GuidedAction);
method protected android.support.v4.app.Fragment onProvideBackgroundSupportFragment();
method protected void onProvideFragmentTransitions();
@@ -960,6 +968,7 @@
public class GuidedAction extends android.support.v17.leanback.widget.Action {
method public int getCheckSetId();
method public java.lang.CharSequence getDescription();
+ method public java.lang.CharSequence getEditDescription();
method public java.lang.CharSequence getEditTitle();
method public android.content.Intent getIntent();
method public java.lang.CharSequence getTitle();
@@ -967,17 +976,20 @@
method public boolean hasNext();
method public boolean infoOnly();
method public boolean isChecked();
+ method public boolean isDescriptionEditable();
method public boolean isEditTitleUsed();
method public boolean isEditable();
method public boolean isEnabled();
method public void setChecked(boolean);
method public void setDescription(java.lang.CharSequence);
+ method public void setEditDescription(java.lang.CharSequence);
method public void setEditTitle(java.lang.CharSequence);
method public void setEnabled(boolean);
method public void setTitle(java.lang.CharSequence);
+ field public static final int ACTION_ID_CURRENT = -3; // 0xfffffffd
+ field public static final int ACTION_ID_NEXT = -2; // 0xfffffffe
field public static final int DEFAULT_CHECK_SET_ID = 1; // 0x1
field public static final int NO_CHECK_SET = 0; // 0x0
- field public static final int NO_DRAWABLE = 0; // 0x0
}
public static class GuidedAction.Builder {
@@ -985,8 +997,10 @@
method public android.support.v17.leanback.widget.GuidedAction build();
method public android.support.v17.leanback.widget.GuidedAction.Builder checkSetId(int);
method public android.support.v17.leanback.widget.GuidedAction.Builder checked(boolean);
- method public android.support.v17.leanback.widget.GuidedAction.Builder description(java.lang.String);
- method public android.support.v17.leanback.widget.GuidedAction.Builder editTitle(java.lang.String);
+ method public android.support.v17.leanback.widget.GuidedAction.Builder description(java.lang.CharSequence);
+ method public android.support.v17.leanback.widget.GuidedAction.Builder descriptionEditable(boolean);
+ method public android.support.v17.leanback.widget.GuidedAction.Builder editDescription(java.lang.CharSequence);
+ method public android.support.v17.leanback.widget.GuidedAction.Builder editTitle(java.lang.CharSequence);
method public android.support.v17.leanback.widget.GuidedAction.Builder editable(boolean);
method public android.support.v17.leanback.widget.GuidedAction.Builder enabled(boolean);
method public android.support.v17.leanback.widget.GuidedAction.Builder hasNext(boolean);
@@ -996,7 +1010,7 @@
method public android.support.v17.leanback.widget.GuidedAction.Builder infoOnly(boolean);
method public android.support.v17.leanback.widget.GuidedAction.Builder intent(android.content.Intent);
method public android.support.v17.leanback.widget.GuidedAction.Builder multilineDescription(boolean);
- method public android.support.v17.leanback.widget.GuidedAction.Builder title(java.lang.String);
+ method public android.support.v17.leanback.widget.GuidedAction.Builder title(java.lang.CharSequence);
}
public class GuidedActionEditText extends android.widget.EditText implements android.support.v17.leanback.widget.ImeKeyMonitor {
@@ -1015,10 +1029,12 @@
method public void onBindViewHolder(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, android.support.v17.leanback.widget.GuidedAction);
method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup);
method public android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup);
+ method protected void onEditingModeChange(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, android.support.v17.leanback.widget.GuidedAction, boolean);
method public void onImeAppearing(java.util.List<android.animation.Animator>);
method public void onImeDisappearing(java.util.List<android.animation.Animator>);
method public int onProvideItemLayoutId();
method public int onProvideLayoutId();
+ method public void setEditingMode(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, android.support.v17.leanback.widget.GuidedAction, boolean);
field protected android.support.v17.leanback.widget.VerticalGridView mActionsGridView;
field protected android.view.View mMainView;
field protected android.view.View mSelectorView;
@@ -1030,9 +1046,13 @@
method public android.widget.ImageView getChevronView();
method public android.view.View getContentView();
method public android.widget.TextView getDescriptionView();
+ method public android.widget.EditText getEditableDescriptionView();
method public android.widget.EditText getEditableTitleView();
+ method public android.view.View getEditingView();
method public android.widget.ImageView getIconView();
method public android.widget.TextView getTitleView();
+ method public boolean isInEditing();
+ method public boolean isInEditingDescription();
field public final android.view.View view;
}
diff --git a/v17/leanback/res/layout/lb_guidedactions_item.xml b/v17/leanback/res/layout/lb_guidedactions_item.xml
index 3babaa9..8f5fcb7 100644
--- a/v17/leanback/res/layout/lb_guidedactions_item.xml
+++ b/v17/leanback/res/layout/lb_guidedactions_item.xml
@@ -38,9 +38,10 @@
android:id="@+id/guidedactions_item_title"
style="?attr/guidedActionItemTitleStyle" />
- <TextView
+ <android.support.v17.leanback.widget.GuidedActionEditText
android:id="@+id/guidedactions_item_description"
style="?attr/guidedActionItemDescriptionStyle" />
+
</android.support.v17.leanback.widget.NonOverlappingLinearLayout>
<ImageView
diff --git a/v17/leanback/res/values-ta-rIN/strings.xml b/v17/leanback/res/values-ta-rIN/strings.xml
index 9472522..f67ee4d 100644
--- a/v17/leanback/res/values-ta-rIN/strings.xml
+++ b/v17/leanback/res/values-ta-rIN/strings.xml
@@ -20,7 +20,7 @@
<string name="orb_search_action" msgid="5651268540267663887">"செயலைத் தேடுக"</string>
<string name="lb_search_bar_hint" msgid="8325490927970116252">"தேடு"</string>
<string name="lb_search_bar_hint_speech" msgid="5511270823320183816">"தேட, பேசவும்"</string>
- <string name="lb_search_bar_hint_with_title" msgid="1627103380996590035">"<xliff:g id="SEARCH_CONTEXT">%1$s</xliff:g> ஐத் தேடுக"</string>
+ <string name="lb_search_bar_hint_with_title" msgid="1627103380996590035">"<xliff:g id="SEARCH_CONTEXT">%1$s</xliff:g> இல் தேடுக"</string>
<string name="lb_search_bar_hint_with_title_speech" msgid="2712734639766312034">"<xliff:g id="SEARCH_CONTEXT">%1$s</xliff:g> ஐத் தேட, பேசவும்"</string>
<string name="lb_control_display_fast_forward_multiplier" msgid="4541442045214207774">"%1$dX"</string>
<string name="lb_control_display_rewind_multiplier" msgid="3097220783222910245">"%1$dX"</string>
diff --git a/v17/leanback/res/values/dimens.xml b/v17/leanback/res/values/dimens.xml
index 66417c0..7f15fd2 100644
--- a/v17/leanback/res/values/dimens.xml
+++ b/v17/leanback/res/values/dimens.xml
@@ -238,6 +238,8 @@
<dimen name="lb_guidedactions_selector_min_height">8dp</dimen>
<dimen name="lb_guidedactions_vertical_padding">12dp</dimen>
+ <item name="lb_guidedactions_item_disabled_text_alpha" format="float" type="string">0.25</item>
+ <item name="lb_guidedactions_item_disabled_description_text_alpha" format="float" type="string">0.25</item>
<item name="lb_guidedactions_item_unselected_text_alpha" format="float" type="string">1.00</item>
<item name="lb_guidedactions_item_unselected_description_text_alpha" format="float" type="string">0.50</item>
<item name="lb_guidedactions_item_enabled_chevron_alpha" format="float" type="string">1.00</item>
diff --git a/v17/leanback/res/values/styles.xml b/v17/leanback/res/values/styles.xml
index 447ad22..e5182b3 100644
--- a/v17/leanback/res/values/styles.xml
+++ b/v17/leanback/res/values/styles.xml
@@ -510,12 +510,13 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:alpha">@string/lb_guidedactions_item_unselected_description_text_alpha</item>
- <item name="android:ellipsize">marquee</item>
+ <item name="android:ellipsize">end</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:maxLines">@integer/lb_guidedactions_item_description_min_lines</item>
<item name="android:textColor">@color/lb_guidedactions_item_unselected_text_color</item>
<item name="android:textSize">@dimen/lb_guidedactions_item_description_font_size</item>
<item name="android:visibility">gone</item>
+ <item name="android:background">@null</item>
</style>
<!-- Style for an action's chevron in a GuidedActionsStylist's default item layout. -->
diff --git a/v17/leanback/src/android/support/v17/leanback/app/GuidedActionAdapter.java b/v17/leanback/src/android/support/v17/leanback/app/GuidedActionAdapter.java
index cc9b4db..7836a5a 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/GuidedActionAdapter.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/GuidedActionAdapter.java
@@ -80,9 +80,19 @@
public interface EditListener {
/**
- * Called when the user enters or exits edit mode on an action.
+ * Called when the user exits edit mode on an action.
*/
- public void onGuidedActionEdited(GuidedAction action, boolean entering);
+ public long onGuidedActionEdited(GuidedAction action);
+
+ /**
+ * Called when Ime Open
+ */
+ public void onImeOpen();
+
+ /**
+ * Called when Ime Close
+ */
+ public void onImeClose();
}
/**
@@ -137,6 +147,7 @@
}
}
};
+ private boolean mImeOpened;
/**
* Constructs a GuidedActionAdapter with the given list of guided actions, the given click and
@@ -237,7 +248,13 @@
v.setOnClickListener(mOnClickListener);
v.setOnFocusChangeListener(mActionOnFocusListener);
- final EditText edit = vh.getEditableTitleView();
+ setupListeners(vh.getEditableTitleView());
+ setupListeners(vh.getEditableDescriptionView());
+
+ return new ActionViewHolder(v, vh);
+ }
+
+ private void setupListeners(EditText edit) {
if (edit != null) {
edit.setPrivateImeOptions("EscapeNorth=1;");
edit.setOnEditorActionListener(mActionEditListener);
@@ -246,8 +263,6 @@
monitor.setImeKeyListener(mActionEditListener);
}
}
-
- return new ActionViewHolder(v, vh);
}
/**
@@ -258,16 +273,18 @@
if (position >= mActions.size()) {
return;
}
- ActionViewHolder avh = (ActionViewHolder)holder;
+ final ActionViewHolder avh = (ActionViewHolder)holder;
GuidedAction action = mActions.get(position);
avh.setAction(action);
mStylist.onBindViewHolder(avh.mStylistViewHolder, action);
- final EditText edit = avh.mStylistViewHolder.getEditableTitleView();
+ setupNextImeOptions(avh.mStylistViewHolder.getEditableTitleView());
+ setupNextImeOptions(avh.mStylistViewHolder.getEditableDescriptionView());
+ }
+
+ private void setupNextImeOptions(EditText edit) {
if (edit != null) {
- int next = getNextEditableActionIndex(action);
- int flag = (next == -1) ? EditorInfo.IME_ACTION_DONE : EditorInfo.IME_ACTION_NEXT;
- edit.setImeOptions(flag);
+ edit.setImeOptions(EditorInfo.IME_ACTION_NEXT);
}
}
@@ -279,23 +296,29 @@
return mActions.size();
}
- private int getNextEditableActionIndex(GuidedAction action) {
- int i, size = mActions.size();
- for (i = 0; i < size; i++) {
- GuidedAction a = mActions.get(i);
- if (mActions.get(i) == action) {
+ private int getNextActionIndex(GuidedAction action, long nextActionId) {
+ if (nextActionId == GuidedAction.ACTION_ID_NEXT) {
+ int i, size = mActions.size();
+ for (i = 0; i < size; i++) {
+ GuidedAction a = mActions.get(i);
+ if (mActions.get(i) == action) {
+ break;
+ }
+ }
+ if (nextActionId == GuidedAction.ACTION_ID_NEXT) {
i++;
- break;
}
- }
- for (; i < size; i++) {
- GuidedAction a = mActions.get(i);
- if (a.isEditable()) {
- break;
+ return (i == size) ? -1 : i;
+ } else {
+ int i, size = mActions.size();
+ for (i = 0; i < size; i++) {
+ GuidedAction a = mActions.get(i);
+ if (mActions.get(i).getId() == nextActionId) {
+ break;
+ }
}
+ return (i == size) ? -1 : i;
}
- int result = (i == size) ? -1 : i;
- return result;
}
private class ActionOnFocusListener implements View.OnFocusChangeListener {
@@ -337,12 +360,19 @@
}
} else {
if (mSelectedView == v) {
+ mStylist.onAnimateItemPressed(avh.mStylistViewHolder, false);
mSelectedView = null;
}
}
}
}
+ public void openIme(ActionViewHolder avh) {
+ mStylist.setEditingMode(avh.mStylistViewHolder,
+ avh.getAction(), true);
+ mActionEditListener.openIme(avh);
+ }
+
private class ActionOnKeyListener implements View.OnKeyListener {
private boolean mKeyPressed = false;
@@ -407,9 +437,9 @@
}
mStylist.onAnimateItemPressed(avh.mStylistViewHolder, mKeyPressed);
- if (action.isEditable()) {
+ if (action.isEditable() || action.isDescriptionEditable()) {
if (DEBUG_EDIT) Log.v(TAG_EDIT, "openIme click");
- mActionEditListener.openIme(avh, true);
+ openIme(avh);
} else {
handleCheckedActions(avh, action);
mClickListener.onGuidedActionClicked(action);
@@ -471,83 +501,105 @@
actionId == EditorInfo.IME_ACTION_DONE) {
ActionViewHolder avh = findSubChildViewHolder(v);
- GuidedAction action = avh.getAction();
- if (action.getEditTitle() != null) {
- action.setEditTitle(v.getText());
- } else {
- action.setTitle(v.getText());
- }
- mClickListener.onGuidedActionClicked(action);
- int next = getNextEditableActionIndex(action);
- if (next != -1) {
- ViewHolder vh = mRecyclerView.findViewHolderForPosition(next);
- if (vh != null) {
- if (DEBUG_EDIT) Log.v(TAG_EDIT, "openIme next/done");
- handled = true;
- openIme((ActionViewHolder)vh, false);
+ updateTextIntoAction(avh, v);
+ mClickListener.onGuidedActionClicked(avh.getAction());
+ long nextActionId = finishEditing(avh);
+ if (nextActionId != GuidedAction.ACTION_ID_CURRENT
+ && nextActionId != avh.getAction().getId()) {
+ int next = getNextActionIndex(avh.getAction(), nextActionId);
+ if (next != -1) {
+ ActionViewHolder vh = (ActionViewHolder) mRecyclerView
+ .findViewHolderForPosition(next);
+ if (vh != null) {
+ if (vh.getAction().isEditable() ||
+ vh.getAction().isDescriptionEditable()) {
+ if (DEBUG_EDIT) Log.v(TAG_EDIT, "openIme next/done");
+ handled = true;
+ mStylist.setEditingMode(vh.mStylistViewHolder,
+ vh.getAction(), true);
+ openIme(vh);
+ } else {
+ vh.mStylistViewHolder.view.requestFocus();
+ }
+ }
}
}
if (!handled) {
if (DEBUG_EDIT) Log.v(TAG_EDIT, "closeIme no next");
handled = true;
- closeIme(avh);
+ closeIme(v);
}
} else if (actionId == EditorInfo.IME_ACTION_NONE) {
if (DEBUG_EDIT) Log.v(TAG_EDIT, "closeIme escape north");
// Escape north handling: stay on current item, but close editor
handled = true;
ActionViewHolder avh = findSubChildViewHolder(v);
- closeIme(avh);
+ finishEditing(avh);
+ closeIme(v);
}
return handled;
}
+ private void updateTextIntoAction(ActionViewHolder avh, TextView v) {
+ GuidedAction action = avh.getAction();
+ if (v == avh.mStylistViewHolder.getDescriptionView()) {
+ if (action.getEditDescription() != null) {
+ action.setEditDescription(v.getText());
+ } else {
+ action.setDescription(v.getText());
+ }
+ } else if (v == avh.mStylistViewHolder.getTitleView()) {
+ if (action.getEditTitle() != null) {
+ action.setEditTitle(v.getText());
+ } else {
+ action.setTitle(v.getText());
+ }
+ }
+ }
+
@Override
public boolean onKeyPreIme(EditText editText, int keyCode, KeyEvent event) {
if (DEBUG_EDIT) Log.v(TAG_EDIT, "IME key: " + keyCode);
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
ActionViewHolder avh = findSubChildViewHolder(editText);
- GuidedAction action = avh.getAction();
- if (action.isEditTitleUsed()) {
- action.setEditTitle(editText.getText());
- } else {
- action.setTitle(editText.getText());
- }
+ updateTextIntoAction(avh, editText);
editText.clearFocus();
- mEditListener.onGuidedActionEdited(action, false);
- updateTitleAndDescription(avh);
+ finishEditing(avh);
+ if (mImeOpened) {
+ mImeOpened = false;
+ mEditListener.onImeClose();
+ }
}
return false;
}
- public void openIme(ActionViewHolder avh, boolean notify) {
- View v = avh.mStylistViewHolder.getTitleView();
- CharSequence editTitle = avh.getAction().getEditTitle();
- if (editTitle != null) {
- ((TextView) v).setText(editTitle);
- }
+ public void openIme(ActionViewHolder avh) {
+ View v = avh.mStylistViewHolder.getEditingView();
InputMethodManager mgr = (InputMethodManager)
v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
v.requestFocus();
mgr.showSoftInput(v, 0);
- if (notify) {
- mEditListener.onGuidedActionEdited(avh.getAction(), true);
+ if (!mImeOpened) {
+ mImeOpened = true;
+ mEditListener.onImeOpen();
}
}
- public void closeIme(ActionViewHolder avh) {
- View v = avh.mStylistViewHolder.getTitleView();
- InputMethodManager mgr = (InputMethodManager)
- v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- v.clearFocus();
- mgr.hideSoftInputFromWindow(v.getWindowToken(), 0);
- mEditListener.onGuidedActionEdited(avh.getAction(), false);
- updateTitleAndDescription(avh);
+ public long finishEditing(ActionViewHolder avh) {
+ long nextActionId = mEditListener.onGuidedActionEdited(avh.getAction());
+ mStylist.setEditingMode(avh.mStylistViewHolder, avh.getAction(), false);
+ return nextActionId;
}
- private void updateTitleAndDescription(ActionViewHolder avh) {
- avh.mStylistViewHolder.getTitleView().setText(avh.getAction().getTitle());
- avh.mStylistViewHolder.getDescriptionView().setText(avh.getAction().getDescription());
+ public void closeIme(View v) {
+ if (mImeOpened) {
+ mImeOpened = false;
+ InputMethodManager mgr = (InputMethodManager)
+ v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ v.clearFocus();
+ mgr.hideSoftInputFromWindow(v.getWindowToken(), 0);
+ mEditListener.onImeClose();
+ }
}
private ActionViewHolder findSubChildViewHolder(View v) {
diff --git a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
index f985d55..fe2624d 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
@@ -279,12 +279,28 @@
}
/**
- * Callback invoked when an action's title has been edited.
+ * Callback invoked when an action's title or description has been edited.
+ * Override {@link #onGuidedActionEditedAndProceed(GuidedAction)} instead of app wants to
+ * control the next action to focus on.
*/
public void onGuidedActionEdited(GuidedAction action) {
}
/**
+ * Callback invoked when an action's title or description has been edited. Default
+ * implementation calls {@link #onGuidedActionEdited(GuidedAction)} and returns
+ * {@link GuidedAction#ACTION_ID_NEXT}.
+ *
+ * @param action The action that has been edited.
+ * @return ID of the action will be focused or {@link GuidedAction#ACTION_ID_NEXT},
+ * {@link GuidedAction#ACTION_ID_CURRENT}.
+ */
+ public long onGuidedActionEditedAndProceed(GuidedAction action) {
+ onGuidedActionEdited(action);
+ return GuidedAction.ACTION_ID_NEXT;
+ }
+
+ /**
* Adds the specified GuidedStepFragment to the fragment stack, replacing any existing
* GuidedStepFragments in the stack, and configuring the fragment-to-fragment custom
* transitions. A backstack entry is added, so the fragment will be dismissed when BACK key
@@ -418,6 +434,33 @@
}
/**
+ * Find GuidedAction by Id.
+ * @param id Id of the action to search.
+ * @return GuidedAction object or null if not found.
+ */
+ public GuidedAction findActionById(long id) {
+ int index = findActionPositionById(id);
+ return index >= 0 ? mActions.get(index) : null;
+ }
+
+ /**
+ * Find GuidedAction position in array by Id.
+ * @param id Id of the action to search.
+ * @return position of GuidedAction object in array or -1 if not found.
+ */
+ public int findActionPositionById(long id) {
+ if (mActions != null) {
+ for (int i = 0; i < mActions.size(); i++) {
+ GuidedAction action = mActions.get(i);
+ if (mActions.get(i).getId() == id) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
* Sets the list of GuidedActions that the user may take in this fragment.
* @param actions The list of GuidedActions for this fragment.
*/
@@ -429,6 +472,16 @@
}
/**
+ * Notify an action has changed and update its UI.
+ * @param position Position of the GuidedAction in array.
+ */
+ public void notifyActionChanged(int position) {
+ if (mAdapter != null) {
+ mAdapter.notifyItemChanged(position);
+ }
+ }
+
+ /**
* Returns the view corresponding to the action at the indicated position in the list of
* actions for this fragment.
* @param position The integer position of the action of interest.
@@ -647,12 +700,20 @@
actionContainer.addView(actionsView);
GuidedActionAdapter.EditListener editListener = new GuidedActionAdapter.EditListener() {
+
@Override
- public void onGuidedActionEdited(GuidedAction action, boolean entering) {
- runImeAnimations(entering);
- if (!entering) {
- GuidedStepFragment.this.onGuidedActionEdited(action);
- }
+ public void onImeOpen() {
+ runImeAnimations(true);
+ }
+
+ @Override
+ public void onImeClose() {
+ runImeAnimations(false);
+ }
+
+ @Override
+ public long onGuidedActionEdited(GuidedAction action) {
+ return GuidedStepFragment.this.onGuidedActionEditedAndProceed(action);
}
};
diff --git a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepSupportFragment.java b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepSupportFragment.java
index 10c8a72..d1d1318 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepSupportFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepSupportFragment.java
@@ -281,12 +281,28 @@
}
/**
- * Callback invoked when an action's title has been edited.
+ * Callback invoked when an action's title or description has been edited.
+ * Override {@link #onGuidedActionEditedAndProceed(GuidedAction)} instead of app wants to
+ * control the next action to focus on.
*/
public void onGuidedActionEdited(GuidedAction action) {
}
/**
+ * Callback invoked when an action's title or description has been edited. Default
+ * implementation calls {@link #onGuidedActionEdited(GuidedAction)} and returns
+ * {@link GuidedAction#ACTION_ID_NEXT}.
+ *
+ * @param action The action that has been edited.
+ * @return ID of the action will be focused or {@link GuidedAction#ACTION_ID_NEXT},
+ * {@link GuidedAction#ACTION_ID_CURRENT}.
+ */
+ public long onGuidedActionEditedAndProceed(GuidedAction action) {
+ onGuidedActionEdited(action);
+ return GuidedAction.ACTION_ID_NEXT;
+ }
+
+ /**
* Adds the specified GuidedStepSupportFragment to the fragment stack, replacing any existing
* GuidedStepSupportFragments in the stack, and configuring the fragment-to-fragment custom
* transitions. A backstack entry is added, so the fragment will be dismissed when BACK key
@@ -420,6 +436,33 @@
}
/**
+ * Find GuidedAction by Id.
+ * @param id Id of the action to search.
+ * @return GuidedAction object or null if not found.
+ */
+ public GuidedAction findActionById(long id) {
+ int index = findActionPositionById(id);
+ return index >= 0 ? mActions.get(index) : null;
+ }
+
+ /**
+ * Find GuidedAction position in array by Id.
+ * @param id Id of the action to search.
+ * @return position of GuidedAction object in array or -1 if not found.
+ */
+ public int findActionPositionById(long id) {
+ if (mActions != null) {
+ for (int i = 0; i < mActions.size(); i++) {
+ GuidedAction action = mActions.get(i);
+ if (mActions.get(i).getId() == id) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
* Sets the list of GuidedActions that the user may take in this fragment.
* @param actions The list of GuidedActions for this fragment.
*/
@@ -431,6 +474,16 @@
}
/**
+ * Notify an action has changed and update its UI.
+ * @param position Position of the GuidedAction in array.
+ */
+ public void notifyActionChanged(int position) {
+ if (mAdapter != null) {
+ mAdapter.notifyItemChanged(position);
+ }
+ }
+
+ /**
* Returns the view corresponding to the action at the indicated position in the list of
* actions for this fragment.
* @param position The integer position of the action of interest.
@@ -649,12 +702,20 @@
actionContainer.addView(actionsView);
GuidedActionAdapter.EditListener editListener = new GuidedActionAdapter.EditListener() {
+
@Override
- public void onGuidedActionEdited(GuidedAction action, boolean entering) {
- runImeAnimations(entering);
- if (!entering) {
- GuidedStepSupportFragment.this.onGuidedActionEdited(action);
- }
+ public void onImeOpen() {
+ runImeAnimations(true);
+ }
+
+ @Override
+ public void onImeClose() {
+ runImeAnimations(false);
+ }
+
+ @Override
+ public long onGuidedActionEdited(GuidedAction action) {
+ return GuidedStepSupportFragment.this.onGuidedActionEditedAndProceed(action);
}
};
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GuidedAction.java b/v17/leanback/src/android/support/v17/leanback/widget/GuidedAction.java
index 7949ea7..6df5db0 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GuidedAction.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GuidedAction.java
@@ -34,24 +34,34 @@
private static final String TAG = "GuidedAction";
- public static final int NO_DRAWABLE = 0;
public static final int NO_CHECK_SET = 0;
public static final int DEFAULT_CHECK_SET_ID = 1;
/**
+ * When finishing editing, goes to next action.
+ */
+ public static final int ACTION_ID_NEXT = -2;
+ /**
+ * When finishing editing, stay on current action.
+ */
+ public static final int ACTION_ID_CURRENT = -3;
+
+ /**
* Builds a {@link GuidedAction} object.
*/
public static class Builder {
private long mId;
- private String mTitle;
- private String mEditTitle;
- private String mDescription;
+ private CharSequence mTitle;
+ private CharSequence mEditTitle;
+ private CharSequence mDescription;
+ private CharSequence mEditDescription;
private Drawable mIcon;
private boolean mChecked;
private boolean mMultilineDescription;
private boolean mHasNext;
private boolean mInfoOnly;
private boolean mEditable = false;
+ private boolean mDescriptionEditable = false;
private int mCheckSetId = NO_CHECK_SET;
private boolean mEnabled = true;
private Intent mIntent;
@@ -67,11 +77,13 @@
action.setLabel1(mTitle);
action.setEditTitle(mEditTitle);
action.setLabel2(mDescription);
+ action.setEditDescription(mEditDescription);
action.setIcon(mIcon);
// Subclass values
action.mIntent = mIntent;
action.mEditable = mEditable;
+ action.mDescriptionEditable = mDescriptionEditable;
action.mChecked = mChecked;
action.mCheckSetId = mCheckSetId;
action.mMultilineDescription = mMultilineDescription;
@@ -96,7 +108,7 @@
* action to be taken on click, e.g. "Continue" or "Cancel".
* @param title The title for this action.
*/
- public Builder title(String title) {
+ public Builder title(CharSequence title) {
mTitle = title;
return this;
}
@@ -105,7 +117,7 @@
* Sets the optional title text to edit. When TextView is activated, the edit title
* replaces the string of title.
*/
- public Builder editTitle(String editTitle) {
+ public Builder editTitle(CharSequence editTitle) {
mEditTitle = editTitle;
return this;
}
@@ -115,12 +127,22 @@
* providing extra information on what the action will do.
* @param description The description for this action.
*/
- public Builder description(String description) {
+ public Builder description(CharSequence description) {
mDescription = description;
return this;
}
/**
+ * Sets the optional description text to edit. When TextView is activated, the edit
+ * description replaces the string of description.
+ * @param description The description to edit for this action.
+ */
+ public Builder editDescription(CharSequence description) {
+ mEditDescription = description;
+ return this;
+ }
+
+ /**
* Sets the intent associated with this action. Clients would typically fire this intent
* directly when the action is clicked.
* @param intent The intent associated with this action.
@@ -164,12 +186,24 @@
}
/**
+ * Indicates whether this action's description is editable
+ * @param editable Whether this action description is editable.
+ */
+ public Builder descriptionEditable(boolean editable) {
+ mDescriptionEditable = editable;
+ if (mChecked || mCheckSetId != NO_CHECK_SET) {
+ throw new IllegalArgumentException("Editable actions cannot also be checked");
+ }
+ return this;
+ }
+
+ /**
* Indicates whether this action is initially checked.
* @param checked Whether this action is checked.
*/
public Builder checked(boolean checked) {
mChecked = checked;
- if (mEditable) {
+ if (mEditable || mDescriptionEditable) {
throw new IllegalArgumentException("Editable actions cannot also be checked");
}
return this;
@@ -183,7 +217,7 @@
*/
public Builder checkSetId(int checkSetId) {
mCheckSetId = checkSetId;
- if (mEditable) {
+ if (mEditable || mDescriptionEditable) {
throw new IllegalArgumentException("Editable actions cannot also be in check sets");
}
return this;
@@ -228,7 +262,9 @@
}
private CharSequence mEditTitle;
+ private CharSequence mEditDescription;
private boolean mEditable;
+ private boolean mDescriptionEditable;
private boolean mMultilineDescription;
private boolean mHasNext;
private boolean mChecked;
@@ -276,6 +312,24 @@
}
/**
+ * Returns the optional description text to edit. When not null, it is being edited instead of
+ * {@link #getDescription()}.
+ * @return Optional description text to edit instead of {@link #getDescription()}.
+ */
+ public CharSequence getEditDescription() {
+ return mEditDescription;
+ }
+
+ /**
+ * Sets the optional description text to edit instead of {@link #setDescription(CharSequence)}.
+ * @param editDescription Optional description text to edit instead of
+ * {@link #setDescription(CharSequence)}.
+ */
+ public void setEditDescription(CharSequence editDescription) {
+ mEditDescription = editDescription;
+ }
+
+ /**
* Returns true if {@link #getEditTitle()} is not null. When true, the {@link #getEditTitle()}
* is being edited instead of {@link #getTitle()}.
* @return true if {@link #getEditTitle()} is not null.
@@ -317,6 +371,14 @@
}
/**
+ * Returns whether this action description is editable.
+ * @return true if the action description is editable, false otherwise.
+ */
+ public boolean isDescriptionEditable() {
+ return mDescriptionEditable;
+ }
+
+ /**
* Returns whether this action is checked.
* @return true if the action is currently checked, false otherwise.
*/
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java b/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
index ae281b8..75bb841 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
@@ -133,6 +133,8 @@
private ImageView mIconView;
private ImageView mCheckmarkView;
private ImageView mChevronView;
+ private boolean mInEditing;
+ private boolean mInEditingDescription;
/**
* Constructs an ViewHolder and caches the relevant subviews.
@@ -179,6 +181,14 @@
}
/**
+ * Convenience method to return an editable version of the description, if possible,
+ * or null if the description view isn't an EditText.
+ */
+ public EditText getEditableDescriptionView() {
+ return (mDescriptionView instanceof EditText) ? (EditText)mDescriptionView : null;
+ }
+
+ /**
* Returns the icon view within this view holder's view.
*/
public ImageView getIconView() {
@@ -199,6 +209,27 @@
return mChevronView;
}
+ /**
+ * Returns true if the TextView is in editing title or description, false otherwise.
+ */
+ public boolean isInEditing() {
+ return mInEditing;
+ }
+
+ /**
+ * Returns true if the TextView is in editing description, false otherwise.
+ */
+ public boolean isInEditingDescription() {
+ return mInEditingDescription;
+ }
+
+ public View getEditingView() {
+ if (mInEditing) {
+ return mInEditingDescription ? mDescriptionView : mTitleView;
+ } else {
+ return null;
+ }
+ }
}
private static String TAG = "GuidedActionsStylist";
@@ -208,6 +239,10 @@
protected View mSelectorView;
// Cached values from resources
+ private float mEnabledTextAlpha;
+ private float mDisabledTextAlpha;
+ private float mEnabledDescriptionAlpha;
+ private float mDisabledDescriptionAlpha;
private float mEnabledChevronAlpha;
private float mDisabledChevronAlpha;
private int mContentWidth;
@@ -285,6 +320,14 @@
mDisplayHeight = ((WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay().getHeight();
+ mEnabledTextAlpha = Float.valueOf(ctx.getResources().getString(R.string
+ .lb_guidedactions_item_unselected_text_alpha));
+ mDisabledTextAlpha = Float.valueOf(ctx.getResources().getString(R.string
+ .lb_guidedactions_item_disabled_text_alpha));
+ mEnabledDescriptionAlpha = Float.valueOf(ctx.getResources().getString(R.string
+ .lb_guidedactions_item_unselected_description_text_alpha));
+ mDisabledDescriptionAlpha = Float.valueOf(ctx.getResources().getString(R.string
+ .lb_guidedactions_item_disabled_description_text_alpha));
return mMainView;
}
@@ -350,11 +393,14 @@
if (vh.mTitleView != null) {
vh.mTitleView.setText(action.getTitle());
+ vh.mTitleView.setAlpha(action.isEnabled() ? mEnabledTextAlpha : mDisabledTextAlpha);
}
if (vh.mDescriptionView != null) {
vh.mDescriptionView.setText(action.getDescription());
vh.mDescriptionView.setVisibility(TextUtils.isEmpty(action.getDescription()) ?
View.GONE : View.VISIBLE);
+ vh.mDescriptionView.setAlpha(action.isEnabled() ? mEnabledDescriptionAlpha :
+ mDisabledDescriptionAlpha);
}
// Clients might want the check mark view to be gone entirely, in which case, ignore it.
if (vh.mCheckmarkView != null && vh.mCheckmarkView.getVisibility() != View.GONE) {
@@ -393,6 +439,51 @@
vh.mDescriptionView.setMaxLines(mDescriptionMinLines);
}
}
+ setEditingMode(vh, action, false);
+ }
+
+ public void setEditingMode(ViewHolder vh, GuidedAction action, boolean editing) {
+ if (editing != vh.mInEditing) {
+ vh.mInEditing = editing;
+ onEditingModeChange(vh, action, editing);
+ }
+ }
+
+ protected void onEditingModeChange(ViewHolder vh, GuidedAction action, boolean editing) {
+ TextView titleView = vh.getTitleView();
+ TextView descriptionView = vh.getDescriptionView();
+ if (editing) {
+ CharSequence editTitle = action.getEditTitle();
+ if (titleView != null && editTitle != null) {
+ titleView.setText(editTitle);
+ }
+ CharSequence editDescription = action.getEditDescription();
+ if (descriptionView != null && editDescription != null) {
+ descriptionView.setText(editDescription);
+ }
+ if (action.isDescriptionEditable()) {
+ if (descriptionView != null) {
+ descriptionView.setVisibility(View.VISIBLE);
+ }
+ vh.mInEditingDescription = true;
+ } else {
+ vh.mInEditingDescription = false;
+ }
+ } else {
+ if (titleView != null) {
+ titleView.setText(action.getTitle());
+ }
+ if (descriptionView != null) {
+ descriptionView.setText(action.getDescription());
+ }
+ if (vh.mInEditingDescription) {
+ if (descriptionView != null) {
+ descriptionView.setVisibility(TextUtils.isEmpty(action.getDescription()) ?
+ View.GONE : View.VISIBLE);
+ }
+ vh.mInEditingDescription = false;
+ }
+ }
}
/**
diff --git a/v17/preference-leanback/Android.mk b/v17/preference-leanback/Android.mk
index 8b6a0a1..14be7eb 100644
--- a/v17/preference-leanback/Android.mk
+++ b/v17/preference-leanback/Android.mk
@@ -34,6 +34,8 @@
LOCAL_JAR_EXCLUDE_FILES := none
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of API 21.
@@ -45,6 +47,8 @@
android-support-v17-leanback
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# Here is the final static library that apps can link against.
# The R class is automatically excluded from the generated library.
# Applications that use this library must specify LOCAL_RESOURCE_DIR
@@ -66,11 +70,12 @@
android-support-v17-preference-leanback-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# API Check
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
-support_module_src_files := $(LOCAL_SRC_FILES)
support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
support_module_java_packages := android.support.v17.preference
include $(SUPPORT_API_CHECK)
diff --git a/v4/Android.mk b/v4/Android.mk
index 2050725..5296369 100644
--- a/v4/Android.mk
+++ b/v4/Android.mk
@@ -22,6 +22,9 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-annotations
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+support_module_java_libraries := android-support-annotations
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Eclair APIs.
@@ -32,6 +35,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-donut
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Eclair MR1 APIs.
@@ -42,6 +47,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-eclair
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Froyo APIs.
@@ -52,6 +59,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-eclair-mr1
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Gingerbread APIs.
@@ -62,6 +71,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-froyo
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Honeycomb APIs.
@@ -72,6 +83,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-gingerbread
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Honeycomb MR1 APIs.
@@ -82,6 +95,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-honeycomb
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Honeycomb MR2 APIs.
@@ -92,6 +107,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-honeycomb-mr1
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Ice Cream Sandwich APIs.
@@ -102,6 +119,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-honeycomb-mr2
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Ice Cream Sandwich MR1 APIs.
@@ -112,6 +131,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-ics
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of JellyBean APIs.
@@ -122,6 +143,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-ics-mr1
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of JellyBean MR1 APIs.
@@ -132,6 +155,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-jellybean
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of JellyBean MR2 APIs.
@@ -142,6 +167,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-jellybean-mr1
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of KitKat APIs.
@@ -152,6 +179,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-jellybean-mr2
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of V20 APIs.
@@ -162,6 +191,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-kitkat
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of Lollipop APIs.
@@ -172,6 +203,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-api20
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of V22 APIs.
@@ -182,6 +215,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-api21
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# A helper sub-library that makes direct use of V23 APIs.
@@ -192,6 +227,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4-api22
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# -----------------------------------------------------------------------
# Here is the final static library that apps can link against.
@@ -204,11 +241,12 @@
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4-api23
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+support_module_aidl_includes := $(LOCAL_AIDL_INCLUDES)
+
# API Check
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
-support_module_src_files := $(LOCAL_SRC_FILES)
-support_module_java_libraries := android-support-v4
support_module_java_packages := android.support.v4.*
include $(SUPPORT_API_CHECK)
diff --git a/v4/api/current.txt b/v4/api/current.txt
index 4f04ab0..d5b09eb 100644
--- a/v4/api/current.txt
+++ b/v4/api/current.txt
@@ -26,36 +26,6 @@
}
-package android.support.v4.animation {
-
- public abstract class AnimatorCompatHelper {
- method public static void clearInterpolator(android.view.View);
- method public static android.support.v4.animation.ValueAnimatorCompat emptyValueAnimator();
- }
-
- public abstract interface AnimatorListenerCompat {
- method public abstract void onAnimationCancel(android.support.v4.animation.ValueAnimatorCompat);
- method public abstract void onAnimationEnd(android.support.v4.animation.ValueAnimatorCompat);
- method public abstract void onAnimationRepeat(android.support.v4.animation.ValueAnimatorCompat);
- method public abstract void onAnimationStart(android.support.v4.animation.ValueAnimatorCompat);
- }
-
- public abstract interface AnimatorUpdateListenerCompat {
- method public abstract void onAnimationUpdate(android.support.v4.animation.ValueAnimatorCompat);
- }
-
- public abstract interface ValueAnimatorCompat {
- method public abstract void addListener(android.support.v4.animation.AnimatorListenerCompat);
- method public abstract void addUpdateListener(android.support.v4.animation.AnimatorUpdateListenerCompat);
- method public abstract void cancel();
- method public abstract float getAnimatedFraction();
- method public abstract void setDuration(long);
- method public abstract void setTarget(android.view.View);
- method public abstract void start();
- }
-
-}
-
package android.support.v4.app {
public deprecated class ActionBarDrawerToggle implements android.support.v4.widget.DrawerLayout.DrawerListener {
@@ -562,7 +532,7 @@
field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
}
- public static class NotificationCompat.Action extends android.support.v4.app.NotificationCompatBase.Action {
+ public static class NotificationCompat.Action {
ctor public NotificationCompat.Action(int, java.lang.CharSequence, android.app.PendingIntent);
method public android.app.PendingIntent getActionIntent();
method public android.os.Bundle getExtras();
@@ -683,7 +653,7 @@
method public android.support.v4.app.NotificationCompat.CarExtender setUnreadConversation(android.support.v4.app.NotificationCompat.CarExtender.UnreadConversation);
}
- public static class NotificationCompat.CarExtender.UnreadConversation extends android.support.v4.app.NotificationCompatBase.UnreadConversation {
+ public static class NotificationCompat.CarExtender.UnreadConversation {
method public long getLatestTimestamp();
method public java.lang.String[] getMessages();
method public java.lang.String getParticipant();
@@ -772,23 +742,6 @@
field public static final int UNSET_ACTION_INDEX = -1; // 0xffffffff
}
- public class NotificationCompatBase {
- ctor public NotificationCompatBase();
- }
-
- public static abstract class NotificationCompatBase.Action {
- ctor public NotificationCompatBase.Action();
- method public abstract android.app.PendingIntent getActionIntent();
- method public abstract android.os.Bundle getExtras();
- method public abstract int getIcon();
- method public abstract android.support.v4.app.RemoteInputCompatBase.RemoteInput[] getRemoteInputs();
- method public abstract java.lang.CharSequence getTitle();
- }
-
- public static abstract class NotificationCompatBase.UnreadConversation {
- ctor public NotificationCompatBase.UnreadConversation();
- }
-
public final class NotificationCompatExtras {
field public static final java.lang.String EXTRA_ACTION_EXTRAS = "android.support.actionExtras";
field public static final java.lang.String EXTRA_GROUP_KEY = "android.support.groupKey";
@@ -2365,6 +2318,13 @@
method public abstract int computeVerticalScrollRange();
}
+ public abstract interface TintableBackgroundView {
+ method public abstract android.content.res.ColorStateList getSupportBackgroundTintList();
+ method public abstract android.graphics.PorterDuff.Mode getSupportBackgroundTintMode();
+ method public abstract void setSupportBackgroundTintList(android.content.res.ColorStateList);
+ method public abstract void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode);
+ }
+
public class VelocityTrackerCompat {
ctor public VelocityTrackerCompat();
method public static float getXVelocity(android.view.VelocityTracker, int);
@@ -3456,6 +3416,13 @@
method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, int, int, int, int);
}
+ public abstract interface TintableCompoundButton {
+ method public abstract android.content.res.ColorStateList getSupportButtonTintList();
+ method public abstract android.graphics.PorterDuff.Mode getSupportButtonTintMode();
+ method public abstract void setSupportButtonTintList(android.content.res.ColorStateList);
+ method public abstract void setSupportButtonTintMode(android.graphics.PorterDuff.Mode);
+ }
+
public class ViewDragHelper {
method public void abort();
method protected boolean canScroll(android.view.View, boolean, int, int, int, int);
diff --git a/v4/api23/android/support/v4/app/AppOpsManagerCompat23.java b/v4/api23/android/support/v4/app/AppOpsManagerCompat23.java
index 64a1206..72e07bf 100644
--- a/v4/api23/android/support/v4/app/AppOpsManagerCompat23.java
+++ b/v4/api23/android/support/v4/app/AppOpsManagerCompat23.java
@@ -22,7 +22,7 @@
/**
* AppOpsManager implementations for API 23.
*/
-public class AppOpsManagerCompat23 {
+class AppOpsManagerCompat23 {
public static String permissionToOp(String permission) {
return AppOpsManager.permissionToOp(permission);
}
diff --git a/v4/api23/android/support/v4/text/ICUCompatApi23.java b/v4/api23/android/support/v4/text/ICUCompatApi23.java
index f013522..1a3c54f 100644
--- a/v4/api23/android/support/v4/text/ICUCompatApi23.java
+++ b/v4/api23/android/support/v4/text/ICUCompatApi23.java
@@ -22,7 +22,7 @@
import java.lang.reflect.Method;
import java.util.Locale;
-public class ICUCompatApi23 {
+class ICUCompatApi23 {
private static final String TAG = "ICUCompatIcs";
diff --git a/v4/donut/android/support/v4/animation/ValueAnimatorCompat.java b/v4/donut/android/support/v4/animation/ValueAnimatorCompat.java
index 6d98c97..07cc602 100644
--- a/v4/donut/android/support/v4/animation/ValueAnimatorCompat.java
+++ b/v4/donut/android/support/v4/animation/ValueAnimatorCompat.java
@@ -19,7 +19,7 @@
import android.view.View;
/**
- * Compatibility implementation for {@link android.animation.Animator}.
+ * Compatibility implementation for {@code android.animation.ValueAnimator}.
*
* @hide
*/
diff --git a/v4/ics/android/support/v4/view/ViewParentCompatICS.java b/v4/ics/android/support/v4/view/ViewParentCompatICS.java
index 251de0e..f9fc5a5 100644
--- a/v4/ics/android/support/v4/view/ViewParentCompatICS.java
+++ b/v4/ics/android/support/v4/view/ViewParentCompatICS.java
@@ -23,7 +23,7 @@
/**
* ICS-specific ViewParent API implementation.
*/
-public class ViewParentCompatICS {
+class ViewParentCompatICS {
public static boolean requestSendAccessibilityEvent(
ViewParent parent, View child, AccessibilityEvent event) {
return parent.requestSendAccessibilityEvent(child, event);
diff --git a/v4/java/android/support/v4/animation/AnimatorCompatHelper.java b/v4/java/android/support/v4/animation/AnimatorCompatHelper.java
index 8fa3679..6ebe5c8 100644
--- a/v4/java/android/support/v4/animation/AnimatorCompatHelper.java
+++ b/v4/java/android/support/v4/animation/AnimatorCompatHelper.java
@@ -19,9 +19,12 @@
import android.os.Build;
import android.view.View;
-abstract public class AnimatorCompatHelper {
+/**
+ * @hide
+ */
+public final class AnimatorCompatHelper {
- static AnimatorProvider IMPL;
+ private final static AnimatorProvider IMPL;
static {
if (Build.VERSION.SDK_INT >= 12) {
@@ -35,9 +38,7 @@
return IMPL.emptyValueAnimator();
}
- AnimatorCompatHelper() {
-
- }
+ private AnimatorCompatHelper() {}
public static void clearInterpolator(View view) {
IMPL.clearInterpolator(view);
diff --git a/v4/java/android/support/v4/app/Fragment.java b/v4/java/android/support/v4/app/Fragment.java
index 79f21ff..48fc495 100644
--- a/v4/java/android/support/v4/app/Fragment.java
+++ b/v4/java/android/support/v4/app/Fragment.java
@@ -272,9 +272,6 @@
// If set this fragment is being retained across the current config change.
boolean mRetaining;
-
- // If set this fragment's loaders are being retained across the current config change.
- boolean mRetainLoader;
// If set this fragment has menu items to contribute.
boolean mHasMenu;
@@ -2153,7 +2150,7 @@
mLoaderManager = mHost.getLoaderManager(mWho, mLoadersStarted, false);
}
if (mLoaderManager != null) {
- if (mRetainLoader) {
+ if (mHost.getRetainLoaders()) {
mLoaderManager.doRetain();
} else {
mLoaderManager.doStop();
diff --git a/v4/java/android/support/v4/app/FragmentController.java b/v4/java/android/support/v4/app/FragmentController.java
index dbf9ee7..5d647b0 100644
--- a/v4/java/android/support/v4/app/FragmentController.java
+++ b/v4/java/android/support/v4/app/FragmentController.java
@@ -346,7 +346,6 @@
*/
public void doLoaderStop(boolean retain) {
mHost.doLoaderStop(retain);
- mHost.mFragmentManager.setRetainLoader(retain);
}
/**
diff --git a/v4/java/android/support/v4/app/FragmentHostCallback.java b/v4/java/android/support/v4/app/FragmentHostCallback.java
index fb4410f..5d6145a 100644
--- a/v4/java/android/support/v4/app/FragmentHostCallback.java
+++ b/v4/java/android/support/v4/app/FragmentHostCallback.java
@@ -42,9 +42,14 @@
private final Handler mHandler;
final int mWindowAnimations;
final FragmentManagerImpl mFragmentManager = new FragmentManagerImpl();
+ /** The loader managers for individual fragments [i.e. Fragment#getLoaderManager()] */
private SimpleArrayMap<String, LoaderManager> mAllLoaderManagers;
+ /** Whether or not fragment loaders should retain their state */
+ private boolean mRetainLoaders;
+ /** The loader manger for the fragment host [i.e. Activity#getLoaderManager()] */
private LoaderManagerImpl mLoaderManager;
private boolean mCheckedForLoaderManager;
+ /** Whether or not the fragment host loader manager was started */
private boolean mLoadersStarted;
public FragmentHostCallback(Context context, Handler handler, int windowAnimations) {
@@ -197,6 +202,10 @@
void onAttachFragment(Fragment fragment) {
}
+ boolean getRetainLoaders() {
+ return mRetainLoaders;
+ }
+
void doLoaderStart() {
if (mLoadersStarted) {
return;
@@ -217,6 +226,8 @@
// retain -- whether to stop the loader or retain it
void doLoaderStop(boolean retain) {
+ mRetainLoaders = retain;
+
if (mLoaderManager == null) {
return;
}
diff --git a/v4/java/android/support/v4/app/FragmentManager.java b/v4/java/android/support/v4/app/FragmentManager.java
index 4673f8c..50bc88b 100644
--- a/v4/java/android/support/v4/app/FragmentManager.java
+++ b/v4/java/android/support/v4/app/FragmentManager.java
@@ -959,17 +959,6 @@
}
}
- void setRetainLoader(boolean retain) {
- if (mActive != null) {
- for (int i=0; i<mActive.size(); i++) {
- Fragment f = mActive.get(i);
- if (f != null) {
- f.mRetainLoader = retain;
- }
- }
- }
- }
-
void moveToState(Fragment f, int newState, int transit, int transitionStyle,
boolean keepActive) {
// Fragments that are not currently added will sit in the onCreate() state.
@@ -2305,6 +2294,7 @@
// This fragment was retained from a previous instance; get it
// going now.
fragment.mInLayout = true;
+ fragment.mHost = mHost;
// If this fragment is newly instantiated (either right now, or
// from last saved state), then give it the attributes to
// initialize itself.
diff --git a/v4/java/android/support/v4/media/session/MediaButtonReceiver.java b/v4/java/android/support/v4/media/session/MediaButtonReceiver.java
index b0c3812..d5eb0e8 100644
--- a/v4/java/android/support/v4/media/session/MediaButtonReceiver.java
+++ b/v4/java/android/support/v4/media/session/MediaButtonReceiver.java
@@ -41,7 +41,7 @@
* <intent-filter>
* <action android:name="android.intent.action.MEDIA_BUTTON" />
* </intent-filter>
- * </service>
+ * </receiver>
* </pre>
* This class assumes you have a {@link Service} in your app that controls
* media playback via a {@link MediaSessionCompat}. That {@link Service} must
diff --git a/v4/jellybean-mr1/android/support/v4/text/TextUtilsCompatJellybeanMr1.java b/v4/jellybean-mr1/android/support/v4/text/TextUtilsCompatJellybeanMr1.java
index fcdf8b5..d5b675b 100644
--- a/v4/jellybean-mr1/android/support/v4/text/TextUtilsCompatJellybeanMr1.java
+++ b/v4/jellybean-mr1/android/support/v4/text/TextUtilsCompatJellybeanMr1.java
@@ -25,7 +25,7 @@
/**
* Jellybean MR1 - specific TextUtils API access.
*/
-public class TextUtilsCompatJellybeanMr1 {
+class TextUtilsCompatJellybeanMr1 {
@NonNull
public static String htmlEncode(@NonNull String s) {
return TextUtils.htmlEncode(s);
diff --git a/v7/appcompat/res/values-v21/themes_base.xml b/v7/appcompat/res/values-v21/themes_base.xml
index 6a4ab87..6c2aa26 100644
--- a/v7/appcompat/res/values-v21/themes_base.xml
+++ b/v7/appcompat/res/values-v21/themes_base.xml
@@ -48,8 +48,6 @@
<item name="actionBarDivider">?android:attr/actionBarDivider</item>
<item name="actionBarItemBackground">@drawable/abc_action_bar_item_background_material</item>
<item name="actionButtonStyle">?android:attr/actionButtonStyle</item>
- <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
- <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="actionModeBackground">?android:attr/actionModeBackground</item>
<item name="actionModeCloseDrawable">?android:attr/actionModeCloseDrawable</item>
<item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
@@ -95,8 +93,6 @@
<item name="actionBarDivider">?android:attr/actionBarDivider</item>
<item name="actionBarItemBackground">@drawable/abc_action_bar_item_background_material</item>
<item name="actionButtonStyle">?android:attr/actionButtonStyle</item>
- <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
- <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="actionModeBackground">?android:attr/actionModeBackground</item>
<item name="actionModeCloseDrawable">?android:attr/actionModeCloseDrawable</item>
<item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
diff --git a/v7/appcompat/res/values-v23/themes_base.xml b/v7/appcompat/res/values-v23/themes_base.xml
index becb1f2..276a3c6 100644
--- a/v7/appcompat/res/values-v23/themes_base.xml
+++ b/v7/appcompat/res/values-v23/themes_base.xml
@@ -23,6 +23,9 @@
<style name="Base.V23.Theme.AppCompat" parent="Base.V22.Theme.AppCompat">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
+ <!-- We can use the platform styles on v23+ -->
+ <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
+ <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="controlBackground">@drawable/abc_control_background_material</item>
</style>
@@ -30,6 +33,9 @@
<style name="Base.V23.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
+ <!-- We can use the platform styles on v23+ -->
+ <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
+ <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="controlBackground">@drawable/abc_control_background_material</item>
</style>
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java b/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
index 2a1d02c..11417d5 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
@@ -17,6 +17,7 @@
package android.support.v7.widget;
import android.content.Context;
+import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
@@ -62,28 +63,16 @@
// Now read the compound drawable and grab any tints
if (a.hasValue(1)) {
- mDrawableLeftTint = new TintInfo();
- mDrawableLeftTint.mHasTintList = true;
- mDrawableLeftTint.mTintList = drawableManager.getTintList(
- context, a.getResourceId(1, 0));
+ mDrawableLeftTint = createTintInfo(context, drawableManager, a.getResourceId(1, 0));
}
if (a.hasValue(2)) {
- mDrawableTopTint = new TintInfo();
- mDrawableTopTint.mHasTintList = true;
- mDrawableTopTint.mTintList = drawableManager.getTintList(
- context, a.getResourceId(2, 0));
+ mDrawableTopTint = createTintInfo(context, drawableManager, a.getResourceId(2, 0));
}
if (a.hasValue(3)) {
- mDrawableRightTint = new TintInfo();
- mDrawableRightTint.mHasTintList = true;
- mDrawableRightTint.mTintList = drawableManager.getTintList(
- context, a.getResourceId(3, 0));
+ mDrawableRightTint = createTintInfo(context, drawableManager, a.getResourceId(3, 0));
}
if (a.hasValue(4)) {
- mDrawableBottomTint = new TintInfo();
- mDrawableBottomTint.mHasTintList = true;
- mDrawableBottomTint.mTintList = drawableManager.getTintList(
- context, a.getResourceId(4, 0));
+ mDrawableBottomTint = createTintInfo(context, drawableManager, a.getResourceId(4, 0));
}
a.recycle();
@@ -134,4 +123,15 @@
AppCompatDrawableManager.tintDrawable(drawable, info, mView.getDrawableState());
}
}
+
+ private static TintInfo createTintInfo(Context context,
+ AppCompatDrawableManager drawableManager, int drawableId) {
+ final ColorStateList tintList = drawableManager.getTintList(context, drawableId);
+ if (tintList != null) {
+ final TintInfo tintInfo = new TintInfo();
+ tintInfo.mHasTintList = true;
+ tintInfo.mTintList = tintList;
+ }
+ return null;
+ }
}
diff --git a/v7/cardview/Android.mk b/v7/cardview/Android.mk
index 91d82b4..dcbc4c6 100644
--- a/v7/cardview/Android.mk
+++ b/v7/cardview/Android.mk
@@ -26,6 +26,8 @@
LOCAL_JAR_EXCLUDE_FILES := none
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+
# A helper sub-library to resolve cyclic dependencies between CardView and platform dependent
# implementations
include $(CLEAR_VARS)
@@ -34,6 +36,8 @@
LOCAL_SRC_FILES := $(call all-java-files-under, base)
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of Eclair MR1 APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-cardview-eclair-mr1
@@ -43,6 +47,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v7-cardview-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of JB MR1 APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-cardview-jellybean-mr1
@@ -52,6 +58,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v7-cardview-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of L APIs
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-cardview-api21
@@ -62,6 +70,8 @@
LOCAL_JAVA_LIBRARIES := android-support-v7-cardview-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# Here is the final static library that apps can link against.
# The R class is automatically excluded from the generated library.
# Applications that use this library must specify LOCAL_RESOURCE_DIR
@@ -74,11 +84,12 @@
LOCAL_JAVA_LIBRARIES := android-support-v7-cardview-res
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# API Check
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
-support_module_src_files := $(LOCAL_SRC_FILES)
-support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES) android-support-v7-cardview
+support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
support_module_java_packages := android.support.v7.widget
include $(SUPPORT_API_CHECK)
diff --git a/v7/mediarouter/Android.mk b/v7/mediarouter/Android.mk
index f21152f..9bd9960 100644
--- a/v7/mediarouter/Android.mk
+++ b/v7/mediarouter/Android.mk
@@ -30,6 +30,8 @@
LOCAL_JAR_EXCLUDE_FILES := none
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files := $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of JellyBean APIs.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-mediarouter-jellybean
@@ -37,6 +39,8 @@
LOCAL_SRC_FILES := $(call all-java-files-under, jellybean)
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of JellyBean MR1 APIs.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-mediarouter-jellybean-mr1
@@ -45,6 +49,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-mediarouter-jellybean
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# A helper sub-library that makes direct use of JellyBean MR2 APIs.
include $(CLEAR_VARS)
LOCAL_MODULE := android-support-v7-mediarouter-jellybean-mr2
@@ -53,6 +59,8 @@
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-mediarouter-jellybean-mr1
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# Here is the final static library that apps can link against.
# The R class is automatically excluded from the generated library.
# Applications that use this library must specify LOCAL_RESOURCE_DIR
@@ -67,11 +75,13 @@
android-support-v7-palette
include $(BUILD_STATIC_JAVA_LIBRARY)
+support_module_src_files += $(LOCAL_SRC_FILES)
+
# API Check
# ---------------------------------------------
support_module := $(LOCAL_MODULE)
support_module_api_dir := $(LOCAL_PATH)/api
support_module_src_files := $(LOCAL_SRC_FILES)
-support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES) android-support-v7-mediarouter
+support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
support_module_java_packages := android.support.v7.app android.support.v7.media
include $(SUPPORT_API_CHECK)
diff --git a/v7/mediarouter/res/values-af/strings.xml b/v7/mediarouter/res/values-af/strings.xml
index 182b520..024a99c 100644
--- a/v7/mediarouter/res/values-af/strings.xml
+++ b/v7/mediarouter/res/values-af/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Stelsel"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Toestelle"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Saai uit"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-knoppie"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Saai uit na"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Vind tans toestelle"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ontkoppel"</string>
diff --git a/v7/mediarouter/res/values-am/strings.xml b/v7/mediarouter/res/values-am/strings.xml
index a76cab1..4456b45 100644
--- a/v7/mediarouter/res/values-am/strings.xml
+++ b/v7/mediarouter/res/values-am/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ስርዓት"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"መሣሪያዎች"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"የCast አዝራር"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast አድርግ ወደ"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"መሣሪያዎችን በማግኘት ላይ"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ግንኙነት አቋርጥ"</string>
diff --git a/v7/mediarouter/res/values-ar/strings.xml b/v7/mediarouter/res/values-ar/strings.xml
index 3ad27f8..7222590 100644
--- a/v7/mediarouter/res/values-ar/strings.xml
+++ b/v7/mediarouter/res/values-ar/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"النظام"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"الأجهزة"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"إرسال"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"زر الإرسال"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"إرسال إلى"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"جارٍ البحث عن أجهزة"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"قطع الاتصال"</string>
diff --git a/v7/mediarouter/res/values-az-rAZ/strings.xml b/v7/mediarouter/res/values-az-rAZ/strings.xml
index 10395dc..aa3a70f 100644
--- a/v7/mediarouter/res/values-az-rAZ/strings.xml
+++ b/v7/mediarouter/res/values-az-rAZ/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Cihazlar"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Yayım"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Yayım düyməsi"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Bura yayımlayın"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Cihazlar axtarılır"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Bağlantını kəsin"</string>
diff --git a/v7/mediarouter/res/values-bg/strings.xml b/v7/mediarouter/res/values-bg/strings.xml
index 4524b81..de49179 100644
--- a/v7/mediarouter/res/values-bg/strings.xml
+++ b/v7/mediarouter/res/values-bg/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Система"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Устройства"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Предаване"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Бутон за предаване"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Предаване към"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Търсят се устройства"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Прекратяване на връзката"</string>
diff --git a/v7/mediarouter/res/values-bn-rBD/strings.xml b/v7/mediarouter/res/values-bn-rBD/strings.xml
index 16e5f11..7eb5301 100644
--- a/v7/mediarouter/res/values-bn-rBD/strings.xml
+++ b/v7/mediarouter/res/values-bn-rBD/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"সিস্টেম"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ডিভাইসগুলি"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"কাস্ট করুন"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"কাস্ট করার বোতাম"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"এতে কাস্ট করুন"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ডিভাইসগুলিকে খোঁজা হচ্ছে"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"সংযোগ বিচ্ছিন্ন করুন"</string>
diff --git a/v7/mediarouter/res/values-ca/strings.xml b/v7/mediarouter/res/values-ca/strings.xml
index eb7a186..ab8809a 100644
--- a/v7/mediarouter/res/values-ca/strings.xml
+++ b/v7/mediarouter/res/values-ca/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositius"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Emet"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botó d\'emetre"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Emet a"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"S\'estan cercant dispositius"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconnecta"</string>
diff --git a/v7/mediarouter/res/values-cs/strings.xml b/v7/mediarouter/res/values-cs/strings.xml
index 0cb4a5e..57c1594 100644
--- a/v7/mediarouter/res/values-cs/strings.xml
+++ b/v7/mediarouter/res/values-cs/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Systém"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Zařízení"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Odeslat"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Tlačítko odesílání"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Odesílat do"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Hledání zařízení"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Odpojit"</string>
diff --git a/v7/mediarouter/res/values-da/strings.xml b/v7/mediarouter/res/values-da/strings.xml
index 022abda..eb6c8fa 100644
--- a/v7/mediarouter/res/values-da/strings.xml
+++ b/v7/mediarouter/res/values-da/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Enheder"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-knap"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast til"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Finder enheder"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Afbryd"</string>
diff --git a/v7/mediarouter/res/values-de/strings.xml b/v7/mediarouter/res/values-de/strings.xml
index 0c3f759..17a84af 100644
--- a/v7/mediarouter/res/values-de/strings.xml
+++ b/v7/mediarouter/res/values-de/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Geräte"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Streamen"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-Symbol"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Streamen auf"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Geräte werden gesucht."</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Verbindung trennen"</string>
diff --git a/v7/mediarouter/res/values-el/strings.xml b/v7/mediarouter/res/values-el/strings.xml
index 04f3fdb..9258296 100644
--- a/v7/mediarouter/res/values-el/strings.xml
+++ b/v7/mediarouter/res/values-el/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Σύστημα"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Συσκευές"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Μετάδοση"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Κουμπί Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Μετάδοση σε"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Εύρεση συσκευών"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Αποσύνδεση"</string>
diff --git a/v7/mediarouter/res/values-en-rAU/strings.xml b/v7/mediarouter/res/values-en-rAU/strings.xml
index 3ee5c4e..5edd79b 100644
--- a/v7/mediarouter/res/values-en-rAU/strings.xml
+++ b/v7/mediarouter/res/values-en-rAU/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Devices"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast button"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast to"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Finding devices"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Disconnect"</string>
diff --git a/v7/mediarouter/res/values-en-rGB/strings.xml b/v7/mediarouter/res/values-en-rGB/strings.xml
index 3ee5c4e..5edd79b 100644
--- a/v7/mediarouter/res/values-en-rGB/strings.xml
+++ b/v7/mediarouter/res/values-en-rGB/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Devices"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast button"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast to"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Finding devices"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Disconnect"</string>
diff --git a/v7/mediarouter/res/values-en-rIN/strings.xml b/v7/mediarouter/res/values-en-rIN/strings.xml
index 3ee5c4e..5edd79b 100644
--- a/v7/mediarouter/res/values-en-rIN/strings.xml
+++ b/v7/mediarouter/res/values-en-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Devices"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast button"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast to"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Finding devices"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Disconnect"</string>
diff --git a/v7/mediarouter/res/values-es-rUS/strings.xml b/v7/mediarouter/res/values-es-rUS/strings.xml
index 3074ef2..b0a0a61 100644
--- a/v7/mediarouter/res/values-es-rUS/strings.xml
+++ b/v7/mediarouter/res/values-es-rUS/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmitir"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botón para transmitir"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmitir a"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Buscando dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconectar"</string>
diff --git a/v7/mediarouter/res/values-es/strings.xml b/v7/mediarouter/res/values-es/strings.xml
index 8c6e340..3a1eaeb 100644
--- a/v7/mediarouter/res/values-es/strings.xml
+++ b/v7/mediarouter/res/values-es/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Enviar"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botón de enviar"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Enviar a"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Buscando dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconectar"</string>
diff --git a/v7/mediarouter/res/values-et-rEE/strings.xml b/v7/mediarouter/res/values-et-rEE/strings.xml
index 2de394d..9058dcf 100644
--- a/v7/mediarouter/res/values-et-rEE/strings.xml
+++ b/v7/mediarouter/res/values-et-rEE/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Süsteem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Seadmed"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Ülekandmine"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Ülekandenupp"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Ülekandmine seadmesse"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Seadmete otsimine"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Katkesta ühendus"</string>
diff --git a/v7/mediarouter/res/values-eu-rES/strings.xml b/v7/mediarouter/res/values-eu-rES/strings.xml
index 8eb2541..ad85c5a 100644
--- a/v7/mediarouter/res/values-eu-rES/strings.xml
+++ b/v7/mediarouter/res/values-eu-rES/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Gailuak"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Igorri"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Igorri botoia"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Igorri hona"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Gailuak bilatzen"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Deskonektatu"</string>
diff --git a/v7/mediarouter/res/values-fa/strings.xml b/v7/mediarouter/res/values-fa/strings.xml
index dcd95a9..87a81ba 100644
--- a/v7/mediarouter/res/values-fa/strings.xml
+++ b/v7/mediarouter/res/values-fa/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"سیستم"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"دستگاهها"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ارسال محتوا"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"دکمه ارسال محتوا"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ارسال محتوا به"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"پیدا کردن دستگاهها"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"قطع ارتباط"</string>
diff --git a/v7/mediarouter/res/values-fi/strings.xml b/v7/mediarouter/res/values-fi/strings.xml
index 30c08c4..a93d74e 100644
--- a/v7/mediarouter/res/values-fi/strings.xml
+++ b/v7/mediarouter/res/values-fi/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Järjestelmä"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Laitteet"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Suoratoisto"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-painike"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Suoratoiston kohde"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Etsitään laitteita"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Katkaise yhteys"</string>
diff --git a/v7/mediarouter/res/values-fr-rCA/strings.xml b/v7/mediarouter/res/values-fr-rCA/strings.xml
index dc2341d..f0c6976 100644
--- a/v7/mediarouter/res/values-fr-rCA/strings.xml
+++ b/v7/mediarouter/res/values-fr-rCA/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Système"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Appareils"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Diffuser"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Bouton Diffuser"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Diffuser sur"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Recherche d\'appareils"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Se déconnecter"</string>
diff --git a/v7/mediarouter/res/values-fr/strings.xml b/v7/mediarouter/res/values-fr/strings.xml
index 314a622..de94f18 100644
--- a/v7/mediarouter/res/values-fr/strings.xml
+++ b/v7/mediarouter/res/values-fr/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Système"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Appareils"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Diffuser"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Icône Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Diffuser sur"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Recherche d\'appareils en cours…"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Déconnecter"</string>
diff --git a/v7/mediarouter/res/values-gl-rES/strings.xml b/v7/mediarouter/res/values-gl-rES/strings.xml
index c589176..fb76c68 100644
--- a/v7/mediarouter/res/values-gl-rES/strings.xml
+++ b/v7/mediarouter/res/values-gl-rES/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Emitir"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botón de emitir"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Emitir en"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Buscando dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconectar"</string>
diff --git a/v7/mediarouter/res/values-gu-rIN/strings.xml b/v7/mediarouter/res/values-gu-rIN/strings.xml
index 46eb0da..211f836 100644
--- a/v7/mediarouter/res/values-gu-rIN/strings.xml
+++ b/v7/mediarouter/res/values-gu-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"સિસ્ટમ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ઉપકરણો"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"કાસ્ટ કરો"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"કાસ્ટ કરો બટન"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"આના પર કાસ્ટ કરો"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ઉપકરણો શોધી રહ્યાં છીએ"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ડિસ્કનેક્ટ કરો"</string>
diff --git a/v7/mediarouter/res/values-hi/strings.xml b/v7/mediarouter/res/values-hi/strings.xml
index 5323564..e2c7a43 100644
--- a/v7/mediarouter/res/values-hi/strings.xml
+++ b/v7/mediarouter/res/values-hi/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"सिस्टम"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"डिवाइस"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"कास्ट करें"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"कास्ट करें बटन"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"इस पर कास्ट करें"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"डिवाइस ढूंढ रहा है"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"डिस्कनेक्ट करें"</string>
diff --git a/v7/mediarouter/res/values-hr/strings.xml b/v7/mediarouter/res/values-hr/strings.xml
index 9b60d2b..d79258f 100644
--- a/v7/mediarouter/res/values-hr/strings.xml
+++ b/v7/mediarouter/res/values-hr/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sustav"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Uređaji"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Emitiranje"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Gumb za emitiranje"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Emitiranje na"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Traženje uređaja"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Prekini vezu"</string>
diff --git a/v7/mediarouter/res/values-hu/strings.xml b/v7/mediarouter/res/values-hu/strings.xml
index 52e2d30..7686fea 100644
--- a/v7/mediarouter/res/values-hu/strings.xml
+++ b/v7/mediarouter/res/values-hu/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Rendszer"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Eszközök"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Tartalomátküldés"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Átküldés gomb"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Átküldés ide"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Eszközök keresése"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Leválasztás"</string>
diff --git a/v7/mediarouter/res/values-hy-rAM/strings.xml b/v7/mediarouter/res/values-hy-rAM/strings.xml
index 0468d80..85bd488 100644
--- a/v7/mediarouter/res/values-hy-rAM/strings.xml
+++ b/v7/mediarouter/res/values-hy-rAM/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Համակարգ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Սարքեր"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Հեռարձակում"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Հեռարձակման կոճակ"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Հեռարձակել դեպի"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Սարքերի որոնում"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Անջատել"</string>
diff --git a/v7/mediarouter/res/values-in/strings.xml b/v7/mediarouter/res/values-in/strings.xml
index b9c347f..3d01880 100644
--- a/v7/mediarouter/res/values-in/strings.xml
+++ b/v7/mediarouter/res/values-in/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Perangkat"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmisi"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Tombol transmisi"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmisi ke"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Mencari perangkat"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Putuskan sambungan"</string>
diff --git a/v7/mediarouter/res/values-is-rIS/strings.xml b/v7/mediarouter/res/values-is-rIS/strings.xml
index 54a33a1..366f6f6 100644
--- a/v7/mediarouter/res/values-is-rIS/strings.xml
+++ b/v7/mediarouter/res/values-is-rIS/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Kerfi"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Tæki"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Senda út"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Útsendingarhnappur"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Senda út í"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Leitað að tækjum"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Aftengjast"</string>
diff --git a/v7/mediarouter/res/values-it/strings.xml b/v7/mediarouter/res/values-it/strings.xml
index cb2d553..9febd99 100644
--- a/v7/mediarouter/res/values-it/strings.xml
+++ b/v7/mediarouter/res/values-it/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivi"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Trasmetti"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Pulsante Trasmetti"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Trasmetti a"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Ricerca di dispositivi in corso"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Scollega"</string>
diff --git a/v7/mediarouter/res/values-iw/strings.xml b/v7/mediarouter/res/values-iw/strings.xml
index 4e6085f..d1698a5 100644
--- a/v7/mediarouter/res/values-iw/strings.xml
+++ b/v7/mediarouter/res/values-iw/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"מערכת"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"מכשירים"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"העבר"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"לחצן הפעלת Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"העבר אל"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"מחפש מכשירים"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"נתק"</string>
diff --git a/v7/mediarouter/res/values-ja/strings.xml b/v7/mediarouter/res/values-ja/strings.xml
index 6b91989..ea8d838 100644
--- a/v7/mediarouter/res/values-ja/strings.xml
+++ b/v7/mediarouter/res/values-ja/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"システム"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"端末"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"キャスト"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"キャストアイコン"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"キャスト先"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"端末を検索しています"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"接続を解除"</string>
diff --git a/v7/mediarouter/res/values-ka-rGE/strings.xml b/v7/mediarouter/res/values-ka-rGE/strings.xml
index 880ef9e..2182b64 100644
--- a/v7/mediarouter/res/values-ka-rGE/strings.xml
+++ b/v7/mediarouter/res/values-ka-rGE/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"სისტემა"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"მოწყობილობები"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ტრანსლირება"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ტრანსლირების ღილაკი"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ტრანსლირებული"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"მიმდინარეობს მოწყობილობების მოძიება"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"კავშირის გაწყვეტა"</string>
diff --git a/v7/mediarouter/res/values-kk-rKZ/strings.xml b/v7/mediarouter/res/values-kk-rKZ/strings.xml
index e501d8d..5c72c5f 100644
--- a/v7/mediarouter/res/values-kk-rKZ/strings.xml
+++ b/v7/mediarouter/res/values-kk-rKZ/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Жүйе"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Құрылғылар"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Трансляциялау"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Трансляциялау түймесі"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Келесіге трансляциялау"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Құрылғыларды табу"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ажырату"</string>
diff --git a/v7/mediarouter/res/values-km-rKH/strings.xml b/v7/mediarouter/res/values-km-rKH/strings.xml
index f399f8f..cdf94db 100644
--- a/v7/mediarouter/res/values-km-rKH/strings.xml
+++ b/v7/mediarouter/res/values-km-rKH/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ប្រព័ន្ធ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ឧបករណ៍"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ខាស"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ប៊ូតុងខាស"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ខាសទៅ"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ស្វែងរកឧបករណ៍"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ផ្ដាច់"</string>
diff --git a/v7/mediarouter/res/values-kn-rIN/strings.xml b/v7/mediarouter/res/values-kn-rIN/strings.xml
index b80b9f9..970dc41 100644
--- a/v7/mediarouter/res/values-kn-rIN/strings.xml
+++ b/v7/mediarouter/res/values-kn-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ಸಿಸ್ಟಂ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ಸಾಧನಗಳು"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ಬಿತ್ತರಿಸುವಿಕೆ"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ಬಿತ್ತರಿಸು ಬಟನ್"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ಇದಕ್ಕೆ ಬಿತ್ತರಿಸಿ"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ಸಾಧನಗಳನ್ನು ಹುಡುಕಲಾಗುತ್ತಿದೆ"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ಸಂಪರ್ಕ ಕಡಿತಗೊಳಿಸು"</string>
diff --git a/v7/mediarouter/res/values-ko/strings.xml b/v7/mediarouter/res/values-ko/strings.xml
index f96913f..2b3455f 100644
--- a/v7/mediarouter/res/values-ko/strings.xml
+++ b/v7/mediarouter/res/values-ko/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"시스템"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"기기"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"전송"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"전송 버튼"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"전송 대상"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"기기를 찾는 중"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"연결 해제"</string>
diff --git a/v7/mediarouter/res/values-ky-rKG/strings.xml b/v7/mediarouter/res/values-ky-rKG/strings.xml
index cc5d44b..d7409db 100644
--- a/v7/mediarouter/res/values-ky-rKG/strings.xml
+++ b/v7/mediarouter/res/values-ky-rKG/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Систем"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Түзмөктөр"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Тышкы экранга чыгаруу"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Тышкы экранга чыгаруу баскычы"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Төмөнкүгө чыгаруу"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Түзмөктөр изделүүдө"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ажыратуу"</string>
diff --git a/v7/mediarouter/res/values-lo-rLA/strings.xml b/v7/mediarouter/res/values-lo-rLA/strings.xml
index 1fb32ee..a19dd69 100644
--- a/v7/mediarouter/res/values-lo-rLA/strings.xml
+++ b/v7/mediarouter/res/values-lo-rLA/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ລະບົບ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ອຸປະກອນ"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ຄາສທ໌"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ປຸ່ມຄາສທ໌"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ຄາສທ໌ຫາ"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ກຳລັງຊອກຫາອຸປະກອນ"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ຕັດການເຊື່ອມຕໍ່"</string>
diff --git a/v7/mediarouter/res/values-lt/strings.xml b/v7/mediarouter/res/values-lt/strings.xml
index 4a58465..d286e0c 100644
--- a/v7/mediarouter/res/values-lt/strings.xml
+++ b/v7/mediarouter/res/values-lt/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Įrenginiai"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Perduoti"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Perdavimo mygtukas"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Perduoti į"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Randami įrenginiai"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Atjungti"</string>
diff --git a/v7/mediarouter/res/values-lv/strings.xml b/v7/mediarouter/res/values-lv/strings.xml
index c9956b8..8f49d85 100644
--- a/v7/mediarouter/res/values-lv/strings.xml
+++ b/v7/mediarouter/res/values-lv/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistēma"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Ierīces"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Apraidīt"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Apraides poga"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Apraidīšana uz ierīci"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Notiek ierīču meklēšana"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Atvienot"</string>
diff --git a/v7/mediarouter/res/values-mk-rMK/strings.xml b/v7/mediarouter/res/values-mk-rMK/strings.xml
index dd9d5e6..e8ff3e7 100644
--- a/v7/mediarouter/res/values-mk-rMK/strings.xml
+++ b/v7/mediarouter/res/values-mk-rMK/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Систем"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Уреди"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Емитувај"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Копчето за Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Емитувај на"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Наоѓање уреди"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Исклучи"</string>
diff --git a/v7/mediarouter/res/values-ml-rIN/strings.xml b/v7/mediarouter/res/values-ml-rIN/strings.xml
index de8423e..7dbdf5d 100644
--- a/v7/mediarouter/res/values-ml-rIN/strings.xml
+++ b/v7/mediarouter/res/values-ml-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"സിസ്റ്റം"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ഉപകരണങ്ങൾ"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"കാസ്റ്റുചെയ്യുക"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ടാപ്പുചെയ്യുക"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ഇതിലേക്ക് കാസ്റ്റുചെയ്യുക"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ഉപകരണങ്ങൾ കണ്ടെത്തുന്നു"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"വിച്ഛേദിക്കുക"</string>
diff --git a/v7/mediarouter/res/values-mn-rMN/strings.xml b/v7/mediarouter/res/values-mn-rMN/strings.xml
index a820731..db6d599 100644
--- a/v7/mediarouter/res/values-mn-rMN/strings.xml
+++ b/v7/mediarouter/res/values-mn-rMN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Систем"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Төхөөрөмжүүд"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Дамжуулах"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Дамжуулах товчлуур"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Дамжуулах"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Төхөөрөмж хайж байна"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Салгах"</string>
diff --git a/v7/mediarouter/res/values-mr-rIN/strings.xml b/v7/mediarouter/res/values-mr-rIN/strings.xml
index c425e76..b3f9264 100644
--- a/v7/mediarouter/res/values-mr-rIN/strings.xml
+++ b/v7/mediarouter/res/values-mr-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"सिस्टम"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"डिव्हाइसेस"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"कास्ट करा"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"कास्ट बटण"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"यावर कास्ट करा"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"डिव्हाइसेस शोधत आहे"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"डिस्कनेक्ट करा"</string>
diff --git a/v7/mediarouter/res/values-ms-rMY/strings.xml b/v7/mediarouter/res/values-ms-rMY/strings.xml
index 786848b..4d7a0c8 100644
--- a/v7/mediarouter/res/values-ms-rMY/strings.xml
+++ b/v7/mediarouter/res/values-ms-rMY/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Peranti"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Hantar"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Butang Hantar"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Hantar ke"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Mencari peranti"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Putuskan sambungan"</string>
diff --git a/v7/mediarouter/res/values-my-rMM/strings.xml b/v7/mediarouter/res/values-my-rMM/strings.xml
index 557bfd3..9447089 100644
--- a/v7/mediarouter/res/values-my-rMM/strings.xml
+++ b/v7/mediarouter/res/values-my-rMM/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"စနစ်"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"စက်ပစ္စည်းများ"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ကာစ်တ်"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ကာစ်တ်လုပ်ရန် ခလုတ်"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"သို့ ကာစ်တ်လုပ်ရန်"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"စက်ပစ္စည်းများ ရှာဖွေခြင်း"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ဆက်သွယ်မှု ဖြတ်ရန်"</string>
diff --git a/v7/mediarouter/res/values-nb/strings.xml b/v7/mediarouter/res/values-nb/strings.xml
index c8b92df..aea341f 100644
--- a/v7/mediarouter/res/values-nb/strings.xml
+++ b/v7/mediarouter/res/values-nb/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Enheter"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-ikonet"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Cast til"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Finner enheter"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Koble fra"</string>
diff --git a/v7/mediarouter/res/values-ne-rNP/strings.xml b/v7/mediarouter/res/values-ne-rNP/strings.xml
index 05aa6f8..d261553 100644
--- a/v7/mediarouter/res/values-ne-rNP/strings.xml
+++ b/v7/mediarouter/res/values-ne-rNP/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"प्रणाली"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"उपकरणहरू"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast बटन"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"यसमा Cast गर्नुहोस्"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"यन्त्रहरू पत्ता लगाउँदै"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"विच्छेद गर्नुहोस्"</string>
diff --git a/v7/mediarouter/res/values-nl/strings.xml b/v7/mediarouter/res/values-nl/strings.xml
index 762139e..7843b52 100644
--- a/v7/mediarouter/res/values-nl/strings.xml
+++ b/v7/mediarouter/res/values-nl/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Systeem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Apparaten"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Casten"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-icoon"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Casten naar"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Apparaten zoeken"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Loskoppelen"</string>
diff --git a/v7/mediarouter/res/values-pa-rIN/strings.xml b/v7/mediarouter/res/values-pa-rIN/strings.xml
index 63ac0ce..55dfd88 100644
--- a/v7/mediarouter/res/values-pa-rIN/strings.xml
+++ b/v7/mediarouter/res/values-pa-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ਸਿਸਟਮ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"ਡਿਵਾਈਸਾਂ"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ਜੋੜੋ"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ਕਾਸਟ ਬਟਨ"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"ਇਸ ਨਾਲ ਕਾਸਟ ਕਰੋ"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"ਡਿਵਾਈਸਾਂ ਲੱਭ ਰਿਹਾ ਹੈ"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ਡਿਸਕਨੈਕਟ ਕਰੋ"</string>
diff --git a/v7/mediarouter/res/values-pl/strings.xml b/v7/mediarouter/res/values-pl/strings.xml
index 33c081c..c6e7f8a 100644
--- a/v7/mediarouter/res/values-pl/strings.xml
+++ b/v7/mediarouter/res/values-pl/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Urządzenia"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Przesyłaj"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Przycisk Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Przesyłaj na"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Znajdowanie urządzeń"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Odłącz"</string>
diff --git a/v7/mediarouter/res/values-pt-rBR/strings.xml b/v7/mediarouter/res/values-pt-rBR/strings.xml
index 115b278..17e64f0 100644
--- a/v7/mediarouter/res/values-pt-rBR/strings.xml
+++ b/v7/mediarouter/res/values-pt-rBR/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmitir"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botão Transmitir"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmitir para"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Localizando dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconectar"</string>
diff --git a/v7/mediarouter/res/values-pt-rPT/strings.xml b/v7/mediarouter/res/values-pt-rPT/strings.xml
index 9cf90f2..3c9d4cb 100644
--- a/v7/mediarouter/res/values-pt-rPT/strings.xml
+++ b/v7/mediarouter/res/values-pt-rPT/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmitir"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botão Transmitir"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmitir para"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"A localizar dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desassociar"</string>
diff --git a/v7/mediarouter/res/values-pt/strings.xml b/v7/mediarouter/res/values-pt/strings.xml
index 115b278..17e64f0 100644
--- a/v7/mediarouter/res/values-pt/strings.xml
+++ b/v7/mediarouter/res/values-pt/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistema"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispositivos"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmitir"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Botão Transmitir"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmitir para"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Localizando dispositivos"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Desconectar"</string>
diff --git a/v7/mediarouter/res/values-ro/strings.xml b/v7/mediarouter/res/values-ro/strings.xml
index f2c90e6..20c3b71 100644
--- a/v7/mediarouter/res/values-ro/strings.xml
+++ b/v7/mediarouter/res/values-ro/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Dispozitive"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Proiectați"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Butonul de proiecție"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Proiectați pe"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Se caută dispozitive"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Deconectați-vă"</string>
diff --git a/v7/mediarouter/res/values-ru/strings.xml b/v7/mediarouter/res/values-ru/strings.xml
index ad91e8a..5a47ec6 100644
--- a/v7/mediarouter/res/values-ru/strings.xml
+++ b/v7/mediarouter/res/values-ru/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Система"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Устройства"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Транслировать"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Кнопка трансляции"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Выберите устройство"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Поиск устройств…"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Отключить"</string>
diff --git a/v7/mediarouter/res/values-si-rLK/strings.xml b/v7/mediarouter/res/values-si-rLK/strings.xml
index fac7535..45f67ff 100644
--- a/v7/mediarouter/res/values-si-rLK/strings.xml
+++ b/v7/mediarouter/res/values-si-rLK/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"පද්ධතිය"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"උපාංග"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"විකාශය"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"විකාශ බොත්තම"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"විකාශය"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"උපාංග සෙවීම"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"විසන්ධි කරන්න"</string>
diff --git a/v7/mediarouter/res/values-sk/strings.xml b/v7/mediarouter/res/values-sk/strings.xml
index 6330497..df95e00 100644
--- a/v7/mediarouter/res/values-sk/strings.xml
+++ b/v7/mediarouter/res/values-sk/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Systém"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Zariadenia"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Prenos"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Tlačidlo prenosu"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Prenos do"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Vyhľadávanie zariadení"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Odpojiť"</string>
diff --git a/v7/mediarouter/res/values-sl/strings.xml b/v7/mediarouter/res/values-sl/strings.xml
index 486b3d5..6425222 100644
--- a/v7/mediarouter/res/values-sl/strings.xml
+++ b/v7/mediarouter/res/values-sl/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Naprave"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Predvajanje"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Gumb za predvajanje"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Predvajanje prek:"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Iskanje naprav"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Prekini povezavo"</string>
diff --git a/v7/mediarouter/res/values-sq-rAL/strings.xml b/v7/mediarouter/res/values-sq-rAL/strings.xml
index 873dc70..6f375cf 100644
--- a/v7/mediarouter/res/values-sq-rAL/strings.xml
+++ b/v7/mediarouter/res/values-sq-rAL/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistemi"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Pajisjet"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Transmeto"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Butoni i transmetimit"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Transmeto te"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Gjetja e pajisjeve"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Shkëpute"</string>
diff --git a/v7/mediarouter/res/values-sr/strings.xml b/v7/mediarouter/res/values-sr/strings.xml
index 48019fc..26a36a9 100644
--- a/v7/mediarouter/res/values-sr/strings.xml
+++ b/v7/mediarouter/res/values-sr/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Систем"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Уређаји"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Пребацивање"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Дугме Пребаци"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Пребацујте на"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Проналажење уређаја"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Прекини везу"</string>
diff --git a/v7/mediarouter/res/values-sv/strings.xml b/v7/mediarouter/res/values-sv/strings.xml
index 5702582..3e8c47b 100644
--- a/v7/mediarouter/res/values-sv/strings.xml
+++ b/v7/mediarouter/res/values-sv/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Enheter"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Casta"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Cast-knappen"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Casta till"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Letar efter enheter"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Koppla från"</string>
diff --git a/v7/mediarouter/res/values-sw/strings.xml b/v7/mediarouter/res/values-sw/strings.xml
index fb19f71..38fdb45 100644
--- a/v7/mediarouter/res/values-sw/strings.xml
+++ b/v7/mediarouter/res/values-sw/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Mfumo"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Vifaa"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Tuma"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Kitufe cha kutuma"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Tuma kwenye"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Inatafuta vifaa"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ondoa"</string>
diff --git a/v7/mediarouter/res/values-ta-rIN/strings.xml b/v7/mediarouter/res/values-ta-rIN/strings.xml
index f5ecb7b..6147b75 100644
--- a/v7/mediarouter/res/values-ta-rIN/strings.xml
+++ b/v7/mediarouter/res/values-ta-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"அமைப்பு"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"சாதனங்கள்"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"அனுப்பும்"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"அனுப்புதல் பொத்தான்"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"இதற்கு அனுப்பு"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"சாதனங்களைத் தேடுகிறது"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"தொடர்பைத் துண்டி"</string>
diff --git a/v7/mediarouter/res/values-te-rIN/strings.xml b/v7/mediarouter/res/values-te-rIN/strings.xml
index 9949915..73c75f4 100644
--- a/v7/mediarouter/res/values-te-rIN/strings.xml
+++ b/v7/mediarouter/res/values-te-rIN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"సిస్టమ్"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"పరికరాలు"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"ప్రసారం చేస్తుంది"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ప్రసారం చేయి బటన్"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"దీనికి ప్రసారం చేయండి"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"పరికరాలను కనుగొంటోంది"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"డిస్కనెక్ట్ చేయి"</string>
diff --git a/v7/mediarouter/res/values-th/strings.xml b/v7/mediarouter/res/values-th/strings.xml
index 0e236c9..fdf0957 100644
--- a/v7/mediarouter/res/values-th/strings.xml
+++ b/v7/mediarouter/res/values-th/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"ระบบ"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"อุปกรณ์"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"แคสต์"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"ปุ่ม \"แคสต์\""</string>
<string name="mr_chooser_title" msgid="414301941546135990">"แคสต์ไปยัง"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"กำลังค้นหาอุปกรณ์"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"ยกเลิกการเชื่อมต่อ"</string>
diff --git a/v7/mediarouter/res/values-tl/strings.xml b/v7/mediarouter/res/values-tl/strings.xml
index fde2fab..7c04b33 100644
--- a/v7/mediarouter/res/values-tl/strings.xml
+++ b/v7/mediarouter/res/values-tl/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"System"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Mga Device"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"I-cast"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Button na I-cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"I-cast sa"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Naghahanap ng mga device"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Idiskonekta"</string>
diff --git a/v7/mediarouter/res/values-tr/strings.xml b/v7/mediarouter/res/values-tr/strings.xml
index 42e8132..f8316f4 100644
--- a/v7/mediarouter/res/values-tr/strings.xml
+++ b/v7/mediarouter/res/values-tr/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Sistem"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Cihazlar"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Yayınla"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Yayın düğmesi"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Şuraya yayınla:"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Cihazlar bulunuyor"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Bağlantıyı kes"</string>
diff --git a/v7/mediarouter/res/values-uk/strings.xml b/v7/mediarouter/res/values-uk/strings.xml
index 7eceaa8..fd4e0d0 100644
--- a/v7/mediarouter/res/values-uk/strings.xml
+++ b/v7/mediarouter/res/values-uk/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Система"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Пристрої"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Транслювати"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Кнопка трансляції"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Транслювати на"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Пошук пристроїв"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Відключити"</string>
diff --git a/v7/mediarouter/res/values-ur-rPK/strings.xml b/v7/mediarouter/res/values-ur-rPK/strings.xml
index d874ebe..afd5534 100644
--- a/v7/mediarouter/res/values-ur-rPK/strings.xml
+++ b/v7/mediarouter/res/values-ur-rPK/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"سسٹم"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"آلات"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"کاسٹ کریں"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"کاسٹ کرنے کا بٹن"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"اس میں کاسٹ کریں"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"آلات تلاش ہو رہے ہیں"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"غیر منسلک کریں"</string>
diff --git a/v7/mediarouter/res/values-uz-rUZ/strings.xml b/v7/mediarouter/res/values-uz-rUZ/strings.xml
index f9699f6..c13b06b 100644
--- a/v7/mediarouter/res/values-uz-rUZ/strings.xml
+++ b/v7/mediarouter/res/values-uz-rUZ/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Tizim"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Qurilmalar"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Translatsiya"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Translatsiya tugmasi"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Quyidagiga translatsiya qilish:"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Qurilmalarni topish"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ulanishni uzish"</string>
diff --git a/v7/mediarouter/res/values-vi/strings.xml b/v7/mediarouter/res/values-vi/strings.xml
index 997bf89..3301cee 100644
--- a/v7/mediarouter/res/values-vi/strings.xml
+++ b/v7/mediarouter/res/values-vi/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Hệ thống"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Thiết bị"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Truyền"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Nút truyền"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Truyền tới"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Tìm thiết bị"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Ngắt kết nối"</string>
diff --git a/v7/mediarouter/res/values-zh-rCN/strings.xml b/v7/mediarouter/res/values-zh-rCN/strings.xml
index 592e630..cdd66f5 100644
--- a/v7/mediarouter/res/values-zh-rCN/strings.xml
+++ b/v7/mediarouter/res/values-zh-rCN/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"系统"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"设备"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"投射"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"投射按钮"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"投射到"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"正在查找设备"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"断开连接"</string>
diff --git a/v7/mediarouter/res/values-zh-rHK/strings.xml b/v7/mediarouter/res/values-zh-rHK/strings.xml
index d54c642..873e5ce 100644
--- a/v7/mediarouter/res/values-zh-rHK/strings.xml
+++ b/v7/mediarouter/res/values-zh-rHK/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"系統"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"裝置"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"投放"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"投放按鈕"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"投放至"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"正在尋找裝置"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"中斷連線"</string>
diff --git a/v7/mediarouter/res/values-zh-rTW/strings.xml b/v7/mediarouter/res/values-zh-rTW/strings.xml
index 966d6b5..27755e7 100644
--- a/v7/mediarouter/res/values-zh-rTW/strings.xml
+++ b/v7/mediarouter/res/values-zh-rTW/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"系統"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"裝置"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"投放"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"投放按鈕"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"投放到"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"正在尋找裝置"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"中斷連線"</string>
diff --git a/v7/mediarouter/res/values-zu/strings.xml b/v7/mediarouter/res/values-zu/strings.xml
index eb4b925..f513fd4 100644
--- a/v7/mediarouter/res/values-zu/strings.xml
+++ b/v7/mediarouter/res/values-zu/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mr_system_route_name" msgid="5441529851481176817">"Isistimu"</string>
<string name="mr_user_route_category_name" msgid="7498112907524977311">"Amadivayisi"</string>
- <string name="mr_button_content_description" msgid="4324764887951330391">"Sakaza"</string>
+ <string name="mr_button_content_description" msgid="3698378085901466129">"Inkinobho ye-Cast"</string>
<string name="mr_chooser_title" msgid="414301941546135990">"Sakaza ku-"</string>
<string name="mr_chooser_searching" msgid="6349900579507521956">"Ithola amadivayisi"</string>
<string name="mr_controller_disconnect" msgid="1227264889412989580">"Nqamula"</string>
diff --git a/v7/preference/proguard-rules.pro b/v7/preference/proguard-rules.pro
index 531302c..bdcc466 100644
--- a/v7/preference/proguard-rules.pro
+++ b/v7/preference/proguard-rules.pro
@@ -13,6 +13,9 @@
# limitations under the License.
# Preference objects are inflated via reflection
--keep public class android.support.v7.preference.Preference
--keep public class * extends android.support.v7.preference.Preference
-
+-keep public class android.support.v7.preference.Preference {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+-keep public class * extends android.support.v7.preference.Preference {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
diff --git a/v7/recyclerview/src/android/support/v7/widget/ChildHelper.java b/v7/recyclerview/src/android/support/v7/widget/ChildHelper.java
index fd1cee4..0afa405 100644
--- a/v7/recyclerview/src/android/support/v7/widget/ChildHelper.java
+++ b/v7/recyclerview/src/android/support/v7/widget/ChildHelper.java
@@ -208,8 +208,8 @@
for (int i = 0; i < count; i++) {
final View view = mHiddenViews.get(i);
RecyclerView.ViewHolder holder = mCallback.getChildViewHolder(view);
- if (holder.getLayoutPosition() == position && !holder.isInvalid() &&
- (type == RecyclerView.INVALID_TYPE || holder.getItemViewType() == type)) {
+ if (holder.getLayoutPosition() == position && !holder.isInvalid() && !holder.isRemoved()
+ && (type == RecyclerView.INVALID_TYPE || holder.getItemViewType() == type)) {
return view;
}
}
diff --git a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
index b2e122e..57684f8 100644
--- a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
+++ b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
@@ -4241,7 +4241,11 @@
// if it is a removed holder, nothing to verify since we cannot ask adapter anymore
// if it is not removed, verify the type and id.
if (holder.isRemoved()) {
- return true;
+ if (DEBUG && !mState.isPreLayout()) {
+ throw new IllegalStateException("should not receive a removed view unelss it"
+ + " is pre layout");
+ }
+ return mState.isPreLayout();
}
if (holder.mPosition < 0 || holder.mPosition >= mAdapter.getItemCount()) {
throw new IndexOutOfBoundsException("Inconsistency detected. Invalid view holder "
@@ -4704,7 +4708,8 @@
*/
void scrapView(View view) {
final ViewHolder holder = getChildViewHolderInt(view);
- if (!holder.isUpdated() || holder.isInvalid() || canReuseUpdatedViewHolder(holder)) {
+ if (holder.hasAnyOfTheFlags(ViewHolder.FLAG_REMOVED | ViewHolder.FLAG_INVALID)
+ || !holder.isUpdated() || canReuseUpdatedViewHolder(holder)) {
if (holder.isInvalid() && !holder.isRemoved() && !mAdapter.hasStableIds()) {
throw new IllegalArgumentException("Called scrap view with an invalid view."
+ " Invalid views cannot be reused from scrap, they should rebound from"
diff --git a/v7/recyclerview/src/android/support/v7/widget/helper/ItemTouchHelper.java b/v7/recyclerview/src/android/support/v7/widget/helper/ItemTouchHelper.java
index 0c22d1c..72d3e8c 100644
--- a/v7/recyclerview/src/android/support/v7/widget/helper/ItemTouchHelper.java
+++ b/v7/recyclerview/src/android/support/v7/widget/helper/ItemTouchHelper.java
@@ -873,7 +873,6 @@
anim.cancel();
}
mRecoverAnimations.remove(i);
- anim.mViewHolder.setIsRecyclable(true);
return anim.mAnimationType;
}
}
@@ -1902,7 +1901,6 @@
final RecoverAnimation anim = recoverAnimationList.get(i);
if (anim.mEnded && !anim.mIsPendingCleanup) {
recoverAnimationList.remove(i);
- anim.mViewHolder.setIsRecyclable(true);
} else if (!anim.mEnded) {
hasRunningAnimation = true;
}
@@ -2314,6 +2312,9 @@
@Override
public void onAnimationEnd(ValueAnimatorCompat animation) {
+ if (!mEnded) {
+ mViewHolder.setIsRecyclable(true);
+ }
mEnded = true;
}
diff --git a/v7/recyclerview/tests/src/android/support/v7/widget/ChildHelperTest.java b/v7/recyclerview/tests/src/android/support/v7/widget/ChildHelperTest.java
new file mode 100644
index 0000000..8163310
--- /dev/null
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/ChildHelperTest.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.support.v7.widget;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+import android.test.AndroidTestCase;
+import android.test.mock.MockContext;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(AndroidJUnit4.class)
+public class ChildHelperTest extends AndroidTestCase {
+ LoggingCallback mLoggingCallback;
+ ChildHelper mChildHelper;
+
+ @Before
+ public void prepare() throws Exception {
+ setUp();
+ setContext(InstrumentationRegistry.getContext());
+ mLoggingCallback = new LoggingCallback();
+ mChildHelper = new ChildHelper(mLoggingCallback);
+ }
+
+ private RecyclerView.ViewHolder vh() {
+ View view = new View(mContext);
+ RecyclerViewBasicTest.MockViewHolder mockViewHolder
+ = new RecyclerViewBasicTest.MockViewHolder(view);
+ RecyclerView.LayoutParams lp = new RecyclerView.LayoutParams(0 , 0);
+ lp.mViewHolder = mockViewHolder;
+ view.setLayoutParams(lp);
+ return mockViewHolder;
+ }
+
+ @Test
+ public void testAddChild() {
+ RecyclerView.ViewHolder vh = vh();
+ mChildHelper.addView(vh.itemView, false);
+ assertEquals(1, mLoggingCallback.getChildCount());
+ assertFalse(mChildHelper.isHidden(vh.itemView));
+ assertEquals(0, mLoggingCallback.mOnEnteredHiddenState.size());
+ }
+
+ @Test
+ public void testAddChildHidden() {
+ RecyclerView.ViewHolder vh = vh();
+ mChildHelper.addView(vh.itemView, true);
+ assertEquals(1, mLoggingCallback.getChildCount());
+ assertTrue(mChildHelper.isHidden(vh.itemView));
+ assertTrue(mLoggingCallback.mOnEnteredHiddenState.contains(vh.itemView));
+ }
+
+ @Test
+ public void testAddChildAndHide() {
+ RecyclerView.ViewHolder vh = vh();
+ mChildHelper.addView(vh.itemView, false);
+ mChildHelper.hide(vh.itemView);
+ assertTrue(mChildHelper.isHidden(vh.itemView));
+ mChildHelper.unhide(vh.itemView);
+ assertFalse(mChildHelper.isHidden(vh.itemView));
+ }
+
+ @Test
+ public void testFindHiddenNonRemoved() {
+ RecyclerView.ViewHolder vh = vh();
+ vh.mPosition = 12;
+ mChildHelper.addView(vh.itemView, true);
+ assertSame(vh.itemView,
+ mChildHelper.findHiddenNonRemovedView(12, RecyclerView.INVALID_TYPE));
+ }
+
+ @Test
+ public void testFindHiddenRemoved() {
+ RecyclerView.ViewHolder vh = vh();
+ vh.mPosition = 12;
+ vh.addFlags(RecyclerView.ViewHolder.FLAG_REMOVED);
+ mChildHelper.addView(vh.itemView, true);
+ assertNull(mChildHelper.findHiddenNonRemovedView(12, RecyclerView.INVALID_TYPE));
+ }
+
+ private static class LoggingCallback implements ChildHelper.Callback {
+ List<View> mViews = new ArrayList<>();
+ List<View> mDetached = new ArrayList<>();
+ List<View> mOnEnteredHiddenState = new ArrayList<>();
+ List<View> mOnExitedHiddenState = new ArrayList<>();
+ @Override
+ public int getChildCount() {
+ return mViews.size();
+ }
+
+ @Override
+ public void addView(View child, int index) {
+ mViews.add(index, child);
+ }
+
+ @Override
+ public int indexOfChild(View view) {
+ return mViews.indexOf(view);
+ }
+
+ private boolean validateIndex(int index) {
+ return index < getChildCount() && index >= 0;
+ }
+
+ @Override
+ public void removeViewAt(int index) {
+ if (validateIndex(index)) {
+ mViews.remove(index);
+ }
+ }
+
+ @Override
+ public View getChildAt(int offset) {
+ if (validateIndex(offset)) {
+ return mViews.remove(offset);
+ }
+ return null;
+ }
+
+ @Override
+ public void removeAllViews() {
+ mViews.clear();
+ }
+
+ @Override
+ public RecyclerView.ViewHolder getChildViewHolder(View view) {
+ return RecyclerView.getChildViewHolderInt(view);
+ }
+
+ @Override
+ public void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams) {
+ assertTrue(mDetached.remove(child));
+ addView(child, index);
+ }
+
+ @Override
+ public void detachViewFromParent(int offset) {
+ mDetached.add(getChildAt(offset));
+ }
+
+ @Override
+ public void onEnteredHiddenState(View child) {
+ mOnEnteredHiddenState.add(child);
+ }
+
+ @Override
+ public void onLeftHiddenState(View child) {
+ mOnExitedHiddenState.add(child);
+ }
+
+ public void clearHiddenStateLog() {
+ mOnExitedHiddenState.clear();
+ mOnEnteredHiddenState.clear();
+ }
+ }
+}
diff --git a/v7/recyclerview/tests/src/android/support/v7/widget/ItemAnimatorV2ApiTest.java b/v7/recyclerview/tests/src/android/support/v7/widget/ItemAnimatorV2ApiTest.java
index 3ef0b3f..5733e72 100644
--- a/v7/recyclerview/tests/src/android/support/v7/widget/ItemAnimatorV2ApiTest.java
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/ItemAnimatorV2ApiTest.java
@@ -506,7 +506,7 @@
dispatchAnimationFinished(oldHolder);
assertSame(preLayoutInfoMap.get(oldHolder), preInfo);
}
- if (newHolder != null) {
+ if (newHolder != null && oldHolder != newHolder) {
dispatchAnimationFinished(newHolder);
assertSame(postLayoutInfoMap.get(newHolder), postInfo);
}