Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#65] 온보딩 종료 뷰 애니메이션 추가 #67

Merged
merged 8 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.View
import androidx.activity.viewModels
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityInputInfoBinding
import com.sopt.umbba_android.presentation.onboarding.viewmodel.InputInfoViewModel
import com.sopt.umbba_android.util.binding.BindingActivity
import java.util.regex.Pattern

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
package com.sopt.umbba_android.presentation.onboarding

import androidx.appcompat.app.AppCompatActivity
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import android.view.animation.AnimationUtils
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityOnboardingFinishBinding
import com.sopt.umbba_android.presentation.MainActivity
import com.sopt.umbba_android.util.binding.BindingActivity

class OnboardingFinishActivity : AppCompatActivity() {
class OnboardingFinishActivity : BindingActivity<ActivityOnboardingFinishBinding>(R.layout.activity_onboarding_finish) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_onboarding_finish)

animateFadeBackground()
goMainActivity()
}

private fun animateFadeBackground() {
Handler(Looper.getMainLooper()).postDelayed({
val fadeOutAnim = AnimationUtils.loadAnimation(this, R.anim.fadeout)
with(binding.clStart) {
startAnimation(fadeOutAnim)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 우와아아 언젠가 이 애니메이션 쇽샥 할게요

visibility = View.INVISIBLE
}
val fadeInAnim = AnimationUtils.loadAnimation(this, R.anim.fadein)
binding.clArrive.startAnimation(fadeInAnim)
with(binding.clArrive) {
startAnimation(fadeInAnim)
visibility = View.VISIBLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이게 반전이군..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

화면이 두개가 동시에 교차돼서 그래요!!!!
글고 마지막에는 visibility도 고정해줘야댐.

}
},2000)

}

private fun goMainActivity() {
binding.btnStart.setOnClickListener {
startActivity(Intent(this, MainActivity::class.java))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.View
import androidx.activity.viewModels
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivitySelectFamilyBinding
import com.sopt.umbba_android.presentation.onboarding.viewmodel.SelectFamilyViewModel
import com.sopt.umbba_android.util.binding.BindingActivity

class SelectFamilyActivity :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.umbba_android.presentation.onboarding
package com.sopt.umbba_android.presentation.onboarding.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.umbba_android.presentation.onboarding
package com.sopt.umbba_android.presentation.onboarding.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/anim/fadein.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0"
android:toAlpha="1.0">
</alpha>
7 changes: 7 additions & 0 deletions app/src/main/res/anim/fadeout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="1.0"
android:toAlpha="0.0">
</alpha>
20 changes: 20 additions & 0 deletions app/src/main/res/drawable/ic_arrow_back_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M16,24H32"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#FCFAF8"
android:strokeLineCap="round"/>
<path
android:pathData="M22,18L16,24L22,30"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#FCFAF8"
android:strokeLineCap="round"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_input_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<variable
name="viewmodel"
type="com.sopt.umbba_android.presentation.onboarding.InputInfoViewModel" />
type="com.sopt.umbba_android.presentation.onboarding.viewmodel.InputInfoViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
103 changes: 73 additions & 30 deletions app/src/main/res/layout/activity_onboarding_finish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,81 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/umbba_white"
tools:context=".presentation.onboarding.OnboardingFinishActivity">

<include
android:id="@+id/layout_appbar"
layout="@layout/basic_appbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_arrive_past"
style="@style/AndroidHead1SemiBold24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/arrive_past"
android:textColor="@color/umbba_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_appbar" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start"
style="@style/AndroidBody1_1SemiBold16"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_start"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginHorizontal="24dp"
android:layout_marginVertical="24dp"
android:background="@drawable/sel_btn_next"
android:stateListAnimator="@null"
android:text="@string/btn_start"
android:textColor="@color/umbba_white"
app:layout_constraintBottom_toBottomOf="parent" />
android:layout_height="match_parent"
android:background="@drawable/img_past_trip_start">

<ImageView
android:id="@+id/btn_back1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginStart="12dp"
android:src="@drawable/ic_arrow_back_white"
android:background="@android:color/transparent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/tv_arrive_past1"
style="@style/AndroidHead1SemiBold24"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:layout_marginStart="28dp"
android:text="@string/arrive_past"
android:textColor="@color/umbba_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_back1" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_arrive"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_past_trip_arrive"
android:visibility="invisible"
tools:context=".presentation.onboarding.OnboardingFinishActivity">

<ImageView
android:id="@+id/btn_back2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:layout_marginStart="24dp"
android:src="@drawable/ic_arrow_back"
android:background="@android:color/transparent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/tv_arrive_past2"
style="@style/AndroidHead1SemiBold24"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginStart="28dp"
android:text="@string/arrive_past"
android:textColor="@color/umbba_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_back2" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start"
style="@style/AndroidBody1_1SemiBold16"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginHorizontal="24dp"
android:layout_marginVertical="24dp"
android:background="@drawable/sel_btn_next"
android:stateListAnimator="@null"
android:text="@string/btn_start"
android:textColor="@color/umbba_white"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_select_family.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<variable
name="viewmodel"
type="com.sopt.umbba_android.presentation.onboarding.SelectFamilyViewModel" />
type="com.sopt.umbba_android.presentation.onboarding.viewmodel.SelectFamilyViewModel" />

</data>

Expand Down