Files
Alexander Djenkov 08e23bcc3b feat: overhaul and streamline Android page navigation transitions (#7925)
* feat: remove Animators and replace with Transitions

* fix: handle disappearing nested fragments for tabs.

Extract TabFragmentImplementation in tab-navigation base for both tabs and bottom navigation

* chore: bump webpack cycles counter

* feat(android-widgets): add androidx.transition:transition as dependency

* chore: fix typescript errors

* fix(frame-android): child already has a parent. Replace removeView with removeAllViews

* fix(tests): wait for fragment before isAdded() check

* fix(bottom-navigation): prevent changeTab logic when fragment manager is destroyed

* chore: apply PR comments changes
2019-10-15 18:19:47 +03:00

100 lines
2.2 KiB
Groovy

import groovy.json.JsonSlurper //used to parse package.json
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
def isWinOs = System.properties['os.name'].toLowerCase().contains('windows')
apply plugin: 'com.android.library'
def computeCompileSdkVersion () {
if(project.hasProperty("compileSdk")) {
return compileSdk
}
else {
return 28
}
}
def computeBuildToolsVersion() {
if(project.hasProperty("buildToolsVersion")) {
return buildToolsVersion
}
else {
return "28.0.2"
}
}
def computeAndroidXVersion() {
if(project.hasProperty("androidxVersion")) {
return androidxVersion
}
else {
return "1.0.0"
}
}
def computeSupportVersion() {
if(project.hasProperty("supportVersion")) {
return supportVersion
}
else {
return "28.0.0"
}
}
def computeTargetSdkVersion() {
if(project.hasProperty("targetSdk")) {
return targetSdk
}
else {
return 28
}
}
android {
compileSdkVersion computeCompileSdkVersion()
buildToolsVersion computeBuildToolsVersion()
defaultConfig {
minSdkVersion 16
targetSdkVersion computeTargetSdkVersion()
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
if(project.hasProperty("useAndroidX")) {
println 'Using androix'
def androidxVersion = computeAndroidXVersion()
implementation 'androidx.viewpager:viewpager:' + androidxVersion
implementation 'androidx.fragment:fragment:' + androidxVersion
implementation 'androidx.transition:transition:' + androidxVersion
} else {
println 'Using support library'
implementation 'com.android.support:support-v4:' + computeSupportVersion()
}
}
task cleanBuildDir (type: Delete) {
delete "../build/"
}
task copyAar << {
copy {
from "build/outputs/aar/widgets-release.aar"
into "../build/"
}
}
assemble.dependsOn(cleanBuildDir)
copyAar.dependsOn(assemble)
build.dependsOn(copyAar)