Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleks Haecky committed Nov 9, 2018
1 parent f088809 commit 48eff58
Show file tree
Hide file tree
Showing 115 changed files with 433 additions and 386 deletions.
15 changes: 7 additions & 8 deletions AppWidgetSample/app/build.gradle
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 26
defaultConfig {
applicationId "com.example.android.appwidgetsample"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,11 +19,11 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
}
4 changes: 3 additions & 1 deletion AppWidgetSample/build.gradle
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
2 changes: 1 addition & 1 deletion AppWidgetSample/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
7 changes: 3 additions & 4 deletions CanvasExample/app/build.gradle
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 26
defaultConfig {
applicationId "com.example.canvasexample"
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,5 +19,5 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:appcompat-v7:26.1.0'
}
2 changes: 1 addition & 1 deletion CanvasExample/build.gradle
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions CanvasExample/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon Oct 30 10:28:57 PDT 2017
#Mon Oct 08 09:46:08 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
13 changes: 6 additions & 7 deletions ClippingExample/app/build.gradle
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 28
defaultConfig {
applicationId "com.example.clippingexample"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,8 +19,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
Expand Up @@ -24,6 +24,7 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

Expand Down Expand Up @@ -164,9 +165,21 @@ protected void onDraw(Canvas canvas) {
// Use the subtraction of two clipping rectangles to create a frame.
canvas.clipRect(2*mRectInset, 2*mRectInset,
mClipRectRight-2*mRectInset, mClipRectBottom-2*mRectInset);
canvas.clipRect(4*mRectInset, 4*mRectInset,
mClipRectRight-4*mRectInset, mClipRectBottom-4*mRectInset,
Region.Op.DIFFERENCE);
// The method clipRect(float, float, float, float, Region.Op
// .DIFFERENCE) was deprecated in API level 26. The recommended
// alternative method is clipOutRect(float, float, float, float),
// which is currently available in API level 26 and higher.
if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
canvas.clipRect(4*mRectInset, 4*mRectInset,
mClipRectRight-4*mRectInset, mClipRectBottom-4*mRectInset,
Region.Op.DIFFERENCE);
else{
canvas.clipOutRect(4*mRectInset, 4*mRectInset,
mClipRectRight-4*mRectInset,
mClipRectBottom-4*mRectInset);
}


drawClippedRectangle(canvas);
canvas.restore();

Expand All @@ -178,19 +191,38 @@ protected void onDraw(Canvas canvas) {
mPath.rewind();
mPath.addCircle(mCircleRadius, mClipRectBottom-mCircleRadius,
mCircleRadius, Path.Direction.CCW);
canvas.clipPath(mPath, Region.Op.DIFFERENCE);
// The method clipPath(path, Region.Op.DIFFERENCE) was deprecated in
// API level 26. The recommended alternative method is
// clipOutPath(Path), which is currently available in API level 26
// and higher.
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
canvas.clipPath(mPath, Region.Op.DIFFERENCE);
} else {
canvas.clipOutPath(mPath);
}
drawClippedRectangle(canvas);
canvas.restore();

// Use the interserction of two rectangles as the clipping region.
// Use the intersection of two rectangles as the clipping region.
canvas.save();
canvas.translate(mColumnnTwo, mRowTwo);
canvas.clipRect(mClipRectLeft, mClipRectTop,
mClipRectRight-mSmallRectOffset,
mClipRectBottom-mSmallRectOffset);
canvas.clipRect(mClipRectLeft+mSmallRectOffset,
mClipRectTop+mSmallRectOffset,
mClipRectRight, mClipRectBottom, Region.Op.INTERSECT);
// The method clipRect(float, float, float, float, Region.Op
// .INTERSECT) was deprecated in API level 26. The recommended
// alternative method is clipRect(float, float, float, float), which
// is currently available in API level 26 and higher.
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
canvas.clipRect(mClipRectLeft + mSmallRectOffset,
mClipRectTop + mSmallRectOffset, mClipRectRight,
mClipRectBottom, Region.Op.INTERSECT);
} else {
canvas.clipRect(mClipRectLeft + mSmallRectOffset,
mClipRectTop + mSmallRectOffset, mClipRectRight,
mClipRectBottom);
}

drawClippedRectangle(canvas);
canvas.restore();

Expand Down
9 changes: 4 additions & 5 deletions ClippingExample/build.gradle
Expand Up @@ -2,13 +2,11 @@

buildscript {
repositories {
//jcenter()
maven {
url 'https://maven.google.com'
}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta7'
classpath 'com.android.tools.build:gradle:3.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -18,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions ClippingExample/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon Oct 30 10:34:55 PDT 2017
#Mon Oct 08 10:51:31 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
11 changes: 5 additions & 6 deletions CustomEditText/app/build.gradle
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
defaultConfig {
applicationId "com.example.android.customedittext"
minSdkVersion 17
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Expand All @@ -19,7 +18,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
4 changes: 3 additions & 1 deletion CustomEditText/build.gradle
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions CustomEditText/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sat May 20 19:10:21 PDT 2017
#Mon Oct 08 11:37:30 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
5 changes: 2 additions & 3 deletions CustomFanChallenge/Application/build.gradle
Expand Up @@ -6,7 +6,6 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.android.customfanchallenge"
minSdkVersion 15
Expand All @@ -24,6 +23,6 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:25.4.0"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "com.android.support:appcompat-v7:26.1.0"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
2 changes: 1 addition & 1 deletion CustomFanChallenge/build.gradle
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions CustomFanChallenge/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon Apr 02 12:09:05 PDT 2018
#Mon Oct 08 11:41:08 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
15 changes: 8 additions & 7 deletions CustomFanController/Application/build.gradle
Expand Up @@ -5,12 +5,11 @@ apply plugin: 'com.android.application'
// the main sample code.

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
defaultConfig {
applicationId "com.example.android.customfancontroller"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Expand All @@ -25,19 +24,21 @@ android {
buildscript {
repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.0'
}
}

repositories {
jcenter()
google()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:25.3.1"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:26.1.0"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
10 changes: 9 additions & 1 deletion CustomFanController/build.gradle
@@ -1,4 +1,12 @@

repositories {
google()
}

buildscript {
repositories {
google()
}
}



Expand Down
4 changes: 2 additions & 2 deletions CustomFanController/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon May 08 14:47:34 PDT 2017
#Mon Oct 08 11:49:47 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

0 comments on commit 48eff58

Please sign in to comment.