-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ํต๊ณ, ๋ง์ด ํ์ด์ง ์์ฑ * fix: BaseFragment binding ์ค๋ฅ ์์ * feat: Navigator์ hilt ์ค์ * feat: BottomNavigationView ๊ตฌํ * ui: StatusBar ํฐ์์ผ๋ก ๋ณ๊ฒฝ * chore: ํ์ํ์ง ์์ ์ฝ๋ ์ญ์ * fix: build ์คํจ๋ฅผ ๊ณ ์น๊ธฐ ์ํด gradle dependency ๋ณต๊ตฌ * fix: ์ค๋ณต๋ dependency ์ญ์ ์ initView ์ฌ์ฉ ์ฝ๋ ์ถ๊ฐ
- Loading branch information
1 parent
7ed1ae7
commit 5cc4ca4
Showing
35 changed files
with
488 additions
and
19 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
app/src/main/java/com/depromeet/threedays/ThreeDaysApplication.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,6 +1,8 @@ | ||
package com.depromeet.threedays | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class ThreeDaysApplication : Application() { | ||
} |
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
3 changes: 3 additions & 0 deletions
3
navigator/src/main/java/com/depromeet/threedays/navigator/HomeNavigator.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,3 @@ | ||
package com.depromeet.threedays.navigator | ||
|
||
interface HomeNavigator : Navigator |
8 changes: 8 additions & 0 deletions
8
navigator/src/main/java/com/depromeet/threedays/navigator/Navigator.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,8 @@ | ||
package com.depromeet.threedays.navigator | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
|
||
interface Navigator { | ||
fun intent(context: Context): Intent | ||
} |
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
39 changes: 36 additions & 3 deletions
39
presentation/home/src/main/java/com/depromeet/threedays/home/MainActivity.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,11 +1,44 @@ | ||
package com.depromeet.threedays.home | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import com.depromeet.threedays.core.BaseActivity | ||
import com.depromeet.threedays.home.databinding.ActivityMainBinding | ||
import com.depromeet.threedays.home.home.HomeFragment | ||
import com.depromeet.threedays.my.MyFragment | ||
import com.depromeet.threedays.statistics.StatisticsFragment | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainActivity : BaseActivity<ActivityMainBinding>(R.layout.activity_main) { | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
|
||
initNavigationBar() | ||
} | ||
|
||
private fun initNavigationBar() { | ||
binding.bnvMain.run { | ||
setOnItemSelectedListener { | ||
when (it.itemId) { | ||
R.id.homeFragment -> { | ||
changeFragment(HomeFragment()) | ||
} | ||
R.id.statisticsFragment -> { | ||
changeFragment(StatisticsFragment()) | ||
} | ||
R.id.myFragment -> { | ||
changeFragment(MyFragment()) | ||
} | ||
} | ||
true | ||
} | ||
selectedItemId = R.id.homeFragment | ||
} | ||
} | ||
|
||
private fun changeFragment(fragment: Fragment) { | ||
supportFragmentManager.beginTransaction().replace(binding.flMain.id, fragment).commit() | ||
} | ||
} |
26 changes: 24 additions & 2 deletions
26
presentation/home/src/main/java/com/depromeet/threedays/home/home/HomeFragment.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,7 +1,29 @@ | ||
package com.depromeet.threedays.home.home | ||
|
||
import androidx.fragment.app.Fragment | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.viewModels | ||
import com.depromeet.threedays.core.BaseFragment | ||
import com.depromeet.threedays.home.R | ||
import com.depromeet.threedays.home.databinding.FragmentHomeBinding | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
class HomeFragment : Fragment() { | ||
@AndroidEntryPoint | ||
class HomeFragment: BaseFragment<FragmentHomeBinding, HomeViewModel>(R.layout.fragment_home) { | ||
override val viewModel by viewModels<HomeViewModel>() | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
initView() | ||
} | ||
|
||
private fun initView() { | ||
// ์ฐ์ ์์๋ก setOnClickListener๋ฅผ ๋ฌ์๋จ์ต๋๋ค. | ||
// ํ์ธ๋ ๋ ํฌ์ ์๋ ๊ฒ์ฒ๋ผ setOnSingleClickListener๋ฅผ ๋ง๋ค์ด์ ์ฌ์ฉํ ์ง ์ฌ๋ถ์ | ||
// viewModel์์ ํด๋ฆญ๋ฆฌ์ค๋๋ฅผ ๋ฌ์์ค์ง ๋ฑ์ ํ์ํ๊ณ ํ์ ๋๋ฉด ์ถํ์ ์์ ํ๊ฒ ์ต๋๋ค. | ||
binding.btnMakeGoal.setOnClickListener { | ||
// TODO: ๋ง๋ค๊ธฐ ํ์ด์ง๋ก ์ด๋ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
presentation/home/src/main/java/com/depromeet/threedays/home/home/HomeModule.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,14 @@ | ||
package com.depromeet.threedays.home.home | ||
|
||
import com.depromeet.threedays.navigator.HomeNavigator | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
internal abstract class HomeModule { | ||
@Binds | ||
abstract fun bindHomeNavigator(navigator: HomeNavigatorImpl): HomeNavigator | ||
} |
13 changes: 13 additions & 0 deletions
13
presentation/home/src/main/java/com/depromeet/threedays/home/home/HomeNavigatorImpl.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,13 @@ | ||
package com.depromeet.threedays.home.home | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import com.depromeet.threedays.home.MainActivity | ||
import com.depromeet.threedays.navigator.HomeNavigator | ||
import javax.inject.Inject | ||
|
||
internal class HomeNavigatorImpl @Inject constructor() : HomeNavigator { | ||
override fun intent(context: Context): Intent { | ||
return Intent(context, MainActivity::class.java) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
presentation/home/src/main/java/com/depromeet/threedays/home/home/HomeViewModel.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,6 @@ | ||
package com.depromeet.threedays.home.home | ||
|
||
import com.depromeet.threedays.core.BaseViewModel | ||
|
||
class HomeViewModel : BaseViewModel() { | ||
} |
5 changes: 5 additions & 0 deletions
5
presentation/home/src/main/res/drawable/selector_menu_color.xml
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:color="#1A1F27" android:state_checked="true" /> | ||
<item android:color="#B0B8C1" /> | ||
</selector> |
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,9 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".MainActivity"> | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
<data> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".MainActivity"> | ||
|
||
<FrameLayout | ||
android:id="@+id/fl_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
app:layout_constraintBottom_toTopOf="@+id/bnv_main" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<com.google.android.material.bottomnavigation.BottomNavigationView | ||
android:id="@+id/bnv_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:itemIconTint="@drawable/selector_menu_color" | ||
app:itemTextColor="@drawable/selector_menu_color" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:menu="@menu/bottom_nav_menu"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<item | ||
android:id="@+id/homeFragment" | ||
android:icon="@drawable/ic_tab_home" | ||
android:title="ํ" /> | ||
<item | ||
android:id="@+id/statisticsFragment" | ||
android:icon="@drawable/ic_tab_statistics" | ||
android:title="ํต๊ณ" /> | ||
<item | ||
android:id="@+id/myFragment" | ||
android:icon="@drawable/ic_tab_my" | ||
android:title="๋ง์ดํ์ด์ง" /> | ||
</menu> |
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,52 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
id "kotlin-kapt" | ||
id 'dagger.hilt.android.plugin' | ||
} | ||
|
||
android { | ||
compileSdk 32 | ||
|
||
defaultConfig { | ||
minSdk 24 | ||
targetSdk 32 | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles "consumer-rules.pro" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled 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 { | ||
dataBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(project(":core")) | ||
implementation(project(":navigator")) | ||
implementation(project(":domain")) | ||
implementation(project(":core-design-system")) | ||
|
||
implementation(jetpackDeps) | ||
implementation(coroutines) | ||
|
||
implementation deps.hilt.core | ||
kapt deps.hilt.compiler | ||
|
||
testImplementation(testDeps) | ||
androidTestImplementation(androidTestDeps) | ||
} |
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. | ||
# | ||
# For more details, see | ||
# http://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 |
24 changes: 24 additions & 0 deletions
24
presentation/my/src/androidTest/java/com/depromeet/threedays/my/ExampleInstrumentedTest.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,24 @@ | ||
package com.depromeet.threedays.my | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.depromeet.threedays.my.test", appContext.packageName) | ||
} | ||
} |
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.depromeet.threedays.my"> | ||
|
||
</manifest> |
Oops, something went wrong.