Skip to content

Commit

Permalink
[FEAT/#47] finish trip 코드리뷰 반영 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
crownjoe committed Jan 9, 2024
1 parent ef88518 commit 3716ded
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import androidx.activity.viewModels
import com.going.presentation.R
import com.going.presentation.databinding.ActivityFinishTripBinding
import com.going.presentation.preferencetag.PreferenceTagActivity
import com.going.presentation.starttrip.createtrip.CreateTripViewModel
import com.going.ui.base.BaseActivity
import com.going.ui.extension.setOnSingleClickListener
import com.going.ui.extension.toast

class FinishTripActivity :
BaseActivity<ActivityFinishTripBinding>(R.layout.activity_finish_trip) {
Expand All @@ -24,15 +22,14 @@ class FinishTripActivity :
initCopyCodetvClickListener()
initSendCodeBtnClickListener()
initEnterTripBtnClickListener()
//checkDayLeft()
}

private fun initCopyCodetvClickListener() {
val inviteCode = viewModel.INVITE_CODE

binding.tvFinishTripTermsText.setOnSingleClickListener {
val clipboardManager =
this.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clipData = ClipData.newPlainText("Invite Code", inviteCode)
val clipData = ClipData.newPlainText("INVITE_CODE_LABEL", viewModel.INVITE_CODE)
clipboardManager.setPrimaryClip(clipData)
}
}
Expand All @@ -52,6 +49,17 @@ class FinishTripActivity :
finish()
}
}
}

// private fun checkDayLeft(){
// 그 전 뷰에서 서버 붙여서 보내주는 day 값 알게 되면 맞게 로직 구현하겠습니다
// if(dayLeft > 0) {
// binding.tvFinishTripDayLeft.text = dayLeft
// }else{
// binding.tvFinishTripDayLeft.text =
// }
// }
companion object {
const val INVITE_CODE_LABEL = "Invite Code"
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import androidx.lifecycle.ViewModel

class FinishTripViewModel : ViewModel(){
val INVITE_CODE = "a1b2c3"
}
}

44 changes: 9 additions & 35 deletions presentation/src/main/res/layout/activity_finish_trip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/white_000"
android:elevation="2dp"
android:paddingVertical="12dp"
android:paddingStart="18dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_back"
Expand Down Expand Up @@ -63,44 +61,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_finish_trip_day_left"
<TextView
android:id="@+id/tv_finish_trip_day_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="35dp"
android:layout_marginTop="34dp"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:background="@drawable/shape_rect_2_red100_fill"
android:visibility="visible"
android:text="D - 16"
android:textColor="@color/red_500"
android:textAppearance="@style/TextAppearance.Doorip.Detail2.Bold"
app:layout_constraintStart_toEndOf="@id/iv_finish_trip_icon"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/tv_finish_trip_deadline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:paddingVertical="2dp"
android:textAppearance="@style/TextAppearance.Doorip.Detail2.Bold"
android:textColor="@color/red_500"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="D - " />

<TextView
android:id="@+id/tv_finish_trip_deadline_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:paddingVertical="2dp"
android:textAppearance="@style/TextAppearance.Doorip.Detail2.Bold"
android:textColor="@color/red_500"
app:layout_constraintBottom_toBottomOf="@id/tv_finish_trip_deadline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_finish_trip_deadline"
app:layout_constraintTop_toTopOf="@id/tv_finish_trip_deadline"
android:text="16" />

</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/tv_finish_trip_name"
Expand All @@ -112,7 +86,7 @@
android:text="@string/finish_trip_tv_trip_name"
android:textColor="@color/gray_700"
app:layout_constraintStart_toEndOf="@id/iv_finish_trip_icon"
app:layout_constraintTop_toBottomOf="@id/layout_finish_trip_day_left" />
app:layout_constraintTop_toBottomOf="@id/tv_finish_trip_day_left" />

<TextView
android:id="@+id/tv_finish_trip_start"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
xmlns:tools="http://schemas.android.com/tools">

<data>

<import type="android.view.View" />

<import type="com.going.domain.entity.NameState" />

<variable
name="viewModel"
type="com.going.presentation.starttrip.createtrip.CreateTripViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down

0 comments on commit 3716ded

Please sign in to comment.