Merge "Keep primary icon in the same position regardless of text." into oc-mr1-jetpack-dev
diff --git a/car/OWNERS b/car/OWNERS
index d226975..eac51b8 100644
--- a/car/OWNERS
+++ b/car/OWNERS
@@ -1 +1,3 @@
-ajchen@google.com
\ No newline at end of file
+ajchen@google.com
+deanh@google.com
+yaoyx@google.com
diff --git a/compat/api/current.txt b/compat/api/current.txt
index dc27c1b..e5305ff 100644
--- a/compat/api/current.txt
+++ b/compat/api/current.txt
@@ -1786,7 +1786,7 @@
     field public static final int TYPE_TOUCH = 0; // 0x0
   }
 
-  public final deprecated class ViewConfigurationCompat {
+  public final class ViewConfigurationCompat {
     method public static float getScaledHorizontalScrollFactor(android.view.ViewConfiguration, android.content.Context);
     method public static deprecated int getScaledPagingTouchSlop(android.view.ViewConfiguration);
     method public static float getScaledVerticalScrollFactor(android.view.ViewConfiguration, android.content.Context);
diff --git a/compat/src/main/java/android/support/v4/view/ViewConfigurationCompat.java b/compat/src/main/java/android/support/v4/view/ViewConfigurationCompat.java
index f14b806..60d37a9 100644
--- a/compat/src/main/java/android/support/v4/view/ViewConfigurationCompat.java
+++ b/compat/src/main/java/android/support/v4/view/ViewConfigurationCompat.java
@@ -27,10 +27,7 @@
 
 /**
  * Helper for accessing features in {@link ViewConfiguration}.
- *
- * @deprecated Use {@link ViewConfiguration} directly.
  */
-@Deprecated
 public final class ViewConfigurationCompat {
     private static final String TAG = "ViewConfigCompat";
 
diff --git a/lifecycle/extensions/src/main/java/android/arch/lifecycle/ViewModelStores.java b/lifecycle/extensions/src/main/java/android/arch/lifecycle/ViewModelStores.java
index d7d769d..e79c934 100644
--- a/lifecycle/extensions/src/main/java/android/arch/lifecycle/ViewModelStores.java
+++ b/lifecycle/extensions/src/main/java/android/arch/lifecycle/ViewModelStores.java
@@ -40,6 +40,9 @@
      */
     @MainThread
     public static ViewModelStore of(@NonNull FragmentActivity activity) {
+        if (activity instanceof ViewModelStoreOwner) {
+            return ((ViewModelStoreOwner) activity).getViewModelStore();
+        }
         return holderFragmentFor(activity).getViewModelStore();
     }
 
@@ -51,6 +54,9 @@
      */
     @MainThread
     public static ViewModelStore of(@NonNull Fragment fragment) {
+        if (fragment instanceof ViewModelStoreOwner) {
+            return ((ViewModelStoreOwner) fragment).getViewModelStore();
+        }
         return holderFragmentFor(fragment).getViewModelStore();
     }
 }
diff --git a/samples/Support13Demos/src/main/AndroidManifest.xml b/samples/Support13Demos/src/main/AndroidManifest.xml
index af7fad2..6be99b6 100644
--- a/samples/Support13Demos/src/main/AndroidManifest.xml
+++ b/samples/Support13Demos/src/main/AndroidManifest.xml
@@ -77,13 +77,5 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".view.inputmethod.CommitContentSupport"
-                  android:label="@string/commit_content_support">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="com.example.android.supportv13.SUPPORT13_SAMPLE_CODE" />
-            </intent-filter>
-        </activity>
-
     </application>
 </manifest>
diff --git a/samples/Support13Demos/src/main/java/com/example/android/supportv13/Shakespeare.java b/samples/Support13Demos/src/main/java/com/example/android/supportv13/Shakespeare.java
deleted file mode 100644
index 01f8dc8..0000000
--- a/samples/Support13Demos/src/main/java/com/example/android/supportv13/Shakespeare.java
+++ /dev/null
@@ -1,223 +0,0 @@
-package com.example.android.supportv13;
-
-public final class Shakespeare {
-    /**
-     * Our data, part 1.
-     */
-    public static final String[] TITLES =
-    {
-            "Henry IV (1)",
-            "Henry V",
-            "Henry VIII",
-            "Richard II",
-            "Richard III",
-            "Merchant of Venice",
-            "Othello",
-            "King Lear"
-    };
-
-    /**
-     * Our data, part 2.
-     */
-    public static final String[] DIALOGUE =
-    {
-            "So shaken as we are, so wan with care," +
-            "Find we a time for frighted peace to pant," +
-            "And breathe short-winded accents of new broils" +
-            "To be commenced in strands afar remote." +
-            "No more the thirsty entrance of this soil" +
-            "Shall daub her lips with her own children's blood;" +
-            "Nor more shall trenching war channel her fields," +
-            "Nor bruise her flowerets with the armed hoofs" +
-            "Of hostile paces: those opposed eyes," +
-            "Which, like the meteors of a troubled heaven," +
-            "All of one nature, of one substance bred," +
-            "Did lately meet in the intestine shock" +
-            "And furious close of civil butchery" +
-            "Shall now, in mutual well-beseeming ranks," +
-            "March all one way and be no more opposed" +
-            "Against acquaintance, kindred and allies:" +
-            "The edge of war, like an ill-sheathed knife," +
-            "No more shall cut his master. Therefore, friends," +
-            "As far as to the sepulchre of Christ," +
-            "Whose soldier now, under whose blessed cross" +
-            "We are impressed and engaged to fight," +
-            "Forthwith a power of English shall we levy;" +
-            "Whose arms were moulded in their mothers' womb" +
-            "To chase these pagans in those holy fields" +
-            "Over whose acres walk'd those blessed feet" +
-            "Which fourteen hundred years ago were nail'd" +
-            "For our advantage on the bitter cross." +
-            "But this our purpose now is twelve month old," +
-            "And bootless 'tis to tell you we will go:" +
-            "Therefore we meet not now. Then let me hear" +
-            "Of you, my gentle cousin Westmoreland," +
-            "What yesternight our council did decree" +
-            "In forwarding this dear expedience.",
-
-            "Hear him but reason in divinity," +
-            "And all-admiring with an inward wish" +
-            "You would desire the king were made a prelate:" +
-            "Hear him debate of commonwealth affairs," +
-            "You would say it hath been all in all his study:" +
-            "List his discourse of war, and you shall hear" +
-            "A fearful battle render'd you in music:" +
-            "Turn him to any cause of policy," +
-            "The Gordian knot of it he will unloose," +
-            "Familiar as his garter: that, when he speaks," +
-            "The air, a charter'd libertine, is still," +
-            "And the mute wonder lurketh in men's ears," +
-            "To steal his sweet and honey'd sentences;" +
-            "So that the art and practic part of life" +
-            "Must be the mistress to this theoric:" +
-            "Which is a wonder how his grace should glean it," +
-            "Since his addiction was to courses vain," +
-            "His companies unletter'd, rude and shallow," +
-            "His hours fill'd up with riots, banquets, sports," +
-            "And never noted in him any study," +
-            "Any retirement, any sequestration" +
-            "From open haunts and popularity.",
-
-            "I come no more to make you laugh: things now," +
-            "That bear a weighty and a serious brow," +
-            "Sad, high, and working, full of state and woe," +
-            "Such noble scenes as draw the eye to flow," +
-            "We now present. Those that can pity, here" +
-            "May, if they think it well, let fall a tear;" +
-            "The subject will deserve it. Such as give" +
-            "Their money out of hope they may believe," +
-            "May here find truth too. Those that come to see" +
-            "Only a show or two, and so agree" +
-            "The play may pass, if they be still and willing," +
-            "I'll undertake may see away their shilling" +
-            "Richly in two short hours. Only they" +
-            "That come to hear a merry bawdy play," +
-            "A noise of targets, or to see a fellow" +
-            "In a long motley coat guarded with yellow," +
-            "Will be deceived; for, gentle hearers, know," +
-            "To rank our chosen truth with such a show" +
-            "As fool and fight is, beside forfeiting" +
-            "Our own brains, and the opinion that we bring," +
-            "To make that only true we now intend," +
-            "Will leave us never an understanding friend." +
-            "Therefore, for goodness' sake, and as you are known" +
-            "The first and happiest hearers of the town," +
-            "Be sad, as we would make ye: think ye see" +
-            "The very persons of our noble story" +
-            "As they were living; think you see them great," +
-            "And follow'd with the general throng and sweat" +
-            "Of thousand friends; then in a moment, see" +
-            "How soon this mightiness meets misery:" +
-            "And, if you can be merry then, I'll say" +
-            "A man may weep upon his wedding-day.",
-
-            "First, heaven be the record to my speech!" +
-            "In the devotion of a subject's love," +
-            "Tendering the precious safety of my prince," +
-            "And free from other misbegotten hate," +
-            "Come I appellant to this princely presence." +
-            "Now, Thomas Mowbray, do I turn to thee," +
-            "And mark my greeting well; for what I speak" +
-            "My body shall make good upon this earth," +
-            "Or my divine soul answer it in heaven." +
-            "Thou art a traitor and a miscreant," +
-            "Too good to be so and too bad to live," +
-            "Since the more fair and crystal is the sky," +
-            "The uglier seem the clouds that in it fly." +
-            "Once more, the more to aggravate the note," +
-            "With a foul traitor's name stuff I thy throat;" +
-            "And wish, so please my sovereign, ere I move," +
-            "What my tongue speaks my right drawn sword may prove.",
-
-            "Now is the winter of our discontent" +
-            "Made glorious summer by this sun of York;" +
-            "And all the clouds that lour'd upon our house" +
-            "In the deep bosom of the ocean buried." +
-            "Now are our brows bound with victorious wreaths;" +
-            "Our bruised arms hung up for monuments;" +
-            "Our stern alarums changed to merry meetings," +
-            "Our dreadful marches to delightful measures." +
-            "Grim-visaged war hath smooth'd his wrinkled front;" +
-            "And now, instead of mounting barded steeds" +
-            "To fright the souls of fearful adversaries," +
-            "He capers nimbly in a lady's chamber" +
-            "To the lascivious pleasing of a lute." +
-            "But I, that am not shaped for sportive tricks," +
-            "Nor made to court an amorous looking-glass;" +
-            "I, that am rudely stamp'd, and want love's majesty" +
-            "To strut before a wanton ambling nymph;" +
-            "I, that am curtail'd of this fair proportion," +
-            "Cheated of feature by dissembling nature," +
-            "Deformed, unfinish'd, sent before my time" +
-            "Into this breathing world, scarce half made up," +
-            "And that so lamely and unfashionable" +
-            "That dogs bark at me as I halt by them;" +
-            "Why, I, in this weak piping time of peace," +
-            "Have no delight to pass away the time," +
-            "Unless to spy my shadow in the sun" +
-            "And descant on mine own deformity:" +
-            "And therefore, since I cannot prove a lover," +
-            "To entertain these fair well-spoken days," +
-            "I am determined to prove a villain" +
-            "And hate the idle pleasures of these days." +
-            "Plots have I laid, inductions dangerous," +
-            "By drunken prophecies, libels and dreams," +
-            "To set my brother Clarence and the king" +
-            "In deadly hate the one against the other:" +
-            "And if King Edward be as true and just" +
-            "As I am subtle, false and treacherous," +
-            "This day should Clarence closely be mew'd up," +
-            "About a prophecy, which says that 'G'" +
-            "Of Edward's heirs the murderer shall be." +
-            "Dive, thoughts, down to my soul: here" +
-            "Clarence comes.",
-
-            "To bait fish withal: if it will feed nothing else," +
-            "it will feed my revenge. He hath disgraced me, and" +
-            "hindered me half a million; laughed at my losses," +
-            "mocked at my gains, scorned my nation, thwarted my" +
-            "bargains, cooled my friends, heated mine" +
-            "enemies; and what's his reason? I am a Jew. Hath" +
-            "not a Jew eyes? hath not a Jew hands, organs," +
-            "dimensions, senses, affections, passions? fed with" +
-            "the same food, hurt with the same weapons, subject" +
-            "to the same diseases, healed by the same means," +
-            "warmed and cooled by the same winter and summer, as" +
-            "a Christian is? If you prick us, do we not bleed?" +
-            "if you tickle us, do we not laugh? if you poison" +
-            "us, do we not die? and if you wrong us, shall we not" +
-            "revenge? If we are like you in the rest, we will" +
-            "resemble you in that. If a Jew wrong a Christian," +
-            "what is his humility? Revenge. If a Christian" +
-            "wrong a Jew, what should his sufferance be by" +
-            "Christian example? Why, revenge. The villany you" +
-            "teach me, I will execute, and it shall go hard but I" +
-            "will better the instruction.",
-
-            "Virtue! a fig! 'tis in ourselves that we are thus" +
-            "or thus. Our bodies are our gardens, to the which" +
-            "our wills are gardeners: so that if we will plant" +
-            "nettles, or sow lettuce, set hyssop and weed up" +
-            "thyme, supply it with one gender of herbs, or" +
-            "distract it with many, either to have it sterile" +
-            "with idleness, or manured with industry, why, the" +
-            "power and corrigible authority of this lies in our" +
-            "wills. If the balance of our lives had not one" +
-            "scale of reason to poise another of sensuality, the" +
-            "blood and baseness of our natures would conduct us" +
-            "to most preposterous conclusions: but we have" +
-            "reason to cool our raging motions, our carnal" +
-            "stings, our unbitted lusts, whereof I take this that" +
-            "you call love to be a sect or scion.",
-
-            "Blow, winds, and crack your cheeks! rage! blow!" +
-            "You cataracts and hurricanoes, spout" +
-            "Till you have drench'd our steeples, drown'd the cocks!" +
-            "You sulphurous and thought-executing fires," +
-            "Vaunt-couriers to oak-cleaving thunderbolts," +
-            "Singe my white head! And thou, all-shaking thunder," +
-            "Smite flat the thick rotundity o' the world!" +
-            "Crack nature's moulds, an germens spill at once," +
-            "That make ingrateful man!"
-    };
-}
diff --git a/samples/Support13Demos/src/main/java/com/example/android/supportv13/view/CheckableFrameLayout.java b/samples/Support13Demos/src/main/java/com/example/android/supportv13/view/CheckableFrameLayout.java
deleted file mode 100644
index e2383de..0000000
--- a/samples/Support13Demos/src/main/java/com/example/android/supportv13/view/CheckableFrameLayout.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2011 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 com.example.android.supportv13.view;
-
-import android.content.Context;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-import android.widget.Checkable;
-import android.widget.FrameLayout;
-
-public class CheckableFrameLayout extends FrameLayout implements Checkable {
-    private boolean mChecked;
-
-    public CheckableFrameLayout(Context context) {
-        super(context);
-    }
-
-    public CheckableFrameLayout(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    public void setChecked(boolean checked) {
-        mChecked = checked;
-        setBackgroundDrawable(checked ? new ColorDrawable(0xff0000a0) : null);
-    }
-
-    @Override
-    public boolean isChecked() {
-        return mChecked;
-    }
-
-    @Override
-    public void toggle() {
-        setChecked(!mChecked);
-    }
-
-}
diff --git a/samples/Support13Demos/src/main/res/drawable-hdpi/alert_dialog_icon.png b/samples/Support13Demos/src/main/res/drawable-hdpi/alert_dialog_icon.png
deleted file mode 100755
index fe54477..0000000
--- a/samples/Support13Demos/src/main/res/drawable-hdpi/alert_dialog_icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/Support13Demos/src/main/res/drawable-mdpi/alert_dialog_icon.png b/samples/Support13Demos/src/main/res/drawable-mdpi/alert_dialog_icon.png
deleted file mode 100644
index 0a7de04..0000000
--- a/samples/Support13Demos/src/main/res/drawable-mdpi/alert_dialog_icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/Support13Demos/src/main/res/layout/simple_list_item_checkable_1.xml b/samples/Support13Demos/src/main/res/layout/simple_list_item_checkable_1.xml
deleted file mode 100644
index 84017a6..0000000
--- a/samples/Support13Demos/src/main/res/layout/simple_list_item_checkable_1.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-
-<com.example.android.supportv4.view.CheckableFrameLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-    <TextView
-            android:id="@android:id/text1"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceLarge"
-            android:minHeight="?android:attr/listPreferredItemHeight"
-            android:gravity="center_vertical"
-    />
-</com.example.android.supportv4.view.CheckableFrameLayout>
diff --git a/samples/Support13Demos/src/main/res/values/colors.xml b/samples/Support13Demos/src/main/res/values/colors.xml
deleted file mode 100644
index e50c7a0..0000000
--- a/samples/Support13Demos/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<resources>
-    <drawable name="red">#7f00</drawable>
-    <drawable name="blue">#770000ff</drawable>
-    <drawable name="green">#7700ff00</drawable>
-    <drawable name="yellow">#77ffff00</drawable>
-</resources>
diff --git a/samples/Support13Demos/src/main/res/values/strings.xml b/samples/Support13Demos/src/main/res/values/strings.xml
index b0950b2..7c621e9 100644
--- a/samples/Support13Demos/src/main/res/values/strings.xml
+++ b/samples/Support13Demos/src/main/res/values/strings.xml
@@ -20,11 +20,6 @@
     <string name="hello_world"><b>Hello, <i>World!</i></b></string>
     <string name="retained">Retained state</string>
 
-    <string name="alert_dialog_two_buttons_title">
-        Lorem ipsum dolor sit aie consectetur adipiscing\nPlloaso mako nuto
-        siwuf cakso dodtos anr koop.
-    </string>
-
     <string name="fragment_nesting_pager_support">Fragment/Nesting Pager</string>
 
     <string name="fragment_nesting_state_pager_support">Fragment/Nesting State Pager</string>
@@ -34,9 +29,4 @@
     <string name="last">Last</string>
 
     <string name="fragment_state_pager_support">Fragment/State Pager</string>
-
-    <string name="action_bar_tabs_pager">Fragment/Action Bar Tabs Pager</string>
-
-    <string name="commit_content_support">View/Input Method/Commit Content</string>
-
 </resources>
diff --git a/samples/Support4Demos/src/main/AndroidManifest.xml b/samples/Support4Demos/src/main/AndroidManifest.xml
index 812d4e8..66f34dc 100644
--- a/samples/Support4Demos/src/main/AndroidManifest.xml
+++ b/samples/Support4Demos/src/main/AndroidManifest.xml
@@ -424,6 +424,14 @@
         </provider>
 <!-- END_INCLUDE(file_provider_declaration) -->
 
+        <activity android:name=".view.inputmethod.CommitContentSupport"
+                  android:label="@string/commit_content_support">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="com.example.android.supportv13.SUPPORT13_SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- MediaBrowserCompat Sample -->
         <activity android:name=".media.MediaBrowserSupport"
             android:label="@string/media_browser_support">
diff --git a/samples/Support13Demos/src/main/java/com/example/android/supportv13/view/inputmethod/CommitContentSupport.java b/samples/Support4Demos/src/main/java/com/example/android/supportv4/view/inputmethod/CommitContentSupport.java
similarity index 93%
rename from samples/Support13Demos/src/main/java/com/example/android/supportv13/view/inputmethod/CommitContentSupport.java
rename to samples/Support4Demos/src/main/java/com/example/android/supportv4/view/inputmethod/CommitContentSupport.java
index 78d64cd..335fa76 100644
--- a/samples/Support13Demos/src/main/java/com/example/android/supportv13/view/inputmethod/CommitContentSupport.java
+++ b/samples/Support4Demos/src/main/java/com/example/android/supportv4/view/inputmethod/CommitContentSupport.java
@@ -11,22 +11,19 @@
  * 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
+ * limitations under the License.
  */
 
-package com.example.android.supportv13.view.inputmethod;
-
-import com.example.android.supportv13.R;
-
-import android.support.v13.view.inputmethod.EditorInfoCompat;
-import android.support.v13.view.inputmethod.InputConnectionCompat;
-import android.support.v13.view.inputmethod.InputContentInfoCompat;
+package com.example.android.supportv4.view.inputmethod;
 
 import android.app.Activity;
 import android.graphics.Color;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Parcelable;
+import android.support.v13.view.inputmethod.EditorInfoCompat;
+import android.support.v13.view.inputmethod.InputConnectionCompat;
+import android.support.v13.view.inputmethod.InputContentInfoCompat;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.inputmethod.EditorInfo;
@@ -36,14 +33,18 @@
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.example.android.supportv4.R;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 
+/**
+ * Demo activity for using {@link InputConnectionCompat}.
+ */
 public class CommitContentSupport extends Activity {
     private static final String INPUT_CONTENT_INFO_KEY = "COMMIT_CONTENT_INPUT_CONTENT_INFO";
     private static final String COMMIT_CONTENT_FLAGS_KEY = "COMMIT_CONTENT_FLAGS";
-
-    private static String TAG = "CommitContentSupport";
+    private static final String TAG = "CommitContentSupport";
 
     private WebView mWebView;
     private TextView mLabel;
@@ -108,7 +109,7 @@
     }
 
     private boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags,
-            Bundle opts, String[] contentMimeTypes) {
+            String[] contentMimeTypes) {
         // Clear the temporary permission (if any).  See below about why we do this here.
         try {
             if (mCurrentInputContentInfo != null) {
@@ -211,14 +212,9 @@
                 final InputConnection ic = super.onCreateInputConnection(editorInfo);
                 EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
                 final InputConnectionCompat.OnCommitContentListener callback =
-                        new InputConnectionCompat.OnCommitContentListener() {
-                            @Override
-                            public boolean onCommitContent(InputContentInfoCompat inputContentInfo,
-                                    int flags, Bundle opts) {
-                                return CommitContentSupport.this.onCommitContent(
-                                        inputContentInfo, flags, opts, mimeTypes);
-                            }
-                        };
+                        (inputContentInfo, flags, opts) ->
+                                CommitContentSupport.this.onCommitContent(
+                                        inputContentInfo, flags, mimeTypes);
                 return InputConnectionCompat.createWrapper(ic, editorInfo, callback);
             }
         };
diff --git a/samples/Support13Demos/src/main/res/layout/commit_content.xml b/samples/Support4Demos/src/main/res/layout/commit_content.xml
similarity index 100%
rename from samples/Support13Demos/src/main/res/layout/commit_content.xml
rename to samples/Support4Demos/src/main/res/layout/commit_content.xml
diff --git a/samples/Support4Demos/src/main/res/values/strings.xml b/samples/Support4Demos/src/main/res/values/strings.xml
index 83404e8..86adb94 100644
--- a/samples/Support4Demos/src/main/res/values/strings.xml
+++ b/samples/Support4Demos/src/main/res/values/strings.xml
@@ -241,4 +241,6 @@
     <string name="drawable_compat_no_tint">Not tint</string>
     <string name="drawable_compat_color_tint">Color tint</string>
     <string name="drawable_compat_color_list_tint">Color state list</string>
+
+    <string name="commit_content_support">View/Input Method/Commit Content</string>
 </resources>
diff --git a/v13/build.gradle b/v13/build.gradle
index 88e0bc0..9965d1d 100644
--- a/v13/build.gradle
+++ b/v13/build.gradle
@@ -1,4 +1,3 @@
-import static android.support.dependencies.DependenciesKt.*
 import android.support.LibraryGroups
 import android.support.LibraryVersions
 
@@ -9,11 +8,6 @@
 dependencies {
     api(project(":support-annotations"))
     api(project(":support-v4"))
-
-    androidTestImplementation(TEST_RUNNER)
-    androidTestImplementation(ESPRESSO_CORE)
-    androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
-    androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
 }
 
 android {
diff --git a/v13/tests/AndroidManifest.xml b/v13/tests/AndroidManifest.xml
deleted file mode 100644
index 3ec7e98..0000000
--- a/v13/tests/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-   Copyright (C) 2016 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.
-  -->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="android.support.v13.test">
-    <uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
-
-    <application>
-        <activity android:name="android.support.v13.app.FragmentCompatTestActivity" />
-    </application>
-
-</manifest>
diff --git a/v13/tests/NO_DOCS b/v13/tests/NO_DOCS
deleted file mode 100644
index 092a39c..0000000
--- a/v13/tests/NO_DOCS
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2016 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.
-
-Having this file, named NO_DOCS, in a directory will prevent
-Android javadocs from being generated for java files under
-the directory. This is especially useful for test projects.
diff --git a/v13/tests/java/android/support/v13/app/FragmentCompatTest.java b/v13/tests/java/android/support/v13/app/FragmentCompatTest.java
deleted file mode 100644
index 34b01f1..0000000
--- a/v13/tests/java/android/support/v13/app/FragmentCompatTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2017 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.v13.app;
-
-import static org.mockito.AdditionalMatchers.aryEq;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.ArgumentMatchers.same;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-
-import android.Manifest;
-import android.app.Activity;
-import android.app.Fragment;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SdkSuppress;
-import android.support.test.filters.SmallTest;
-import android.support.test.rule.ActivityTestRule;
-import android.support.test.runner.AndroidJUnit4;
-import android.support.v13.app.FragmentCompat.PermissionCompatDelegate;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SdkSuppress(minSdkVersion = Build.VERSION_CODES.HONEYCOMB)
-public class FragmentCompatTest {
-    @Rule
-    public ActivityTestRule<FragmentCompatTestActivity> mActivityRule =
-            new ActivityTestRule<>(FragmentCompatTestActivity.class);
-
-    private Activity mActivity;
-    private TestFragment mFragment;
-
-    @Before
-    public void setup() throws Throwable {
-        mActivity = mActivityRule.getActivity();
-        mFragment = attachTestFragment();
-    }
-
-    @SmallTest
-    @Test
-    public void testFragmentCompatDelegate() {
-        FragmentCompat.PermissionCompatDelegate delegate = mock(PermissionCompatDelegate.class);
-
-        // First test setting the delegate
-        FragmentCompat.setPermissionCompatDelegate(delegate);
-
-        FragmentCompat.requestPermissions(mFragment, new String[]{
-                Manifest.permission.ACCESS_FINE_LOCATION}, 42);
-        verify(delegate).requestPermissions(same(mFragment),
-                aryEq(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}), eq(42));
-
-        // Now test clearing the delegate
-        FragmentCompat.setPermissionCompatDelegate(null);
-
-        FragmentCompat.requestPermissions(mFragment, new String[]{
-                Manifest.permission.ACCESS_FINE_LOCATION}, 42);
-
-        verifyNoMoreInteractions(delegate);
-    }
-
-    private TestFragment attachTestFragment() throws Throwable {
-        final TestFragment fragment = new TestFragment();
-        mActivityRule.runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                mActivity.getFragmentManager().beginTransaction()
-                        .add(fragment, null)
-                        .addToBackStack(null)
-                        .commitAllowingStateLoss();
-                mActivity.getFragmentManager().executePendingTransactions();
-            }
-        });
-        InstrumentationRegistry.getInstrumentation().waitForIdleSync();
-        return fragment;
-    }
-
-    /**
-     * Empty class to satisfy java class dependency.
-     */
-    public static class TestFragment extends Fragment implements
-            FragmentCompat.OnRequestPermissionsResultCallback {
-        @Override
-        public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
-                @NonNull int[] grantResults) {}
-    }
-}
diff --git a/v13/tests/java/android/support/v13/app/FragmentCompatTestActivity.java b/v13/tests/java/android/support/v13/app/FragmentCompatTestActivity.java
deleted file mode 100644
index b3ab763..0000000
--- a/v13/tests/java/android/support/v13/app/FragmentCompatTestActivity.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2017 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.v13.app;
-
-import android.app.Activity;
-
-public class FragmentCompatTestActivity extends Activity {
-}
diff --git a/v7/appcompat/src/main/java/android/support/v7/widget/ButtonBarLayout.java b/v7/appcompat/src/main/java/android/support/v7/widget/ButtonBarLayout.java
index b47a568..f4bbc6c 100644
--- a/v7/appcompat/src/main/java/android/support/v7/widget/ButtonBarLayout.java
+++ b/v7/appcompat/src/main/java/android/support/v7/widget/ButtonBarLayout.java
@@ -35,9 +35,6 @@
  */
 @RestrictTo(LIBRARY_GROUP)
 public class ButtonBarLayout extends LinearLayout {
-    /** Minimum screen height required for button stacking. */
-    private static final int ALLOW_STACKING_MIN_HEIGHT_DP = 320;
-
     /** Amount of the second button to "peek" above the fold when stacked. */
     private static final int PEEK_BUTTON_DP = 16;
 
@@ -50,11 +47,8 @@
 
     public ButtonBarLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
-        final boolean allowStackingDefault =
-                getResources().getConfiguration().screenHeightDp >= ALLOW_STACKING_MIN_HEIGHT_DP;
         final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ButtonBarLayout);
-        mAllowStacking = ta.getBoolean(R.styleable.ButtonBarLayout_allowStacking,
-                allowStackingDefault);
+        mAllowStacking = ta.getBoolean(R.styleable.ButtonBarLayout_allowStacking, true);
         ta.recycle();
     }