1 <?xml version="1.0" encoding="utf-8"?><!--
2 ~ Copyright © 2019 Damyan Ivanov.
3 ~ This file is part of MoLe.
4 ~ MoLe is free software: you can distribute it and/or modify it
5 ~ under the term of the GNU General Public License as published by
6 ~ the Free Software Foundation, either version 3 of the License, or
7 ~ (at your opinion), any later version.
9 ~ MoLe is distributed in the hope that it will be useful,
10 ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ~ GNU General Public License terms for details.
14 ~ You should have received a copy of the GNU General Public License
15 ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
18 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
19 xmlns:app="http://schemas.android.com/apk/res-auto"
20 xmlns:tools="http://schemas.android.com/tools"
21 android:layout_width="match_parent"
22 android:layout_height="match_parent"
23 android:minWidth="60dp"
24 android:animateLayoutChanges="true"
25 app:layout_constraintWidth_min="60dp"
26 android:padding="@dimen/text_margin">
28 <com.google.android.material.textview.MaterialTextView
29 android:id="@+id/label"
30 android:layout_width="wrap_content"
31 android:layout_height="wrap_content"
32 android:layout_marginBottom="@dimen/text_margin"
33 android:text="@string/choose_currency_label"
34 android:textSize="18sp"
35 app:layout_constraintEnd_toEndOf="parent"
36 app:layout_constraintStart_toStartOf="parent"
37 app:layout_constraintTop_toTopOf="parent" />
39 <androidx.recyclerview.widget.RecyclerView
40 android:id="@+id/list"
41 android:name="net.ktnx.mobileledger.ui.CurrencySelectorFragment"
42 android:layout_width="wrap_content"
43 android:layout_height="wrap_content"
44 android:layout_marginLeft="@dimen/activity_horizontal_margin"
45 android:layout_marginRight="@dimen/activity_horizontal_margin"
46 app:layoutManager="LinearLayoutManager"
47 app:layout_constraintBottom_toTopOf="@id/new_currency_panel"
48 app:layout_constraintEnd_toEndOf="parent"
49 app:layout_constraintStart_toStartOf="parent"
50 app:layout_constraintTop_toBottomOf="@id/label"
51 tools:context="net.ktnx.mobileledger.ui.CurrencySelectorFragment"
52 tools:listitem="@layout/fragment_currency_selector">
54 </androidx.recyclerview.widget.RecyclerView>
56 <androidx.constraintlayout.widget.ConstraintLayout
57 android:id="@+id/new_currency_panel"
58 android:layout_width="wrap_content"
59 android:layout_height="wrap_content"
60 android:layout_marginLeft="@dimen/activity_horizontal_margin"
61 android:layout_marginRight="@dimen/activity_horizontal_margin"
62 app:layout_constraintTop_toBottomOf="@id/list"
63 app:layout_constraintBottom_toTopOf="@id/params_panel"
64 app:layout_constraintEnd_toEndOf="parent"
65 app:layout_constraintStart_toStartOf="parent">
68 android:id="@+id/btn_add_new"
69 style="@style/TextAppearance.AppCompat.Widget.Button.Colored"
70 android:textColor="@color/colorPrimary"
71 android:layout_width="wrap_content"
72 android:layout_height="wrap_content"
73 android:text="@string/add_button"
74 android:layout_margin="@dimen/text_margin"
75 app:layout_constraintBottom_toBottomOf="parent"
76 app:layout_constraintEnd_toEndOf="parent"
77 app:layout_constraintStart_toEndOf="@id/btn_no_currency"
78 app:layout_constraintTop_toTopOf="parent" />
80 android:layout_width="wrap_content"
81 android:layout_height="wrap_content"
82 android:id="@+id/btn_no_currency"
83 android:text="@string/btn_no_currency"
84 style="@style/TextAppearance.AppCompat.Widget.Button.Colored"
85 android:textColor="@color/colorPrimary"
86 app:layout_constraintBottom_toBottomOf="parent"
87 app:layout_constraintTop_toTopOf="parent"
88 app:layout_constraintStart_toStartOf="parent"
89 app:layout_constraintEnd_toStartOf="@id/btn_add_new"
90 android:layout_margin="@dimen/text_margin"/>
93 android:id="@+id/new_currency_name"
94 android:layout_width="wrap_content"
95 android:layout_height="wrap_content"
97 android:hint="@string/new_currency_name_hint"
98 android:inputType="text"
99 android:singleLine="true"
101 android:visibility="invisible"
102 app:layout_constraintEnd_toEndOf="parent"
103 app:layout_constraintStart_toStartOf="parent"
104 app:layout_constraintTop_toTopOf="parent" />
107 android:id="@+id/btn_add_currency"
108 style="@style/TextAppearance.AppCompat.Button"
109 android:layout_width="wrap_content"
110 android:layout_height="wrap_content"
111 android:layout_margin="@dimen/text_margin"
112 android:text="@string/add_button"
113 app:layout_constraintBottom_toBottomOf="parent"
114 app:layout_constraintEnd_toEndOf="parent"
115 app:layout_constraintTop_toBottomOf="@id/new_currency_name" />
116 </androidx.constraintlayout.widget.ConstraintLayout>
118 <androidx.constraintlayout.widget.ConstraintLayout
119 android:layout_width="wrap_content"
120 android:layout_height="wrap_content"
121 android:id="@+id/params_panel"
122 app:layout_constraintStart_toStartOf="parent"
123 app:layout_constraintEnd_toEndOf="parent"
124 app:layout_constraintBottom_toBottomOf="parent"
125 app:layout_constraintTop_toBottomOf="@id/new_currency_panel">
128 android:id="@+id/position_radio_group"
129 android:layout_width="match_parent"
130 android:layout_height="wrap_content"
131 app:layout_constraintTop_toTopOf="parent"
132 app:layout_constraintStart_toStartOf="parent"
133 app:layout_constraintEnd_toEndOf="parent"
134 android:orientation="horizontal"
135 app:layout_constraintBottom_toTopOf="@id/currency_gap"
136 android:layout_marginBottom="@dimen/text_margin"
140 android:id="@+id/currency_position_left"
141 android:layout_width="wrap_content"
142 android:layout_height="wrap_content"
143 android:layout_weight="1"
144 android:text="@string/currency_position_left" />
147 android:id="@+id/currency_position_right"
148 android:layout_width="wrap_content"
149 android:layout_height="wrap_content"
150 android:layout_weight="1"
151 android:text="@string/currency_position_right" />
155 android:id="@+id/currency_gap"
156 android:layout_width="match_parent"
157 android:layout_height="wrap_content"
158 android:text="@string/currency_has_gap"
159 app:layout_constraintTop_toBottomOf="@id/position_radio_group"
160 app:layout_constraintStart_toStartOf="parent"
161 app:layout_constraintEnd_toEndOf="parent"
162 app:layout_constraintBottom_toBottomOf="parent"/>
164 </androidx.constraintlayout.widget.ConstraintLayout>
166 </androidx.constraintlayout.widget.ConstraintLayout>