-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added flow screen, bottom navigation, flight & profile tabs, atm stubs.
- Loading branch information
Showing
50 changed files
with
691 additions
and
37 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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/nassdk/aero/mediators/FlightsMediator.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,9 @@ | ||
package com.nassdk.aero.mediators | ||
|
||
import com.nassdk.flights.FlightsApi | ||
import com.nassdk.flights.FlightsFeature | ||
|
||
class FlightsMediator { | ||
|
||
fun getApi(): FlightsApi = FlightsFeature.getApi() | ||
} |
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
5 changes: 4 additions & 1 deletion
5
core/common/src/main/java/com/nassdk/common/extensions/GenericExt.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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
package com.nassdk.common.extensions | ||
|
||
fun <T> T?.ifNull(alternative: T): T = this ?: alternative | ||
fun <T> T?.ifNull(alternative: T): T = this ?: alternative | ||
fun <T> T?.ifNull(make: () -> T) { | ||
make() | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,39 @@ | ||
plugins { | ||
id("com.android.library") | ||
kotlin(module = "android") | ||
kotlin(module = "kapt") | ||
} | ||
|
||
android { | ||
compileSdk = 31 | ||
|
||
defaultConfig { | ||
minSdk = 23 | ||
targetSdk = 31 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.0.5" | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(dependencyNotation = projects.core.common) | ||
kapt(dependencyNotation = libs.daggerCompiler) | ||
} |
Empty file.
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle.kts. | ||
# | ||
# For more details, see | ||
# https://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
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,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.nassdk.flights" /> |
10 changes: 10 additions & 0 deletions
10
feature/flights/src/main/java/com/nassdk/flights/FlightsApi.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,10 @@ | ||
package com.nassdk.flights | ||
|
||
import com.nassdk.common.base.BaseViewModel | ||
import com.nassdk.flights.presentation.mvi.FlightsViewEvent | ||
import com.nassdk.flights.presentation.mvi.FlightsViewState | ||
|
||
interface FlightsApi { | ||
|
||
fun provideViewModel(): BaseViewModel<FlightsViewState, FlightsViewEvent> | ||
} |
17 changes: 17 additions & 0 deletions
17
feature/flights/src/main/java/com/nassdk/flights/FlightsApiImpl.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,17 @@ | ||
package com.nassdk.flights | ||
|
||
import com.nassdk.common.base.BaseViewModel | ||
import com.nassdk.flights.presentation.FlightsViewModel | ||
import com.nassdk.flights.presentation.mvi.FlightsViewEvent | ||
import com.nassdk.flights.presentation.mvi.FlightsViewState | ||
import javax.inject.Inject | ||
import javax.inject.Provider | ||
|
||
class FlightsApiImpl @Inject constructor() : FlightsApi { | ||
|
||
@Inject lateinit var viewModelFactory: Provider<FlightsViewModel> | ||
|
||
override fun provideViewModel(): BaseViewModel<FlightsViewState, FlightsViewEvent> { | ||
return viewModelFactory.get() | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
feature/flights/src/main/java/com/nassdk/flights/FlightsFeature.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,25 @@ | ||
package com.nassdk.flights | ||
|
||
import androidx.annotation.MainThread | ||
import com.nassdk.flights.di.DaggerFlightsComponent | ||
import com.nassdk.flights.di.FlightsComponent | ||
|
||
object FlightsFeature { | ||
|
||
private var component: FlightsComponent? = null | ||
|
||
@MainThread | ||
fun getApi(): FlightsApi = getComponent().moduleApi() | ||
|
||
internal fun getComponent(): FlightsComponent = | ||
component ?: run { | ||
|
||
component = DaggerFlightsComponent.factory().create() | ||
|
||
requireNotNull(component) | ||
} | ||
|
||
internal fun destroyModuleGraph() { | ||
component = null | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
feature/flights/src/main/java/com/nassdk/flights/di/FlightsComponent.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,17 @@ | ||
package com.nassdk.flights.di | ||
|
||
import com.nassdk.di.scopes.FeatureScope | ||
import com.nassdk.flights.FlightsApi | ||
import dagger.Component | ||
|
||
@Component(modules = [FlightsModule::class]) | ||
@FeatureScope | ||
interface FlightsComponent { | ||
|
||
@Component.Factory | ||
interface Factory { | ||
fun create(): FlightsComponent | ||
} | ||
|
||
fun moduleApi(): FlightsApi | ||
} |
15 changes: 15 additions & 0 deletions
15
feature/flights/src/main/java/com/nassdk/flights/di/FlightsModule.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,15 @@ | ||
package com.nassdk.flights.di | ||
|
||
import com.nassdk.di.scopes.FeatureScope | ||
import com.nassdk.flights.FlightsApi | ||
import com.nassdk.flights.FlightsApiImpl | ||
import dagger.Binds | ||
import dagger.Module | ||
|
||
@Module | ||
interface FlightsModule { | ||
|
||
@Binds | ||
@FeatureScope | ||
fun bindModuleApi(impl: FlightsApiImpl): FlightsApi | ||
} |
27 changes: 27 additions & 0 deletions
27
feature/flights/src/main/java/com/nassdk/flights/presentation/FlightsScreen.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,27 @@ | ||
package com.nassdk.flights.presentation | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import com.nassdk.common.base.BaseViewModel | ||
import com.nassdk.flights.presentation.mvi.FlightsViewEvent | ||
import com.nassdk.flights.presentation.mvi.FlightsViewState | ||
import com.nassdk.ui.theme.AeroTheme | ||
|
||
@Composable | ||
fun FlightsScreen(viewModel: BaseViewModel<FlightsViewState, FlightsViewEvent>) { | ||
|
||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(color = AeroTheme.colors.primaryBackground), | ||
contentAlignment = Alignment.Center, | ||
content = { | ||
Text(text = "Flights") | ||
} | ||
) | ||
} |
Oops, something went wrong.