]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/fragment_currency_selector_list.xml
themed buttons in the currency selector
[mobile-ledger.git] / app / src / main / res / layout / fragment_currency_selector_list.xml
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.
8   ~
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.
13   ~
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/>.
16   -->
17
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">
27
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" />
38
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">
53
54     </androidx.recyclerview.widget.RecyclerView>
55
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">
66
67         <TextView
68             android:id="@+id/btn_add_new"
69             style="@style/Widget.MaterialComponents.Button.TextButton"
70             android:layout_width="wrap_content"
71             android:layout_height="wrap_content"
72             android:text="@string/add_button"
73             android:layout_margin="@dimen/text_margin"
74             app:layout_constraintBottom_toBottomOf="parent"
75             app:layout_constraintEnd_toEndOf="parent"
76             app:layout_constraintStart_toEndOf="@id/btn_no_currency"
77             app:layout_constraintTop_toTopOf="parent" />
78         <TextView
79             android:layout_width="wrap_content"
80             android:layout_height="wrap_content"
81             android:id="@+id/btn_no_currency"
82             android:text="@string/btn_no_currency"
83             style="@style/Widget.MaterialComponents.Button.TextButton"
84             app:layout_constraintBottom_toBottomOf="parent"
85             app:layout_constraintTop_toTopOf="parent"
86             app:layout_constraintStart_toStartOf="parent"
87             app:layout_constraintEnd_toStartOf="@id/btn_add_new"
88             android:layout_margin="@dimen/text_margin"/>
89
90         <EditText
91             android:id="@+id/new_currency_name"
92             android:layout_width="wrap_content"
93             android:layout_height="wrap_content"
94             android:ems="10"
95             android:hint="@string/new_currency_name_hint"
96             android:inputType="text"
97             android:singleLine="true"
98             android:text=""
99             android:visibility="invisible"
100             app:layout_constraintEnd_toEndOf="parent"
101             app:layout_constraintStart_toStartOf="parent"
102             app:layout_constraintTop_toTopOf="parent" />
103
104         <TextView
105             android:id="@+id/btn_add_currency"
106             style="@style/Widget.MaterialComponents.Button.TextButton"
107             android:layout_width="wrap_content"
108             android:layout_height="wrap_content"
109             android:layout_margin="@dimen/text_margin"
110             android:text="@string/add_button"
111             app:layout_constraintBottom_toBottomOf="parent"
112             app:layout_constraintEnd_toEndOf="parent"
113             app:layout_constraintTop_toBottomOf="@id/new_currency_name" />
114     </androidx.constraintlayout.widget.ConstraintLayout>
115
116     <androidx.constraintlayout.widget.ConstraintLayout
117         android:layout_width="wrap_content"
118         android:layout_height="wrap_content"
119         android:id="@+id/params_panel"
120         app:layout_constraintStart_toStartOf="parent"
121         app:layout_constraintEnd_toEndOf="parent"
122         app:layout_constraintBottom_toBottomOf="parent"
123         app:layout_constraintTop_toBottomOf="@id/new_currency_panel">
124
125         <RadioGroup
126             android:id="@+id/position_radio_group"
127             android:layout_width="match_parent"
128             android:layout_height="wrap_content"
129             app:layout_constraintTop_toTopOf="parent"
130             app:layout_constraintStart_toStartOf="parent"
131             app:layout_constraintEnd_toEndOf="parent"
132             android:orientation="horizontal"
133             app:layout_constraintBottom_toTopOf="@id/currency_gap"
134             android:layout_marginBottom="@dimen/text_margin"
135             >
136
137             <RadioButton
138                 android:id="@+id/currency_position_left"
139                 android:layout_width="wrap_content"
140                 android:layout_height="wrap_content"
141                 android:layout_weight="1"
142                 android:text="@string/currency_position_left" />
143
144             <RadioButton
145                 android:id="@+id/currency_position_right"
146                 android:layout_width="wrap_content"
147                 android:layout_height="wrap_content"
148                 android:layout_weight="1"
149                 android:text="@string/currency_position_right" />
150         </RadioGroup>
151
152         <Switch
153             android:id="@+id/currency_gap"
154             android:layout_width="match_parent"
155             android:layout_height="wrap_content"
156             android:text="@string/currency_has_gap"
157             app:layout_constraintTop_toBottomOf="@id/position_radio_group"
158             app:layout_constraintStart_toStartOf="parent"
159             app:layout_constraintEnd_toEndOf="parent"
160             app:layout_constraintBottom_toBottomOf="parent"/>
161
162     </androidx.constraintlayout.widget.ConstraintLayout>
163
164 </androidx.constraintlayout.widget.ConstraintLayout>