Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 0a68771

Browse files
author
evgenii
committed
Fixed a bug with wrong resizing of the layout after showing keyboard on small screens.
1 parent 54b68a0 commit 0a68771

File tree

2 files changed

+95
-94
lines changed

2 files changed

+95
-94
lines changed

app/src/main/java/com/blogspot/e_kanivets/moneytracker/fragment/AddExpenseFragment.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.blogspot.e_kanivets.moneytracker.fragment;
22

33
import android.app.Activity;
4-
import android.content.Context;
5-
import android.content.res.Configuration;
64
import android.os.Bundle;
75
import android.support.v4.app.Fragment;
86
import android.support.v7.app.ActionBar;
@@ -13,8 +11,6 @@
1311
import android.view.MenuItem;
1412
import android.view.View;
1513
import android.view.ViewGroup;
16-
import android.view.inputmethod.InputMethodManager;
17-
import android.widget.AdapterView;
1814
import android.widget.ArrayAdapter;
1915
import android.widget.EditText;
2016
import android.widget.Spinner;
@@ -25,7 +21,6 @@
2521
import com.blogspot.e_kanivets.moneytracker.helper.MTHelper;
2622
import com.blogspot.e_kanivets.moneytracker.model.Account;
2723
import com.blogspot.e_kanivets.moneytracker.model.Record;
28-
import com.blogspot.e_kanivets.moneytracker.util.AppUtils;
2924

3025
import java.util.ArrayList;
3126
import java.util.Date;

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

Lines changed: 95 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -7,106 +7,112 @@
77
android:background="@color/white"
88
android:orientation="vertical">
99

10-
<LinearLayout
10+
<ScrollView
1111
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
13-
android:orientation="vertical">
14-
15-
<LinearLayout
16-
android:layout_width="fill_parent"
17-
android:layout_height="wrap_content"
18-
android:layout_margin="2dp"
19-
android:orientation="horizontal">
20-
21-
<TextView
22-
android:layout_width="match_parent"
23-
android:layout_height="match_parent"
24-
android:layout_weight="3"
25-
android:gravity="center_vertical|left"
26-
android:paddingLeft="10dp"
27-
android:text="@string/title" />
28-
29-
<EditText
30-
android:id="@+id/et_title"
31-
android:layout_width="match_parent"
32-
android:layout_height="match_parent"
33-
android:layout_marginRight="10dp"
34-
android:layout_weight="1" />
35-
</LinearLayout>
12+
android:layout_height="match_parent">
3613

3714
<LinearLayout
3815
android:layout_width="match_parent"
3916
android:layout_height="wrap_content"
40-
android:layout_margin="2dp"
41-
android:layout_weight="1"
42-
android:orientation="horizontal">
17+
android:orientation="vertical">
4318

44-
<TextView
45-
android:layout_width="match_parent"
46-
android:layout_height="match_parent"
47-
android:layout_weight="3"
48-
android:gravity="center_vertical|left"
49-
android:paddingLeft="10dp"
50-
android:text="@string/category" />
51-
52-
<EditText
53-
android:id="@+id/et_category"
54-
android:layout_width="match_parent"
55-
android:layout_height="match_parent"
56-
android:layout_marginRight="10dp"
57-
android:layout_weight="1" />
58-
59-
</LinearLayout>
60-
61-
<LinearLayout
62-
android:layout_width="match_parent"
63-
android:layout_height="wrap_content"
64-
android:layout_gravity="center_horizontal"
65-
android:layout_margin="2dp"
66-
android:layout_weight="1"
67-
android:orientation="horizontal">
68-
69-
<TextView
19+
<LinearLayout
20+
android:layout_width="fill_parent"
21+
android:layout_height="wrap_content"
22+
android:layout_margin="2dp"
23+
android:orientation="horizontal">
24+
25+
<TextView
26+
android:layout_width="match_parent"
27+
android:layout_height="match_parent"
28+
android:layout_weight="3"
29+
android:gravity="center_vertical|left"
30+
android:paddingLeft="10dp"
31+
android:text="@string/title" />
32+
33+
<EditText
34+
android:id="@+id/et_title"
35+
android:layout_width="match_parent"
36+
android:layout_height="match_parent"
37+
android:layout_marginRight="10dp"
38+
android:layout_weight="1" />
39+
</LinearLayout>
40+
41+
<LinearLayout
7042
android:layout_width="match_parent"
71-
android:layout_height="match_parent"
72-
android:layout_weight="3"
73-
android:gravity="center_vertical|left"
74-
android:paddingLeft="10dp"
75-
android:text="@string/price" />
76-
77-
<EditText
78-
android:id="@+id/et_price"
43+
android:layout_height="wrap_content"
44+
android:layout_margin="2dp"
45+
android:layout_weight="1"
46+
android:orientation="horizontal">
47+
48+
<TextView
49+
android:layout_width="match_parent"
50+
android:layout_height="match_parent"
51+
android:layout_weight="3"
52+
android:gravity="center_vertical|left"
53+
android:paddingLeft="10dp"
54+
android:text="@string/category" />
55+
56+
<EditText
57+
android:id="@+id/et_category"
58+
android:layout_width="match_parent"
59+
android:layout_height="match_parent"
60+
android:layout_marginRight="10dp"
61+
android:layout_weight="1" />
62+
63+
</LinearLayout>
64+
65+
<LinearLayout
7966
android:layout_width="match_parent"
8067
android:layout_height="wrap_content"
81-
android:layout_marginRight="10dp"
68+
android:layout_gravity="center_horizontal"
69+
android:layout_margin="2dp"
8270
android:layout_weight="1"
83-
android:inputType="numberSigned" />
84-
85-
</LinearLayout>
86-
87-
<LinearLayout
88-
android:layout_width="match_parent"
89-
android:layout_height="wrap_content"
90-
android:layout_gravity="center_horizontal"
91-
android:layout_margin="2dp"
92-
android:layout_weight="1"
93-
android:orientation="horizontal">
94-
95-
<TextView
71+
android:orientation="horizontal">
72+
73+
<TextView
74+
android:layout_width="match_parent"
75+
android:layout_height="match_parent"
76+
android:layout_weight="3"
77+
android:gravity="center_vertical|left"
78+
android:paddingLeft="10dp"
79+
android:text="@string/price" />
80+
81+
<EditText
82+
android:id="@+id/et_price"
83+
android:layout_width="match_parent"
84+
android:layout_height="wrap_content"
85+
android:layout_marginRight="10dp"
86+
android:layout_weight="1"
87+
android:inputType="numberSigned" />
88+
89+
</LinearLayout>
90+
91+
<LinearLayout
9692
android:layout_width="match_parent"
97-
android:layout_height="match_parent"
98-
android:layout_weight="3"
99-
android:gravity="center_vertical|left"
100-
android:paddingLeft="10dp"
101-
android:text="@string/account" />
102-
103-
<Spinner
104-
android:layout_width="wrap_content"
10593
android:layout_height="wrap_content"
106-
android:id="@+id/spinner_account"
107-
android:layout_marginRight="10dp"
108-
android:layout_weight="1" />
109-
94+
android:layout_gravity="center_horizontal"
95+
android:layout_margin="2dp"
96+
android:layout_weight="1"
97+
android:orientation="horizontal">
98+
99+
<TextView
100+
android:layout_width="match_parent"
101+
android:layout_height="match_parent"
102+
android:layout_weight="3"
103+
android:gravity="center_vertical|left"
104+
android:paddingLeft="10dp"
105+
android:text="@string/account" />
106+
107+
<Spinner
108+
android:layout_width="wrap_content"
109+
android:layout_height="wrap_content"
110+
android:id="@+id/spinner_account"
111+
android:layout_marginRight="10dp"
112+
android:layout_weight="1" />
113+
114+
</LinearLayout>
110115
</LinearLayout>
111-
</LinearLayout>
116+
117+
</ScrollView>
112118
</LinearLayout>

0 commit comments

Comments
 (0)