Skip to content

Commit

Permalink
build: remove unused code (#3889)
Browse files Browse the repository at this point in the history
* build: remove unused code

* replace hardcoded color to library reference
  • Loading branch information
Balcan authored Nov 29, 2024
1 parent 3620ad3 commit 5093a03
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 1,741 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package org.dhis2.usescases.settings.bindings

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.ui.Alignment
import androidx.compose.ui.platform.ComposeView
import androidx.databinding.BindingAdapter
import org.dhis2.ui.Dhis2ProgressIndicator
import org.dhis2.ui.model.ButtonUiModel
import org.dhis2.ui.theme.Dhis2Theme
import org.dhis2.ui.theme.textSecondary
import org.hisp.dhis.mobile.ui.designsystem.component.Button
import org.hisp.dhis.mobile.ui.designsystem.component.ProgressIndicator
import org.hisp.dhis.mobile.ui.designsystem.component.ProgressIndicatorType
import org.hisp.dhis.mobile.ui.designsystem.theme.DHIS2Theme

@BindingAdapter("addTextButton")
fun ComposeView.addTextButton(model: ButtonUiModel?) {
Expand All @@ -25,8 +31,13 @@ fun ComposeView.addTextButton(model: ButtonUiModel?) {
@BindingAdapter("progressIndicator")
fun ComposeView.progressIndicator(message: String?) {
setContent {
Dhis2Theme {
Dhis2ProgressIndicator(message)
DHIS2Theme {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
ProgressIndicator(
type = ProgressIndicatorType.CIRCULAR,
)
message?.let { Text(it, color = textSecondary) }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.android.material.composethemeadapter.MdcTheme
import dhis2.org.R
import dhis2.org.analytics.charts.data.ChartType
Expand All @@ -41,8 +47,8 @@ import org.dhis2.composetable.ui.TableDimensions
import org.dhis2.composetable.ui.TableSelection
import org.dhis2.composetable.ui.TableTheme
import org.dhis2.composetable.ui.compositions.LocalInteraction
import org.dhis2.ui.theme.descriptionTextStyle
import org.hisp.dhis.android.core.arch.helpers.DateUtils
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor
import kotlin.math.roundToInt

private const val LINE_LISTING_MAX_ROWS = 500
Expand Down Expand Up @@ -169,7 +175,15 @@ class GraphToTable {
R.string.line_listing_max_results,
LINE_LISTING_MAX_ROWS,
),
style = descriptionTextStyle,
style = TextStyle(
color = TextColor.OnSurfaceLight,
fontSize = 10.sp,
fontWeight = FontWeight.Normal,
fontFamily = FontFamily(Font(org.dhis2.ui.R.font.roboto_regular)),
lineHeight = 16.sp,
letterSpacing = (0.4).sp,
textAlign = TextAlign.End,
),
)
}
}
Expand Down
6 changes: 1 addition & 5 deletions form/src/main/java/org/dhis2/form/model/FieldUiModelImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ data class FieldUiModelImpl(

override fun invokeUiEvent(uiEventType: UiEventType) {
callback?.intent(FormIntent.OnRequestCoordinates(uid))
if (uiEventType != UiEventType.QR_CODE &&
uiEventType != UiEventType.EMAIL &&
uiEventType != UiEventType.PHONE_NUMBER &&
!focused
) {
if (!focused) {
onItemClick()
}
uiEventFactory?.generateEvent(value, uiEventType, renderingType, this)?.let {
Expand Down
12 changes: 0 additions & 12 deletions form/src/main/java/org/dhis2/form/model/UiEventType.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
package org.dhis2.form.model

enum class UiEventType {
DATE_TIME,
AGE_CALENDAR,
ORG_UNIT,
REQUEST_CURRENT_LOCATION,
REQUEST_LOCATION_BY_MAP,
ADD_PICTURE,
SHOW_PICTURE,
SHOW_DESCRIPTION,
COPY_TO_CLIPBOARD,
QR_CODE,
OPTION_SET,
ADD_SIGNATURE,
ADD_FILE,
OPEN_FILE,
EMAIL,
PHONE_NUMBER,
SHARE_IMAGE,
}
Loading

0 comments on commit 5093a03

Please sign in to comment.