Skip to content

Commit

Permalink
Migrate to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhanif-simformsolutions committed Jun 7, 2021
1 parent 7a65fc1 commit 41e4f42
Show file tree
Hide file tree
Showing 26 changed files with 468 additions and 327 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

25 changes: 12 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 27
compileSdkVersion 30
defaultConfig {
applicationId "com.elconfidencial.bubbleshowcase"
minSdkVersion 16
targetSdkVersion 27
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -25,11 +23,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':bubbleshowcase')
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.elconfidencial.bubbleshowcase

import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4

import androidx.test.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.elconfidencial.bubbleshowcase

import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.support.v4.content.ContextCompat
import android.support.v7.view.menu.ActionMenuItemView
import androidx.core.content.ContextCompat
import androidx.appcompat.view.menu.ActionMenuItemView
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down Expand Up @@ -85,4 +85,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonEventListener" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
38 changes: 12 additions & 26 deletions bubbleshowcase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven-publish'



android {
compileSdkVersion 26



compileSdkVersion 30
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
Expand All @@ -29,26 +21,20 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
repositories {
mavenCentral()
}


apply from: 'deploy.gradle'
//apply from: 'deploy.gradle'
2 changes: 1 addition & 1 deletion bubbleshowcase/deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (project.hasProperty("kotlin")) { //Kotlin libraries
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc, dependsOn: dokka) {
task javadoc(type: Javadoc) {

}
} else if (project.hasProperty("android")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.elconfidencial.bubbleshowcase;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import androidx.test.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* Instrumented test, which will execute on an Android device.
Expand Down
3 changes: 1 addition & 2 deletions bubbleshowcase/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.elconfidencial.bubbleshowcase" />
<manifest package="com.elconfidencial.bubbleshowcase" />
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ object AnimationUtils {

fun getScaleAnimation(offset: Int, duration: Int): Animation {
val anim = ScaleAnimation(
0f, 1f, // Start and end values for the X axis scaling
0f, 1f, // Start and end values for the Y axis scaling
Animation.RELATIVE_TO_SELF, 0.5f, // Pivot point of X scaling
Animation.RELATIVE_TO_SELF, 0.5f) // Pivot point of Y scaling
0f, 1f, // Start and end values for the X axis scaling
0f, 1f, // Start and end values for the Y axis scaling
Animation.RELATIVE_TO_SELF, 0.5f, // Pivot point of X scaling
Animation.RELATIVE_TO_SELF, 0.5f
) // Pivot point of Y scaling
anim.fillAfter = true
anim.startOffset = offset.toLong()
anim.duration = duration.toLong()
Expand All @@ -34,10 +35,11 @@ object AnimationUtils {
}

fun setBouncingAnimation(view: View, offset: Int, duration: Int): View {

val objAnim = ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofFloat("scaleX", 1.05f),
PropertyValuesHolder.ofFloat("scaleY", 1.05f))
val objAnim = ObjectAnimator.ofPropertyValuesHolder(
view,
PropertyValuesHolder.ofFloat("scaleX", 1.05f),
PropertyValuesHolder.ofFloat("scaleY", 1.05f)
)
objAnim.duration = duration.toLong()
objAnim.startDelay = offset.toLong()
objAnim.repeatCount = ObjectAnimator.INFINITE
Expand Down
Loading

0 comments on commit 41e4f42

Please sign in to comment.