Skip to content

Commit bf212e5

Browse files
committed
more small layout tweeks
1 parent 277279e commit bf212e5

File tree

5 files changed

+55
-31
lines changed

5 files changed

+55
-31
lines changed

app/src/main/java/org/torproject/android/OrbotActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class OrbotActivity : BaseActivity() {
8383

8484
val navController: NavController = findNavController(R.id.nav_fragment)
8585
val bottomNavigationView: BottomNavigationView = findViewById(R.id.bottom_navigation)
86-
8786
bottomNavigationView.setupWithNavController(navController)
8887

8988
bottomNavigationView.menu.findItem(R.id.connectFragment).isChecked = true
@@ -159,6 +158,7 @@ class OrbotActivity : BaseActivity() {
159158
}
160159

161160
override fun onBackPressed() {
161+
super.onBackPressed()
162162
finish()
163163
}
164164

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

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.constraintlayout.widget.ConstraintLayout
3-
android:layout_width="match_parent"
4-
android:layout_height="match_parent"
5-
android:layout_marginTop="140dp"
6-
android:backgroundTint="@color/new_background"
7-
xmlns:android="http://schemas.android.com/apk/res/android"
8-
xmlns:app="http://schemas.android.com/apk/res-auto">
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
xmlns:tools="http://schemas.android.com/tools"
6+
android:backgroundTint="@color/new_background"
7+
xmlns:android="http://schemas.android.com/apk/res/android"
8+
xmlns:app="http://schemas.android.com/apk/res-auto"
9+
app:layout_behavior="@string/appbar_scrolling_view_behavior"
10+
>
11+
12+
13+
14+
<com.google.android.material.appbar.AppBarLayout
15+
android:layout_width="0dp"
16+
android:layout_height="wrap_content"
17+
app:layout_constraintEnd_toEndOf="parent"
18+
app:layout_constraintStart_toStartOf="parent"
19+
app:layout_constraintTop_toTopOf="parent"
20+
android:id="@+id/toolbarGroup"
21+
>
22+
23+
<androidx.appcompat.widget.Toolbar
24+
android:id="@+id/toolbar"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:background="?attr/colorPrimary"
28+
android:minHeight="?attr/actionBarSize"
29+
android:theme="?attr/actionBarTheme"
30+
tools:layout_editor_absoluteX="0dp"
31+
tools:layout_editor_absoluteY="0dp" />
32+
33+
</com.google.android.material.appbar.AppBarLayout>
934

1035
<fragment
1136
android:id="@+id/nav_fragment"
1237
android:name="androidx.navigation.fragment.NavHostFragment"
1338
android:layout_width="match_parent"
14-
android:layout_height="0dp"
39+
android:layout_height="wrap_content"
40+
android:layout_marginTop="?attr/actionBarSize"
41+
1542
app:defaultNavHost="true"
16-
app:layout_constraintTop_toTopOf="parent"
43+
app:layout_constraintTop_toBottomOf="@+id/toolbarGroup"
1744
app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
1845
app:layout_constraintLeft_toLeftOf="parent"
1946
app:layout_constraintRight_toRightOf="parent"
20-
app:layout_constraintVertical_bias="0.5"
47+
app:layout_constraintVertical_bias="0"
2148
app:navGraph="@navigation/nav_graph" />
2249

2350
<com.google.android.material.bottomnavigation.BottomNavigationView
@@ -28,6 +55,7 @@
2855
app:layout_constraintStart_toStartOf="parent"
2956
app:layout_constraintEnd_toEndOf="parent"
3057
app:layout_constraintBottom_toBottomOf="parent"
58+
android:fitsSystemWindows="true"
3159
app:menu="@menu/main_bottom_nav"
3260
app:itemTextColor="@color/bottom_nav_color"
3361
app:itemIconTint="@color/bottom_nav_color" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:app="http://schemas.android.com/apk/res-auto"
55
xmlns:tools="http://schemas.android.com/tools"
66
android:layout_width="match_parent"
7-
android:layout_height="match_parent"
7+
android:layout_height="wrap_content"
88
android:backgroundTint="@color/new_background">
99

1010
<ProgressBar

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="wrap_content"
7-
android:layout_marginBottom="@dimen/button_horizontal_large_margin">
7+
android:layout_marginBottom="@dimen/button_horizontal_large_margin"
8+
android:paddingTop="30dp"
9+
>
810

911
<androidx.constraintlayout.widget.ConstraintLayout
1012
android:layout_width="match_parent"
@@ -19,7 +21,6 @@
1921
android:layout_width="match_parent"
2022
android:layout_height="wrap_content"
2123
app:layout_constraintStart_toStartOf="parent"
22-
app:layout_constraintTop_toBottomOf="@+id/ivHeart"
2324
android:clickable="true">
2425

2526
<androidx.constraintlayout.widget.ConstraintLayout
@@ -31,8 +32,8 @@
3132

3233
<ImageView
3334
android:id="@+id/ivHeart"
34-
android:layout_width="140sp"
35-
android:layout_height="140dp"
35+
android:layout_width="120sp"
36+
android:layout_height="120dp"
3637
android:src="@drawable/orbiesnoozing"
3738
app:layout_constraintBottom_toTopOf="@+id/tvTitle"
3839
app:layout_constraintEnd_toEndOf="parent"
@@ -115,8 +116,8 @@
115116

116117
<ImageView
117118
android:id="@+id/ivHeader"
118-
android:layout_width="140sp"
119-
android:layout_height="140sp"
119+
android:layout_width="120sp"
120+
android:layout_height="120sp"
120121
android:src="@drawable/kindness"
121122
app:layout_constraintStart_toStartOf="parent"
122123
app:layout_constraintEnd_toEndOf="parent"
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6+
android:orientation="vertical"
67
tools:context=".MoreFragment">
78

89
<!-- TODO: Update blank fragment layout -->
@@ -16,24 +17,18 @@
1617
android:layout_height="wrap_content"
1718
android:id="@+id/lvMoreActions"/>
1819

19-
<LinearLayout
20+
<TextView
21+
android:id="@+id/tvVersion"
2022
android:layout_width="match_parent"
2123
android:layout_height="wrap_content"
22-
android:layout_gravity="bottom|center"
23-
android:orientation="horizontal"
24-
>
24+
android:text="Orbot vX.X.X"
25+
/>
26+
2527
<ImageView
2628
android:layout_width="64dp"
2729
android:layout_height="64dp"
2830
android:src="@drawable/orbion"
2931
android:layout_margin="12dp"
32+
android:layout_gravity="center_horizontal"
3033
/>
31-
<TextView
32-
android:id="@+id/tvVersion"
33-
android:layout_width="wrap_content"
34-
android:layout_height="wrap_content"
35-
android:text="Orbot vX.X.X"
36-
android:layout_marginBottom="100dp"
37-
/>
38-
</LinearLayout>
39-
</FrameLayout>
34+
</LinearLayout>

0 commit comments

Comments
 (0)