diff --git a/demo/src/main/java/org/michaelevans/colorart/demo/DetailsActivity.java b/demo/src/main/java/org/michaelevans/colorart/demo/DetailsActivity.java index 8e5ff0b..921bed2 100644 --- a/demo/src/main/java/org/michaelevans/colorart/demo/DetailsActivity.java +++ b/demo/src/main/java/org/michaelevans/colorart/demo/DetailsActivity.java @@ -37,9 +37,12 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_details); + getActionBar().setHomeButtonEnabled(true); + getActionBar().setDisplayHomeAsUpEnabled(true); + int position = 0; Bundle extras = getIntent().getExtras(); - if(extras != null) + if (extras != null) position = extras.getInt("position"); Bitmap album = BitmapFactory.decodeResource(getResources(), SampleData.imageIds[position]); @@ -62,7 +65,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public boolean onCreateOptionsMenu(Menu menu) { - + // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.details, menu); return true; @@ -73,17 +76,20 @@ public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); if (id == R.id.action_fade) { - if(item.isChecked()){ + if (item.isChecked()) { mImageView.setFadeEnabled(true); item.setChecked(false); - }else{ + } else { mImageView.setFadeEnabled(false); item.setChecked(true); } return true; + } else if (id == android.R.id.home) { + onBackPressed(); } return super.onOptionsItemSelected(item); } -} +} \ No newline at end of file diff --git a/demo/src/main/project.properties b/demo/src/main/project.properties new file mode 100644 index 0000000..5365aaf --- /dev/null +++ b/demo/src/main/project.properties @@ -0,0 +1,16 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-19 +android.library.reference.1=../../../library/src/main + diff --git a/library/src/main/project.properties b/library/src/main/project.properties new file mode 100644 index 0000000..91d2b02 --- /dev/null +++ b/library/src/main/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-19 +android.library=true