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: 플로팅 버튼 화면 이동 구현 #271

Merged
merged 3 commits into from
Aug 6, 2024
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
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
android:theme="@style/Theme.Ody"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".presentation.FloatingButtonActivity"
android:exported="true" />
<activity
android:name=".presentation.invitecode.InviteCodeActivity"
android:exported="false"
Expand Down Expand Up @@ -72,4 +75,4 @@
</service>
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.woowacourse.ody.presentation

import android.view.View
import com.woowacourse.ody.R
import com.woowacourse.ody.databinding.ActivityMeetingListBinding
import com.woowacourse.ody.presentation.common.binding.BindingActivity
import com.woowacourse.ody.presentation.creation.MeetingCreationActivity
import com.woowacourse.ody.presentation.invitecode.InviteCodeActivity

class FloatingButtonActivity :
BindingActivity<ActivityMeetingListBinding>(R.layout.activity_meeting_list),
FloatingButtonListener {
override fun initializeBinding() {
binding.listener = this
}

override fun onFab() {
binding.cvMenuView.visibility = if (binding.fabHomeNavigator.isSelected) View.GONE else View.VISIBLE
binding.fabHomeNavigator.isSelected = !binding.fabHomeNavigator.isSelected
}

override fun onJoinMeeting() {
startActivity(InviteCodeActivity.getIntent(this))
}

override fun onCreationMeeting() {
startActivity(MeetingCreationActivity.getIntent(this))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.woowacourse.ody.presentation

interface FloatingButtonListener {
fun onFab()

fun onJoinMeeting()

fun onCreationMeeting()
}
45 changes: 44 additions & 1 deletion android/app/src/main/res/layout/activity_meeting_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<variable
name="listener"
type="com.woowacourse.ody.presentation.intro.listener.IntroListener" />
type="com.woowacourse.ody.presentation.FloatingButtonListener" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -48,13 +48,56 @@
app:layout_constraintTop_toBottomOf="@id/tb_intro"
tools:listitem="@layout/item_meeting" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cv_menu_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="18dp"
android:background="@drawable/rectangle_radius_15"
android:backgroundTint="@color/purple_300"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/fab_home_navigator"
app:layout_constraintEnd_toEndOf="@id/fab_home_navigator">

<TextView
android:id="@+id/tv_create_meeting"
style="@style/pretendard_medium_18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="57dp"
android:onClick="@{() -> listener.onCreationMeeting()}"
android:text="약속 개설하기"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_join_meeting"
style="@style/pretendard_medium_18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="29dp"
android:layout_marginBottom="18dp"
android:onClick="@{() -> listener.onJoinMeeting()}"
android:text="약속 참여하기"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_create_meeting"
app:layout_constraintTop_toBottomOf="@id/tv_create_meeting" />

</androidx.constraintlayout.widget.ConstraintLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_home_navigator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginBottom="32dp"
android:backgroundTint="@color/purple_300"
android:onClick="@{() -> listener.onFab()}"
android:src="@drawable/selector_floating_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down