Skip to content

Commit 6383f38

Browse files
committed
Merge branch 'feat/show-name-in-misc' into 'master'
Zobrazení jména postavy v tabu Misc See merge request fmasa/pv239-project!60
2 parents a081637 + 7c00496 commit 6383f38

File tree

2 files changed

+41
-13
lines changed

2 files changed

+41
-13
lines changed

app/src/main/java/cz/muni/fi/rpg/ui/character/CharacterMiscFragment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ internal class CharacterMiscFragment : Fragment(R.layout.fragment_character_misc
6060

6161
private fun bindTopBar() {
6262
viewModel.character.observe(viewLifecycleOwner) { character ->
63+
nameValue.text = character.getName()
6364
raceValue.setText(character.getRace().getReadableNameId())
6465
careerValue.text = character.getCareer()
6566
socialClassValue.text = character.getSocialClass()

app/src/main/res/layout/fragment_character_misc.xml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,14 @@
2626
android:layout_height="wrap_content"
2727
tools:ignore="MissingConstraints">
2828

29-
30-
31-
<Button
32-
android:id="@+id/xpPoints"
33-
style="?attr/materialButtonOutlinedStyle"
34-
android:layout_width="wrap_content"
35-
android:layout_height="wrap_content"
36-
android:layout_marginEnd="16dp"
37-
app:layout_constraintEnd_toEndOf="parent"
38-
app:layout_constraintTop_toTopOf="parent" />
39-
40-
4129
<androidx.constraintlayout.helper.widget.Flow
4230
android:id="@+id/flow1"
4331
android:layout_width="match_parent"
4432
app:flow_firstHorizontalBias="0"
4533
android:orientation="vertical"
4634
android:layout_height="wrap_content"
4735
app:constraint_referenced_ids="
36+
nameRow,
4837
careerLabel,
4938
careerValue,
5039
raceLabel,
@@ -60,7 +49,45 @@
6049
app:flow_horizontalStyle="spread"
6150
app:flow_horizontalAlign="start"
6251
app:layout_constraintStart_toStartOf="parent"
63-
app:layout_constraintTop_toBottomOf="@id/xpPoints" />
52+
app:layout_constraintTop_toTopOf="parent" />
53+
54+
<androidx.constraintlayout.widget.ConstraintLayout
55+
android:id="@+id/nameRow"
56+
android:layout_width="match_parent"
57+
android:layout_height="wrap_content">
58+
<TextView
59+
android:id="@+id/nameLabel"
60+
android:text="@string/label_name"
61+
android:layout_width="wrap_content"
62+
app:layout_constraintTop_toTopOf="parent"
63+
app:layout_constraintStart_toStartOf="parent"
64+
android:layout_height="wrap_content" />
65+
66+
<TextView
67+
android:id="@+id/nameValue"
68+
app:layout_constraintTop_toBottomOf="@id/nameLabel"
69+
app:layout_constraintStart_toStartOf="@id/nameLabel"
70+
app:layout_constraintHorizontal_bias="0"
71+
style="@style/TextAppearance.AppCompat.Medium"
72+
android:textColor="@color/colorText"
73+
android:paddingBottom="6dp"
74+
android:layout_width="0dp"
75+
android:maxLines="1"
76+
android:layout_marginEnd="5dp"
77+
android:ellipsize="end"
78+
app:layout_constraintEnd_toStartOf="@id/xpPoints"
79+
android:layout_height="wrap_content" />
80+
81+
82+
<Button
83+
android:id="@+id/xpPoints"
84+
style="?attr/materialButtonOutlinedStyle"
85+
android:layout_width="wrap_content"
86+
android:layout_height="wrap_content"
87+
android:layout_marginEnd="16dp"
88+
app:layout_constraintEnd_toEndOf="parent"
89+
app:layout_constraintTop_toTopOf="parent" />
90+
</androidx.constraintlayout.widget.ConstraintLayout>
6491

6592
<TextView
6693
android:id="@+id/careerLabel"

0 commit comments

Comments
 (0)