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:com.emotiona.study.listviewpage.SwipeMenuListViewFragment.java

private void initData() {
    mAppList = getActivity().getPackageManager().getInstalledApplications(0);
    mAdapter = new AppAdapter();
    mListView.setAdapter(mAdapter);/*from   w w  w. j a  va  2  s.  c om*/

    // step 1. create a MenuCreator
    SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(getActivity());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xC9, 0xC9, 0xCE)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            openItem.setIcon(android.R.drawable.ic_menu_add);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(getActivity());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xF9, 0x3F, 0x25)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(android.R.drawable.ic_delete);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mListView.setMenuCreator(creator);

    // step 2. listener item click event
    mListView.setOnMenuItemClickListener(new SwipeMenuListView.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(int position, SwipeMenu menu, int index) {
            ApplicationInfo item = mAppList.get(position);
            switch (index) {
            case 0:
                // open
                open(item);
                break;
            case 1:
                // delete
                //               delete(item);
                mAppList.remove(position);
                mAdapter.notifyDataSetChanged();
                break;
            }
            return false;
        }
    });

    // set SwipeListener
    mListView.setOnSwipeListener(new SwipeMenuListView.OnSwipeListener() {

        @Override
        public void onSwipeStart(int position) {
            // swipe start
        }

        @Override
        public void onSwipeEnd(int position) {
            // swipe end
        }
    });

    // set MenuStateChangeListener
    mListView.setOnMenuStateChangeListener(new SwipeMenuListView.OnMenuStateChangeListener() {
        @Override
        public void onMenuOpen(int position) {

        }

        @Override
        public void onMenuClose(int position) {

        }
    });
    // other setting
    //      listView.setCloseInterpolator(new BounceInterpolator());

    // test item long click
    mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            Toast.makeText(getActivity(), position + " long click", Toast.LENGTH_SHORT).show();
            return false;
        }
    });
}

From source file:com.spoiledmilk.ibikecph.IssuesActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_issues);
    spinner = (Spinner) findViewById(R.id.spinner);
    Bundle data = getIntent().getExtras();
    turns = data.getStringArrayList("turns");
    startLoc = data.getString("startLoc");
    endLoc = data.getString("endLoc");
    startName = data.getString("startName");
    endName = data.getString("endName");
    IssuesAdapter dataAdapter = new IssuesAdapter(this, turns, R.layout.list_row_issues,
            R.layout.spinner_layout);/*from   www. j av a  2  s .  c  o m*/
    spinner.setAdapter(dataAdapter);
    textTitle = (TextView) findViewById(R.id.textTitle);
    textOption1 = (TextView) findViewById(R.id.textOption1);
    textOption2 = (TextView) findViewById(R.id.textOption2);
    textOption3 = (TextView) findViewById(R.id.textOption3);
    textOption4 = (TextView) findViewById(R.id.textOption4);
    textOption5 = (TextView) findViewById(R.id.textOption5);
    textOption6 = (TextView) findViewById(R.id.textOption6);
    textComment1 = (EditText) findViewById(R.id.textComment1);
    textComment2 = (EditText) findViewById(R.id.textComment2);
    textComment3 = (EditText) findViewById(R.id.textComment3);
    textComment4 = (EditText) findViewById(R.id.textComment4);
    textComment5 = (EditText) findViewById(R.id.textComment5);
    textComment6 = (EditText) findViewById(R.id.textComment6);
    imgRadio1 = (ImageView) findViewById(R.id.imgRadio1);
    imgRadio2 = (ImageView) findViewById(R.id.imgRadio2);
    imgRadio3 = (ImageView) findViewById(R.id.imgRadio3);
    imgRadio4 = (ImageView) findViewById(R.id.imgRadio4);
    imgRadio5 = (ImageView) findViewById(R.id.imgRadio5);
    imgRadio6 = (ImageView) findViewById(R.id.imgRadio6);
    btnSend = (TexturedButton) findViewById(R.id.btnSend);
    btnSend.setTextureResource(R.drawable.btn_pattern_repeteable);
    btnSend.setBackgroundResource(R.drawable.btn_blue_selector);
    btnSend.setTextColor(Color.WHITE);
    IbikeApplication.getTracker().sendEvent("Report", "Start", "", (long) 0);
    deselectAll();
}

From source file:com.danimahardhika.android.helpers.core.ColorHelper.java

public static boolean isLightColor(@ColorInt int color) {
    int title = ColorHelper.getTitleTextColor(color);
    return title != Color.WHITE;
}

From source file:com.dogar.geodesic.activities.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.inject(this);
    toolbar.setTitleTextColor(Color.WHITE);
    setSupportActionBar(toolbar);/*w  w w .j ava2  s . c  o m*/
    initDrawerMenu();
    if (savedInstanceState != null) {
        selectedMapID = savedInstanceState.getInt(MENU_MAP_TYPE_SELECTED);
        return;
    }

    if (isLoggedIn(this)) {
        setGMFragment();
    } else {
        chooseAccount();
    }
}

From source file:com.bilibili.socialize.share.utils.selector.PopFullScreenSharePlatformSelector.java

private void createShareWindowIfNeed() {
    if (mShareWindow != null)
        return;/*  w w w  . j  ava 2  s.co m*/

    Context context = getContext();

    grid = createShareGridView(context, getItemClickListener());
    RelativeLayout.LayoutParams gridParams = new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    gridParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    grid.setLayoutParams(gridParams);

    mContainerView = new RelativeLayout(getContext());
    mContainerView.setBackgroundColor(getContext().getResources().getColor(R.color.bili_socialize_black_trans));
    RelativeLayout.LayoutParams containerParams = new RelativeLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
    mContainerView.setLayoutParams(containerParams);
    mContainerView.addView(grid);
    mContainerView.setOnClickListener(this);

    mShareWindow = new PopupWindow(mContainerView, WindowManager.LayoutParams.MATCH_PARENT,
            WindowManager.LayoutParams.MATCH_PARENT, true);
    grid.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
    mShareWindow.setOutsideTouchable(true);
    mShareWindow.setAnimationStyle(-1);
    mShareWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            if (getDismissListener() != null)
                getDismissListener().onDismiss();
        }
    });
}

From source file:com.cmtv.tv.widget.pagerindicator.TabPageIndicator.java

public TabPageIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    setHorizontalScrollBarEnabled(false);

    //custom/* ww  w. j  a  va2 s  .c om*/
    mContext = context;
    this.mTextFocusColor = context.getResources().getColor(R.color.tab_view_indicator_focus_color);
    this.mFocusedShader = new LinearGradient(0.0f, 0.0f, 0.0f, 50.0f, mTextFocusColor, mTextFocusColor,
            Shader.TileMode.CLAMP);
    this.mNormalShader = new LinearGradient(0.0f, 0.0f, 0.0f, 40.0f, Color.WHITE, Color.GRAY,
            Shader.TileMode.CLAMP);

    mTabLayout = new IcsLinearLayout(context, R.attr.vpiTabPageIndicatorStyle);
    addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, MATCH_PARENT));
}

From source file:android.support.v7.app.MediaRouterThemeHelper.java

public static void setMediaControlsBackgroundColor(Context context, View mainControls, View groupControls,
        boolean hasGroup) {
    int primaryColor = getThemeColor(context, 0, android.support.v7.appcompat.R.attr.colorPrimary);
    int primaryDarkColor = getThemeColor(context, 0, android.support.v7.appcompat.R.attr.colorPrimaryDark);
    if (hasGroup && getControllerColor(context, 0) == COLOR_DARK_ON_LIGHT_BACKGROUND) {
        // Instead of showing dark controls in a possibly dark (i.e. the primary dark), model
        // the white dialog and use the primary color for the group controls.
        primaryDarkColor = primaryColor;
        primaryColor = Color.WHITE;
    }//from  w w  w  . ja v  a  2 s. c  om
    mainControls.setBackgroundColor(primaryColor);
    groupControls.setBackgroundColor(primaryDarkColor);
    // Also store the background colors to the view tags. They are used in
    // setVolumeSliderColor() below.
    mainControls.setTag(primaryColor);
    groupControls.setTag(primaryDarkColor);
}

From source file:com.frublin.androidoauth2.FsDialog.java

private void setUpTitle() {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    Drawable icon = getContext().getResources().getDrawable(R.drawable.foursquareicon);
    mTitle = new TextView(getContext());
    mTitle.setText("Foursquare");
    mTitle.setTextColor(Color.WHITE);
    mTitle.setTypeface(Typeface.DEFAULT_BOLD);
    mTitle.setBackgroundColor(FS_BLUE);/*from w w w. ja  va 2  s . c o m*/
    mTitle.setPadding(MARGIN + PADDING, MARGIN, MARGIN, MARGIN);
    mTitle.setCompoundDrawablePadding(MARGIN + PADDING);
    mTitle.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
    mContent.addView(mTitle);
}

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

public ColoredRectangleActor(Vector2D position, Vector2D dimens, String type) {
    super(position, Vector2D.get());

    this.dimens = dimens;
    this.type = type;
    this.zIndex = -1;

    if (type.equals(FAIRWAY_GREEN)) {
        this.zIndex = -2;
    }//  www .  j av a2  s  .c  o  m

    selectedDirection = Direction.NONE;
    paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setColor(TYPE_TO_COLOR_MAP.get(type));
    paint.setStyle(Style.FILL);

    midpointPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    midpointPaint.setColor(Color.WHITE);

    updateExtents();
}

From source file:com.commonsware.android.preso.decktastic.MainActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_actions, menu);

    rc = (ReverseChronometer) menu.findItem(R.id.countdown).getActionView();

    rc.setWarningDuration(5 * 60);// w  w w  .j  a  va  2  s  .c o  m
    rc.setOnClickListener(this);
    rc.setOnLongClickListener(this);
    rc.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24);
    rc.setTextColor(Color.WHITE);

    if (durationInSeconds > 0) {
        rc.setOverallDuration(durationInSeconds);
    }

    MenuItem item = menu.findItem(R.id.route_provider);
    MediaRouteActionProvider provider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(item);

    provider.setRouteSelector(selector);

    return (super.onCreateOptionsMenu(menu));
}