Fix VisitCard
This commit is contained in:
parent
9f3e4369fc
commit
8ed8bdcbd9
57
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
57
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
|
<option name="composableFile" value="true" />
|
||||||
|
<option name="previewFile" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
@ -35,7 +35,7 @@ class DataRepositoryImpl @Inject constructor(@ApplicationContext private val con
|
|||||||
else UserDTO(isError = true, isUnauthorized = result.code() == 403)
|
else UserDTO(isError = true, isUnauthorized = result.code() == 403)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun getVisits(id: String): VisitCardWrapper {
|
override suspend fun getVisits(id: String?): VisitCardWrapper {
|
||||||
val result = Provider.provideRetrofit().getVisits(getToken()).execute()
|
val result = Provider.provideRetrofit().getVisits(getToken()).execute()
|
||||||
return if (result.isSuccessful) {
|
return if (result.isSuccessful) {
|
||||||
VisitCardWrapper(result.body()!!)
|
VisitCardWrapper(result.body()!!)
|
||||||
|
@ -21,8 +21,10 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.nto.data.models.cards.VisitCardDTO
|
import com.nto.data.models.cards.VisitCardDTO
|
||||||
|
import com.nto.data.models.cards.VisitType
|
||||||
import com.nto.presentation.R
|
import com.nto.presentation.R
|
||||||
import com.nto.presentation.theme.NTOTheme
|
import com.nto.presentation.theme.NTOTheme
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
|
fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
|
||||||
@ -49,7 +51,7 @@ fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
Text(
|
Text(
|
||||||
text = data.id,
|
text = data.id.toString(),
|
||||||
style = NTOTheme.typography.displaySmall,
|
style = NTOTheme.typography.displaySmall,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
fontWeight = FontWeight.Thin
|
fontWeight = FontWeight.Thin
|
||||||
@ -57,14 +59,14 @@ fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
Column(horizontalAlignment = Alignment.End) {
|
Column(horizontalAlignment = Alignment.End) {
|
||||||
Text(
|
Text(
|
||||||
text = data.dateString,
|
text = data.dateString.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
||||||
style = NTOTheme.typography.displaySmall,
|
style = NTOTheme.typography.displaySmall,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = NTOTheme.colors.disabledText
|
color = NTOTheme.colors.disabledText
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(if (data.isCode) R.string.label_qr_login else R.string.label_card_login),
|
text = stringResource(if (data.visitType == VisitType.PHONE_ENTRY) R.string.label_qr_login else R.string.label_card_login),
|
||||||
style = NTOTheme.typography.displaySmall,
|
style = NTOTheme.typography.displaySmall,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = NTOTheme.colors.disabledText
|
color = NTOTheme.colors.disabledText
|
||||||
@ -78,6 +80,6 @@ fun VisitCard(data: VisitCardDTO, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
private fun VisitCardPreview() {
|
private fun VisitCardPreview() {
|
||||||
NTOTheme {
|
NTOTheme {
|
||||||
VisitCard(VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01"))
|
VisitCard(VisitCardDTO("Кабинет 207"))
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user