From 44d2384aecb2aabc2d833ae9689234ce17ebe806 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sun, 27 Aug 2017 18:26:49 +0200 Subject: [PATCH] Use gridlayout from support library Add gridlayout dependency and use it instead of heavily nested linearlayouts (fragment_live_activity) or to simplify existing grid layouts. --- app/build.gradle | 1 + .../res/layout/activity_db_management.xml | 82 ++++++++--------- app/src/main/res/layout/activity_debug.xml | 90 +++++++------------ .../res/layout/fragment_live_activity.xml | 44 ++++----- 4 files changed, 89 insertions(+), 128 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c611794b..06027cc0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -68,6 +68,7 @@ dependencies { compile 'com.android.support:cardview-v7:25.3.1' compile 'com.android.support:recyclerview-v7:25.3.1' compile 'com.android.support:support-v4:25.3.1' + compile 'com.android.support:gridlayout-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.github.tony19:logback-android-classic:1.1.1-6' compile 'org.slf4j:slf4j-api:1.7.7' diff --git a/app/src/main/res/layout/activity_db_management.xml b/app/src/main/res/layout/activity_db_management.xml index a66eba21..ebd0eb99 100644 --- a/app/src/main/res/layout/activity_db_management.xml +++ b/app/src/main/res/layout/activity_db_management.xml @@ -6,53 +6,51 @@ - + android:paddingTop="@dimen/activity_vertical_margin" + grid:alignmentMode="alignBounds" + grid:columnCount="2"> - +