diff --git a/app/build.gradle b/app/build.gradle index 5a0c1850d..60333fd16 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,13 +23,13 @@ def gitCommitCount = 100 + Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim()) android { - compileSdkVersion 'android-O' - buildToolsVersion '26.0.0 rc1' + compileSdkVersion 26 + buildToolsVersion '26.0.0' defaultConfig { applicationId "io.plaidapp" minSdkVersion 21 - targetSdkVersion 'O' + targetSdkVersion 26 versionCode gitCommitCount versionName gitTag archivesBaseName = "plaid" @@ -63,12 +63,10 @@ android { repositories { jcenter() - maven { - url 'https://maven.google.com' - } + google() } -ext.supportLibVersion = '26.0.0-beta1' +ext.supportLibVersion = '26.0.0-beta2' ext.retrofit2Version = '2.2.0' dependencies { diff --git a/app/src/main/java/io/plaidapp/ui/widget/ForegroundLinearLayout.java b/app/src/main/java/io/plaidapp/ui/widget/ForegroundLinearLayout.java index b150f76a8..28dcf6adf 100644 --- a/app/src/main/java/io/plaidapp/ui/widget/ForegroundLinearLayout.java +++ b/app/src/main/java/io/plaidapp/ui/widget/ForegroundLinearLayout.java @@ -19,10 +19,8 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; -import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; -import android.view.Gravity; import android.widget.LinearLayout; import io.plaidapp.R; @@ -32,12 +30,7 @@ */ public class ForegroundLinearLayout extends LinearLayout { - private final Rect mSelfBounds = new Rect(); - private final Rect mOverlayBounds = new Rect(); - protected boolean mForegroundInPadding = true; - boolean mForegroundBoundsChanged = false; private Drawable mForeground; - private int mForegroundGravity = Gravity.FILL; public ForegroundLinearLayout(Context context) { super(context); @@ -52,59 +45,13 @@ public ForegroundLinearLayout(Context context, AttributeSet attrs, int defStyle) TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ForegroundView, defStyle, 0); - - mForegroundGravity = a.getInt( - R.styleable.ForegroundView_android_foregroundGravity, mForegroundGravity); - final Drawable d = a.getDrawable(R.styleable.ForegroundView_android_foreground); if (d != null) { setForeground(d); } - - mForegroundInPadding = a.getBoolean( - R.styleable.ForegroundView_android_foregroundInsidePadding, true); - a.recycle(); } - /** - * Describes how the foreground is positioned. - * - * @return foreground gravity. - * @see #setForegroundGravity(int) - */ - public int getForegroundGravity() { - return mForegroundGravity; - } - - /** - * Describes how the foreground is positioned. Defaults to START and TOP. - * - * @param foregroundGravity See {@link android.view.Gravity} - * @see #getForegroundGravity() - */ - public void setForegroundGravity(int foregroundGravity) { - if (mForegroundGravity != foregroundGravity) { - if ((foregroundGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) == 0) { - foregroundGravity |= Gravity.START; - } - - if ((foregroundGravity & Gravity.VERTICAL_GRAVITY_MASK) == 0) { - foregroundGravity |= Gravity.TOP; - } - - mForegroundGravity = foregroundGravity; - - - if (mForegroundGravity == Gravity.FILL && mForeground != null) { - Rect padding = new Rect(); - mForeground.getPadding(padding); - } - - requestLayout(); - } - } - @Override protected boolean verifyDrawable(Drawable who) { return super.verifyDrawable(who) || (who == mForeground); @@ -157,10 +104,6 @@ public void setForeground(Drawable drawable) { if (drawable.isStateful()) { drawable.setState(getDrawableState()); } - if (mForegroundGravity == Gravity.FILL) { - Rect padding = new Rect(); - drawable.getPadding(padding); - } } else { setWillNotDraw(true); } @@ -169,48 +112,19 @@ public void setForeground(Drawable drawable) { } } - @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - super.onLayout(changed, left, top, right, bottom); - if (changed) { - mForegroundBoundsChanged = true; - } - } - @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); - mForegroundBoundsChanged = true; + if (mForeground != null) { + mForeground.setBounds(0, 0, w, h); + } } @Override public void draw(Canvas canvas) { super.draw(canvas); - if (mForeground != null) { - final Drawable foreground = mForeground; - - if (mForegroundBoundsChanged) { - mForegroundBoundsChanged = false; - final Rect selfBounds = mSelfBounds; - final Rect overlayBounds = mOverlayBounds; - - final int w = getRight() - getLeft(); - final int h = getBottom() - getTop(); - - if (mForegroundInPadding) { - selfBounds.set(0, 0, w, h); - } else { - selfBounds.set(getPaddingLeft(), getPaddingTop(), - w - getPaddingRight(), h - getPaddingBottom()); - } - - Gravity.apply(mForegroundGravity, foreground.getIntrinsicWidth(), - foreground.getIntrinsicHeight(), selfBounds, overlayBounds); - foreground.setBounds(overlayBounds); - } - - foreground.draw(canvas); + mForeground.draw(canvas); } } diff --git a/app/src/main/res/values/attrs_foreground_view.xml b/app/src/main/res/values/attrs_foreground_view.xml index cb212717e..a423abadd 100644 --- a/app/src/main/res/values/attrs_foreground_view.xml +++ b/app/src/main/res/values/attrs_foreground_view.xml @@ -19,8 +19,6 @@ - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1a2909a9d..3228fb2cb 100644 --- a/build.gradle +++ b/build.gradle @@ -17,13 +17,11 @@ buildscript { repositories { - maven { - url 'https://maven.google.com' - } + google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-alpha1' + classpath 'com.android.tools.build:gradle:3.0.0-alpha3' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f0aab8707..a5678b60c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue May 23 15:23:19 BST 2017 +#Mon Jun 12 11:28:19 BST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-2-all.zip diff --git a/third_party/bypass/build.gradle b/third_party/bypass/build.gradle index 403947935..855e9f729 100644 --- a/third_party/bypass/build.gradle +++ b/third_party/bypass/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 'android-O' - buildToolsVersion '26.0.0 rc1' + compileSdkVersion 26 + buildToolsVersion '26.0.0' defaultConfig { minSdkVersion 8 - targetSdkVersion 'O' + targetSdkVersion 26 versionCode 1 versionName "1.0" } @@ -17,7 +17,11 @@ android { } } +repositories { + google() +} + dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:support-annotations:25.3.0' + compile 'com.android.support:support-annotations:26.0.0-beta2' }