add the properties dialog to viewpager items

This commit is contained in:
tibbi 2016-11-03 23:27:09 +01:00
parent b3fa4bf880
commit a5fc444ba3
2 changed files with 13 additions and 0 deletions

View file

@ -19,6 +19,7 @@ import android.widget.EditText;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.simplemobiletools.fileproperties.dialogs.PropertiesDialog;
import com.simplemobiletools.gallery.Constants; import com.simplemobiletools.gallery.Constants;
import com.simplemobiletools.gallery.MyViewPager; import com.simplemobiletools.gallery.MyViewPager;
import com.simplemobiletools.gallery.R; import com.simplemobiletools.gallery.R;
@ -164,6 +165,9 @@ public class ViewPagerActivity extends SimpleActivity
case R.id.menu_edit: case R.id.menu_edit:
openEditor(); openEditor();
return true; return true;
case R.id.menu_properties:
showProperties();
return true;
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@ -212,6 +216,10 @@ public class ViewPagerActivity extends SimpleActivity
} }
} }
private void showProperties() {
new PropertiesDialog(this, getCurrentFile().getAbsolutePath(), false);
}
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == EDIT_IMAGE) { if (requestCode == EDIT_IMAGE) {

View file

@ -24,6 +24,11 @@
android:icon="@mipmap/rename" android:icon="@mipmap/rename"
android:title="@string/rename" android:title="@string/rename"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/menu_properties"
android:icon="@mipmap/info"
android:title="@string/properties"
app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/menu_delete" android:id="@+id/menu_delete"
android:icon="@mipmap/delete" android:icon="@mipmap/delete"