-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ab5e7e
commit 79554b4
Showing
44 changed files
with
1,043 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/Constant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote | ||
|
||
object Constant { | ||
const val END_POINT_WEATHER_API = | ||
"v1/forecast?hourly=temperature_2m,weathercode,relativehumidity_2m,windspeed_10m,pressure_msl" | ||
const val BASE_URL_WEATHER_API = "https://api.open-meteo.com/" | ||
} |
5 changes: 3 additions & 2 deletions
5
...mpose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDataDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...mpose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 6 additions & 9 deletions
15
...e/android_architectures/clean_code_with_mvi_mvvm/data/repository/WeatherRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/di/AppModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.di | ||
|
||
import android.app.Application | ||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote.Constant.BASE_URL_WEATHER_API | ||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote.WeatherApi | ||
import com.google.android.gms.location.FusedLocationProviderClient | ||
import com.google.android.gms.location.LocationServices | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.moshi.MoshiConverterFactory | ||
import retrofit2.create | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object AppModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideWeatherApi(): WeatherApi { | ||
return Retrofit.Builder() | ||
.baseUrl(BASE_URL_WEATHER_API) | ||
.addConverterFactory(MoshiConverterFactory.create()) | ||
.build() | ||
.create() | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
fun provideFusedLocationProviderClient(application: Application): FusedLocationProviderClient { | ||
return LocationServices.getFusedLocationProviderClient(application) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ck_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/di/LocationModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.di | ||
|
||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.location.DefaultLocationTracker | ||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.domain.location.LocationTracker | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class LocationModule { | ||
|
||
@Binds | ||
@Singleton | ||
abstract fun bindLocationTracker( | ||
defaultLocationTracker: DefaultLocationTracker | ||
): LocationTracker | ||
} |
20 changes: 20 additions & 0 deletions
20
..._compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/di/RepositoryModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.di | ||
|
||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.repository.WeatherRepositoryImpl | ||
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.domain.repository.WeatherRepository | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class RepositoryModule { | ||
|
||
@Binds | ||
@Singleton | ||
abstract fun bindWeatherRepository( | ||
weatherRepositoryImpl: WeatherRepositoryImpl | ||
): WeatherRepository | ||
} |
2 changes: 1 addition & 1 deletion
2
..._in_one/android_architectures/clean_code_with_mvi_mvvm/domain/location/LocationTracker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...one/android_architectures/clean_code_with_mvi_mvvm/domain/repository/WeatherRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/domain/util/Resource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e_all_in_one/android_architectures/clean_code_with_mvi_mvvm/domain/weather/WeatherData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e_all_in_one/android_architectures/clean_code_with_mvi_mvvm/domain/weather/WeatherInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...e_all_in_one/android_architectures/clean_code_with_mvi_mvvm/domain/weather/WeatherType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherDataDisplay.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
...all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherForecast.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.