Skip to content

Commit 4cd695b

Browse files
committed
Squashed 'libs/login/' changes from afcb169132..33d3a31871
33d3a31871 Merge pull request #10 from wordpress-mobile/merge-wpa b3d3bc5f14 Update style and lint configs 752425f1af Update Gradle wrapper version 3bbe173be8 Merge commit 'e3c231d50ec6bd985404c7aec05502864b4c08d4' into subtree-updates-v3 e81fa900e5 Merge pull request #9215 from wordpress-mobile/feature/update-support-lib-28 c6332e5081 Move default login input row values from layout to class 2ec15519ee Add icon drawable tint color assignment to login input row class f737b09567 Add icon drawable tint color to login input row attributes 8dd430c3b9 Revert update of targetSdkVersion f50df670e6 Update supportLib version to 28.0.0 ac2e27a64f Update to Gradle 4.10.3/Android Gradle plugin 3.2.1 64e1ef8889 Reorder repositories in build.gradle to fix Gradle git-subtree-dir: libs/login git-subtree-split: 33d3a31871928975215f919dc59e1b71df8b13f6
1 parent e3c231d commit 4cd695b

File tree

8 files changed

+52
-22
lines changed

8 files changed

+52
-22
lines changed

.idea/checkstyle-idea.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WordPressLoginFlow/build.gradle

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
buildscript {
22
repositories {
3-
jcenter()
43
google()
4+
jcenter()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.1.3'
7+
classpath 'com.android.tools.build:gradle:3.2.1'
88
}
99
}
1010

@@ -17,8 +17,8 @@ repositories {
1717
}
1818

1919
android {
20-
compileSdkVersion 27
21-
buildToolsVersion "27.0.3"
20+
compileSdkVersion 28
21+
buildToolsVersion "28.0.3"
2222

2323
defaultConfig {
2424
minSdkVersion 16
@@ -35,8 +35,12 @@ dependencies {
3535
exclude group: "com.mcxiaoke.volley"
3636
}
3737

38-
implementation 'com.android.support:appcompat-v7:27.1.1'
39-
implementation 'com.android.support:design:27.1.1'
38+
implementation 'com.android.support:appcompat-v7:28.0.0'
39+
implementation 'com.android.support:animated-vector-drawable:28.0.0'
40+
implementation 'com.android.support:support-media-compat:28.0.0'
41+
implementation 'com.android.support:support-v13:28.0.0'
42+
implementation 'com.android.support:gridlayout-v7:28.0.0'
43+
implementation 'com.android.support:design:28.0.0'
4044

4145
api 'com.google.android.gms:play-services-auth:15.0.1'
4246

WordPressLoginFlow/src/main/java/org/wordpress/android/login/widgets/WPLoginInputRow.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
package org.wordpress.android.login.widgets;
22

33
import android.content.Context;
4+
import android.content.res.ColorStateList;
45
import android.content.res.TypedArray;
6+
import android.graphics.PorterDuff;
7+
import android.graphics.drawable.Drawable;
58
import android.os.Build;
69
import android.os.Bundle;
710
import android.os.Parcel;
811
import android.os.Parcelable;
912
import android.support.annotation.Nullable;
1013
import android.support.design.widget.TextInputLayout;
14+
import android.support.v4.content.ContextCompat;
15+
import android.support.v4.graphics.drawable.DrawableCompat;
1116
import android.text.TextWatcher;
1217
import android.util.AttributeSet;
1318
import android.util.SparseArray;
@@ -70,7 +75,21 @@ private void init(Context context, AttributeSet attrs) {
7075

7176
try {
7277
if (a.hasValue(R.styleable.wpLoginInputRow_wpIconDrawable)) {
73-
mIcon.setImageResource(a.getResourceId(R.styleable.wpLoginInputRow_wpIconDrawable, 0));
78+
int iconResId = a.getResourceId(R.styleable.wpLoginInputRow_wpIconDrawable,
79+
R.drawable.ic_user_grey_24dp);
80+
int tintResId = a.getResourceId(R.styleable.wpLoginInputRow_wpIconDrawableTint,
81+
R.color.login_input_icon_color);
82+
83+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
84+
mIcon.setImageTintList(ColorStateList.valueOf(ContextCompat.getColor(context, tintResId)));
85+
mIcon.setImageResource(iconResId);
86+
} else {
87+
Drawable drawable = context.getResources().getDrawable(iconResId);
88+
DrawableCompat.setTint(drawable, context.getResources().getColor(tintResId));
89+
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
90+
mIcon.setImageDrawable(drawable);
91+
}
92+
7493
mIcon.setVisibility(View.VISIBLE);
7594
} else {
7695
mIcon.setVisibility(View.GONE);

WordPressLoginFlow/src/main/res/layout/login_input_row.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
android:layout_marginRight="@dimen/margin_extra_large"
1616
android:layout_marginEnd="@dimen/margin_extra_large"
1717
android:importantForAccessibility="no"
18-
android:tint="@color/login_input_icon_color"
19-
app:srcCompat="@drawable/ic_user_grey_24dp"/>
18+
tools:srcCompat="@drawable/ic_user_grey_24dp"
19+
tools:tint="@color/login_input_icon_color"/>
2020

2121
<org.wordpress.android.util.widgets.WPTextInputLayout
2222
android:layout_centerVertical="true"

WordPressLoginFlow/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
-->
77
<declare-styleable name="wpLoginInputRow">
88
<attr name="wpIconDrawable" format="reference"/>
9+
<attr name="wpIconDrawableTint" format="color"/>
910
<attr name="android:inputType" />
1011
<attr name="android:hint" />
1112
<attr name="android:imeOptions" />

config/checkstyle.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@
3434

3535
<!-- Miscellaneous other checks. -->
3636
<!-- See http://checkstyle.sf.net/config_misc.html -->
37-
<module name="RegexpSingleline">
38-
<property name="format" value="\s+$"/>
39-
<property name="minimum" value="0"/>
40-
<property name="maximum" value="0"/>
41-
<property name="message" value="Line has trailing spaces."/>
42-
<property name="severity" value="error"/>
43-
</module>
44-
45-
4637
<module name="RegexpMultiline">
4738
<property name="format"
4839
value="(\n|\r\n)[\t ]*(\n|\r\n)[\t ]*\}"/>
@@ -154,7 +145,9 @@
154145
<!-- Checks for imports -->
155146
<!-- See http://checkstyle.sf.net/config_import.html -->
156147
<module name="AvoidStarImport"/>
157-
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
148+
<module name="IllegalImport">
149+
<property name="illegalClasses" value="android.app.Fragment"/>
150+
</module>
158151
<module name="RedundantImport"/>
159152
<module name="UnusedImports">
160153
<property name="processJavadoc" value="true"/>
@@ -181,6 +174,7 @@
181174
<property name="tokens" value="METHOD_DEF"/>
182175
<!-- TODO: We should set this value around 40 or 50 -->
183176
<property name="max" value="200"/>
177+
<property name="severity" value="warning"/>
184178
</module>
185179

186180
<!-- Checks for whitespace -->

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip

0 commit comments

Comments
 (0)