@momo-kits/native-kits 0.89.6 → 0.89.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ import androidx.compose.ui.Modifier
21
21
  import androidx.compose.ui.graphics.Color
22
22
  import androidx.compose.ui.input.pointer.pointerInput
23
23
  import androidx.compose.ui.platform.LocalSoftwareKeyboardController
24
+ import androidx.compose.ui.unit.Dp
24
25
  import androidx.compose.ui.unit.dp
25
26
  import androidx.compose.ui.unit.min
26
27
  import vn.momo.kits.const.AppTheme
@@ -47,13 +48,15 @@ fun Screen(
47
48
  titlePosition: TitlePosition = TitlePosition.LEFT,
48
49
  goBack: (() -> Unit) = { },
49
50
  scrollable: Boolean = true,
51
+ useAvoidKeyboard: Boolean = true,
50
52
  footer: @Composable (() -> Unit)? = null,
51
53
  headerRight: @Composable (() -> Unit)? = null,
52
54
  content: @Composable () -> Unit,
53
55
  ) {
54
56
  val keyboardController = LocalSoftwareKeyboardController.current
55
57
  val keyboardHeight = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
56
- val avoidKeyboard = when {
58
+ val keyboardSize = when {
59
+ !useAvoidKeyboard -> 0.dp
57
60
  keyboardHeight > 100.dp && footer == null -> keyboardHeight
58
61
  keyboardHeight > 100.dp && footer != null -> keyboardHeight - 21.dp
59
62
  else -> 0.dp
@@ -81,9 +84,9 @@ fun Screen(
81
84
  )
82
85
 
83
86
  Column(
84
- modifier = if (scrollable) Modifier.weight(1f).padding(bottom = avoidKeyboard)
87
+ modifier = if (scrollable) Modifier.weight(1f).padding(bottom = keyboardSize)
85
88
  .verticalScroll(rememberScrollState()) else
86
- Modifier.padding(bottom = avoidKeyboard),
89
+ Modifier.padding(bottom = keyboardSize),
87
90
  verticalArrangement = verticalArrangement,
88
91
  horizontalAlignment = horizontalAlignment
89
92
  ) {
@@ -91,19 +94,18 @@ fun Screen(
91
94
  }
92
95
 
93
96
  footer?.let {
94
- Footer(footer)
97
+ Footer(footer, keyboardSize)
95
98
  }
96
99
  }
97
100
  }
98
101
  }
99
102
 
100
103
  @Composable
101
- fun Footer(footer: @Composable (() -> Unit)? = null) {
104
+ fun Footer(footer: @Composable (() -> Unit)? = null, keyboardSize: Dp = 0.dp) {
102
105
  val indicator = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
103
- val keyboardHeight = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
104
106
  Box(
105
107
  Modifier
106
- .offset(y = if (keyboardHeight > 150.dp) -keyboardHeight + 21.dp else 0.dp)
108
+ .offset(y = - keyboardSize)
107
109
  .padding(bottom = min(indicator, 21.dp))
108
110
  .shadow(
109
111
  Colors.black_20.copy(alpha = 0.1f),
@@ -7,6 +7,7 @@ import androidx.compose.ui.text.TextLayoutResult
7
7
  import androidx.compose.ui.text.TextStyle
8
8
  import androidx.compose.ui.text.style.TextAlign
9
9
  import androidx.compose.ui.text.style.TextDecoration
10
+ import androidx.compose.ui.text.style.TextOverflow
10
11
  import androidx.compose.ui.unit.sp
11
12
  import vn.momo.kits.const.AppTheme
12
13
  import vn.momo.kits.const.Typography
@@ -21,6 +22,7 @@ fun Text(
21
22
  textAlign: TextAlign? = TextAlign.Start,
22
23
  modifier: Modifier = Modifier,
23
24
  maxLines: Int = Int.MAX_VALUE,
25
+ overflow: TextOverflow = TextOverflow.Clip,
24
26
  textDecoration: TextDecoration? = null,
25
27
  onTextLayout: ((TextLayoutResult) -> Unit)? = null,
26
28
  ) {
@@ -38,5 +40,6 @@ fun Text(
38
40
  maxLines = maxLines,
39
41
  textDecoration = textDecoration,
40
42
  onTextLayout = onTextLayout,
43
+ overflow = overflow
41
44
  )
42
45
  }
package/local.properties CHANGED
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Mon Mar 04 18:29:01 ICT 2024
7
+ #Thu May 16 11:34:53 ICT 2024
8
8
  sdk.dir=/Users/wem/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.89.6",
3
+ "version": "0.89.8",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
package/publish.sh CHANGED
@@ -16,4 +16,4 @@ npm publish --tag beta --access=public
16
16
  cd ..
17
17
  rm -rf dist
18
18
 
19
- curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/native new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/native-kits"}'
19
+ #curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/native new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/native-kits"}'
File without changes
@@ -1,2 +0,0 @@
1
- #Wed Dec 27 16:34:14 ICT 2023
2
- java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
File without changes
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="GradleSettings">
4
- <option name="linkedExternalProjectsSettings">
5
- <GradleProjectSettings>
6
- <option name="externalProjectPath" value="$PROJECT_DIR$" />
7
- <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
8
- <option name="resolveExternalAnnotations" value="false" />
9
- </GradleProjectSettings>
10
- </option>
11
- </component>
12
- </project>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectMigrations">
4
- <option name="MigrateToGradleLocalJavaHome">
5
- <set>
6
- <option value="$PROJECT_DIR$" />
7
- </set>
8
- </option>
9
- </component>
10
- </project>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ExternalStorageConfigurationManager" enabled="true" />
4
- <component name="ProjectRootManager">
5
- <output url="file://$PROJECT_DIR$/build/classes" />
6
- </component>
7
- <component name="ProjectType">
8
- <option name="id" value="Android" />
9
- </component>
10
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
- </component>
6
- </project>
@@ -1,50 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AutoImportSettings">
4
- <option name="autoReloadType" value="NONE" />
5
- </component>
6
- <component name="ChangeListManager">
7
- <list default="true" id="7ac6a412-719a-420a-88c9-469c04bccebf" name="Changes" comment="" />
8
- <option name="SHOW_DIALOG" value="false" />
9
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
- <option name="LAST_RESOLUTION" value="IGNORE" />
12
- </component>
13
- <component name="ClangdSettings">
14
- <option name="formatViaClangd" value="false" />
15
- </component>
16
- <component name="Git.Settings">
17
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
18
- </component>
19
- <component name="ProjectId" id="2a7VYs7GWpDvnabiqoEP3S5zR6T" />
20
- <component name="ProjectViewState">
21
- <option name="hideEmptyMiddlePackages" value="true" />
22
- <option name="showLibraryContents" value="true" />
23
- </component>
24
- <component name="PropertiesComponent"><![CDATA[{
25
- "keyToString": {
26
- "RunOnceActivity.ShowReadmeOnStart": "true",
27
- "RunOnceActivity.cidr.known.project.marker": "true",
28
- "android.gradle.sync.needed": "true",
29
- "cf.first.check.clang-format": "false",
30
- "cidr.known.project.marker": "true",
31
- "dart.analysis.tool.window.visible": "false",
32
- "project.structure.last.edited": "Project",
33
- "project.structure.proportion": "0.17",
34
- "project.structure.side.proportion": "0.0",
35
- "settings.editor.selected.configurable": "preferences.lookFeel",
36
- "show.migrate.to.gradle.popup": "false"
37
- }
38
- }]]></component>
39
- <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
40
- <component name="TaskManager">
41
- <task active="true" id="Default" summary="Default task">
42
- <changelist id="7ac6a412-719a-420a-88c9-469c04bccebf" name="Changes" comment="" />
43
- <created>1703669655154</created>
44
- <option name="number" value="Default" />
45
- <option name="presentableId" value="Default" />
46
- <updated>1703669655154</updated>
47
- </task>
48
- <servers />
49
- </component>
50
- </project>
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Wed Dec 27 16:34:14 ICT 2023
8
- sdk.dir=/Users/wem/Library/Android/sdk