Skip to content

Commit

Permalink
Fix #2432: fixed about us landscape orientation ui
Browse files Browse the repository at this point in the history
  • Loading branch information
keshriAyushh authored and therajanmaurya committed Dec 28, 2023
1 parent 938f833 commit d25746d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.mifos.mobile.ui.about

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.net.Uri
Expand Down Expand Up @@ -30,6 +31,7 @@ class AboutUsFragment : BaseFragment() {

private val viewModel: AboutUsViewModel by viewModels()

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand Down
74 changes: 41 additions & 33 deletions app/src/main/java/org/mifos/mobile/ui/about/AboutUsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,57 @@ import java.util.*
@SuppressWarnings("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun AboutUsScreen(viewModel: AboutUsViewModel) {
Column(


LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
) {
Spacer(modifier = Modifier.height(48.dp))
AboutUsHeader()
LazyColumn {
items(viewModel.aboutUsItems) { item ->
MifosItemCard(
modifier = Modifier.padding(bottom = 8.dp),
onClick = {
when (item.itemId) {
AboutUsListItemId.OFFICE_WEBSITE -> {
viewModel.navigateToItem(AboutUsListItemId.OFFICE_WEBSITE)
}
AboutUsListItemId.LICENSES -> {
viewModel.navigateToItem(AboutUsListItemId.LICENSES)
}
AboutUsListItemId.PRIVACY_POLICY -> {
viewModel.navigateToItem(AboutUsListItemId.PRIVACY_POLICY)
}
AboutUsListItemId.SOURCE_CODE -> {
viewModel.navigateToItem(AboutUsListItemId.SOURCE_CODE)
}
AboutUsListItemId.LICENSES_STRING_WITH_VALUE -> {
viewModel.navigateToItem(AboutUsListItemId.LICENSES_STRING_WITH_VALUE)
}
else -> {}
item {
Spacer(modifier = Modifier.height(48.dp))
AboutUsHeader()
}
items(viewModel.aboutUsItems) { item ->
MifosItemCard(
modifier = Modifier.padding(bottom = 8.dp),
onClick = {
when (item.itemId) {
AboutUsListItemId.OFFICE_WEBSITE -> {
viewModel.navigateToItem(AboutUsListItemId.OFFICE_WEBSITE)
}

AboutUsListItemId.LICENSES -> {
viewModel.navigateToItem(AboutUsListItemId.LICENSES)
}

AboutUsListItemId.PRIVACY_POLICY -> {
viewModel.navigateToItem(AboutUsListItemId.PRIVACY_POLICY)
}

AboutUsListItemId.SOURCE_CODE -> {
viewModel.navigateToItem(AboutUsListItemId.SOURCE_CODE)
}

AboutUsListItemId.LICENSES_STRING_WITH_VALUE -> {
viewModel.navigateToItem(AboutUsListItemId.LICENSES_STRING_WITH_VALUE)
}

else -> {}
}
) {
item.title?.let {
AboutUsItemCard(
title = it,
subtitle = item.subtitle,
iconUrl = item.iconUrl
)
}
}
) {
item.title?.let {
AboutUsItemCard(
title = it,
subtitle = item.subtitle,
iconUrl = item.iconUrl
)
}
}
}
}

}

@Composable
Expand Down

0 comments on commit d25746d

Please sign in to comment.