Example usage for android.widget TabWidget setAlpha

List of usage examples for android.widget TabWidget setAlpha

Introduction

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

Prototype

public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) 

Source Link

Document

Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.

Usage

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

private void setUiEnabled() {
    util.addDebugLogMsg(1, "I", "setUiEnabled entered");
    mGp.enableMainUi = true;//from  w  w w  . j  a v  a  2s . c o 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;/* ww  w .jav  a 2  s . com*/
    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();
}