From 53ee178452375cc2497236823963e39db00b99fd Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Thu, 13 Nov 2014 19:00:43 +0100 Subject: [PATCH] using support library 21 to add material action bar. --- app/app.iml | 3 +++ app/build.gradle | 2 +- .../java/fr/gaulupeau/apps/Poche/BaseActionBarActivity.java | 5 +++-- app/src/main/res/values-v11/styles.xml | 5 ----- app/src/main/res/values-v14/styles.xml | 5 ----- app/src/main/res/values/styles.xml | 4 ++-- 6 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 app/src/main/res/values-v11/styles.xml delete mode 100644 app/src/main/res/values-v14/styles.xml diff --git a/app/app.iml b/app/app.iml index b4701ab..bd5df84 100644 --- a/app/app.iml +++ b/app/app.iml @@ -80,6 +80,9 @@ + + + diff --git a/app/build.gradle b/app/build.gradle index 0e2e10f..f565250 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,5 +20,5 @@ android { } dependencies { -// compile 'com.android.support:appcompat-v7:20.0.0' + compile 'com.android.support:appcompat-v7:21.0.0' } diff --git a/app/src/main/java/fr/gaulupeau/apps/Poche/BaseActionBarActivity.java b/app/src/main/java/fr/gaulupeau/apps/Poche/BaseActionBarActivity.java index e04e598..b8a98f0 100644 --- a/app/src/main/java/fr/gaulupeau/apps/Poche/BaseActionBarActivity.java +++ b/app/src/main/java/fr/gaulupeau/apps/Poche/BaseActionBarActivity.java @@ -5,9 +5,10 @@ import android.annotation.TargetApi; import android.app.Activity; import android.os.Build; import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; -public class BaseActionBarActivity extends Activity { +public class BaseActionBarActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { @@ -19,7 +20,7 @@ public class BaseActionBarActivity extends Activity { protected void addBackButtonToActionBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { try { - getActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); } catch (Exception e) { // } diff --git a/app/src/main/res/values-v11/styles.xml b/app/src/main/res/values-v11/styles.xml deleted file mode 100644 index a6f4000..0000000 --- a/app/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,5 +0,0 @@ - - -