Skip to content

Commit

Permalink
Migrated to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
RationalRank committed Nov 24, 2020
1 parent af3b57b commit c12ce2f
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 57 deletions.
32 changes: 20 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.novoda:bintray-release:0.4.0'
classpath 'com.android.tools.build:gradle:4.1.1'
}
}

allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
userOrg = 'polyak01'
groupId = 'com.polyak'
uploadName = 'IconSwitch'
description = 'Custom switch-like widget.'
publishVersion = '1.0.1'
licences = ['Apache-2.0']
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Nov 24 15:21:07 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
21 changes: 4 additions & 17 deletions iconswitch/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "1.1"
}
}

dependencies {
compile 'com.android.support:appcompat-v7:25.2.0'
}


publish {
artifactId = 'icon-switch'
userOrg = rootProject.userOrg
groupId = rootProject.groupId
uploadName = rootProject.uploadName
publishVersion = rootProject.publishVersion
description = rootProject.description
licences = rootProject.licences
compile 'androidx.appcompat:appcompat:1.0.0'
}
10 changes: 5 additions & 5 deletions iconswitch/src/main/java/com/polyak/iconswitch/IconSwitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.ColorInt;
import android.support.annotation.RequiresApi;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.content.res.AppCompatResources;
import androidx.annotation.ColorInt;
import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.appcompat.content.res.AppCompatResources;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.graphics.PixelFormat;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

/**
* Created by polyak01 on 31.03.2017.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.graphics.Paint;
import android.graphics.PointF;
import android.os.Build;
import android.support.annotation.RequiresApi;
import androidx.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.View;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.polyak.iconswitch;

import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.VelocityTrackerCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.ScrollerCompat;
import androidx.core.view.MotionEventCompat;
import androidx.core.view.VelocityTrackerCompat;
import androidx.core.view.ViewCompat;
import androidx.core.widget.ScrollerCompat;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
Expand Down Expand Up @@ -949,7 +949,7 @@ public boolean isViewUnder(View view, int x, int y) {

/**
* Find the topmost child under the given point within the parent view's coordinate system.
* The child order is determined using {@link android.support.v4.widget.ViewDragHelper.Callback#getOrderedChildIndex(int)}.
* The child order is determined using {@link androidx.customview.widget.ViewDragHelper.Callback#getOrderedChildIndex(int)}.
*
* @param x X position to test in the parent's coordinate system
* @param y Y position to test in the parent's coordinate system
Expand Down
10 changes: 5 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 29

defaultConfig {
applicationId "com.polyak.iconswitch.sample"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 29
versionCode 2
versionName "1.1"
}
Expand All @@ -21,8 +21,8 @@ android {

dependencies {
compile project(':iconswitch')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'androidx.appcompat:appcompat:1.0.0'
compile 'com.google.android.material:material:1.0.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'

compile 'com.yarolegovich:mp:1.0.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import android.animation.ValueAnimator;
import android.content.Intent;
import android.graphics.Point;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.design.widget.Snackbar;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import com.google.android.material.snackbar.Snackbar;
import androidx.fragment.app.FragmentManager;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.Window;
Expand Down
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:orientation="vertical"
tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand Down Expand Up @@ -48,7 +48,7 @@
android:textColor="@android:color/white" />

</FrameLayout>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<FrameLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit c12ce2f

Please sign in to comment.