Java Code Examples for android.view.MenuItem.getTitleCondensed()

The following are Jave code examples for showing how to use getTitleCondensed() of the android.view.MenuItem class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 2
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 3
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 4
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 5
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 6
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 7
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 8
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 9
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 10
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 11
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 12
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 13
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}
 
Example 14
Project: ProgressManager   File: a.java   View Source Code Vote up 4 votes
/**
 * Default implementation of
 * {@link android.view.Window.Callback#onMenuItemSelected}
 * for activities.  This calls through to the new
 * {@link #onOptionsItemSelected} method for the
 * {@link android.view.Window#FEATURE_OPTIONS_PANEL}
 * panel, so that subclasses of
 * Activity don't need to deal with feature codes.
 */
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    CharSequence titleCondensed = item.getTitleCondensed();

    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            // Put event logging here so it gets called even if subclass
            // doesn't call through to superclass's implmeentation of each
            // of these methods below
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 0, titleCondensed.toString());
            }
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (mFragments.dispatchOptionsItemSelected(item)) {
                return true;
            }
            if (item.getItemId() == android.R.id.home && mActionBar != null &&
                    (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                if (mParent == null) {
                    return onNavigateUp();
                } else {
                    return mParent.onNavigateUpFromChild(this);
                }
            }
            return false;

        case Window.FEATURE_CONTEXT_MENU:
            if(titleCondensed != null) {
                EventLog.writeEvent(50000, 1, titleCondensed.toString());
            }
            if (onContextItemSelected(item)) {
                return true;
            }
            return mFragments.dispatchContextItemSelected(item);

        default:
            return false;
    }
}