Merge "Drag in the EditText's hint colors in TextInputLayout" into lmp-mr1-ub-dev
diff --git a/build.gradle b/build.gradle
index 82de0c2..5d8a0cb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@
maven { url '../../prebuilts/tools/common/m2/internal' }
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.2.3'
+ classpath 'com.android.tools.build:gradle:1.3.0-beta2'
}
}
@@ -166,6 +166,7 @@
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.buildToolsVersion = rootProject.buildToolsVersion
+ project.android.aaptOptions.useNewCruncher = false
}
}
}
diff --git a/design/src/android/support/design/widget/TabLayout.java b/design/src/android/support/design/widget/TabLayout.java
index 6e0153a..432f5f3 100755
--- a/design/src/android/support/design/widget/TabLayout.java
+++ b/design/src/android/support/design/widget/TabLayout.java
@@ -785,6 +785,10 @@
}
void selectTab(Tab tab) {
+ selectTab(tab, true);
+ }
+
+ void selectTab(Tab tab, boolean updateIndicator) {
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
if (mOnTabSelectedListener != null) {
@@ -795,15 +799,15 @@
} else {
final int newPosition = tab != null ? tab.getPosition() : Tab.INVALID_POSITION;
setSelectedTabView(newPosition);
-
- if ((mSelectedTab == null || mSelectedTab.getPosition() == Tab.INVALID_POSITION)
- && newPosition != Tab.INVALID_POSITION) {
- // If we don't currently have a tab, just draw the indicator
- setScrollPosition(newPosition, 0f, true);
- } else {
- animateToTab(newPosition);
+ if (updateIndicator) {
+ if ((mSelectedTab == null || mSelectedTab.getPosition() == Tab.INVALID_POSITION)
+ && newPosition != Tab.INVALID_POSITION) {
+ // If we don't currently have a tab, just draw the indicator
+ setScrollPosition(newPosition, 0f, true);
+ } else {
+ animateToTab(newPosition);
+ }
}
-
if (mSelectedTab != null && mOnTabSelectedListener != null) {
mOnTabSelectedListener.onTabUnselected(mSelectedTab);
}
@@ -1556,8 +1560,11 @@
@Override
public void onPageSelected(int position) {
final TabLayout tabLayout = mTabLayoutRef.get();
- if (mScrollState == SCROLL_STATE_IDLE && tabLayout != null) {
- tabLayout.getTabAt(position).select();
+ if (tabLayout != null) {
+ // Select the tab, only updating the indicator if we're not being dragged/settled
+ // (since onPageScrolled will handle that).
+ tabLayout.selectTab(tabLayout.getTabAt(position),
+ mScrollState == SCROLL_STATE_IDLE);
}
}
}
diff --git a/v7/appcompat/res/values-v21/styles_base.xml b/v7/appcompat/res/values-v21/styles_base.xml
index 1bf90ef..241cb04 100644
--- a/v7/appcompat/res/values-v21/styles_base.xml
+++ b/v7/appcompat/res/values-v21/styles_base.xml
@@ -174,6 +174,8 @@
<style name="Base.Widget.AppCompat.AutoCompleteTextView" parent="android:Widget.Material.AutoCompleteTextView" />
+ <style name="Base.Widget.AppCompat.EditText" parent="android:Widget.Material.EditText" />
+
<style name="Base.Widget.AppCompat.RatingBar" parent="android:Widget.Material.RatingBar" />
<style name="Base.Widget.AppCompat.Button" parent="android:Widget.Material.Button" />
diff --git a/v7/appcompat/res/values/styles.xml b/v7/appcompat/res/values/styles.xml
index b38c6ad..0ac20d5 100644
--- a/v7/appcompat/res/values/styles.xml
+++ b/v7/appcompat/res/values/styles.xml
@@ -194,9 +194,7 @@
<style name="Widget.AppCompat.SearchView" parent="Base.Widget.AppCompat.SearchView" />
<style name="Widget.AppCompat.SearchView.ActionBar" parent="Base.Widget.AppCompat.SearchView.ActionBar" />
- <style name="Widget.AppCompat.EditText"
- parent="Base.Widget.AppCompat.EditText">
- </style>
+ <style name="Widget.AppCompat.EditText" parent="Base.Widget.AppCompat.EditText"/>
<style name="Widget.AppCompat.CompoundButton.Switch" parent="Base.Widget.AppCompat.CompoundButton.Switch" />