Skip to content

Commit

Permalink
build: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Balcan authored and andresmr committed Nov 21, 2024
1 parent 222e3d3 commit 059511d
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 @@ -13,11 +13,18 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
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,7 +48,6 @@ 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 kotlin.math.roundToInt

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 = Color(0xFF667685),
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 059511d

Please sign in to comment.