Skip to content

Commit

Permalink
Merge branch '6/06_step2_residential_bottom_sheet' into 6/07_step3_se…
Browse files Browse the repository at this point in the history
…arch_company
  • Loading branch information
HayleyKim0716 committed Aug 18, 2022
2 parents 7e7f9d2 + 0f8e411 commit e86caf3
Show file tree
Hide file tree
Showing 127 changed files with 3,459 additions and 411 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$android_junit_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$android_espresso_core_version"

//kakaomap
implementation files('libs/libDaumMapAndroid.jar')
}

kapt {
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package="com.ftw.hometerview">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".config.HometerviewApplication"
Expand All @@ -12,10 +14,19 @@
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Hometerview"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".ui.buildinglist.BuildingListActivity"
android:exported="false" />

<activity
android:name=".ui.searchaddressbuilding.SearchAddressBuildingActivity"
android:exported="false" />

<activity
android:name=".ui.loading.LoadingActivity"
Expand Down Expand Up @@ -80,6 +91,9 @@
</intent-filter>
</activity>

<meta-data
android:name="com.kakao.sdk.AppKey"
android:value="@string/kakao_api_key" />
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.ftw.hometerview.adapter

import android.content.Context
import android.graphics.Rect
import android.view.View
import androidx.annotation.DimenRes
import androidx.recyclerview.widget.RecyclerView
import com.ftw.hometerview.R

class SpacingItemDecoration(
context: Context,
@DimenRes private val spacingResId: Int = R.dimen.dp_size_16
) : RecyclerView.ItemDecoration() {

private val dividerHeight: Int = context.resources.getDimensionPixelSize(spacingResId)

override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
outRect.set(0, 0, 0, dividerHeight)

if (parent.getChildAdapterPosition(view) == 0) {
outRect.top = dividerHeight
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.ftw.hometerview.adapter
package com.ftw.hometerview.bindingadapter

import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.RecyclerView
import com.ftw.hometerview.adapter.DataBindingRecyclerAdapter
import com.ftw.hometerview.adapter.RecyclerItem

@BindingAdapter("items")
fun setRecyclerViewItems(
Expand All @@ -17,4 +19,4 @@ fun setRecyclerViewItems(
adapter.submitList(
items.orEmpty()
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ package com.ftw.hometerview.di.ui

import com.ftw.domain.usecase.buildingreview.GetBuildingReviewsUseCase
import com.ftw.domain.usecase.login.LoginUseCase
import com.ftw.domain.usecase.review.GetLocationReviewsUseCase
import com.ftw.domain.usecase.searchaddressbuilding.GetSearchAddressBuildingUseCase
import com.ftw.hometerview.dispatcher.Dispatcher
import com.ftw.hometerview.ui.buildingreview.BuildingReviewViewModel
import com.ftw.hometerview.ui.main.MainViewModel
import com.ftw.hometerview.ui.searchcompanyresult.OnboardingResultViewModel
import com.ftw.hometerview.ui.main.home.review.LocationReviewListViewModel
import com.ftw.hometerview.ui.searchaddressbuilding.SearchAddressBuildingViewModel
import com.ftw.hometerview.ui.searchcompanyresult.SearchCompanyResultViewModel
import com.ftw.hometerview.ui.splash.SplashViewModel
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.scopes.ActivityScoped
import javax.inject.Named

@Module
@InstallIn(ActivityComponent::class)
Expand All @@ -27,10 +32,10 @@ class ActivityViewModelModule {

@Provides
@ActivityScoped
fun provideOnboardResultViewModel(
fun provideSearchCompanyResultViewModel(
dispatcher: Dispatcher
): OnboardingResultViewModel {
return OnboardingResultViewModel(dispatcher)
): SearchCompanyResultViewModel {
return SearchCompanyResultViewModel(dispatcher)
}

@Provides
Expand All @@ -39,6 +44,31 @@ class ActivityViewModelModule {
return MainViewModel()
}

@Provides
@ActivityScoped
@Named("BuildingList")
fun provideHomeLocationReviewsViewModel(
dispatcher: Dispatcher,
getLocationReviewsUseCase: GetLocationReviewsUseCase
): LocationReviewListViewModel {
return LocationReviewListViewModel(
dispatcher,
getLocationReviewsUseCase
)
}

@Provides
@ActivityScoped
fun provideSearchAddressBuildingViewModel(
dispatcher: Dispatcher,
getSearchAddressBuildingUseCase: GetSearchAddressBuildingUseCase
): SearchAddressBuildingViewModel {
return SearchAddressBuildingViewModel(
dispatcher,
getSearchAddressBuildingUseCase
)
}

@Provides
@ActivityScoped
fun provideBuildingReviewViewModel(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package com.ftw.hometerview.di.ui

import com.ftw.domain.usecase.favorite.GetFavoriteBuildingsUseCase
import com.ftw.domain.usecase.favorite.GetFavoriteReviewsUseCase
import com.ftw.domain.usecase.review.GetLocationReviewsUseCase
import com.ftw.domain.usecase.user.GetCachedUserUseCase
import com.ftw.hometerview.dispatcher.Dispatcher
import com.ftw.hometerview.ui.main.favorite.favoritelist.FavoriteBuildingsViewModel
import com.ftw.hometerview.ui.main.favorite.favoritelist.FavoriteReviewsViewModel
import com.ftw.hometerview.ui.main.home.HomeViewModel
import com.ftw.hometerview.ui.main.home.review.LocationReviewListViewModel
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.FragmentComponent
import dagger.hilt.android.scopes.FragmentScoped
import javax.inject.Named

@Module
@InstallIn(FragmentComponent::class)
Expand All @@ -31,6 +36,7 @@ class MainFragmentViewModelModule {

@Provides
@FragmentScoped
@Named("LocationReviewList")
fun provideHomeLocationReviewsViewModel(
dispatcher: Dispatcher,
getLocationReviewsUseCase: GetLocationReviewsUseCase
Expand All @@ -40,4 +46,29 @@ class MainFragmentViewModelModule {
getLocationReviewsUseCase
)
}


@Provides
@FragmentScoped
fun provideFavoriteBuildingsViewModel(
dispatcher: Dispatcher,
getFavoriteBuildingsUseCase: GetFavoriteBuildingsUseCase
): FavoriteBuildingsViewModel {
return FavoriteBuildingsViewModel(
dispatcher,
getFavoriteBuildingsUseCase
)
}

@Provides
@FragmentScoped
fun provideFavoriteReviewsViewModel(
dispatcher: Dispatcher,
getFavoriteReviewsUseCase: GetFavoriteReviewsUseCase
): FavoriteReviewsViewModel {
return FavoriteReviewsViewModel(
dispatcher,
getFavoriteReviewsUseCase
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.ftw.hometerview.di.ui

import com.ftw.domain.usecase.map.GetBuildingMarkerUseCase
import com.ftw.domain.usecase.map.GetMarkerUseCase
import com.ftw.hometerview.dispatcher.Dispatcher
import com.ftw.hometerview.ui.main.map.MapViewModel
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.FragmentComponent
import dagger.hilt.android.scopes.FragmentScoped

@Module
@InstallIn(FragmentComponent::class)
class MapFragmentViewModelModule {

@Provides
@FragmentScoped
fun provideMapViewModel(
dispatcher: Dispatcher,
getMarkerUseCase: GetMarkerUseCase,
getBuildingMarkerUseCase: GetBuildingMarkerUseCase
): MapViewModel {
return MapViewModel(
dispatcher,
getMarkerUseCase,
getBuildingMarkerUseCase
)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.ftw.hometerview.di.usecase

import com.ftw.domain.usecase.favorite.GetFavoriteBuildingsUseCase
import com.ftw.domain.usecase.favorite.GetFavoriteBuildingsUseCaseImpl
import com.ftw.domain.usecase.favorite.GetFavoriteReviewsUseCase
import com.ftw.domain.usecase.favorite.GetFavoriteReviewsUseCaseImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class FavoriteUseCaseModule {
@Provides
@Singleton
fun provideGetFavoriteReviewsUseCase(): GetFavoriteReviewsUseCase {
return GetFavoriteReviewsUseCaseImpl()
}

@Provides
@Singleton
fun provideGetFavoriteBuildingsUseCase(): GetFavoriteBuildingsUseCase {
return GetFavoriteBuildingsUseCaseImpl()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.ftw.hometerview.di.usecase

import com.ftw.domain.usecase.map.GetBuildingMarkerUseCase
import com.ftw.domain.usecase.map.GetBuildingMarkerUseCaseImpl
import com.ftw.domain.usecase.map.GetMarkerUseCase
import com.ftw.domain.usecase.map.GetMarkerUseCaseImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class MapUseCaseModule {
@Provides
@Singleton
fun provideGetMarkerUseCase(): GetMarkerUseCase {
return GetMarkerUseCaseImpl()
}
@Provides
@Singleton
fun provideGetBuildingMarkerUseCase(): GetBuildingMarkerUseCase {
return GetBuildingMarkerUseCaseImpl()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ftw.hometerview.di.usecase

import com.ftw.domain.usecase.searchaddressbuilding.GetSearchAddressBuildingUseCase
import com.ftw.domain.usecase.searchaddressbuilding.GetSearchAddressBuildingUseCaseImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class SearchAddressBuildingUseCaseModule {
@Provides
@Singleton
fun provideGetSearchAddressBuildingUseCase(): GetSearchAddressBuildingUseCase {
return GetSearchAddressBuildingUseCaseImpl()
}
}
Loading

0 comments on commit e86caf3

Please sign in to comment.