Skip to content

Commit 5093a03

Browse files
authored
build: remove unused code (#3889)
* build: remove unused code * replace hardcoded color to library reference
1 parent 3620ad3 commit 5093a03

File tree

29 files changed

+81
-1741
lines changed

29 files changed

+81
-1741
lines changed

app/src/main/java/org/dhis2/usescases/settings/bindings/SyncManagerBindings.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package org.dhis2.usescases.settings.bindings
22

3+
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.material3.Text
5+
import androidx.compose.ui.Alignment
36
import androidx.compose.ui.platform.ComposeView
47
import androidx.databinding.BindingAdapter
5-
import org.dhis2.ui.Dhis2ProgressIndicator
68
import org.dhis2.ui.model.ButtonUiModel
79
import org.dhis2.ui.theme.Dhis2Theme
10+
import org.dhis2.ui.theme.textSecondary
811
import org.hisp.dhis.mobile.ui.designsystem.component.Button
12+
import org.hisp.dhis.mobile.ui.designsystem.component.ProgressIndicator
13+
import org.hisp.dhis.mobile.ui.designsystem.component.ProgressIndicatorType
14+
import org.hisp.dhis.mobile.ui.designsystem.theme.DHIS2Theme
915

1016
@BindingAdapter("addTextButton")
1117
fun ComposeView.addTextButton(model: ButtonUiModel?) {
@@ -25,8 +31,13 @@ fun ComposeView.addTextButton(model: ButtonUiModel?) {
2531
@BindingAdapter("progressIndicator")
2632
fun ComposeView.progressIndicator(message: String?) {
2733
setContent {
28-
Dhis2Theme {
29-
Dhis2ProgressIndicator(message)
34+
DHIS2Theme {
35+
Column(horizontalAlignment = Alignment.CenterHorizontally) {
36+
ProgressIndicator(
37+
type = ProgressIndicatorType.CIRCULAR,
38+
)
39+
message?.let { Text(it, color = textSecondary) }
40+
}
3041
}
3142
}
3243
}

dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/mappers/GraphToTable.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ import androidx.compose.ui.Modifier
1616
import androidx.compose.ui.platform.LocalConfiguration
1717
import androidx.compose.ui.platform.LocalDensity
1818
import androidx.compose.ui.res.stringResource
19+
import androidx.compose.ui.text.TextStyle
20+
import androidx.compose.ui.text.font.Font
21+
import androidx.compose.ui.text.font.FontFamily
22+
import androidx.compose.ui.text.font.FontWeight
23+
import androidx.compose.ui.text.style.TextAlign
1924
import androidx.compose.ui.unit.Density
2025
import androidx.compose.ui.unit.dp
26+
import androidx.compose.ui.unit.sp
2127
import com.google.android.material.composethemeadapter.MdcTheme
2228
import dhis2.org.R
2329
import dhis2.org.analytics.charts.data.ChartType
@@ -41,8 +47,8 @@ import org.dhis2.composetable.ui.TableDimensions
4147
import org.dhis2.composetable.ui.TableSelection
4248
import org.dhis2.composetable.ui.TableTheme
4349
import org.dhis2.composetable.ui.compositions.LocalInteraction
44-
import org.dhis2.ui.theme.descriptionTextStyle
4550
import org.hisp.dhis.android.core.arch.helpers.DateUtils
51+
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor
4652
import kotlin.math.roundToInt
4753

4854
private const val LINE_LISTING_MAX_ROWS = 500
@@ -169,7 +175,15 @@ class GraphToTable {
169175
R.string.line_listing_max_results,
170176
LINE_LISTING_MAX_ROWS,
171177
),
172-
style = descriptionTextStyle,
178+
style = TextStyle(
179+
color = TextColor.OnSurfaceLight,
180+
fontSize = 10.sp,
181+
fontWeight = FontWeight.Normal,
182+
fontFamily = FontFamily(Font(org.dhis2.ui.R.font.roboto_regular)),
183+
lineHeight = 16.sp,
184+
letterSpacing = (0.4).sp,
185+
textAlign = TextAlign.End,
186+
),
173187
)
174188
}
175189
}

form/src/main/java/org/dhis2/form/model/FieldUiModelImpl.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ data class FieldUiModelImpl(
6161

6262
override fun invokeUiEvent(uiEventType: UiEventType) {
6363
callback?.intent(FormIntent.OnRequestCoordinates(uid))
64-
if (uiEventType != UiEventType.QR_CODE &&
65-
uiEventType != UiEventType.EMAIL &&
66-
uiEventType != UiEventType.PHONE_NUMBER &&
67-
!focused
68-
) {
64+
if (!focused) {
6965
onItemClick()
7066
}
7167
uiEventFactory?.generateEvent(value, uiEventType, renderingType, this)?.let {
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
package org.dhis2.form.model
22

33
enum class UiEventType {
4-
DATE_TIME,
5-
AGE_CALENDAR,
6-
ORG_UNIT,
7-
REQUEST_CURRENT_LOCATION,
84
REQUEST_LOCATION_BY_MAP,
95
ADD_PICTURE,
10-
SHOW_PICTURE,
11-
SHOW_DESCRIPTION,
12-
COPY_TO_CLIPBOARD,
13-
QR_CODE,
14-
OPTION_SET,
15-
ADD_SIGNATURE,
166
ADD_FILE,
177
OPEN_FILE,
18-
EMAIL,
19-
PHONE_NUMBER,
208
SHARE_IMAGE,
219
}

0 commit comments

Comments
 (0)