Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.example.engine.StaveInterpretationData
Expand Down Expand Up @@ -104,7 +106,12 @@ fun InterpretationCard(
Row(
modifier = Modifier
.fillMaxWidth()
.clickable { expandedRitual = !expandedRitual }
.semantics {
stateDescription = if (expandedRitual) "Π Π°Π·Π²Ρ‘Ρ€Π½ΡƒΡ‚ΠΎ" else "Π‘Π²Ρ‘Ρ€Π½ΡƒΡ‚ΠΎ"
}
.clickable(
onClickLabel = if (expandedRitual) "Π‘Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΈΠ½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡŽ" else "Π Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΈΠ½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡŽ"
) { expandedRitual = !expandedRitual }
.padding(vertical = 8.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
Expand All @@ -126,7 +133,7 @@ fun InterpretationCard(
}
Icon(
imageVector = if (expandedRitual) Icons.Default.ExpandLess else Icons.Default.ExpandMore,
contentDescription = if (expandedRitual) "Π‘Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ" else "Π Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ",
contentDescription = if (expandedRitual) "Π‘Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΈΠ½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡŽ" else "Π Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΈΠ½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡŽ",
tint = MaterialTheme.colorScheme.primary
)
}
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/com/example/ui/screens/EncyclopediaScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.example.data.model.Rune
Expand Down Expand Up @@ -315,7 +317,12 @@ fun RuneDetailCard(
Card(
modifier = Modifier
.fillMaxWidth()
.clickable { expanded = !expanded },
.semantics {
stateDescription = if (expanded) "Π Π°Π·Π²Ρ‘Ρ€Π½ΡƒΡ‚ΠΎ" else "Π‘Π²Ρ‘Ρ€Π½ΡƒΡ‚ΠΎ"
}
.clickable(
onClickLabel = if (expanded) "Π‘Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ подробности" else "Π Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ подробности"
) { expanded = !expanded },
shape = RoundedCornerShape(24.dp),
border = androidx.compose.foundation.BorderStroke(1.dp, MaterialTheme.colorScheme.outline),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
Expand Down Expand Up @@ -367,7 +374,7 @@ fun RuneDetailCard(

Icon(
imageVector = if (expanded) Icons.Default.ExpandLess else Icons.Default.ExpandMore,
contentDescription = null,
contentDescription = if (expanded) "Π‘Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ подробности" else "Π Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ подробности",
tint = MaterialTheme.colorScheme.primary
)
}
Expand Down
Loading