Example usage for android.graphics Color WHITE

List of usage examples for android.graphics Color WHITE

Introduction

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

Prototype

int WHITE

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

Click Source Link

Usage

From source file:android.support.v17.leanback.widget.SeekBar.java

public SeekBar(Context context, AttributeSet attrs) {
    super(context, attrs);
    setWillNotDraw(false);//w  w  w  . j  a v a 2s.  c  o  m
    mBackgroundPaint.setColor(Color.GRAY);
    mSecondProgressPaint.setColor(Color.LTGRAY);
    mProgressPaint.setColor(Color.RED);
    mKnobPaint.setColor(Color.WHITE);
    mBarHeight = context.getResources()
            .getDimensionPixelSize(R.dimen.lb_playback_transport_progressbar_bar_height);
    mActiveBarHeight = context.getResources()
            .getDimensionPixelSize(R.dimen.lb_playback_transport_progressbar_active_bar_height);
    mActiveRadius = context.getResources()
            .getDimensionPixelSize(R.dimen.lb_playback_transport_progressbar_active_radius);
}

From source file:ayushi.view.fragment.SettingsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.frag_settings, container, false);

    getActivity().setTitle("About App");

    mToolbar = (Toolbar) rootView.findViewById(R.id.htab_toolbar);
    if (mToolbar != null) {
        ((ECartHomeActivity) getActivity()).setSupportActionBar(mToolbar);
    }//from   w ww . ja  v a2 s.c  o m

    if (mToolbar != null) {
        ((ECartHomeActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        mToolbar.setNavigationIcon(R.drawable.ic_drawer);

    }

    mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ((ECartHomeActivity) getActivity()).getmDrawerLayout().openDrawer(GravityCompat.START);
        }
    });

    mToolbar.setTitleTextColor(Color.WHITE);

    submitLog = (TextView) rootView.findViewById(R.id.submit_log_txt);

    if (PreferenceHelper.getPrefernceHelperInstace().getBoolean(getActivity(), PreferenceHelper.SUBMIT_LOGS,
            true)) {

        submitLog.setText("Disable");
    } else {
        submitLog.setText("Enable");
    }

    rootView.findViewById(R.id.submit_log).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            if (PreferenceHelper.getPrefernceHelperInstace().getBoolean(getActivity(),
                    PreferenceHelper.SUBMIT_LOGS, true)) {
                PreferenceHelper.getPrefernceHelperInstace().setBoolean(getActivity(),
                        PreferenceHelper.SUBMIT_LOGS, false);

                submitLog.setText("Disable");
            } else {
                PreferenceHelper.getPrefernceHelperInstace().setBoolean(getActivity(),
                        PreferenceHelper.SUBMIT_LOGS, true);
                submitLog.setText("Enable");
            }

        }
    });

    rootView.setFocusableInTouchMode(true);
    rootView.requestFocus();
    rootView.setOnKeyListener(new View.OnKeyListener() {

        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {

            if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {

                Utils.switchContent(R.id.frag_container, Utils.HOME_FRAGMENT,
                        ((ECartHomeActivity) (getContext())), AnimationType.SLIDE_UP);

            }
            return true;
        }
    });

    rootView.findViewById(R.id.picasso).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://github.com/square/picasso"));
            startActivity(browserIntent);

        }
    });

    rootView.findViewById(R.id.acra).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/ACRA/acra"));
            startActivity(browserIntent);

        }
    });

    rootView.findViewById(R.id.pull_zoom_view).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://github.com/Frank-Zhu/PullZoomView"));
            startActivity(browserIntent);

        }
    });

    rootView.findViewById(R.id.list_buddies).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://github.com/jpardogo/ListBuddies"));
            startActivity(browserIntent);

        }
    });

    rootView.findViewById(R.id.list_jazzy).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://github.com/twotoasters/JazzyListView"));
            startActivity(browserIntent);

        }
    });

    rootView.findViewById(R.id.email_dev).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            emailIntent.setType("text/plain");
            emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                    new String[] { "serveroverloadofficial@gmail.com" });
            emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hello There");
            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Add Message here");

            emailIntent.setType("message/rfc822");

            try {
                startActivity(Intent.createChooser(emailIntent, "Send email using..."));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(getActivity(), "No email clients installed.", Toast.LENGTH_SHORT).show();
            }

        }
    });

    return rootView;
}

From source file:biz.wiz.android.wallet.util.ViewPagerTabs.java

@Override
protected void onDraw(final Canvas canvas) {
    super.onDraw(canvas);

    final int viewWidth = getWidth();
    final int viewHalfWidth = viewWidth / 2;
    final int viewBottom = getHeight();

    final float density = getResources().getDisplayMetrics().density;
    final float spacing = 32 * density;

    path.reset();//from   w w w  . j a  va2s .  co  m
    path.moveTo(viewHalfWidth, viewBottom - 5 * density);
    path.lineTo(viewHalfWidth + 5 * density, viewBottom);
    path.lineTo(viewHalfWidth - 5 * density, viewBottom);
    path.close();

    paint.setColor(Color.WHITE);
    canvas.drawPath(path, paint);

    paint.setTypeface(Typeface.DEFAULT_BOLD);
    final float y = getPaddingTop() + -paint.getFontMetrics().top;

    for (int i = 0; i < labels.size(); i++) {
        final String label = labels.get(i);

        paint.setTypeface(i == pagePosition ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
        paint.setColor(i == pagePosition ? Color.BLACK : Color.DKGRAY);

        final float x = viewHalfWidth + (maxWidth + spacing) * (i - pageOffset);
        final float labelWidth = paint.measureText(label);
        final float labelHalfWidth = labelWidth / 2;

        final float labelLeft = x - labelHalfWidth;
        final float labelVisibleLeft = labelLeft >= 0 ? 1f : 1f - (-labelLeft / labelWidth);

        final float labelRight = x + labelHalfWidth;
        final float labelVisibleRight = labelRight < viewWidth ? 1f
                : 1f - ((labelRight - viewWidth) / labelWidth);

        final float labelVisible = Math.min(labelVisibleLeft, labelVisibleRight);

        paint.setAlpha((int) (labelVisible * 255));

        canvas.drawText(label, labelLeft, y, paint);
    }
}

From source file:arun.com.chromer.settings.SettingsGroupActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    ButterKnife.bind(this);
    setSupportActionBar(toolbar);/*www  .  j  ava  2 s . c om*/
    //noinspection ConstantConditions
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    adapter = new SettingsGroupAdapter(this);
    settingsListView.setLayoutManager(new LinearLayoutManager(this));
    settingsListView.setAdapter(adapter);
    settingsListView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    adapter.setGroupItemClickListener(this);

    setDefaultImage.setImageDrawable(
            new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_auto_fix).color(Color.WHITE).sizeDp(24));

    setDefaultCard.setOnClickListener(v -> {
        final String defaultBrowser = Utils.getDefaultBrowserPackage(getApplicationContext());
        if (defaultBrowser.equalsIgnoreCase("android") || defaultBrowser.startsWith("org.cyanogenmod")
                || defaultBrowser.equalsIgnoreCase("com.huawei.android.internal.app")) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.GOOGLE_URL)));
        } else {
            final Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
            intent.setData(Uri.parse("package:" + defaultBrowser));
            Toast.makeText(SettingsGroupActivity.this,
                    Utils.getAppNameWithPackage(getApplicationContext(), defaultBrowser) + " "
                            + getString(R.string.default_clear_msg),
                    Toast.LENGTH_LONG).show();
            startActivity(intent);
        }
    });
    updateDefaultBrowserCard();
}

From source file:com.audionote.widget.SlideSwitch.java

public SlideSwitch(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    listener = null;//from w w w  .java  2 s .  com
    paint = new Paint();
    paint.setAntiAlias(true);
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.slideswitch);
    color_theme = a.getColor(R.styleable.slideswitch_themeColor, DEFAULT_COLOR_THEME);
    color_back_theme = a.getColor(R.styleable.slideswitch_backColor, Color.WHITE);
    isOpen = true;
    shape = SHAPE_CIRCLE;
    a.recycle();

    borderWidth = ScreenUtils.getDipValue(context, 1);
    border_color = Color.parseColor("#ffcccccc");
}

From source file:com.zprogrammer.tool.ui.SearchActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_search, menu);
    MenuItem searchItem = menu.findItem(R.id.action_search);//??item
    final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    int id = searchView.getContext().getResources().getIdentifier("search_src_text", "id",
            BuildConfig.APPLICATION_ID);
    final EditText editText = (EditText) searchView.findViewById(id);
    editText.setTextColor(Color.WHITE);
    MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
        @Override/*w w w  .  j ava  2s  .co  m*/
        public boolean onMenuItemActionExpand(MenuItem item) {
            return true;
        }

        @Override
        public boolean onMenuItemActionCollapse(MenuItem item) {
            ActivityCompat.finishAfterTransition(SearchActivity.this);
            return true;
        }
    });
    searchItem.expandActionView();
    searchView.setQuery(queryText, false);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            queryText = query;
            queryDatas(null);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
    return true;
}

From source file:cn.koosoft.xianzoo.widget.CirclePageIndicator.java

public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    if (isInEditMode())
        return;//from   w  w w. j  a va 2  s . c om

    //Load defaults from resources
    final Resources res = getResources();
    final int defaultPageColor = Color.BLACK;
    final int defaultFillColor = Color.WHITE;
    final int defaultOrientation = HORIZONTAL;
    final int defaultStrokeColor = Color.LTGRAY;
    final float defaultStrokeWidth = TypedValue.complexToDimension(1, getResources().getDisplayMetrics());
    final float defaultRadius = TypedValue.complexToDimension(3, getResources().getDisplayMetrics());
    final boolean defaultCentered = true;
    final boolean defaultSnap = false;

    //Retrieve styles attributes
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CirclePageIndicator, defStyle, 0);

    mCentered = a.getBoolean(R.styleable.CirclePageIndicator_centered, defaultCentered);
    mOrientation = a.getInt(R.styleable.CirclePageIndicator_android_orientation, defaultOrientation);
    mPaintPageFill.setStyle(Style.FILL);
    mPaintPageFill.setColor(a.getColor(R.styleable.CirclePageIndicator_pageColor, defaultPageColor));
    mPaintStroke.setStyle(Style.STROKE);
    mPaintStroke.setColor(a.getColor(R.styleable.CirclePageIndicator_strokeColor, defaultStrokeColor));
    mPaintStroke
            .setStrokeWidth(a.getDimension(R.styleable.CirclePageIndicator_strokeWidth, defaultStrokeWidth));
    mPaintFill.setStyle(Style.FILL);
    mPaintFill.setColor(a.getColor(R.styleable.CirclePageIndicator_fillColor, defaultFillColor));
    mRadius = a.getDimension(R.styleable.CirclePageIndicator_radius, defaultRadius);
    mSnap = a.getBoolean(R.styleable.CirclePageIndicator_snap, defaultSnap);

    Drawable background = a.getDrawable(R.styleable.CirclePageIndicator_android_background);
    if (background != null) {
        setBackgroundDrawable(background);
    }

    a.recycle();

    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}

From source file:com.google.android.apps.santatracker.doodles.tilt.ToggleableBounceActor.java

@Override
public boolean resolveCollision(Actor other, float deltaMs) {
    // Resolve trigger collisions.
    if (onTrigger.collisionBody.contains(other.position)) {
        enabled = true;/*from  w  w  w. j a  va 2s.co m*/
        collisionBody.setPaintColors(Color.RED, Color.WHITE, 0x6400ff00);
    } else if (offTrigger.collisionBody.contains(other.position)) {
        enabled = false;
        collisionBody.setPaintColors(Color.RED, Color.LTGRAY, 0x6400ff00);
    }

    // Handle the actual collision.
    if (enabled) {
        return super.resolveCollision(other, deltaMs);
    }
    return false;
}

From source file:com.spoiledmilk.cykelsuperstier.navigation.SMRouteNavigationActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    textPath = (TextView) findViewById(R.id.textPath);
    textService = (TextView) findViewById(R.id.textService);
    textStrain = (TextView) findViewById(R.id.textStrain);
    textMetro = (TextView) findViewById(R.id.textMetro);
    textLocalTrain = (TextView) findViewById(R.id.textLocalTrain);

    if (getIntent() != null && getIntent().getExtras() != null
            && getIntent().getExtras().containsKey("overlays")) {
        ((SMRouteNavigationMapFragment) getMapFragment()).overlaysShown = getIntent().getIntExtra("overlays",
                0);//from w w w .j a  v  a2s . c o  m
        int overlaysShown = getIntent().getIntExtra("overlays", 0);
        if ((overlaysShown & 1) > 0) {
            isPathSelected = true;
            findViewById(R.id.pathContainer).setBackgroundColor(Color.rgb(236, 104, 0));
            ((ImageView) findViewById(R.id.imgCheckbox1)).setImageResource(R.drawable.check_in_orange);
            ((ImageView) findViewById(R.id.imgPath)).setImageResource(R.drawable.bike_icon_white);
            textPath.setTextColor(Color.WHITE);
        }
        if ((overlaysShown & 2) > 0) {
            isServiceSelected = true;
            findViewById(R.id.serviceContainer).setBackgroundColor(Color.rgb(236, 104, 0));
            ((ImageView) findViewById(R.id.imgCheckbox2)).setImageResource(R.drawable.check_in_orange);
            ((ImageView) findViewById(R.id.imgService)).setImageResource(R.drawable.service_pump_icon_white);
            textService.setTextColor(Color.WHITE);
        }
        if ((overlaysShown & 4) > 0) {
            isStrainSelected = true;
            findViewById(R.id.strainContainer).setBackgroundColor(Color.rgb(236, 104, 0));
            ((ImageView) findViewById(R.id.imgCheckbox3)).setImageResource(R.drawable.check_in_orange);
            ((ImageView) findViewById(R.id.imgStrain)).setImageResource(R.drawable.s_togs_icon_white);
            textStrain.setTextColor(Color.WHITE);
        }
        if ((overlaysShown & 8) > 0) {
            isMetroSelected = true;
            findViewById(R.id.metroContainer).setBackgroundColor(Color.rgb(236, 104, 0));
            ((ImageView) findViewById(R.id.imgCheckbox4)).setImageResource(R.drawable.check_in_orange);
            ((ImageView) findViewById(R.id.imgMetro)).setImageResource(R.drawable.metro_icon_white);
            textMetro.setTextColor(Color.WHITE);
        }
        if ((overlaysShown & 16) > 0) {
            isLocalTrainSelected = true;
            findViewById(R.id.localTrainContainer).setBackgroundColor(Color.rgb(236, 104, 0));
            ((ImageView) findViewById(R.id.imgCheckbox5)).setImageResource(R.drawable.check_in_orange);
            ((ImageView) findViewById(R.id.imgLocalTrain)).setImageResource(R.drawable.local_train_icon_white);
            textLocalTrain.setTextColor(Color.WHITE);
        }
    }

}

From source file:master.flame.danmaku.danmaku.parser.android.AcFunDanmakuParser.java

private Danmakus _parse(JSONArray jsonArray, Danmakus danmakus) {
    if (danmakus == null) {
        danmakus = new Danmakus();
    }/*  www . j a v a 2 s  . c  o m*/
    if (jsonArray == null || jsonArray.length() == 0) {
        return danmakus;
    }
    for (int i = 0; i < jsonArray.length(); i++) {
        try {
            JSONObject obj = jsonArray.getJSONObject(i);
            String c = obj.getString("c");
            String[] values = c.split(",");
            if (values.length > 0) {
                int type = Integer.parseInt(values[2]); // 
                if (type == 7)
                    // FIXME : hard code
                    // TODO : parse advance danmaku json
                    continue;
                long time = (long) (Float.parseFloat(values[0]) * 1000); // 
                int color = Integer.parseInt(values[1]) | 0xFF000000; // 
                float textSize = Float.parseFloat(values[3]); // ?
                BaseDanmaku item = DanmakuFactory.createDanmaku(type, mDisp);
                if (item != null) {
                    item.time = time;
                    item.textSize = textSize * (mDispDensity - 0.6f);
                    item.textColor = color;
                    item.textShadowColor = color <= Color.BLACK ? Color.WHITE : Color.BLACK;
                    DanmakuFactory.fillText(item, obj.optString("m", "...."));
                    item.index = i;
                    item.setTimer(mTimer);
                    danmakus.addItem(item);
                }
            }
        } catch (JSONException e) {
        } catch (NumberFormatException e) {
        }
    }
    return danmakus;
}