<item>@string/pref_default_longclick_action_select_deselect</item>
<item>@string/pref_default_longclick_action_open_with</item>
<item>@string/pref_default_longclick_action_show_properties</item>
+ <item>@string/pref_default_longclick_action_show_actions</item>
</string-array>
<string-array name="default_longclick_action_values" translable="false">
<item>0</item>
<item>2</item>
<item>3</item>
<item>4</item>
+ <item>5</item>
</string-array>
<!-- General. Disk usage warning level -->
<string name="pref_default_longclick_action_open_with">Open with</string>
<!-- Preferences * General * Default long-click action * Show properties -->
<string name="pref_default_longclick_action_show_properties">Show properties</string>
+ <!-- Preferences * General * Default long-click action * Show actions -->
+ <string name="pref_default_longclick_action_show_actions">Show actions</string>
<!-- Preferences * General *Disk usage warning level title -->
<string name="pref_disk_usage_warning_level">Disk usage warning</string>
<!-- Preferences * General * Disk usage warning level summary -->
//Action Bar buttons
//######################
case R.id.ab_actions:
- ActionsDialog dialog = new ActionsDialog(this);
- dialog.setOnRequestRefreshListener(this);
- dialog.setOnSelectionListener(getCurrentNavigationView());
- dialog.show();
+ openActions();
break;
case R.id.ab_bookmarks:
}
/**
+ * Method that opens the actions dialog
+ */
+ private void openActions() {
+ ActionsDialog dialog = new ActionsDialog(this);
+ dialog.setOnRequestRefreshListener(this);
+ dialog.setOnSelectionListener(getCurrentNavigationView());
+ dialog.show();
+ }
+
+ /**
* Method that opens the bookmarks activity.
*/
private void openBookmarks() {
ActionsPolicy.showContentDescription(this, fso);
}
+ // Open with
+ else if (this.mDefaultLongClickAction.compareTo(
+ DefaultLongClickAction.OPEN_WITH) == 0) {
+ // FIXME Invoke ActionPolicy open with
+ }
+
// Show properties
else if (this.mDefaultLongClickAction.compareTo(
DefaultLongClickAction.SHOW_PROPERTIES) == 0) {
ActionsPolicy.showPropertiesDialog(this, fso, this);
}
- // Open with
+ // Show actions
else if (this.mDefaultLongClickAction.compareTo(
- DefaultLongClickAction.OPEN_WITH) == 0) {
- // FIXME Invoke ActionPolicy open with
+ DefaultLongClickAction.SHOW_ACTIONS) == 0) {
+ onRequestMenu(fso);
}
+
return true; //Always consume the event
}
/**
* Select/deselect the item
*/
- SELECT_DESELECT("2"), //$NON-NLS-1$
+ SELECT_DESELECT("2"), //$NON-NLS-1$T
/**
* Open the item with ...
*/
/**
* Show the item properties
*/
- SHOW_PROPERTIES("4"); //$NON-NLS-1$
+ SHOW_PROPERTIES("4"), //$NON-NLS-1$
+ /**
+ * Show the item actions
+ */
+ SHOW_ACTIONS("5"); //$NON-NLS-1$
private String mId;
*/
public void setDefaultLongClickAction(DefaultLongClickAction mDefaultLongClickAction) {
this.mDefaultLongClickAction = mDefaultLongClickAction;
-
+
// Register the long-click listener only if needed
if (this.mDefaultLongClickAction.compareTo(
DefaultLongClickAction.NONE) != 0) {
ActionsPolicy.showContentDescription(getContext(), fso);
}
+ // Open with
+ else if (this.mDefaultLongClickAction.compareTo(
+ DefaultLongClickAction.OPEN_WITH) == 0) {
+ // FIXME Invoke ActionPolicy open with
+ }
+
// Show properties
else if (this.mDefaultLongClickAction.compareTo(
DefaultLongClickAction.SHOW_PROPERTIES) == 0) {
ActionsPolicy.showPropertiesDialog(getContext(), fso, this);
}
- // Open with
+ // Show actions
else if (this.mDefaultLongClickAction.compareTo(
- DefaultLongClickAction.OPEN_WITH) == 0) {
- // FIXME Invoke ActionPolicy open with
+ DefaultLongClickAction.SHOW_ACTIONS) == 0) {
+ onRequestMenu(fso);
}
return true; //Always consume the event