From bbbae5639dba4595b30f60268995fc8c84c535c0 Mon Sep 17 00:00:00 2001 From: Jacques Foucry Date: Sun, 22 May 2016 18:30:58 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20des=20dimensions=20des=20toolbar?= =?UTF-8?q?=20pour=20faire=20appara=C3=AEtre=20le=20bouton=20back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/foucry/pilldroid/MedicamentDetailActivity.java | 6 +++++- .../net/foucry/pilldroid/MedicamentDetailFragment.java | 1 + .../java/net/foucry/pilldroid/MedicamentListActivity.java | 7 +++++-- app/src/main/res/layout/activity_medicament_detail.xml | 4 +--- app/src/main/res/values/dimens.xml | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java index 3ef5acf..898fd15 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java @@ -23,7 +23,11 @@ public class MedicamentDetailActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_medicament_detail); Toolbar toolbar = (Toolbar) findViewById(R.id.detail_toolbar); - setSupportActionBar(toolbar); + + if (toolbar != null) { + setSupportActionBar(toolbar); + toolbar.setTitle(getTitle()); + } FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java index 2a4f954..cceaf80 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.support.design.widget.CollapsingToolbarLayout; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.support.v7.app.ActionBarActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java index d24cd91..8ce1b1f 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java @@ -64,8 +64,11 @@ public class MedicamentListActivity extends AppCompatActivity { dbHelper = new DBHelper(this); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - toolbar.setTitle(getTitle()); + + if (toolbar != null) { + setSupportActionBar(toolbar); + toolbar.setTitle(getTitle()); + } FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/res/layout/activity_medicament_detail.xml b/app/src/main/res/layout/activity_medicament_detail.xml index 1a10701..e49db16 100644 --- a/app/src/main/res/layout/activity_medicament_detail.xml +++ b/app/src/main/res/layout/activity_medicament_detail.xml @@ -17,10 +17,8 @@ diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index cf7bfc1..e742b28 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ 16dp - 100dp + 75dp 200dp 16dp