Java Code Examples for com.actionbarsherlock.ActionBarSherlock#DEBUG

The following examples show how to use com.actionbarsherlock.ActionBarSherlock#DEBUG . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Watson.java    From CSipSimple with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);

    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        if (onOptionsItemSelected(item)) {
            return true;
        }

        if (mFragments.mAdded != null) {
            for (int i = 0; i < mFragments.mAdded.size(); i++) {
                Fragment f = mFragments.mAdded.get(i);
                if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnOptionsItemSelectedListener) {
                    if (((OnOptionsItemSelectedListener)f).onOptionsItemSelected(item)) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
 
Example 2
Source File: ActionBarSherlockCompat.java    From zen4android with MIT License 6 votes vote down vote up
@Override
public void setContentView(int layoutResId) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId);

    if (mContentParent == null) {
        installDecor();
    } else {
        mContentParent.removeAllViews();
    }
    mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);

    android.view.Window.Callback callback = mActivity.getWindow().getCallback();
    if (callback != null) {
        callback.onContentChanged();
    }

    initActionBar();
}
 
Example 3
Source File: ActionBarSherlockNative.java    From CSipSimple with GNU General Public License v3.0 6 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);

    if (mActionMode != null) {
        mActionMode.finish();
    }
    ActionModeCallbackWrapper wrapped = null;
    if (callback != null) {
        wrapped = new ActionModeCallbackWrapper(callback);
    }

    //Calling this will trigger the callback wrapper's onCreate which
    //is where we will set the new instance to mActionMode since we need
    //to pass it through to the sherlock callbacks and the call below
    //will not have returned yet to store its value.
    if (mActivity.startActionMode(wrapped) == null) {
        mActionMode = null;
    }
    if (mActivity instanceof OnActionModeStartedListener && mActionMode != null) {
        ((OnActionModeStartedListener)mActivity).onActionModeStarted(mActionMode);
    }

    return mActionMode;
}
 
Example 4
Source File: ActionBarSherlockCompat.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void dispatchPause() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPause]");

    if (wActionBar != null && wActionBar.isOverflowMenuShowing()) {
        wActionBar.hideOverflowMenu();
    }
}
 
Example 5
Source File: ActionBarSherlockNative.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] menu: " + menu);

    final boolean result = callbackPrepareOptionsMenu(mMenu);
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result);
    return result;
}
 
Example 6
Source File: ActionBarSherlockCompat.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public void setProgressBarVisibility(boolean visible) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible);

    setFeatureInt(Window.FEATURE_PROGRESS, visible ? Window.PROGRESS_VISIBILITY_ON :
        Window.PROGRESS_VISIBILITY_OFF);
}
 
Example 7
Source File: ActionBarSherlockCompat.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean dispatchCloseOptionsMenu() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchCloseOptionsMenu]");

    if (!isReservingOverflow()) {
        return false;
    }

    if (wActionBar != null) {
        return wActionBar.hideOverflowMenu();
    }
    return false;
}
 
Example 8
Source File: ActionBarSherlockCompat.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public void dispatchPause() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPause]");

    if (wActionBar != null && wActionBar.isOverflowMenuShowing()) {
        wActionBar.hideOverflowMenu();
    }
}
 
Example 9
Source File: ActionBarSherlockCompat.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public void dispatchPostCreate(Bundle savedInstanceState) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOnPostCreate]");

    if (mIsDelegate) {
        mIsTitleReady = true;
    }

    if (mDecor == null) {
        initActionBar();
    }
}
 
Example 10
Source File: ActionBarSherlockNative.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public void addContentView(View view, LayoutParams params) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params);

    mActivity.getWindow().addContentView(view, params);
    initActionBar();
}
 
Example 11
Source File: ActionBarSherlockCompat.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public void dispatchPostCreate(Bundle savedInstanceState) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOnPostCreate]");

    if (mIsDelegate) {
        mIsTitleReady = true;
    }

    if (mDecor == null) {
        initActionBar();
    }
}
 
Example 12
Source File: ActionBarSherlockNative.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public void setContentView(View view, LayoutParams params) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params);

    mActivity.getWindow().setContentView(view, params);
    initActionBar();
}
 
Example 13
Source File: ActionBarSherlockCompat.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public void setProgressBarIndeterminate(boolean indeterminate) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarIndeterminate] indeterminate: " + indeterminate);

    setFeatureInt(Window.FEATURE_PROGRESS,
            indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF);
}
 
Example 14
Source File: ActionBarSherlockCompat.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public void dispatchTitleChanged(CharSequence title, int color) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchTitleChanged] title: " + title + ", color: " + color);

    if ((!mIsDelegate || mIsTitleReady) && (wActionBar != null)) {
        wActionBar.setWindowTitle(title);
    }
}
 
Example 15
Source File: ActionBarSherlockCompat.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setProgress(int progress) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgress] progress: " + progress);

    setFeatureInt(Window.FEATURE_PROGRESS, progress + Window.PROGRESS_START);
}
 
Example 16
Source File: ActionBarSherlockNative.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setProgressBarVisibility(boolean visible) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible);

    mActivity.setProgressBarVisibility(visible);
}
 
Example 17
Source File: ActionBarSherlockNative.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
@Override
public void setUiOptions(int uiOptions, int mask) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions + ", mask: " + mask);

    mActivity.getWindow().setUiOptions(uiOptions, mask);
}
 
Example 18
Source File: SherlockFragmentActivity.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
public void supportInvalidateOptionsMenu() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[supportInvalidateOptionsMenu]");

    invalidateOptionsMenu();
}
 
Example 19
Source File: ActionBarSherlockNative.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
@Override
public void setProgress(int progress) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgress] progress: " + progress);

    mActivity.setProgress(progress);
}
 
Example 20
Source File: ActionBarSherlockCompat.java    From zen4android with MIT License 4 votes vote down vote up
private int getFeatures() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getFeatures] returning " + mFeatures);

    return mFeatures;
}