mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 06:28:00 +01:00
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:
parent
acee888740
commit
c3420aa748
9 changed files with 15 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
BIN
app/src/main/res/mipmap-hdpi/camera.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 364 B |
BIN
app/src/main/res/mipmap-mdpi/camera.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 240 B |
BIN
app/src/main/res/mipmap-xhdpi/camera.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 446 B |
BIN
app/src/main/res/mipmap-xxhdpi/camera.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 666 B |
BIN
app/src/main/res/mipmap-xxxhdpi/camera.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 894 B |
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue