From 5a512a304a16a36a1a978ad086cfd22caffd9757 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 17 Jun 2018 02:12:33 +0200 Subject: [PATCH] Fix margins and paddings --- .../moodl/DataManagers/CurrencyData/CurrencyCardview.java | 3 ++- .../DataManagers/CurrencyData/CurrencyDetailsList.java | 6 +++--- .../main/res/layout/fragment_overview_homeactivity.xml | 6 +++--- app/src/main/res/layout/fragment_summary_homeactivity.xml | 8 ++------ .../main/res/layout/fragment_watchlist_homeactivity.xml | 8 ++------ 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java index 71d52d2..73b8d9f 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyCardview.java @@ -212,7 +212,8 @@ public class CurrencyCardview extends CardView { private void setupCardView() { ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT); - layoutParams.setMargins((int) MoodlBox.convertDpToPx(10, getResources()), 0, (int) MoodlBox.convertDpToPx(10, getResources()), (int) MoodlBox.convertDpToPx(10, getResources())); + int margin = (int) MoodlBox.convertDpToPx(10, getResources()); + layoutParams.setMargins(margin, margin, margin, 0); setLayoutParams(layoutParams); diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyDetailsList.java b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyDetailsList.java index 98f7a7b..0978aac 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyDetailsList.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/CurrencyData/CurrencyDetailsList.java @@ -53,17 +53,17 @@ public class CurrencyDetailsList { new Response.Listener() { @Override public void onResponse(String response) { + if (response.length() > 0) { processDetailResult(response, callBack); - + upToDate = true; } - upToDate = true; } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { - upToDate = true; + } }); diff --git a/app/src/main/res/layout/fragment_overview_homeactivity.xml b/app/src/main/res/layout/fragment_overview_homeactivity.xml index 31206f1..95e812b 100644 --- a/app/src/main/res/layout/fragment_overview_homeactivity.xml +++ b/app/src/main/res/layout/fragment_overview_homeactivity.xml @@ -51,8 +51,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="?attr/actionBarSize" - android:background="@color/summary_background" - android:paddingTop="15dp"> + android:background="@color/summary_background"> + android:dividerHeight="0dp" + android:clipChildren="false"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_summary_homeactivity.xml b/app/src/main/res/layout/fragment_summary_homeactivity.xml index fe1a7e9..00424b0 100644 --- a/app/src/main/res/layout/fragment_summary_homeactivity.xml +++ b/app/src/main/res/layout/fragment_summary_homeactivity.xml @@ -82,7 +82,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:layout_marginTop="10dp"> + android:clipChildren="false"> diff --git a/app/src/main/res/layout/fragment_watchlist_homeactivity.xml b/app/src/main/res/layout/fragment_watchlist_homeactivity.xml index df28fa1..296d7ee 100644 --- a/app/src/main/res/layout/fragment_watchlist_homeactivity.xml +++ b/app/src/main/res/layout/fragment_watchlist_homeactivity.xml @@ -74,7 +74,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:paddingTop="25dp"> + android:clipChildren="false">