From 8d742b7e30cb0d7cc1853a4a3d447e09c59d79aa Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Sun, 15 May 2016 10:45:56 +1000 Subject: [PATCH] Correctly expand list of nearby people to the entire height of the screen. If the device is small, then the "Conenct and trade apps with people near you" header takes up too much space and we end up not being able to see any nearby people at all, even if they are in the list. As such, this also removes that header for "small" and "ldpi" devices. During testing I found that "small" was not enough, because a 240x400 screen is considered "medium" and there is not enough space. ldpi seems to be a reasonable metric for "that header is going to be taking valuable space and should not be shown then". All larger devices retain the header and seem to look nice. This also pushes the "Can't find what you're looking for?" message and associated buttons right to the bottom of the screen. This is more in line with the original design. Fixes #604. --- .../fdroid/views/swap/StartSwapView.java | 4 +- .../res/layout-ldpi/start_swap_header.xml | 7 + .../res/layout-small/start_swap_header.xml | 7 + app/src/main/res/layout/start_swap_header.xml | 32 ++ app/src/main/res/layout/swap_blank.xml | 384 ++++++++---------- 5 files changed, 225 insertions(+), 209 deletions(-) create mode 100644 app/src/main/res/layout-ldpi/start_swap_header.xml create mode 100644 app/src/main/res/layout-small/start_swap_header.xml create mode 100644 app/src/main/res/layout/start_swap_header.xml diff --git a/app/src/main/java/org/fdroid/fdroid/views/swap/StartSwapView.java b/app/src/main/java/org/fdroid/fdroid/views/swap/StartSwapView.java index 3b15c261f..f0b170dfb 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/swap/StartSwapView.java +++ b/app/src/main/java/org/fdroid/fdroid/views/swap/StartSwapView.java @@ -26,7 +26,7 @@ import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.ProgressBar; -import android.widget.ScrollView; +import android.widget.RelativeLayout; import android.widget.TextView; import org.fdroid.fdroid.FDroidApp; @@ -42,7 +42,7 @@ import cc.mvdan.accesspoint.WifiApControl; import rx.Subscriber; import rx.Subscription; -public class StartSwapView extends ScrollView implements SwapWorkflowActivity.InnerView { +public class StartSwapView extends RelativeLayout implements SwapWorkflowActivity.InnerView { private static final String TAG = "StartSwapView"; diff --git a/app/src/main/res/layout-ldpi/start_swap_header.xml b/app/src/main/res/layout-ldpi/start_swap_header.xml new file mode 100644 index 000000000..2f8a78fdc --- /dev/null +++ b/app/src/main/res/layout-ldpi/start_swap_header.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout-small/start_swap_header.xml b/app/src/main/res/layout-small/start_swap_header.xml new file mode 100644 index 000000000..2f8a78fdc --- /dev/null +++ b/app/src/main/res/layout-small/start_swap_header.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/start_swap_header.xml b/app/src/main/res/layout/start_swap_header.xml new file mode 100644 index 000000000..a3163d65f --- /dev/null +++ b/app/src/main/res/layout/start_swap_header.xml @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/swap_blank.xml b/app/src/main/res/layout/swap_blank.xml index 0c0f2c91a..6266be168 100644 --- a/app/src/main/res/layout/swap_blank.xml +++ b/app/src/main/res/layout/swap_blank.xml @@ -9,232 +9,202 @@ xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + tools:context=".views.swap.SwapWorkflowActivity"> + + + + + android:layout_below="@id/header" + android:padding="10dp" + android:orientation="horizontal"> - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + tools:text="@string/swap_visible_bluetooth" + android:textSize="18sp" /> - - + tools:text="SP-120" + android:textColor="@color/swap_light_text" /> - - - - - - - - -