From bde80262e573d118d30b7b67f0b2e674b7cb1186 Mon Sep 17 00:00:00 2001 From: Andriy Druk Date: Mon, 2 May 2016 23:51:02 +0300 Subject: [PATCH] add orientation changes on register screens --- app/src/main/AndroidManifest.xml | 2 -- .../druk/bonjour/browser/ui/RegistrationsActivity.java | 10 ++-------- app/src/main/res/layout/blank_activity.xml | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 854ddd8..3263ca0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -53,12 +53,10 @@ diff --git a/app/src/main/java/com/druk/bonjour/browser/ui/RegistrationsActivity.java b/app/src/main/java/com/druk/bonjour/browser/ui/RegistrationsActivity.java index 5a7489d..5c66ee2 100644 --- a/app/src/main/java/com/druk/bonjour/browser/ui/RegistrationsActivity.java +++ b/app/src/main/java/com/druk/bonjour/browser/ui/RegistrationsActivity.java @@ -141,14 +141,8 @@ public void onStop() { private void updateServices() { List registeredServices = BonjourApplication.getRegistrationManager(getContext()).getRegisteredServices(); - if (registeredServices.size() > 0) { - adapter.swap(registeredServices); - mRecyclerView.setVisibility(View.VISIBLE); - mNoServiceView.setVisibility(View.GONE); - } else { - mRecyclerView.setVisibility(View.GONE); - mNoServiceView.setVisibility(View.VISIBLE); - } + adapter.swap(registeredServices); + mNoServiceView.setVisibility(registeredServices.size() > 0 ? View.GONE : View.VISIBLE); } } } diff --git a/app/src/main/res/layout/blank_activity.xml b/app/src/main/res/layout/blank_activity.xml index 7367180..8e505a6 100644 --- a/app/src/main/res/layout/blank_activity.xml +++ b/app/src/main/res/layout/blank_activity.xml @@ -40,6 +40,6 @@ android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginTop="?attr/actionBarSize"/> + app:layout_behavior="@string/appbar_scrolling_view_behavior"/> \ No newline at end of file