Skip to content

Commit c8cafb4

Browse files
authored
Merge pull request #90 from Rhymmor/layout-issue
Fix layout issue for 480x800 display - looks fine! Thanks!
2 parents b7b8966 + 3329199 commit c8cafb4

File tree

2 files changed

+46
-48
lines changed

2 files changed

+46
-48
lines changed

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

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:layout_height="match_parent"
88
android:background="@color/colorBackground">
99

10+
1011
<RelativeLayout
1112
android:id="@+id/top_scenario_bar"
1213
android:layout_height="wrap_content"
@@ -15,15 +16,18 @@
1516
android:orientation="vertical"
1617
android:layout_marginTop="0dp"
1718
>
19+
1820
<RelativeLayout
1921
android:id="@+id/scenario_text_bar"
20-
android:layout_height="wrap_content"
2122
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
2224
android:layout_centerHorizontal="true"
23-
android:orientation="vertical"
24-
android:layout_margin="30dp"
25-
>
26-
<include layout="@layout/selected_scenario"/>
25+
android:layout_marginStart="28dp"
26+
android:layout_marginTop="28dp"
27+
android:layout_marginBottom="16dp"
28+
android:orientation="vertical">
29+
30+
<include layout="@layout/selected_scenario" />
2731
</RelativeLayout>
2832
<View android:id="@+id/line_scenario"
2933
android:layout_height="1dp"
@@ -44,81 +48,74 @@
4448

4549
<ImageView
4650
android:id="@+id/imageView1"
47-
android:layout_width="300dp"
48-
android:layout_height="300dp"
49-
android:background="@color/colorImageViewBackground"
51+
android:layout_width="280dp"
52+
android:layout_height="280dp"
5053
android:layout_centerHorizontal="true"
54+
android:background="@color/colorImageViewBackground"
5155
android:scaleType="centerCrop" />
5256

5357
<RelativeLayout
5458
android:id="@+id/imageButtonBar"
55-
android:layout_width="match_parent"
59+
android:layout_width="280dp"
5660
android:layout_height="62dp"
57-
android:layout_below="@+id/primerdivisor"
58-
android:layout_marginTop="240dp"
59-
android:layout_centerHorizontal="true"
6061
android:background="@color/colorImageViewBarBackground"
61-
android:orientation="horizontal">
62+
android:orientation="horizontal"
63+
android:layout_above="@+id/suggest"
64+
android:layout_alignStart="@+id/imageView1">
6265

6366
<Button
6467
android:id="@+id/btn_capture"
68+
style="?android:attr/buttonStyleSmall"
6569
android:layout_width="wrap_content"
6670
android:layout_height="wrap_content"
67-
android:text=""
68-
android:layout_alignParentLeft="true"
69-
android:layout_alignParentTop="true"
70-
android:layout_marginTop="20dp"
71-
android:layout_marginLeft="10dp"
71+
android:layout_marginStart="10dp"
72+
android:background="@color/colorImageViewButtonBackground"
7273
android:drawableTop="@drawable/b_start_cam"
7374
android:gravity="center"
74-
style="?android:attr/buttonStyleSmall"
75-
android:background="@color/colorImageViewButtonBackground"
75+
android:text=""
7676
android:textColor="#ffffffff"
77-
/>
77+
android:layout_alignTop="@+id/resultPreviewtText"
78+
android:layout_alignParentStart="true" />
7879

7980
<Button
8081
android:id="@+id/btn_ImageOpen"
82+
style="?android:attr/buttonStyleSmall"
8183
android:layout_width="wrap_content"
8284
android:layout_height="wrap_content"
83-
android:text=""
84-
android:layout_alignParentRight="true"
85-
android:layout_alignParentTop="true"
86-
android:layout_marginTop="20dp"
87-
android:layout_marginRight="20dp"
85+
android:layout_marginEnd="10dp"
86+
android:background="@color/colorImageViewButtonBackground"
8887
android:drawableTop="@drawable/b_open_image"
8988
android:gravity="center"
90-
style="?android:attr/buttonStyleSmall"
91-
android:background="@color/colorImageViewButtonBackground"
89+
android:text=""
9290
android:textColor="#ffffffff"
93-
/>
91+
android:layout_alignTop="@+id/resultPreviewtText"
92+
android:layout_alignParentEnd="true" />
9493

9594
<TextView
9695
android:id="@+id/resultPreviewtText"
97-
android:text="Some"
98-
android:textColor="@color/colorTextWhite"
9996
android:layout_width="wrap_content"
10097
android:layout_height="wrap_content"
98+
android:layout_centerHorizontal="true"
10199
android:layout_marginTop="10dp"
102100
android:gravity="center"
103-
android:layout_centerHorizontal="true"
104101
android:minHeight="30dp"
105-
android:textSize="18sp"
106-
/>
102+
android:text="Some"
103+
android:textColor="@color/colorTextWhite"
104+
android:textSize="18sp" />
107105
</RelativeLayout>
108106

109107
<Button
110108
android:id="@+id/suggest"
111-
android:text="Recognize"
112-
android:textColor="#ffffff"
113-
android:textSize="18dp"
114-
android:layout_width="200dp"
115-
android:background="@drawable/b_recognize_enabled"
116-
android:layout_height="56dp"
117-
android:layout_marginTop="30dp"
118-
android:layout_marginBottom="30dp"
109+
android:layout_width="180dp"
110+
android:layout_height="40dp"
119111
android:layout_below="@+id/imageView1"
120112
android:layout_centerHorizontal="true"
121-
/>
113+
android:layout_marginBottom="30dp"
114+
android:layout_marginTop="30dp"
115+
android:background="@drawable/b_recognize_enabled"
116+
android:text="Recognize"
117+
android:textColor="#ffffff"
118+
android:textSize="18dp" />
122119

123120
<EditText
124121
android:id="@+id/consoleEditText"

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
android:layout_marginBottom="0dp"
99
android:id="@+id/selectedScenarioTopBar"
1010
>
11+
1112
<TextView
1213
android:id="@+id/selectedScenarioText"
13-
android:layout_marginRight="50dp"
14-
android:layout_marginBottom="0dp"
1514
android:layout_width="wrap_content"
16-
android:textColor="@color/colorTextWhite"
17-
android:textSize="20sp"
15+
android:layout_height="wrap_content"
1816
android:layout_centerVertical="true"
17+
android:layout_marginBottom="0dp"
18+
android:layout_marginRight="50dp"
1919
android:text="Please select scenario"
20-
android:layout_height="wrap_content"/>
20+
android:textColor="@color/colorTextWhite"
21+
android:textSize="16sp" />
2122

2223
<ImageView
2324
android:id="@+id/ico_scenarioInfo"

0 commit comments

Comments
 (0)