Skip to content

Commit

Permalink
Merge pull request #4 from alexandregpereira/dev
Browse files Browse the repository at this point in the history
Dev - NewVersion
  • Loading branch information
alexandregpereira authored Oct 20, 2020
2 parents 30ba006 + 8374008 commit 8cce50b
Show file tree
Hide file tree
Showing 45 changed files with 892 additions and 1,553 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation project(":jerry")
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
}
14 changes: 2 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,25 @@

<activity android:name=".animation.TextExpandableSpringAnimationActivity" />

<activity android:name=".animation.TextExpandableAnimationActivity" />

<activity android:name=".animation.FadeSpringAnimationActivity" />

<activity android:name=".animation.FadeAnimationActivity" />

<activity android:name=".animation.CollapseFadingSpringAnimationActivity" />

<activity android:name=".animation.CollapseFadingAnimationActivity" />

<activity android:name=".animation.ExpandFadingSpringAnimationActivity" />

<activity android:name=".animation.ExpandFadingAnimationActivity" />

<activity android:name=".animation.CollapseSpringAnimationActivity" />

<activity android:name=".animation.CollapseAnimationActivity" />

<activity android:name=".animation.ExpandSpringAnimationActivity" />

<activity android:name=".animation.ExpandAnimationActivity" />

<activity android:name=".recyclerview.RecyclerViewActivity" />

<activity android:name=".recyclerview.RecyclerViewSpringActivity" />

<activity android:name=".recyclerview.GridRecyclerViewActivity" />

<activity android:name=".recyclerview.GridRecyclerViewSpringActivity" />

<activity android:name=".animation.TranslationAnimationActivity" />
</application>

</manifest>
47 changes: 10 additions & 37 deletions app/src/main/java/br/alexandregpereira/jerry/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +7,45 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import br.alexandregpereira.jerry.app.animation.CollapseAnimationActivity
import br.alexandregpereira.jerry.app.animation.CollapseFadingAnimationActivity
import br.alexandregpereira.jerry.app.animation.CollapseSpringAnimationActivity
import br.alexandregpereira.jerry.animation.setupLiftViewOnScrollCompat
import br.alexandregpereira.jerry.app.animation.CollapseFadingSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.ExpandAnimationActivity
import br.alexandregpereira.jerry.app.animation.ExpandFadingAnimationActivity
import br.alexandregpereira.jerry.app.animation.ExpandSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.CollapseSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.ExpandFadingSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.FadeAnimationActivity
import br.alexandregpereira.jerry.app.animation.ExpandSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.FadeSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.TextExpandableAnimationActivity
import br.alexandregpereira.jerry.app.animation.TextExpandableSpringAnimationActivity
import br.alexandregpereira.jerry.app.animation.TranslationAnimationActivity
import br.alexandregpereira.jerry.app.recyclerview.GridRecyclerViewActivity
import br.alexandregpereira.jerry.app.recyclerview.GridRecyclerViewSpringActivity
import br.alexandregpereira.jerry.app.recyclerview.RecyclerViewActivity
import br.alexandregpereira.jerry.app.recyclerview.RecyclerViewSpringActivity
import br.alexandregpereira.jerry.app.widgets.configMaterialShapeDrawable
import br.alexandregpereira.jerry.dpToPx
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(R.layout.activity_main) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

appBarLayout.isLiftOnScroll = true

componentsRecycler.apply {
layoutManager = LinearLayoutManager(this@MainActivity)
adapter = MainAdapter(getAnimationComponentsName()) {
when (it) {
AnimationComponent.FADE.ordinal -> startActivity(
FadeAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.FADE_SPRING.ordinal -> startActivity(
FadeSpringAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.COLLAPSE_FADING.ordinal -> startActivity(
CollapseFadingAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.COLLAPSE_FADING.ordinal -> startActivity(
CollapseFadingAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.COLLAPSE_FADING_SPRING.ordinal -> startActivity(
CollapseFadingSpringAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.EXPAND_FADING.ordinal -> startActivity(
ExpandFadingAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.EXPAND_FADING_SPRING.ordinal -> startActivity(
ExpandFadingSpringAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.COLLAPSE.ordinal -> startActivity(
CollapseAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.COLLAPSE_SPRING.ordinal -> startActivity(
CollapseSpringAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.EXPAND.ordinal -> startActivity(
ExpandAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.EXPAND_SPRING.ordinal -> startActivity(
ExpandSpringAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.TEXT_EXPANDABLE.ordinal -> startActivity(
TextExpandableAnimationActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.TEXT_EXPANDABLE_SPRING.ordinal -> startActivity(
TextExpandableSpringAnimationActivity.getStartIntent(this@MainActivity)
)
Expand All @@ -87,9 +61,13 @@ class MainActivity : AppCompatActivity(R.layout.activity_main) {
AnimationComponent.GRID_RECYCLER_SPRING.ordinal -> startActivity(
GridRecyclerViewSpringActivity.getStartIntent(this@MainActivity)
)
AnimationComponent.TRANSLATION.ordinal -> startActivity(
TranslationAnimationActivity.getStartIntent(this@MainActivity)
)
}
}
}
componentsRecycler.setupLiftViewOnScrollCompat(appBarLayout, 2f.dpToPx(resources))
}
}

Expand All @@ -98,18 +76,13 @@ fun getAnimationComponentsName(): List<String> {
}

enum class AnimationComponent {
COLLAPSE,
COLLAPSE_SPRING,
COLLAPSE_FADING,
COLLAPSE_FADING_SPRING,
EXPAND,
EXPAND_SPRING,
EXPAND_FADING,
EXPAND_FADING_SPRING,
FADE,
FADE_SPRING,
TEXT_EXPANDABLE,
TEXT_EXPANDABLE_SPRING,
TRANSLATION,
RECYCLER,
RECYCLER_SPRING,
GRID_RECYCLER,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import br.alexandregpereira.jerry.app.R
import br.alexandregpereira.jerry.expandable.collapseHeightFadingSpring
import br.alexandregpereira.jerry.expandable.collapseWidthFadingSpring
import br.alexandregpereira.jerry.expandable.expandHeightFadingSpring
import br.alexandregpereira.jerry.expandable.expandWidthFadingSpring
import br.alexandregpereira.jerry.animation.expandable.goneCollapseHeightFadeOut
import br.alexandregpereira.jerry.animation.expandable.goneCollapseWidthFadeOut
import br.alexandregpereira.jerry.animation.expandable.visibleExpandHeightFadeIn
import br.alexandregpereira.jerry.animation.expandable.visibleExpandWidthFadeIn
import kotlinx.android.synthetic.main.activity_collapse_fading_animation.*

class CollapseFadingSpringAnimationActivity : AppCompatActivity() {
Expand All @@ -26,43 +26,43 @@ class CollapseFadingSpringAnimationActivity : AppCompatActivity() {
collapseFadingLabel.setText(R.string.collapse_fading_spring)

collapseFadingTextButton.setOnClickListener {
collapseFadingTextView.collapseHeightFadingSpring()
collapseFadingTextView.goneCollapseHeightFadeOut()
}

collapseExpandFadingTextButton.setOnClickListener {
collapseFadingTextView.expandHeightFadingSpring()
collapseFadingTextView.visibleExpandHeightFadeIn()
}

collapseFixedFadingTextButton.setOnClickListener {
collapseFixedFadingTextView.collapseHeightFadingSpring()
collapseFixedFadingTextView.goneCollapseHeightFadeOut()
}

collapseExpandFixedFadingTextButton.setOnClickListener {
collapseFixedFadingTextView.expandHeightFadingSpring()
collapseFixedFadingTextView.visibleExpandHeightFadeIn()
}

collapseWidthFadingTextButton.setOnClickListener {
collapseWidthFadingTextView.collapseWidthFadingSpring()
collapseWidthFadingTextView.goneCollapseWidthFadeOut()
}

collapseExpandWidthFadingTextButton.setOnClickListener {
collapseWidthFadingTextView.expandWidthFadingSpring()
collapseWidthFadingTextView.visibleExpandWidthFadeIn()
}

collapseMatchWidthFadingButton.setOnClickListener {
collapseMatchWidthFadingView.collapseWidthFadingSpring()
collapseMatchWidthFadingView.goneCollapseWidthFadeOut()
}

collapseExpandMatchWidthFadingButton.setOnClickListener {
collapseMatchWidthFadingView.expandWidthFadingSpring()
collapseMatchWidthFadingView.visibleExpandWidthFadeIn()
}

collapseFixedWidthFadingButton.setOnClickListener {
collapseFixedWidthFadingView.collapseWidthFadingSpring()
collapseFixedWidthFadingView.goneCollapseWidthFadeOut()
}

collapseExpandFixedWidthFadingButton.setOnClickListener {
collapseFixedWidthFadingView.expandWidthFadingSpring()
collapseFixedWidthFadingView.visibleExpandWidthFadeIn()
}
}
}
Loading

0 comments on commit 8cce50b

Please sign in to comment.