Skip to content
Snippets Groups Projects
Commit 32241f31 authored by John Carlson's avatar John Carlson
Browse files

Remove compat circular reveal

parent 31bf450a
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -100,6 +100,7 @@ ext {
materialDialogsVersion = '0.9.4.5'
leakCanaryVersion = '1.5'
addendumVersion = '1.2.1'
alakazamVersion = '1.0.1'
}
 
dependencies {
Loading
Loading
@@ -169,7 +170,8 @@ dependencies {
compile 'com.github.Commit451:Jounce:1.0.2'
compile 'com.github.Commit451:ForegroundViews:2.4.0'
compile 'com.github.Commit451:MorphTransitions:2.0.0'
compile 'com.github.Commit451.Alakazam:alakazam:1.0.1'
compile "com.github.Commit451.Alakazam:alakazam:$alakazamVersion"
compile "com.github.Commit451.Alakazam:alakazam-kotlin:$alakazamVersion"
compile 'com.github.Commit451:Lift:1.2.0'
compile 'com.github.Commit451:okyo:2.0.0'
compile 'com.github.Commit451:OkioProGuardRules:1.11.0.0'
Loading
Loading
@@ -210,10 +212,6 @@ dependencies {
 
compile 'com.atlassian.commonmark:commonmark:0.9.0'
 
compile('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
transitive = true;
}
normalCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
Loading
Loading
Loading
Loading
@@ -4,8 +4,10 @@ package com.commit451.gitlab.activity
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.ViewAnimationUtils
import android.view.ViewGroup
import android.view.animation.AccelerateDecelerateInterpolator
import butterknife.BindView
Loading
Loading
@@ -13,6 +15,7 @@ import butterknife.ButterKnife
import butterknife.OnClick
import com.commit451.addendum.parceler.getParcelerParcelableExtra
import com.commit451.addendum.parceler.putParcelerParcelableExtra
import com.commit451.alakazam.kotlin.fadeIn
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import com.commit451.gitlab.extension.setup
Loading
Loading
@@ -20,7 +23,6 @@ import com.commit451.gitlab.extension.toPart
import com.commit451.gitlab.model.api.FileUploadResponse
import com.commit451.gitlab.model.api.Project
import com.commit451.gitlab.rx.CustomSingleObserver
import io.codetail.animation.ViewAnimationUtils
import pl.aprilapps.easyphotopicker.DefaultCallback
import pl.aprilapps.easyphotopicker.EasyImage
import timber.log.Timber
Loading
Loading
@@ -75,18 +77,7 @@ class AttachActivity : BaseActivity() {
setContentView(R.layout.activity_attach)
ButterKnife.bind(this)
 
//Run the runnable after the view has been measured
card.post {
//we need the radius of the animation circle, which is the diagonal of the view
val finalRadius = Math.hypot(card.width.toDouble(), card.height.toDouble()).toFloat()
//it's using a 3rd-party ViewAnimationUtils class for compat reasons (up to API 14)
val animator = ViewAnimationUtils
.createCircularReveal(card, 0, card.height, 0f, finalRadius)
animator.duration = 500
animator.interpolator = AccelerateDecelerateInterpolator()
animator.start()
}
reveal()
 
project = intent.getParcelerParcelableExtra<Project>(KEY_PROJECT)
}
Loading
Loading
@@ -117,6 +108,25 @@ class AttachActivity : BaseActivity() {
overridePendingTransition(R.anim.do_nothing, R.anim.fade_out)
}
 
fun reveal() {
if (Build.VERSION.SDK_INT >= 21) {
//Run the runnable after the view has been measured
card.post {
//we need the radius of the animation circle, which is the diagonal of the view
val finalRadius = Math.hypot(card.width.toDouble(), card.height.toDouble()).toFloat()
//it's using a 3rd-party ViewAnimationUtils class for compat reasons (up to API 14)
val animator = ViewAnimationUtils
.createCircularReveal(card, 0, card.height, 0f, finalRadius)
animator.duration = 500
animator.interpolator = AccelerateDecelerateInterpolator()
animator.start()
}
} else {
card.fadeIn()
}
}
fun onPhotoReturned(photo: File) {
progress.visibility = View.VISIBLE
rootButtons.visibility = View.INVISIBLE
Loading
Loading
<?xml version="1.0" encoding="utf-8"?>
<!--We need to use RevealFrameLayout (FrameLayout) to be able to use the circular animation-->
<io.codetail.widget.RevealFrameLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
Loading
Loading
@@ -57,4 +56,4 @@
 
</android.support.v7.widget.CardView>
 
</io.codetail.widget.RevealFrameLayout>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment