Skip to content

Commit 5887f6a

Browse files
Merge pull request #1 from SmartToolFactory/feature/property-detail
Feature/property detail
2 parents 616c269 + c41cdba commit 5887f6a

24 files changed

Lines changed: 439 additions & 73 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ android {
9797

9898
dynamicFeatures = mutableSetOf(
9999
Modules.DynamicFeature.HOME,
100+
Modules.DynamicFeature.PROPERTY_DETAIL,
100101
Modules.DynamicFeature.FAVORITES,
101102
Modules.DynamicFeature.NOTIFICATION,
102103
Modules.DynamicFeature.ACCOUNT

app/src/main/res/navigation/nav_graph_main.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,17 @@
1111
android:label="MainFragment"
1212
tools:layout="@layout/fragment_main" />
1313

14+
15+
<!-- Property Detail dynamic feature module -->
16+
<include-dynamic
17+
android:id="@+id/nav_graph_property_detail"
18+
android:name="com.smarttoolfactory.property_detail"
19+
app:graphResName="nav_graph_property_detail"
20+
app:moduleName="property_detail">
21+
22+
<argument
23+
android:name="property"
24+
app:argType="com.smarttoolfactory.domain.model.PropertyItem" />
25+
26+
</include-dynamic>
1427
</navigation>

features/home/src/main/java/com/smarttoolfactory/home/propertylist/flow/PropertyListFlowFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.smarttoolfactory.home.propertylist.flow
33
import android.os.Bundle
44
import androidx.core.os.bundleOf
55
import androidx.fragment.app.activityViewModels
6+
import androidx.navigation.fragment.findNavController
67
import androidx.recyclerview.widget.LinearLayoutManager
78
import com.smarttoolfactory.core.di.CoreModuleDependencies
89
import com.smarttoolfactory.core.ui.fragment.DynamicNavigationFragment
@@ -93,6 +94,10 @@ class PropertyListFlowFragment : DynamicNavigationFragment<FragmentPropertyListB
9394

9495
it.getContentIfNotHandled()?.let { propertyItem ->
9596
val bundle = bundleOf("property" to propertyItem)
97+
findNavController().navigate(
98+
R.id.action_propertyListFragment_to_nav_graph_property_detail,
99+
bundle
100+
)
96101
}
97102
}
98103
)

features/home/src/main/java/com/smarttoolfactory/home/propertylist/paged/PagedPropertyListFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.smarttoolfactory.home.propertylist.paged
33
import android.os.Bundle
44
import androidx.core.os.bundleOf
55
import androidx.fragment.app.activityViewModels
6+
import androidx.navigation.fragment.findNavController
67
import androidx.recyclerview.widget.LinearLayoutManager
78
import com.smarttoolfactory.core.di.CoreModuleDependencies
89
import com.smarttoolfactory.core.ui.fragment.DynamicNavigationFragment
@@ -110,6 +111,10 @@ class PagedPropertyListFragment :
110111

111112
it.getContentIfNotHandled()?.let { propertyItem ->
112113
val bundle = bundleOf("property" to propertyItem)
114+
findNavController().navigate(
115+
R.id.action_propertyListFragment_to_nav_graph_property_detail,
116+
bundle
117+
)
113118
}
114119
}
115120
)

features/home/src/main/java/com/smarttoolfactory/home/propertylist/rxjava/PropertyListRxjava3Fragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.smarttoolfactory.home.propertylist.rxjava
33
import android.os.Bundle
44
import androidx.core.os.bundleOf
55
import androidx.fragment.app.activityViewModels
6+
import androidx.navigation.fragment.findNavController
67
import androidx.recyclerview.widget.LinearLayoutManager
78
import com.smarttoolfactory.core.di.CoreModuleDependencies
89
import com.smarttoolfactory.core.ui.fragment.DynamicNavigationFragment
@@ -93,6 +94,10 @@ class PropertyListRxjava3Fragment : DynamicNavigationFragment<FragmentPropertyLi
9394

9495
it.getContentIfNotHandled()?.let { propertyItem ->
9596
val bundle = bundleOf("property" to propertyItem)
97+
findNavController().navigate(
98+
R.id.action_propertyListFragment_to_nav_graph_property_detail,
99+
bundle
100+
)
96101
}
97102
}
98103
)

features/home/src/main/res/navigation/nav_graph_property_list_flow.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
android:name="com.smarttoolfactory.home.propertylist.flow.PropertyListFlowFragment"
1111
android:label="Properties with Flow"
1212
tools:layout="@layout/fragment_property_list">
13+
14+
<action
15+
android:id="@+id/action_propertyListFragment_to_nav_graph_property_detail"
16+
app:destination="@id/nav_graph_property_detail" />
1317
</fragment>
1418

19+
<include-dynamic
20+
android:id="@id/nav_graph_property_detail"
21+
android:name="com.smarttoolfactory.property_detail"
22+
app:graphResName="nav_graph_property_detail"
23+
app:moduleName="property_detail">
24+
25+
<argument
26+
android:name="property"
27+
app:argType="com.smarttoolfactory.domain.model.PropertyItem" />
28+
29+
</include-dynamic>
30+
1531
</navigation>

features/home/src/main/res/navigation/nav_graph_property_list_paged.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
android:id="@+id/propertyListFragment"
1010
android:name="com.smarttoolfactory.home.propertylist.paged.PagedPropertyListFragment"
1111
android:label="Flow + Pagination"
12-
tools:layout="@layout/fragment_property_list_paged" />
12+
tools:layout="@layout/fragment_property_list_paged">
13+
14+
<action
15+
android:id="@+id/action_propertyListFragment_to_nav_graph_property_detail"
16+
app:destination="@id/nav_graph_property_detail" />
17+
</fragment>
18+
19+
<include-dynamic
20+
android:id="@id/nav_graph_property_detail"
21+
android:name="com.smarttoolfactory.property_detail"
22+
app:graphResName="nav_graph_property_detail"
23+
app:moduleName="property_detail">
24+
25+
<argument
26+
android:name="property"
27+
app:argType="com.smarttoolfactory.domain.model.PropertyItem" />
28+
29+
</include-dynamic>
1330

1431
</navigation>

features/home/src/main/res/navigation/nav_graph_property_list_rxjava3.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@
1010
android:name="com.smarttoolfactory.home.propertylist.rxjava.PropertyListRxjava3Fragment"
1111
android:label="Properties with RxJava3"
1212
tools:layout="@layout/fragment_property_list">
13+
14+
<action
15+
android:id="@+id/action_propertyListFragment_to_nav_graph_property_detail"
16+
app:destination="@id/nav_graph_property_detail" />
17+
1318
</fragment>
1419

20+
<include-dynamic
21+
android:id="@id/nav_graph_property_detail"
22+
android:name="com.smarttoolfactory.property_detail"
23+
app:graphResName="nav_graph_property_detail"
24+
app:moduleName="property_detail">
25+
26+
<argument
27+
android:name="property"
28+
app:argType="com.smarttoolfactory.domain.model.PropertyItem" />
29+
30+
</include-dynamic>
31+
32+
1533
</navigation>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import extension.addBaseDynamicFeatureModuleDependencies
2+
import extension.addInstrumentationTestDependencies
3+
import extension.addUnitTestDependencies
4+
5+
plugins {
6+
id(Plugins.ANDROID_DYNAMIC_FEATURE_PLUGIN)
7+
id(Plugins.KOTLIN_ANDROID_PLUGIN)
8+
id(Plugins.KOTLIN_ANDROID_EXTENSIONS_PLUGIN)
9+
id(Plugins.KOTLIN_KAPT_PLUGIN)
10+
id(Plugins.DAGGER_HILT_PLUGIN)
11+
}
12+
13+
android {
14+
15+
compileSdkVersion(AndroidVersion.COMPILE_SDK_VERSION)
16+
17+
defaultConfig {
18+
19+
applicationId = "com.smarttoolfactory.home"
20+
21+
minSdkVersion(AndroidVersion.MIN_SDK_VERSION)
22+
targetSdkVersion(AndroidVersion.TARGET_SDK_VERSION)
23+
versionCode = AndroidVersion.VERSION_CODE
24+
versionName = AndroidVersion.VERSION_NAME
25+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
26+
}
27+
28+
buildTypes {
29+
getByName("release") {
30+
isMinifyEnabled = false
31+
proguardFiles(
32+
getDefaultProguardFile("proguard-android-optimize.txt"),
33+
"proguard-rules.pro"
34+
)
35+
}
36+
}
37+
38+
packagingOptions {
39+
exclude("META-INF/AL2.0")
40+
}
41+
42+
dataBinding.isEnabled = true
43+
// android.buildFeatures.viewBinding = true
44+
45+
compileOptions {
46+
sourceCompatibility = JavaVersion.VERSION_1_8
47+
targetCompatibility = JavaVersion.VERSION_1_8
48+
}
49+
kotlinOptions {
50+
jvmTarget = "1.8"
51+
}
52+
}
53+
54+
dependencies {
55+
56+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
57+
58+
implementation(project(Modules.APP))
59+
implementation(project(Modules.AndroidLibrary.CORE))
60+
implementation(project(Modules.AndroidLibrary.DOMAIN))
61+
62+
addBaseDynamicFeatureModuleDependencies()
63+
64+
// Support and Widgets
65+
implementation(Deps.APPCOMPAT)
66+
implementation(Deps.MATERIAL)
67+
implementation(Deps.CONSTRAINT_LAYOUT)
68+
implementation(Deps.RECYCLER_VIEW)
69+
implementation(Deps.VIEWPAGER2)
70+
implementation(Deps.SWIPE_REFRESH_LAYOUT)
71+
72+
// Glide
73+
implementation(Deps.GLIDE)
74+
kapt(Deps.GLIDE_COMPILER)
75+
76+
// Unit Tests
77+
addUnitTestDependencies()
78+
testImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
79+
80+
// Instrumentation Tests
81+
addInstrumentationTestDependencies()
82+
androidTestImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
83+
}

0 commit comments

Comments
 (0)