Example usage for android.widget TabWidget setEnabled

List of usage examples for android.widget TabWidget setEnabled

Introduction

In this page you can find the example usage for android.widget TabWidget setEnabled.

Prototype

@Override
    public void setEnabled(boolean enabled) 

Source Link

Usage

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void setUiEnabled() {
    util.addDebugLogMsg(1, "I", "setUiEnabled entered");
    mGp.enableMainUi = true;//  w w  w.  j  a v a 2s  .co  m
    TabWidget tw = (TabWidget) findViewById(android.R.id.tabs);
    tw.setEnabled(true);
    if (Build.VERSION.SDK_INT >= 11)
        tw.setAlpha(1.0f);
    //      mTabChildviewProf.setEnabled(true); 
    //      mTabChildviewProf.setViewAlpha(1.0f);
    //      mTabChildviewMsg.setEnabled(true);
    //      mTabChildviewMsg.setViewAlpha(1.0f);
    //      mTabChildviewHist.setEnabled(true);
    //      mTabChildviewHist.setViewAlpha(1.0f);

    unsetOnKeyCallBackListener();

    refreshOptionMenu();
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void setUiDisabled() {
    util.addDebugLogMsg(1, "I", "setUiDisabled entered");
    mGp.enableMainUi = false;//from w w w  . jav  a  2  s  .c  om
    TabWidget tw = (TabWidget) findViewById(android.R.id.tabs);
    tw.setEnabled(false);
    if (Build.VERSION.SDK_INT >= 11)
        tw.setAlpha(0.4f);
    //      mTabChildviewProf.setEnabled(false); 
    //      mTabChildviewProf.setAlpha(0.4f);
    //      mTabChildviewMsg.setEnabled(false);
    //      mTabChildviewMsg.setViewAlpha(0.4f);
    //      mTabChildviewHist.setEnabled(false);
    //      mTabChildviewHist.setViewAlpha(0.4f);

    setOnKeyCallBackListener(new CallBackListener() {
        private long next_issued_time = 0;

        @Override
        public boolean onCallBack(Context c, Object o1, Object[] o2) {
            if (next_issued_time < System.currentTimeMillis()) {
                Toast.makeText(mContext, mContext.getString(R.string.msgs_dlg_hardkey_back_button),
                        Toast.LENGTH_SHORT).show();
                next_issued_time = System.currentTimeMillis() + 2000;
            }
            return true;
        }
    });

    refreshOptionMenu();
}

From source file:com.sentaroh.android.SMBExplorer.SMBExplorerMain.java

private void setUiEnabled(boolean enabled) {
    //      Log.v("","enabled="+enabled);
    //      Thread.dumpStack();
    if ((enabled && mUiEnabled) || (!enabled && !mUiEnabled))
        return;// w w  w .j a v a2 s  . c  o m
    mUiEnabled = enabled;
    TabWidget tw = (TabWidget) findViewById(android.R.id.tabs);

    tw.setEnabled(enabled);
    localFileListDirSpinner.setEnabled(enabled);
    remoteFileListDirSpinner.setEnabled(enabled);
    localFileListPasteBtn.setEnabled(enabled);
    remoteFileListPasteBtn.setEnabled(enabled);
    remoteFileListView.setEnabled(enabled);
    localFileListView.setEnabled(enabled);
    if (enabled) {
        remoteFileListView.setVisibility(ListView.VISIBLE);
        localFileListView.setVisibility(ListView.VISIBLE);
        setPasteButtonEnabled();
    } else {
        remoteFileListView.setVisibility(ListView.INVISIBLE);
        localFileListView.setVisibility(ListView.INVISIBLE);
    }
    localFileListUpBtn.setClickable(enabled);
    localFileListTopBtn.setClickable(enabled);
    localFileListCreateBtn.setEnabled(enabled);
    localFileListReloadBtn.setEnabled(enabled);
    remoteFileListUpBtn.setClickable(enabled);
    remoteFileListTopBtn.setClickable(enabled);
    remoteFileListCreateBtn.setEnabled(enabled);
    remoteFileListReloadBtn.setEnabled(enabled);

    refreshOptionMenu();
}