Skip to content

Commit

Permalink
Attempted to adjust view while ime actions
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshPanchal18 committed Feb 15, 2024
1 parent 0836481 commit c5c6ad2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ android {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
android:theme="@style/Theme.Geofencing"
tools:targetApi="31">
<activity
android:windowSoftInputMode="adjustResize"
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="locked"
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/example/geofencing/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class MainActivity : ComponentActivity() {
darkIcons = isDarkMode
)
systemUiController.setStatusBarColor(
color = navigationBarColor,
color = navigationBarColor,
darkIcons = isDarkMode
)

Expand Down Expand Up @@ -124,6 +124,13 @@ class MainActivity : ComponentActivity() {

}
}

/*ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content)) { view, insets ->
val bottom = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom
view.updatePadding(bottom = bottom)
insets
}*/

}

@Deprecated("Deprecated in Java")
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/java/com/example/geofencing/ui/UI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ fun BottomSheetLayout(context: Context, onAdd: (Array<Spot>) -> Unit) {
context.startService(Intent(context, BackgroundService::class.java))
val sharedPref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE)

//val coroutineScope = rememberCoroutineScope()
//val bringIntoViewRequester = BringIntoViewRequester()

Column(
modifier = Modifier
.padding(8.dp)
Expand Down Expand Up @@ -207,7 +210,14 @@ fun BottomSheetLayout(context: Context, onAdd: (Array<Spot>) -> Unit) {
}),
colors = TextFieldDefaults.colors(
focusedIndicatorColor = focusedIndicatorColor
)
),
/*modifier = Modifier.onFocusEvent { event ->
if(event.isFocused) {
coroutineScope.launch {
bringIntoViewRequester.bringIntoView()
}
}
}*/
)
Button(
onClick = {
Expand Down Expand Up @@ -260,6 +270,7 @@ fun BottomSheetLayout(context: Context, onAdd: (Array<Spot>) -> Unit) {
modifier = Modifier
.padding(horizontal = 5.dp)
.weight(1F),
//.bringIntoViewRequester(bringIntoViewRequester),
label = { Text(text = "Longitude") },
placeholder = { Text("Longitude") },
keyboardOptions = KeyboardOptions(
Expand Down

0 comments on commit c5c6ad2

Please sign in to comment.