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/#123] OurTodo, MyTodo / EmptyView 구현 #134

Merged
merged 15 commits into from
Jan 16, 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
34 changes: 17 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.TodoActivity"
android:name="com.going.presentation.onboarding.signup.OnboardingProfileSettingActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.onboarding.signup.OnboardingProfileSettingActivity"
android:name="com.going.presentation.tendency.splash.TendencySplashActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.tendency.splash.TendencySplashActivity"
android:name="com.going.presentation.tendency.ttest.TendencyTestActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.tendency.ttest.TendencyTestActivity"
android:name="com.going.presentation.tendency.result.TendencyResultActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand All @@ -87,67 +87,67 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.dashboard.DashBoardActivity"
android:name="com.going.presentation.entertrip.createtrip.choosedate.CreateTripActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.tendency.result.TendencyResultActivity"
android:name="com.going.presentation.entertrip.StartTripSplashActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.createtrip.choosedate.CreateTripActivity"
android:name="com.going.presentation.entertrip.createtrip.finish.FinishTripActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.StartTripSplashActivity"
android:name="com.going.presentation.entertrip.invitetrip.invitecode.EnterTripActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.mytodo.create.MyTodoCreateActivity"
android:name="com.going.presentation.entertrip.invitetrip.finish.InviteFinishActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.detail.PrivateDetailActivity"
android:name="com.going.presentation.dashboard.DashBoardActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.ourtodo.create.OurTodoCreateActivity"
android:name="com.going.presentation.todo.TodoActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.detail.PublicDetailActivity"
android:name="com.going.presentation.todo.mytodo.create.MyTodoCreateActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.createtrip.finish.FinishTripActivity"
android:name="com.going.presentation.todo.ourtodo.create.OurTodoCreateActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.setting.SettingActivity"
android:name="com.going.presentation.todo.detail.PrivateDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.profile.ProfileActivity"
android:name="com.going.presentation.todo.detail.PublicDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.invitetrip.invitecode.EnterTripActivity"
android:name="com.going.presentation.setting.SettingActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.entertrip.invitetrip.finish.InviteFinishActivity"
android:name="com.going.presentation.profile.ProfileActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand Down
9 changes: 9 additions & 0 deletions core-ui/src/main/java/com/going/ui/extension/ActivityExt.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.going.ui.extension

import android.app.Activity
import androidx.core.content.ContextCompat

fun Activity.setStatusBarColorFromResource(colorResId: Int) {
val statusBarColor = ContextCompat.getColor(this, colorResId)
window.statusBarColor = statusBarColor
}
Comment on lines +6 to +9
Copy link
Member

Choose a reason for hiding this comment

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

익스텐션으로 만드셨네요! 전 그냥 작성했었어서 이거 쓰는걸로 바꿔볼게용

7 changes: 7 additions & 0 deletions core-ui/src/main/java/com/going/ui/extension/FragmentExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ fun Fragment.colorOf(@ColorRes resId: Int) = ContextCompat.getColor(requireConte
fun Fragment.drawableOf(@DrawableRes resId: Int) =
ContextCompat.getDrawable(requireContext(), resId)

fun Fragment.setStatusBarColor(colorResId: Int) {
activity?.let {
val statusBarColor = ContextCompat.getColor(it, colorResId)
it.window.statusBarColor = statusBarColor
}
}

val Fragment.viewLifeCycle
get() = viewLifecycleOwner.lifecycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ import com.going.data.dto.NonDataBaseResponse
import com.going.data.dto.request.TendencyTestRequestDto

interface TendencyDataSource {
suspend fun patchTendencyTest(result: TendencyTestRequestDto): NonDataBaseResponse
suspend fun patchTendencyTest(
result: TendencyTestRequestDto
): NonDataBaseResponse
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class AuthDataSourceImpl @Inject constructor(
override suspend fun postSignUp(
Authorization: String,
data: SignUpRequestDto,
): BaseResponse<AuthResponseDto> = authService.postSignUp(Authorization, data)
): BaseResponse<AuthResponseDto> =
authService.postSignUp(Authorization, data)

override suspend fun getSplash(): NonDataBaseResponse = authService.getSplash()
override suspend fun getSplash(): NonDataBaseResponse =
authService.getSplash()
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class MockDataSourceImpl @Inject constructor(

override suspend fun getFollowerListData(
page: Int
): MockFollowerResponseDto {
return mockService.getFollowerList(page)
}
): MockFollowerResponseDto =
mockService.getFollowerList(page)

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import javax.inject.Inject
class SettingDataSourceImpl @Inject constructor(
private val settingService: SettingService,
) : SettingDataSource {
override suspend fun patchSignOut(): NonDataBaseResponse = settingService.patchSignOut()
override suspend fun deleteWithDraw(): NonDataBaseResponse = settingService.deleteWithDraw()
override suspend fun patchSignOut(): NonDataBaseResponse =
settingService.patchSignOut()

override suspend fun deleteWithDraw(): NonDataBaseResponse =
settingService.deleteWithDraw()
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class AuthRepositoryImpl @Inject constructor(
).data.toAuthTokenModel()
}

override suspend fun getSplash(): Result<Unit> = runCatching {
authDataSource.getSplash()
}
override suspend fun getSplash(): Result<Unit> =
runCatching {
authDataSource.getSplash()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ class EnterTripRepositoryImpl @Inject constructor(

override suspend fun postEnterTrip(
requestEnterTripModel: EnterTripRequestModel
): Result<EnterTripModel> = runCatching {
enterTripDataSource.postEnterTrip(
requestEnterTripModel.toEnterTripRequestDto(),
).data.toEnterTripModel()
}
): Result<EnterTripModel> =
runCatching {
enterTripDataSource.postEnterTrip(
requestEnterTripModel.toEnterTripRequestDto(),
).data.toEnterTripModel()
}

override suspend fun postStartInviteTrip(
tripId: Long, requestStartInviteTripModel: StartInviteTripRequestModel
): Result<StartInviteTripModel> = runCatching {
enterTripDataSource.postStartInviteTrip(
tripId, requestStartInviteTripModel.toStartInviteTripRequestDto(),
).data.toStartInviteTripModel()
}
): Result<StartInviteTripModel> =
runCatching {
enterTripDataSource.postStartInviteTrip(
tripId, requestStartInviteTripModel.toStartInviteTripRequestDto(),
).data.toStartInviteTripModel()
}

override suspend fun postEnterPreferenceTrip(
request: EnterPreferenceRequestModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ class MockRepositoryImpl @Inject constructor(

override suspend fun getFollowerList(
page: Int
): Result<List<MockFollowerModel>> {
return runCatching {
): Result<List<MockFollowerModel>> =
runCatching {
mockDataSource.getFollowerListData(page).toMockFollowerModel()
}
}

}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.going.data.repositoryImpl

import com.going.data.datasource.AuthDataSource
import com.going.data.datasource.ProfileDataSource
import com.going.domain.entity.request.UserProfileRequestModel
import com.going.domain.repository.AuthRepository
import com.going.domain.repository.ProfileRepository
import javax.inject.Inject

class ProfileRepositoryImpl @Inject constructor(
private val profileDataSource: ProfileDataSource
) : ProfileRepository {
override suspend fun getUserProfile(): Result<UserProfileRequestModel> = runCatching {
profileDataSource.getUserProfile().data.toProfileModel()
}
override suspend fun getUserProfile(): Result<UserProfileRequestModel> =
runCatching {
profileDataSource.getUserProfile().data.toProfileModel()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import javax.inject.Inject
class SettingRepositoryImpl @Inject constructor(
private val settingDataSource: SettingDataSource,
) : SettingRepository {
override suspend fun patchSignOut(): Result<Unit> = runCatching {
settingDataSource.patchSignOut()
}
override suspend fun patchSignOut(): Result<Unit> =
runCatching {
settingDataSource.patchSignOut()
}

override suspend fun deleteWithDraw(): Result<Unit> = runCatching {
settingDataSource.deleteWithDraw()
}
override suspend fun deleteWithDraw(): Result<Unit> =
runCatching {
settingDataSource.deleteWithDraw()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import com.going.domain.entity.response.StartInviteTripModel

interface EnterTripRepository {
suspend fun postEnterTrip(
requestEnterTripModel: EnterTripRequestModel
request: EnterTripRequestModel
): Result<EnterTripModel>

suspend fun postStartInviteTrip(
tripId: Long,
requestStartInviteTripModel: StartInviteTripRequestModel
request: StartInviteTripRequestModel
): Result<StartInviteTripModel>

suspend fun postEnterPreferenceTrip(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ package com.going.domain.repository
import com.going.domain.entity.request.TendencyRequestModel

interface TendencyRepository {
suspend fun patchTendencyTest(result: TendencyRequestModel): Result<Unit>
suspend fun patchTendencyTest(
result: TendencyRequestModel
): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.going.presentation.databinding.ActivitySplashBinding
import com.going.presentation.onboarding.signin.SignInActivity
import com.going.presentation.tendency.splash.TendencySplashActivity
import com.going.ui.base.BaseActivity
import com.going.ui.extension.setStatusBarColorFromResource
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
Expand All @@ -26,11 +27,16 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(R.layout.activity_spl
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setStatusBarColor()
checkConnectedNetwork()
observeUserState()

}

private fun setStatusBarColor() {
setStatusBarColorFromResource(R.color.red_500)
}

private fun checkConnectedNetwork() {
if (NetworkManager.checkNetworkState(this)) {
initSplash()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.going.presentation.databinding.ActivityTodoBinding
import com.going.presentation.todo.mytodo.MyTodoFragment
import com.going.presentation.todo.ourtodo.OurTodoFragment
import com.going.ui.base.BaseActivity
import com.going.ui.extension.setStatusBarColorFromResource
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -19,11 +20,16 @@ class TodoActivity() : BaseActivity<ActivityTodoBinding>(R.layout.activity_todo)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setStatusBarColor()
getTripId()
initBnvItemIconTintList()
initBnvItemSelectedListener()
}

private fun setStatusBarColor() {
setStatusBarColorFromResource(R.color.gray_50)
}

private fun getTripId() {
if (intent != null) {
tripId = intent.getLongExtra(EXTRA_TRIP_ID, 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package com.going.presentation.todo.ourtodo
package com.going.presentation.todo

import android.content.Context
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView

class OurTodoDecoration(val context: Context) : RecyclerView.ItemDecoration() {
class TodoDecoration(
val context: Context,
private val top: Int,
private val left: Int,
private val right: Int,
private val bottom: Int
) : RecyclerView.ItemDecoration() {

override fun getItemOffsets(
outRect: Rect,
Expand All @@ -17,7 +23,10 @@ class OurTodoDecoration(val context: Context) : RecyclerView.ItemDecoration() {
val position = parent.getChildAdapterPosition(view)

if (position == parent.adapter?.itemCount?.minus(1)) {
outRect.right = 150
outRect.top = top
outRect.left = left
outRect.right = right
outRect.bottom = bottom
Comment on lines +26 to +29
Copy link
Member

Choose a reason for hiding this comment

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

오호 데코레이션 좋아요!!!!!

}
}
}
Loading