Skip to content

Commit 8d1f1ae

Browse files
Merge branch 'release/v0.8.0'
2 parents eefb0d7 + 4baac8e commit 8d1f1ae

243 files changed

Lines changed: 54428 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/*
5+
/.idea/caches
6+
/.idea/libraries
7+
/.idea/modules.xml
8+
/.idea/workspace.xml
9+
/.idea/navEditor.xml
10+
/.idea/assetWizardSettings.xml
11+
.DS_Store
12+
/build
13+
/captures
14+
.externalNativeBuild
15+
.cxx
16+
local.properties

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import extension.addAppModuleDependencies
2+
import extension.addInstrumentationTestDependencies
3+
import extension.addUnitTestDependencies
4+
5+
plugins {
6+
id(Plugins.ANDROID_APPLICATION_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+
applicationId = AndroidVersion.APPLICATION_ID
19+
minSdkVersion(AndroidVersion.MIN_SDK_VERSION)
20+
targetSdkVersion(AndroidVersion.TARGET_SDK_VERSION)
21+
versionCode = AndroidVersion.VERSION_CODE
22+
versionName = AndroidVersion.VERSION_NAME
23+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
24+
25+
// TODO Scheme is created in data module but with which one, find out
26+
javaCompileOptions {
27+
annotationProcessorOptions {
28+
arguments["room.schemaLocation"] = "$projectDir/schemas"
29+
}
30+
}
31+
kapt {
32+
arguments {
33+
arg("room.schemaLocation", "$projectDir/schemas")
34+
}
35+
}
36+
}
37+
38+
buildTypes {
39+
getByName("release") {
40+
isMinifyEnabled = false
41+
proguardFiles(
42+
getDefaultProguardFile("proguard-android-optimize.txt"),
43+
"proguard-rules.pro"
44+
)
45+
}
46+
}
47+
48+
// signingConfigs {
49+
// create(BuildType.RELEASE) {
50+
// keyAlias = getLocalProperty("signing.key.alias")
51+
// keyPassword = getLocalProperty("signing.key.password")
52+
// storeFile = file(getLocalProperty("signing.store.file"))
53+
// storePassword = getLocalProperty("signing.store.password")
54+
// }
55+
// }
56+
57+
// Specifies one flavor dimension.
58+
// flavorDimensions("reactive")
59+
//
60+
// productFlavors {
61+
//
62+
// create("rxjava") {
63+
// dimension = "reactive"
64+
// applicationIdSuffix = ".rxjava"
65+
// versionNameSuffix = "-rxjava"
66+
// }
67+
// create("coroutines") {
68+
// dimension = "reactive"
69+
// applicationIdSuffix =".coroutines"
70+
// versionNameSuffix = "-coroutines"
71+
// }
72+
// }
73+
74+
// configurations.all {
75+
// resolutionStrategy {
76+
// exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
77+
// }
78+
// }
79+
80+
packagingOptions {
81+
exclude("**/attach_hotspot_windows.dll")
82+
exclude("META-INF/licenses/**")
83+
exclude("META-INF/AL2.0")
84+
exclude("META-INF/LGPL2.1")
85+
}
86+
87+
android.buildFeatures.dataBinding = true
88+
89+
compileOptions {
90+
sourceCompatibility = JavaVersion.VERSION_1_8
91+
targetCompatibility = JavaVersion.VERSION_1_8
92+
}
93+
94+
kotlinOptions {
95+
jvmTarget = "1.8"
96+
}
97+
98+
dynamicFeatures = mutableSetOf(
99+
Modules.DynamicFeature.HOME,
100+
Modules.DynamicFeature.FAVORITES,
101+
Modules.DynamicFeature.NOTIFICATION,
102+
Modules.DynamicFeature.ACCOUNT
103+
)
104+
105+
testOptions {
106+
unitTests.isIncludeAndroidResources = true
107+
}
108+
}
109+
110+
dependencies {
111+
112+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
113+
114+
implementation(project(Modules.AndroidLibrary.DATA))
115+
implementation(project(Modules.AndroidLibrary.DOMAIN))
116+
implementation(project(Modules.AndroidLibrary.CORE))
117+
118+
addAppModuleDependencies()
119+
120+
// Unit Tests
121+
addUnitTestDependencies()
122+
testImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
123+
124+
// Instrumentation Tests
125+
addInstrumentationTestDependencies()
126+
androidTestImplementation(project(Modules.AndroidLibrary.TEST_UTILS))
127+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.smarttoolfactory.propertyfindar
2+
3+
import androidx.test.ext.junit.runners.AndroidJUnit4
4+
import androidx.test.platform.app.InstrumentationRegistry
5+
import org.junit.Assert.assertEquals
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
/**
10+
* Instrumented test, which will execute on an Android device.
11+
*
12+
* See [testing documentation](http://d.android.com/tools/testing).
13+
*/
14+
@RunWith(AndroidJUnit4::class)
15+
class ExampleInstrumentedTest {
16+
@Test
17+
fun useAppContext() {
18+
// Context of the app under test.
19+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
20+
assertEquals("com.smarttoolfactory.propertyfindar", appContext.packageName)
21+
}
22+
}

app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.smarttoolfactory.propertyfindar">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
7+
<application
8+
android:name=".PropertyFindARApplication"
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/Theme.PropertyFindAR">
15+
<activity android:name=".MainActivity">
16+
<intent-filter>
17+
<action android:name="android.intent.action.MAIN" />
18+
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
</application>
23+
24+
</manifest>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.smarttoolfactory.propertyfindar
2+
3+
const val ORDER_BY_NONE = com.smarttoolfactory.data.constant.ORDER_BY_NONE
4+
const val ORDER_BY_PRICE_ASCENDING = com.smarttoolfactory.data.constant.ORDER_BY_PRICE_ASCENDING
5+
const val ORDER_BY_PRICE_DESCENDING = com.smarttoolfactory.data.constant.ORDER_BY_PRICE_DESCENDING
6+
const val ORDER_BY_BEDS_ASCENDING = com.smarttoolfactory.data.constant.ORDER_BY_BEDS_ASCENDING
7+
const val ORDER_BY_DES_DESCENDING = com.smarttoolfactory.data.constant.ORDER_BY_DES_DESCENDING
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.smarttoolfactory.propertyfindar
2+
3+
import android.os.Bundle
4+
import androidx.appcompat.app.AppCompatActivity
5+
import dagger.hilt.android.AndroidEntryPoint
6+
7+
@AndroidEntryPoint
8+
class MainActivity : AppCompatActivity() {
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
setContentView(R.layout.activity_main)
12+
}
13+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.smarttoolfactory.propertyfindar
2+
3+
import android.os.Bundle
4+
import android.view.View
5+
import com.smarttoolfactory.core.ui.fragment.DynamicNavigationFragment
6+
import com.smarttoolfactory.propertyfindar.databinding.FragmentMainBinding
7+
import com.smarttoolfactory.propertyfindar.ui.BottomNavigationFragmentStateAdapter
8+
9+
class MainFragment : DynamicNavigationFragment<FragmentMainBinding>() {
10+
11+
override fun getLayoutRes(): Int = R.layout.fragment_main
12+
13+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
14+
super.onViewCreated(view, savedInstanceState)
15+
16+
val binding = dataBinding!!
17+
18+
val viewPager2 = binding.viewPager
19+
val bottomNavigationView = binding.bottomNav
20+
21+
// Cancel ViewPager swipe
22+
viewPager2.isUserInputEnabled = false
23+
24+
// Set viewpager adapter
25+
viewPager2.adapter =
26+
BottomNavigationFragmentStateAdapter(childFragmentManager, viewLifecycleOwner.lifecycle)
27+
28+
// Listen bottom navigation tabs change
29+
bottomNavigationView.setOnNavigationItemSelectedListener {
30+
31+
when (it.itemId) {
32+
33+
R.id.nav_graph_dfm_home_start -> {
34+
viewPager2.setCurrentItem(0, false)
35+
return@setOnNavigationItemSelectedListener true
36+
}
37+
38+
R.id.nav_graph_dfm_favorites_start -> {
39+
viewPager2.setCurrentItem(1, false)
40+
return@setOnNavigationItemSelectedListener true
41+
}
42+
43+
R.id.nav_graph_dfm_notification_start -> {
44+
viewPager2.setCurrentItem(2, false)
45+
return@setOnNavigationItemSelectedListener true
46+
}
47+
48+
else -> {
49+
viewPager2.setCurrentItem(3, false)
50+
return@setOnNavigationItemSelectedListener true
51+
}
52+
}
53+
}
54+
false
55+
}
56+
57+
override fun onDestroyView() {
58+
59+
val viewPager2 = dataBinding?.viewPager
60+
61+
/*
62+
Without setting ViewPager2 Adapter it causes memory leak
63+
64+
https://stackoverflow.com/questions/62851425/viewpager2-inside-a-fragment-leaks-after-replacing-the-fragment-its-in-by-navig
65+
*/
66+
viewPager2?.let {
67+
it.adapter = null
68+
}
69+
70+
super.onDestroyView()
71+
}
72+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.smarttoolfactory.propertyfindar
2+
3+
import android.app.Application
4+
import dagger.hilt.android.HiltAndroidApp
5+
6+
@HiltAndroidApp
7+
class PropertyFindARApplication : Application() {
8+
9+
override fun onCreate() {
10+
super.onCreate()
11+
}
12+
}

0 commit comments

Comments
 (0)