Example usage for android.graphics Color TRANSPARENT

List of usage examples for android.graphics Color TRANSPARENT

Introduction

In this page you can find the example usage for android.graphics Color TRANSPARENT.

Prototype

int TRANSPARENT

To view the source code for android.graphics Color TRANSPARENT.

Click Source Link

Usage

From source file:com.facebook.litho.InternalNode.java

/**
 * Reset all attributes to default values. Intended to facilitate recycling.
 *///from  w  w  w  .j  a  v  a  2 s.co  m
void release() {
    if (mYogaNode.getParent() != null || mYogaNode.getChildCount() > 0) {
        throw new IllegalStateException("You should not free an attached Internalnode");
    }

    ComponentsPools.release(mYogaNode);
    mYogaNode = null;

    mResourceResolver.internalRelease();

    mResolvedTouchExpansionLeft = YogaConstants.UNDEFINED;
    mResolvedTouchExpansionRight = YogaConstants.UNDEFINED;
    mResolvedX = YogaConstants.UNDEFINED;
    mResolvedY = YogaConstants.UNDEFINED;
    mResolvedWidth = YogaConstants.UNDEFINED;
    mResolvedHeight = YogaConstants.UNDEFINED;

    mComponentContext = null;
    mResources = null;
    mComponents.clear();
    mNestedTree = null;
    mNestedTreeHolder = null;

    if (mNodeInfo != null) {
        mNodeInfo.release();
        mNodeInfo = null;
    }
    mImportantForAccessibility = ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
    mDuplicateParentState = false;
    mBackground = null;
    mForeground = null;
    mForceViewWrapping = false;
    mVisibleRatio = 0;
    mVisibleHandler = null;
    mFocusedHandler = null;
    mUnfocusedHandler = null;
    mFullImpressionHandler = null;
    mInvisibleHandler = null;
    mPrivateFlags = 0L;
    mTransitionKey = null;
    mBorderColor = Color.TRANSPARENT;
    mIsPaddingPercent = null;

    if (mTouchExpansion != null) {
        ComponentsPools.release(mTouchExpansion);
        mTouchExpansion = null;
    }
    if (mNestedTreePadding != null) {
        ComponentsPools.release(mNestedTreePadding);
        mNestedTreePadding = null;
    }
    if (mNestedTreeBorderWidth != null) {
        ComponentsPools.release(mNestedTreeBorderWidth);
        mNestedTreeBorderWidth = null;
    }

    mLastWidthSpec = DiffNode.UNSPECIFIED;
    mLastHeightSpec = DiffNode.UNSPECIFIED;
    mLastMeasuredHeight = DiffNode.UNSPECIFIED;
    mLastMeasuredWidth = DiffNode.UNSPECIFIED;
    mDiffNode = null;
    mCachedMeasuresValid = false;
    mIsNestedTreeHolder = false;
    mTestKey = null;

    if (mPendingTreeProps != null) {
        mPendingTreeProps.reset();
        ComponentsPools.release(mPendingTreeProps);
        mPendingTreeProps = null;
    }
}

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

private void processLocalUpButton() {
    //      Log.v("","size1="+localDirHist.size());
    for (int i = 0; i < localDirHist.size(); i++)
        Log.v("", "hist=" + localDirHist.get(i));
    if (localDirHist.size() > 0) {
        localCurrFLI.pos_fv = localFileListView.getFirstVisiblePosition();
        if (localFileListView.getChildAt(0) != null) {
            localCurrFLI.pos_top = localFileListView.getChildAt(0).getTop();
        }/*w  w w.  ja v a 2 s. c o  m*/
        if (localDirHist.size() <= 2) {
            processLocalTopButton();
            localFileListUpBtn.setEnabled(false);
        } else {
            //            String c_dir=remoteDirHist.get(remoteDirHist.size()-1);
            removeDirHist(localBase, localDir, localDirHist);
            //            Log.v("","size2="+localDirHist.size());
            String t_dir = getLastDirHist(localDirHist);
            FileListCacheItem dhi = getFileListCache(t_dir, localFileListCache);
            localBase = dhi.base;
            localDir = dhi.directory.replace(dhi.base + "/", "");
            localFileListAdapter.setDataList(dhi.file_list);
            localFileListAdapter.notifyDataSetChanged();
            setFileListPathName(localFileListPathBtn, localFileListCache, localBase, localDir);
            localFileListView.setSelectionFromTop(dhi.pos_fv, dhi.pos_top);
            setEmptyFolderView();
            localCurrFLI = dhi;
            for (int j = 0; j < localFileListView.getChildCount(); j++)
                localFileListView.getChildAt(j).setBackgroundColor(Color.TRANSPARENT);
        }
    }
}

From source file:com.skytree.epubtest.BookViewActivity.java

public View makeResultItem(SearchResult sr, int mode) {
    int inlineColor = Color.rgb(133, 105, 75);
    int headColor = Color.rgb(94, 61, 34);
    int textColor = Color.rgb(50, 40, 40);

    SkyLayout view = new SkyLayout(this);
    int itemWidth = ps(370);
    int itemHeight = ps(190);

    this.setFrame(view, 0, 0, itemWidth, itemHeight);

    TextView chapterLabel = null;//from ww  w . j av a 2  s .c  o  m
    TextView positionLabel = null;
    TextView textLabel = null;
    Button itemButton = null;
    itemButton = new Button(this);
    itemButton.setBackgroundColor(Color.TRANSPARENT);
    itemButton.setOnClickListener(listener);
    this.setFrame(itemButton, 0, 0, itemWidth, itemHeight);

    if (mode == 0) { // Normal case
        int ci = sr.chapterIndex;
        String chapterText = "";
        chapterText = sr.chapterTitle;
        String positionText = String.format("%d/%d", sr.pageIndex + 1, sr.numberOfPagesInChapter);
        if (chapterText == null || chapterText.isEmpty()) {
            chapterText = "Chapter " + ci;
        }
        if (sr.pageIndex < 0 || sr.numberOfPagesInChapter < 0) {
            positionText = "";
        }
        chapterLabel = this.makeLabel(3090, chapterText, Gravity.LEFT, 15, headColor);
        positionLabel = this.makeLabel(3091, positionText, Gravity.LEFT, 15, headColor);
        textLabel = this.makeLabel(3092, sr.text, Gravity.LEFT, 15, textColor);
        itemButton.setId(100000 + searchResults.size());
    } else if (mode == 1) { // Paused
        chapterLabel = this.makeLabel(3090, getString(R.string.searchmore) + "....", Gravity.CENTER, 18,
                headColor);
        //         positionLabel    = this.makeLabel(3091, String.format("%d/%d",sr.pageIndex+1,sr.numberOfPagesInChapter), Gravity.LEFT, 15, headColor);
        textLabel = this.makeLabel(3092, sr.numberOfSearched + " " + getString(R.string.searchfound) + ".",
                Gravity.CENTER, 16, textColor);
        itemButton.setId(3093);
    } else if (mode == 2) { // finished
        chapterLabel = this.makeLabel(3090, getString(R.string.searchfinished), Gravity.CENTER, 18, headColor);
        //         positionLabel    = this.makeLabel(3091, String.format("%d/%d",sr.pageIndex+1,sr.numberOfPagesInChapter), Gravity.LEFT, 15, headColor);
        textLabel = this.makeLabel(3092, sr.numberOfSearched + " " + getString(R.string.searchfound) + ".",
                Gravity.CENTER, 16, textColor);
        itemButton.setId(3094);
    }

    textLabel.setMaxLines(3);

    if (mode == 0) {
        this.setFrame(chapterLabel, ps(20), ps(20), ps(270), ps(30));
        this.setFrame(positionLabel, itemWidth - ps(85), ps(20), ps(70), ps(30));
        this.setFrame(textLabel, ps(20), ps(80), itemWidth - ps(40), itemHeight - ps(80 + 20));
    } else {
        this.setFrame(chapterLabel, ps(20), ps(20), ps(350), ps(40));
        //         this.setFrame(positionLabel, itemWidth-ps(80), ps(20),ps(70),ps(30));
        this.setFrame(textLabel, ps(20), ps(80), itemWidth - ps(40), itemHeight - ps(80 + 20));
    }

    view.addView(chapterLabel);
    if (mode == 0)
        view.addView(positionLabel);
    view.addView(textLabel);
    view.addView(itemButton);

    RectShape crs = new RectShape();
    SkyDrawable cd = new SkyDrawable(crs, Color.TRANSPARENT, inlineColor, 1);
    view.setBackgroundDrawable(cd);

    return view;
}

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

private void processLocalTopButton() {
    if (localDirHist.size() > 0) {
        localCurrFLI.pos_fv = localFileListView.getFirstVisiblePosition();
        if (localFileListView.getChildAt(0) != null)
            localCurrFLI.pos_top = localFileListView.getChildAt(0).getTop();

        String t_dir = getTopDirHist(localDirHist);
        FileListCacheItem dhi = getFileListCache(t_dir, localFileListCache);
        localDir = "";
        localBase = dhi.base;//from  www  .ja  v  a 2s .  c  o m
        localFileListAdapter.setDataList(dhi.file_list);
        clearDirHist(localDirHist);
        putDirHist(t_dir, "", localDirHist);
        localFileListAdapter.notifyDataSetChanged();
        setFileListPathName(localFileListPathBtn, localFileListCache, localBase, localDir);
        localFileListView.setSelectionFromTop(dhi.pos_fv, dhi.pos_top);
        setEmptyFolderView();
        localCurrFLI = dhi;
        for (int j = 0; j < localFileListView.getChildCount(); j++)
            localFileListView.getChildAt(j).setBackgroundColor(Color.TRANSPARENT);
        localFileListTopBtn.setEnabled(false);
        localFileListUpBtn.setEnabled(false);
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static int getStatusBackground(final boolean is_mention, final boolean is_favorite,
        final boolean is_retweet, final boolean is_mine) {
    if (is_mention)
        return 0x1A33E5BC;
    else if (is_favorite)
        return 0x1A66CC00;
    //else if (is_retweet) 
    //   return 0x1AFFBB33;
    else if (is_mine)
        return 0x1A33B5E5;
    return Color.TRANSPARENT;
}

From source file:org.getlantern.firetweet.util.Utils.java

public static int getAccountColor(final Context context, final long account_id) {
    if (context == null)
        return Color.TRANSPARENT;
    final Integer cached = sAccountColors.get(account_id);
    if (cached != null)
        return cached;
    if (cached == null) {
        return Color.TRANSPARENT;
    }//  w  w  w .j  av  a 2  s  .  c  om
    final Cursor cur = ContentResolverUtils.query(context.getContentResolver(), Accounts.CONTENT_URI,
            new String[] { Accounts.COLOR }, Accounts.ACCOUNT_ID + " = " + account_id, null, null);
    if (cur == null)
        return Color.TRANSPARENT;
    try {
        if (cur.getCount() > 0 && cur.moveToFirst()) {
            final int color = cur.getInt(0);
            sAccountColors.put(account_id, color);
            return color;
        }
        return Color.TRANSPARENT;
    } finally {
        cur.close();
    }
}

From source file:com.xplink.android.carchecklist.CarCheckListActivity.java

private void SlideEngineLayout() {

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    float height = metrics.heightPixels;
    float width = metrics.widthPixels;

    int left840 = (int) ((width / 100) * 65.625);

    final SharedPreferences settings = getSharedPreferences("mysettings", 0);
    final SharedPreferences.Editor editor = settings.edit();
    final Dialog enginedialog = new Dialog(CarCheckListActivity.this, R.style.backgrounddialog);
    enginedialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    enginedialog.setContentView(R.layout.enginedialoglayout);
    enginedialog.getWindow().getAttributes().windowAnimations = R.style.EngineDialogAnimation;
    enginedialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    // make everything around Dialog brightness than default
    WindowManager.LayoutParams lp = enginedialog.getWindow().getAttributes();
    lp.dimAmount = 0f;//from   w  w  w.  j  av a 2s . c  o  m

    final CheckBox chkengine_hood = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_hood);
    final CheckBox chkengine_backHood = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_backHood);
    final CheckBox chkengine_underEngine = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_underEngine);
    final CheckBox chkengine_brakeOil = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_brakeOil);
    final CheckBox chkengine_engineOil = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_engineOil);
    final CheckBox chkengine_waterCoolant = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_waterCoolant);
    final CheckBox chkengine_belt = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_belt);
    final CheckBox chkengine_gear = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_gear);
    final CheckBox chkengine_liquidLevel = (CheckBox) enginedialog.getWindow()
            .findViewById(R.id.engine_liquidLevel);
    final CheckBox chkengine_soundOut = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_soundOut);
    final CheckBox chkengine_soundIn = (CheckBox) enginedialog.getWindow().findViewById(R.id.engine_soundIn);

    // Change font
    chkengine_hood.setTypeface(type);
    chkengine_backHood.setTypeface(type);
    chkengine_underEngine.setTypeface(type);
    chkengine_brakeOil.setTypeface(type);
    chkengine_engineOil.setTypeface(type);
    chkengine_waterCoolant.setTypeface(type);
    chkengine_belt.setTypeface(type);
    chkengine_gear.setTypeface(type);
    chkengine_liquidLevel.setTypeface(type);
    chkengine_soundOut.setTypeface(type);
    chkengine_soundIn.setTypeface(type);

    enginedialog.setCanceledOnTouchOutside(true);
    enginedialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            headengine.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadengine = new TranslateAnimation(0, 0, 490, -500);
            slideoutheadengine.setDuration(300);
            slideoutheadengine.setFillAfter(true);
            headengine.startAnimation(slideoutheadengine);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("engine_hood", chkengine_hood.isChecked());
            mp.put("engine_backHood", chkengine_backHood.isChecked());
            mp.put("engine_underEngine", chkengine_underEngine.isChecked());
            mp.put("engine_brakeOil", chkengine_brakeOil.isChecked());
            mp.put("engine_engineOil", chkengine_engineOil.isChecked());
            mp.put("engine_waterCoolant", chkengine_waterCoolant.isChecked());
            mp.put("engine_belt", chkengine_belt.isChecked());
            mp.put("engine_gear", chkengine_gear.isChecked());
            mp.put("engine_liquidLevel", chkengine_liquidLevel.isChecked());
            mp.put("engine_soundOut", chkengine_soundOut.isChecked());
            mp.put("engine_soundIn", chkengine_soundIn.isChecked());

            filterStore("engine", mp);
            save(mp);

        }
    });

    TextView engine = (TextView) enginedialog.getWindow().findViewById(R.id.Engine);
    engine.setTypeface(type);
    Button engineback = (Button) enginedialog.getWindow().findViewById(R.id.Engineback);
    engineback.setTypeface(type);
    engineback.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            enginedialog.dismiss();

            headengine.setVisibility(ImageView.VISIBLE);
            TranslateAnimation slideoutheadengine = new TranslateAnimation(0, 0, 490, -500);
            slideoutheadengine.setDuration(300);
            slideoutheadengine.setFillAfter(true);
            headengine.startAnimation(slideoutheadengine);

            Map<String, Boolean> mp = new HashMap<String, Boolean>();

            mp.put("engine_hood", chkengine_hood.isChecked());
            mp.put("engine_backHood", chkengine_backHood.isChecked());
            mp.put("engine_underEngine", chkengine_underEngine.isChecked());
            mp.put("engine_brakeOil", chkengine_brakeOil.isChecked());
            mp.put("engine_engineOil", chkengine_engineOil.isChecked());
            mp.put("engine_waterCoolant", chkengine_waterCoolant.isChecked());
            mp.put("engine_belt", chkengine_belt.isChecked());
            mp.put("engine_gear", chkengine_gear.isChecked());
            mp.put("engine_liquidLevel", chkengine_liquidLevel.isChecked());
            mp.put("engine_soundOut", chkengine_soundOut.isChecked());
            mp.put("engine_soundIn", chkengine_soundIn.isChecked());

            filterStore("engine", mp);
            save(mp);

        }
    });

    chkengine_hood.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_backHood.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_underEngine.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_brakeOil.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_engineOil.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_waterCoolant.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_belt.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_gear.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_liquidLevel.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_soundOut.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    chkengine_soundIn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean increment = true;
            if (((CheckBox) v).isChecked()) {
                getTotalEngine(increment);
            } else {
                increment = false;
                getTotalEngine(increment);
            }
            EngineProgress.setProgress(PercenEngine);
            percenengine.setText("" + PercenEngine + "%");
            RatioProgress.setProgress(PercenRatio);
            Ratiotext.setText("Rating of the Vehicle.   " + PercenRatio + "  %");
            CheckRatio();
        }
    });

    headengine.setVisibility(ImageView.VISIBLE);
    TranslateAnimation slideheadengine = new TranslateAnimation(0, 0, 0, 490);
    slideheadengine.setDuration(300);
    slideheadengine.setFillAfter(true);
    headengine.startAnimation(slideheadengine);

    enginedialog.show();

    WindowManager.LayoutParams params = enginedialog.getWindow().getAttributes();
    params.y = 1;
    params.x = left840;
    params.gravity = Gravity.TOP | Gravity.LEFT;
    enginedialog.getWindow().setAttributes(params);

    chkengine_hood.setChecked(load("engine_hood"));
    chkengine_backHood.setChecked(load("engine_backHood"));
    chkengine_underEngine.setChecked(load("engine_underEngine"));
    chkengine_brakeOil.setChecked(load("engine_brakeOil"));
    chkengine_engineOil.setChecked(load("engine_engineOil"));
    chkengine_waterCoolant.setChecked(load("engine_waterCoolant"));
    chkengine_belt.setChecked(load("engine_belt"));
    chkengine_gear.setChecked(load("engine_gear"));
    chkengine_liquidLevel.setChecked(load("engine_liquidLevel"));
    chkengine_soundOut.setChecked(load("engine_soundOut"));
    chkengine_soundIn.setChecked(load("engine_soundIn"));

}

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

private void setRemoteDirBtnListener() {
    final CustomSpinnerAdapter spAdapter = new CustomSpinnerAdapter(this, R.layout.custom_simple_spinner_item);
    //        spAdapter.setTextColor(Color.BLACK);
    spAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    remoteFileListDirSpinner.setPrompt("??");
    remoteFileListDirSpinner.setAdapter(spAdapter);
    //        mIgnoreRemoteSelection=true;
    if (remoteBase.equals(""))
        spAdapter.add("--- Not selected ---");
    int a_no = 0;
    for (int i = 0; i < profileAdapter.getCount(); i++)
        if (profileAdapter.getItem(i).getType().equals("R")
                && profileAdapter.getItem(i).getActive().equals("A")) {
            spAdapter.add(profileAdapter.getItem(i).getName());
            String surl = buildRemoteBase(profileAdapter.getItem(i));
            if (surl.equals(remoteBase))
                remoteFileListDirSpinner.setSelection(a_no);
            a_no++;/*w ww  .  j  ava  2  s  .  c  o m*/
        }
    remoteFileListDirSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            if (mIgnoreSpinnerSelection) {
                //                  Log.v("","ignored");
                return;
            }
            //               mIgnoreRemoteSelection=false;
            Spinner spinner = (Spinner) parent;
            if (((String) spinner.getSelectedItem()).startsWith("---")) {
                return;
            }
            String sel_item = (String) spinner.getSelectedItem();
            if (spAdapter.getItem(0).startsWith("---")) {
                spAdapter.remove(spAdapter.getItem(0));
                spinner.setSelection(position - 1);
            }

            ProfileListItem pli = null;
            for (int i = 0; i < profileAdapter.getCount(); i++) {
                if (profileAdapter.getItem(i).getName().equals(sel_item)) {
                    pli = profileAdapter.getItem(i);
                }
            }
            String turl = buildRemoteBase(pli);
            if (turl.equals(remoteBase))
                tabHost.setCurrentTabByTag(SMBEXPLORER_TAB_REMOTE);
            else {
                tabHost.getTabWidget().getChildTabViewAt(2).setEnabled(true);
                tabHost.setCurrentTabByTag(SMBEXPLORER_TAB_REMOTE);
                setJcifsProperties(pli.getUser(), pli.getPass());
                remoteBase = turl;
                remoteDir = "";

                clearDirHist(remoteDirHist);
                //               putDirHist(remoteBase, remoteDir, remoteDirHist);

                if (remoteCurrFLI != null) {
                    remoteCurrFLI.pos_fv = remoteFileListView.getFirstVisiblePosition();
                    if (remoteFileListView.getChildAt(0) != null)
                        remoteCurrFLI.pos_top = remoteFileListView.getChildAt(0).getTop();
                }

                loadRemoteFilelist(remoteBase, remoteDir);
                remoteFileListView.setSelection(0);
                for (int j = 0; j < remoteFileListView.getChildCount(); j++)
                    remoteFileListView.getChildAt(j).setBackgroundColor(Color.TRANSPARENT);
            }
        }

        @Override
        public void onNothingSelected(AdapterView<?> arg0) {
        }
    });

    remoteFileListUpBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            processRemoteUpButton();
        }
    });
    remoteFileListPathBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            if (remoteFileListCache.size() > 0)
                showFileListCache(remoteFileListCache, remoteFileListAdapter, remoteFileListView,
                        remoteFileListDirSpinner);
        }
    });

    remoteFileListTopBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            processRemoteTopButton();
        }
    });

    remoteFileListPasteBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            String to_dir = "";
            if (remoteDir.equals(""))
                to_dir = remoteBase;
            else
                to_dir = remoteBase + "/" + remoteDir;
            pasteItem(remoteFileListAdapter, to_dir, remoteBase);
        }
    });
    remoteFileListReloadBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            reloadFilelistView();
            setEmptyFolderView();
        }
    });
    remoteFileListCreateBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            if (currentTabName.equals(SMBEXPLORER_TAB_LOCAL)) {
                if (localDir.length() == 0)
                    createItem(localFileListAdapter, "C", localBase);
                else
                    createItem(localFileListAdapter, "C", localBase + "/" + localDir);
            } else if (currentTabName.equals(SMBEXPLORER_TAB_REMOTE)) {
                if (remoteDir.length() == 0)
                    createItem(remoteFileListAdapter, "C", remoteBase);
                else
                    createItem(remoteFileListAdapter, "C", remoteBase + "/" + remoteDir);
            }
        }
    });

}

From source file:com.skytree.epubtest.BookViewActivity.java

public void makeFontBox() {
    int boxColor = Color.rgb(241, 238, 229);
    int innerBoxColor = Color.rgb(246, 244, 239);
    int inlineColor = Color.rgb(133, 105, 75);

    int width = 450;
    int height = 500;
    fontBox = new SkyBox(this);
    fontBox.setBoxColor(boxColor);//from  w ww  .  ja v a 2s.  co  m
    fontBox.setArrowHeight(ps(25));
    fontBox.setArrowDirection(false);
    setFrame(fontBox, ps(50), ps(200), ps(width), ps(height));

    ScrollView fontBoxScrollView = new ScrollView(this);
    this.setFrame(fontBoxScrollView, ps(5), ps(10), ps(440), ps(height - 50));
    fontBox.contentView.addView(fontBoxScrollView); // NEW

    SkyLayout contentLayout = new SkyLayout(this);
    fontBoxScrollView.addView(contentLayout,
            new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

    // #1 first make brightness controller
    // brView is the box containing the bright slider. 
    int FY = 10;
    View brView = new View(this);
    RoundRectShape rrs = new RoundRectShape(
            new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null, null);
    SkyDrawable srd = new SkyDrawable(rrs, innerBoxColor, inlineColor, 1);
    brView.setBackgroundDrawable(srd);
    setFrame(brView, ps(20), ps(FY), ps(width - 40), ps(53));
    contentLayout.addView(brView);
    // darker and brighter icons
    int SBS = 60;
    ImageButton sbb = this.makeImageButton(9005, R.drawable.brightness2x, ps(SBS), ps(SBS));
    setFrame(sbb, ps(50), ps(FY), ps(SBS), ps(SBS));
    sbb.setAlpha(200);
    int BBS = 70;
    ImageButton bbb = this.makeImageButton(9006, R.drawable.brightness2x, ps(BBS), ps(BBS));
    setFrame(bbb, ps(width - 110), ps(FY - 5), ps(BBS), ps(BBS));
    bbb.setAlpha(200);
    contentLayout.addView(sbb);
    contentLayout.addView(bbb);
    // making bright slider      
    brightBar = new SeekBar(this);
    brightBar.setMax(999);
    brightBar.setId(997);
    brightBar.setBackgroundColor(Color.TRANSPARENT);
    brightBar.setOnSeekBarChangeListener(new SeekBarDelegate());
    brightBar.setProgressDrawable(new LineDrawable(Color.rgb(160, 160, 160), ps(10)));
    brightBar.setThumbOffset(-1);
    setFrame(brightBar, ps(100), ps(FY + 4), ps(width - 210), ps(50));
    contentLayout.addView(brightBar);

    // #2 second make decrese/increse font size buttons
    // decrease font size Button
    int FBY = 80;
    decreaseButton = new Button(this);
    setFrame(decreaseButton, ps(20), ps(FBY), ps(width - 40 - 20) / 2, ps(60));
    decreaseButton.setText(getString(R.string.chara));
    decreaseButton.setGravity(Gravity.CENTER);
    decreaseButton.setTextSize(14);
    decreaseButton.setId(5000);
    RoundRectShape drs = new RoundRectShape(
            new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null, null);
    SkyDrawable drd = new SkyDrawable(drs, innerBoxColor, inlineColor, 1);
    decreaseButton.setBackgroundDrawable(drd);
    decreaseButton.setOnClickListener(listener);
    decreaseButton.setOnTouchListener(new ButtonHighlighterOnTouchListener(decreaseButton));
    contentLayout.addView(decreaseButton);
    // inccrease font size Button
    increaseButton = new Button(this);
    setFrame(increaseButton, ps(10 + width / 2), ps(FBY), ps(width - 40 - 20) / 2, ps(60));
    increaseButton.setText(getString(R.string.chara));
    increaseButton.setTextSize(18);
    increaseButton.setGravity(Gravity.CENTER);
    increaseButton.setId(5001);
    RoundRectShape irs = new RoundRectShape(
            new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null, null);
    SkyDrawable ird = new SkyDrawable(irs, innerBoxColor, inlineColor, 1);
    increaseButton.setBackgroundDrawable(ird);
    increaseButton.setOnClickListener(listener);
    increaseButton.setOnTouchListener(new ButtonHighlighterOnTouchListener(increaseButton));
    contentLayout.addView(increaseButton);

    // # 3 make the button to increase/decrese line spacing. 
    int LBY = 145;
    // deccrease line space Button
    decreaseLineSpaceButton = this.makeImageButton(9005, R.drawable.decline2x, ps(30), ps(30));
    setFrame(decreaseLineSpaceButton, ps(20), ps(LBY), ps(width - 40 - 20) / 2, ps(60));
    decreaseLineSpaceButton.setId(4000);
    drs = new RoundRectShape(new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null,
            null);
    drd = new SkyDrawable(drs, innerBoxColor, inlineColor, 1);
    decreaseLineSpaceButton.setBackgroundDrawable(drd);
    decreaseLineSpaceButton.setOnClickListener(listener);
    decreaseLineSpaceButton
            .setOnTouchListener(new ImageButtonHighlighterOnTouchListener(decreaseLineSpaceButton));
    contentLayout.addView(decreaseLineSpaceButton);
    // inccrease line space Button        
    increaseLineSpaceButton = this.makeImageButton(9005, R.drawable.incline2x, ps(30), ps(30));
    setFrame(increaseLineSpaceButton, ps(10 + width / 2), ps(LBY), ps(width - 40 - 20) / 2, ps(60));
    increaseLineSpaceButton.setId(4001);
    irs = new RoundRectShape(new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null,
            null);
    ird = new SkyDrawable(irs, innerBoxColor, inlineColor, 1);
    increaseLineSpaceButton.setBackgroundDrawable(ird);
    increaseLineSpaceButton.setOnClickListener(listener);
    increaseLineSpaceButton
            .setOnTouchListener(new ImageButtonHighlighterOnTouchListener(increaseLineSpaceButton));
    contentLayout.addView(increaseLineSpaceButton);

    // #4 make themes selector.  
    int TY = 220;
    int TH = 70;
    int TW = (width - 40 - 20) / 3;

    HorizontalScrollView themeScrollView = new HorizontalScrollView(this);
    themesView = new LinearLayout(this);
    themesView.setOrientation(LinearLayout.HORIZONTAL);

    themeScrollView.addView(themesView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

    for (int i = 0; i < this.themes.size(); i++) {
        Theme theme = themes.get(i);
        Button themeButton = new Button(this);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ps(TW), ps(TH));
        layoutParams.setMargins(0, 0, 24, 0);
        themesView.addView(themeButton, layoutParams);
        RoundRectShape rs = new RoundRectShape(
                new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null, null);
        SkyDrawable brd = new SkyDrawable(rs, theme.backgroundColor, Color.BLACK, 1);
        themeButton.setBackgroundDrawable(brd);
        themeButton.setText(theme.name);
        themeButton.setTextColor(theme.foregroundColor);
        themeButton.setId(7000 + i);
        themeButton.setOnClickListener(listener);
    }

    this.setFrame(themeScrollView, ps(20), ps(TY), ps(width - 40), ps(90));
    contentLayout.addView(themeScrollView);

    // #5 font list box
    int SY = 310;
    int fontButtonHeight = 80;
    int fontListHeight;
    fontListHeight = fontButtonHeight * fonts.size();
    fontListView = new LinearLayout(this);
    fontListView.setOrientation(LinearLayout.VERTICAL);
    contentLayout.addView(fontListView);
    this.setFrame(fontListView, ps(20), ps(SY), ps(width - 40), ps(fontListHeight));
    int inlineColor2 = Color.argb(140, 133, 105, 75);

    for (int i = 0; i < fonts.size(); i++) {
        CustomFont customFont = fonts.get(i);
        Button fontButton = new Button(this);
        fontButton.setText(customFont.fontFaceName);
        fontButton.setTextSize(20);
        Typeface tf = null;
        if (customFont.fontFileName == null || customFont.fontFileName.isEmpty()) {
            tf = this.getTypeface(customFont.fontFaceName, Typeface.BOLD);
        } else {
            tf = Typeface.createFromAsset(getAssets(), "fonts/" + customFont.fontFileName);
        }
        if (tf != null)
            fontButton.setTypeface(tf);
        fontButton.setId(5100 + i);
        RoundRectShape rs = new RoundRectShape(
                new float[] { ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5), ps(5) }, null, null);
        SkyDrawable brd = new SkyDrawable(rs, innerBoxColor, inlineColor2, 1);
        fontButton.setBackgroundDrawable(brd);
        this.setFrame(fontButton, ps(0), ps(0), ps(width - 40), ps(fontButtonHeight));
        fontListView.addView(fontButton);
        fontButton.setOnClickListener(listener);
        fontButton.setOnTouchListener(new ButtonHighlighterOnTouchListener(fontButton));
    }

    this.ePubView.addView(fontBox);
    this.hideFontBox();
}

From source file:com.klinker.android.launcher.launcher3.Launcher.java

/**
 * Sets up transparent navigation and status bars in LMP.
 * This method is a no-op for other platform versions.
 *//*from w ww .  j  a va  2 s . c  o m*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setupTransparentSystemBarsForLmp() {
    if (Utilities.isLmpOrAbove()) {
        Window window = getWindow();
        window.getAttributes().systemUiVisibility |= (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(Color.TRANSPARENT);
        window.setNavigationBarColor(Color.TRANSPARENT);
    }
}