Skip to content

Commit

Permalink
Add home screen (#41)
Browse files Browse the repository at this point in the history
* Add feature-home module

* Add home screen
  • Loading branch information
AfigAliyev committed Aug 12, 2022
1 parent 5465943 commit ac9f014
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ dependencies {

implementation(project(":domain"))

implementation(project(":features:feature-home:presentation"))

implementation(libs.dagger.hilt.android)
kapt(libs.dagger.hilt.compiler)
implementation(libs.androidx.navigation.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.maximillianleonov.cinemax.feature.home.presentation.HomeScreen

@Suppress("ForbiddenComment")
@Composable
Expand All @@ -36,7 +37,7 @@ fun CinemaxNavHost(
navController = navController,
startDestination = Screen.Home.route
) {
composable(route = Screen.Home.route) { /* TODO: Not yet implemented. */ }
composable(route = Screen.Home.route) { HomeScreen() }
composable(route = Screen.Search.route) { /* TODO: Not yet implemented. */ }
composable(route = Screen.Wishlist.route) { /* TODO: Not yet implemented. */ }
composable(route = Screen.Settings.route) { /* TODO: Not yet implemented. */ }
Expand Down
1 change: 1 addition & 0 deletions features/feature-home/presentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
71 changes: 71 additions & 0 deletions features/feature-home/presentation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2022 Maximillian Leonov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.dagger.hilt.android)
}

android {
compileSdk = libs.versions.android.compileSdk.get().toInt()

defaultConfig {
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}
}

dependencies {
implementation(project(":core:core-presentation"))

implementation(libs.dagger.hilt.android)
kapt(libs.dagger.hilt.compiler)

testImplementation(libs.bundles.test)
androidTestImplementation(libs.bundles.android.test)
}
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions features/feature-home/presentation/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 Maximillian Leonov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="com.maximillianleonov.cinemax.feature.home.presentation" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2022 Maximillian Leonov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.maximillianleonov.cinemax.feature.home.presentation

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.maximillianleonov.cinemax.core.presentation.theme.CinemaxTheme

@Composable
fun HomeScreen() {
HomeContent()
}

@Composable
private fun HomeContent(modifier: Modifier = Modifier) {
LazyColumn(
modifier = modifier.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(CinemaxTheme.spacing.extraMedium),
contentPadding = PaddingValues(vertical = CinemaxTheme.spacing.extraMedium)
) {
}
}
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ include(
":core:core-presentation",
":data:data-local",
":data:data-remote",
":domain"
":domain",
":features:feature-home:presentation"
)

0 comments on commit ac9f014

Please sign in to comment.