Skip to content

Commit 7d83b17

Browse files
authored
Merge pull request Catrobat#3790 from juliajulie95/CATROID-745
CATROID-745 Implement action buttons instead of bottom bar
2 parents b8debae + 08793d0 commit 7d83b17

5 files changed

+85
-66
lines changed

catroid/src/main/res/layout/activity_recycler.xml

+5-6
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@
3434
android:layout_width="match_parent"
3535
android:layout_height="match_parent">
3636

37-
<include
38-
android:id="@+id/bottom_bar"
39-
layout="@layout/bottom_bar" />
40-
4137
<FrameLayout
4238
android:id="@+id/fragment_container"
4339
android:layout_width="match_parent"
44-
android:layout_height="match_parent"
45-
android:layout_above="@id/bottom_bar" />
40+
android:layout_height="match_parent" />
41+
42+
<include
43+
android:id="@+id/bottom_bar"
44+
layout="@layout/list_action_buttons" />
4645

4746
</RelativeLayout>
4847
</LinearLayout>

catroid/src/main/res/layout/activity_sprite_attributes.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
app:layoutManager="LinearLayoutManager">
4141
</androidx.recyclerview.widget.RecyclerView>
4242

43-
<include layout="@layout/bottom_bar" />
43+
<include layout="@layout/list_action_buttons" />
4444

4545
</RelativeLayout>
4646
</LinearLayout>

catroid/src/main/res/layout/bottom_bar.xml

-45
This file was deleted.

catroid/src/main/res/layout/fragment_user_defined_brick_list.xml

+18-14
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424

2525

2626
<!-- Overdraw lint warning is ignored - fragments need refactoring -->
27-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
27+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2828
xmlns:tools="http://schemas.android.com/tools"
29+
xmlns:app="http://schemas.android.com/apk/res-auto"
2930
android:id="@+id/fragment_user_defined_brick_list"
3031
android:layout_width="match_parent"
3132
android:layout_height="match_parent"
@@ -36,18 +37,16 @@
3637
<ListView
3738
android:id="@android:id/list"
3839
android:layout_width="match_parent"
39-
android:layout_height="0dp"
40-
android:layout_weight="1"
40+
android:layout_height="match_parent"
4141
android:cacheColorHint="#00000000"
4242
android:divider="@android:color/transparent" />
4343

4444
<LinearLayout
4545
android:id="@android:id/empty"
4646
android:layout_width="match_parent"
47-
android:layout_height="0dp"
47+
android:layout_height="match_parent"
4848
android:clickable="true"
49-
android:focusable="true"
50-
android:layout_weight="1">
49+
android:focusable="true">
5150

5251
<TextView
5352
android:layout_width="match_parent"
@@ -58,14 +57,19 @@
5857

5958
</LinearLayout>
6059

61-
<ImageButton
60+
<com.google.android.material.floatingactionbutton.FloatingActionButton
6261
android:id="@+id/button_add_user_brick"
63-
android:layout_width="match_parent"
64-
android:layout_height="@dimen/actionbar_height"
65-
android:layout_weight="0"
66-
android:layout_gravity="center|bottom"
67-
android:background="@drawable/button_background_selector"
62+
android:layout_width="wrap_content"
63+
android:layout_height="wrap_content"
64+
android:layout_alignParentBottom="true"
65+
android:layout_alignParentEnd="true"
66+
android:layout_marginEnd="@dimen/material_design_spacing_large"
67+
android:layout_marginBottom="@dimen/material_design_spacing_large"
6868
android:src="@drawable/ic_plus"
69-
tools:ignore="ContentDescription"/>
69+
android:tint="@color/solid_white"
70+
android:theme="@style/Theme.AppCompat"
71+
app:backgroundTint="@color/orange"
72+
app:elevation="10dp"
73+
android:onClick="handleAddButton" />
7074

71-
</LinearLayout>
75+
</RelativeLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Catroid: An on-device visual programming system for Android devices
4+
~ Copyright (C) 2010-2018 The Catrobat Team
5+
~ (<http://developer.catrobat.org/credits>)
6+
~
7+
~ This program is free software: you can redistribute it and/or modify
8+
~ it under the terms of the GNU Affero General Public License as
9+
~ published by the Free Software Foundation, either version 3 of the
10+
~ License, or (at your option) any later version.
11+
~
12+
~ An additional term exception under section 7 of the GNU Affero
13+
~ General Public License, version 3, is available at
14+
~ http://developer.catrobat.org/license_additional_term
15+
~
16+
~ This program is distributed in the hope that it will be useful,
17+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
~ GNU Affero General Public License for more details.
20+
~
21+
~ You should have received a copy of the GNU Affero General Public License
22+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
-->
24+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
25+
xmlns:app="http://schemas.android.com/apk/res-auto"
26+
android:id="@+id/bottom_bar"
27+
android:layout_width="match_parent"
28+
android:layout_height="match_parent"
29+
android:orientation="horizontal">
30+
31+
<com.google.android.material.floatingactionbutton.FloatingActionButton
32+
android:id="@+id/button_play"
33+
android:layout_width="wrap_content"
34+
android:layout_height="wrap_content"
35+
android:layout_above="@id/button_add"
36+
android:layout_alignWithParentIfMissing="true"
37+
android:layout_alignParentEnd="true"
38+
android:layout_margin="@dimen/material_design_spacing_large"
39+
android:src="@drawable/ic_play"
40+
android:tint="@color/solid_white"
41+
android:theme="@style/Theme.AppCompat"
42+
app:backgroundTint="@color/orange"
43+
app:elevation="10dp"
44+
android:onClick="handlePlayButton" />
45+
46+
<com.google.android.material.floatingactionbutton.FloatingActionButton
47+
android:id="@+id/button_add"
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content"
50+
android:layout_alignParentBottom="true"
51+
android:layout_alignParentEnd="true"
52+
android:layout_marginEnd="@dimen/material_design_spacing_large"
53+
android:layout_marginBottom="@dimen/material_design_spacing_large"
54+
android:src="@drawable/ic_plus"
55+
android:tint="@color/solid_white"
56+
android:theme="@style/Theme.AppCompat"
57+
app:backgroundTint="@color/orange"
58+
app:elevation="10dp"
59+
android:onClick="handleAddButton" />
60+
61+
</RelativeLayout>

0 commit comments

Comments
 (0)