add a button to open the Camera, closes #4

- added it only to the main screen with the directories, as adding it in the specific album might be confusing. People could think that the photo will be saved in that album
This commit is contained in:
tibbi 2016-07-09 21:15:05 +02:00
parent acee888740
commit c3420aa748
9 changed files with 15 additions and 3 deletions

View file

@ -90,17 +90,23 @@ public class MainActivity extends AppCompatActivity
if (mIsThirdPartyIntent) if (mIsThirdPartyIntent)
return false; return false;
getMenuInflater().inflate(R.menu.menu, menu); getMenuInflater().inflate(R.menu.menu_main, menu);
return true; return true;
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.about: case R.id.camera: {
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(intent);
return true;
}
case R.id.about: {
final Intent intent = new Intent(getApplicationContext(), AboutActivity.class); final Intent intent = new Intent(getApplicationContext(), AboutActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
}
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@ -473,7 +479,7 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) { public boolean onCreateActionMode(ActionMode mode, Menu menu) {
final MenuInflater inflater = mode.getMenuInflater(); final MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.directories_menu, menu); inflater.inflate(R.menu.directories_cab, menu);
mActionMode = mode; mActionMode = mode;
return true; return true;
} }

View file

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/camera"
android:icon="@mipmap/camera"
android:title="@string/open_camera"
app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/about" android:id="@+id/about"
android:title="@string/about" android:title="@string/about"

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

View file

@ -18,6 +18,7 @@
<string name="extension">Extension</string> <string name="extension">Extension</string>
<string name="file_deleted">File deleted</string> <string name="file_deleted">File deleted</string>
<string name="setting_wallpaper">Setting wallpaper</string> <string name="setting_wallpaper">Setting wallpaper</string>
<string name="open_camera">Open camera</string>
<plurals name="folders_deleted"> <plurals name="folders_deleted">
<item quantity="one">1 folder deleted</item> <item quantity="one">1 folder deleted</item>