Skip to content

Commit d4b90bc

Browse files
refactor: refactor SavedIndividual Collection Sheet screen to jetpack compose with multi module (#2097)
* refactor: refactor savedindividual collection sheet to compose with multi module * fix: clean up logs * fix: log clean up * refactor: rename module
1 parent e282602 commit d4b90bc

File tree

13 files changed

+162
-7
lines changed

13 files changed

+162
-7
lines changed

feature/collection-sheet/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
plugins {
2+
alias(libs.plugins.mifos.android.feature)
3+
alias(libs.plugins.mifos.android.library.compose)
4+
}
5+
6+
android {
7+
namespace = "com.mifos.feature.collection_sheet"
8+
}
9+
10+
dependencies {
11+
12+
}

feature/collection-sheet/consumer-rules.pro

Whitespace-only changes.
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.mifos.feature.individual
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.mifos.feature.individual.test", appContext.packageName)
23+
}
24+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.mifos.feature.individual_collection_sheet.saved_individual_collection_sheet.ui
2+
3+
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.fillMaxSize
6+
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.material3.Scaffold
8+
import androidx.compose.material3.Text
9+
import androidx.compose.runtime.Composable
10+
import androidx.compose.ui.Alignment
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.graphics.Color
13+
import androidx.compose.ui.res.stringResource
14+
import androidx.compose.ui.text.TextStyle
15+
import androidx.compose.ui.text.font.FontWeight
16+
import androidx.compose.ui.tooling.preview.Preview
17+
import androidx.compose.ui.unit.sp
18+
import com.mifos.feature.collection_sheet.R
19+
20+
@Composable
21+
fun SavedIndividualCollectionSheetCompose() {
22+
23+
// Saved Individual Collection Sheet need to be integrated with API.
24+
25+
Scaffold(
26+
modifier = Modifier.fillMaxSize(),
27+
containerColor = Color.White
28+
) { paddingValue ->
29+
Column(
30+
modifier = Modifier
31+
.padding(paddingValue)
32+
.fillMaxSize(),
33+
horizontalAlignment = Alignment.CenterHorizontally,
34+
verticalArrangement = Arrangement.Center
35+
) {
36+
Text(
37+
text = stringResource(id = R.string.feature_collection_sheet_no_saved_collection_sheet),
38+
style = TextStyle(
39+
fontSize = 24.sp,
40+
fontWeight = FontWeight.Medium
41+
)
42+
)
43+
}
44+
}
45+
}
46+
47+
@Preview(showSystemUi = true)
48+
@Composable
49+
private fun SavedIndividualCollectionSheetComposePreview() {
50+
SavedIndividualCollectionSheetCompose()
51+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.mifos.feature.individual_collection_sheet.saved_individual_collection_sheet.ui
2+
3+
import androidx.lifecycle.ViewModel
4+
import dagger.hilt.android.lifecycle.HiltViewModel
5+
import javax.inject.Inject
6+
7+
@HiltViewModel
8+
class SavedIndividualCollectionSheetViewModel @Inject constructor() : ViewModel() {
9+
10+
// Saved Individual Collection Sheet need to be integrated with API.
11+
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="feature_collection_sheet_no_saved_collection_sheet">No Saved Collection Sheet</string>
4+
5+
</resources>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.mifos.feature.individual
2+
3+
import org.junit.Test
4+
5+
import org.junit.Assert.*
6+
7+
/**
8+
* Example local unit test, which will execute on the development machine (host).
9+
*
10+
* See [testing documentation](http://d.android.com/tools/testing).
11+
*/
12+
class ExampleUnitTest {
13+
@Test
14+
fun addition_isCorrect() {
15+
assertEquals(4, 2 + 2)
16+
}
17+
}

0 commit comments

Comments
 (0)