Example usage for android.graphics Color YELLOW

List of usage examples for android.graphics Color YELLOW

Introduction

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

Prototype

int YELLOW

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

Click Source Link

Usage

From source file:Main.java

public static Paint getGameOverRestartMessageColor() {
    Paint paint = new Paint();
    paint.setColor(Color.YELLOW);
    paint.setTextSize(20);//  www  .  j  a va  2  s  .co m
    paint.setTypeface(Typeface.DEFAULT_BOLD);
    //        paint.setShadowLayer(2, 3, 3, Color.WHITE);
    return paint;
}

From source file:Main.java

public static int getDurationColor(long duration) {
    if (duration < 3 * 3600 * 1000) {
        return Color.RED;
    }/*  w  w w. jav a 2s.  c o  m*/
    if (duration < 12 * 3600 * 1000) {
        return Color.YELLOW;
    }
    if (duration < 24 * 3600 * 1000) {
        return Color.GREEN;
    }
    return Color.WHITE;
}

From source file:Main.java

public static int getLongDurationColor(long duration) {
    if (duration < 24 * 3600 * 1000) {
        return Color.RED;
    }//from  www  .j av  a 2 s.co m
    if (duration < 2 * 24 * 3600 * 1000) {
        return Color.YELLOW;
    }
    if (duration < 7 * 24 * 3600 * 1000) {
        return Color.GREEN;
    }
    return Color.WHITE;
}

From source file:Main.java

/**
 * Create a bitmap with some color.//from  w  ww .j  a  v a  2 s.  com
 *
 * @param config Bitmap config.
 * @return A bitmap.
 */
public static Bitmap createQuadColorBitmap(Bitmap.Config config) {
    return Bitmap.createBitmap(new int[] { Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW }, 2, 2, config);
}

From source file:Main.java

public static int getColor(float barValue) {

    barValue = Math.abs(barValue);

    if (barValue < 50) {
        return Color.GREEN;
    } else if (barValue >= 50 && barValue <= 100) {
        return Color.BLUE;
    } else if (barValue > 100 && barValue <= 200) {
        return Color.YELLOW;
    }//from   www  .  j av  a  2  s .  c o m
    return Color.RED;
}

From source file:Main.java

public static int getRandomColor() {
    List<Integer> colors = new ArrayList<>();
    colors.add(Color.BLACK);/*ww  w  .jav  a 2 s. c  o m*/
    colors.add(Color.RED);
    colors.add(Color.GREEN);
    colors.add(Color.BLUE);
    colors.add(Color.YELLOW);
    colors.add(Color.GRAY);
    colors.add(Color.MAGENTA);
    colors.add(Color.CYAN);
    colors.add(Color.LTGRAY);
    return colors.get(new Random().nextInt(colors.size()));
}

From source file:Main.java

public static Bitmap buildSequence(Context context, String text) {
    Bitmap myBitmap = Bitmap.createBitmap(160, 84, Bitmap.Config.ARGB_4444);
    Canvas myCanvas = new Canvas(myBitmap);
    Paint paint = new Paint();
    //Typeface font = Typeface.createFromAsset(context.getAssets(),"fonts/7LED.ttf");
    paint.setAntiAlias(true);/*  w w  w.  j  av a2  s  .  co m*/
    paint.setSubpixelText(true);
    //paint.setTypeface(font);
    paint.setStyle(Paint.Style.FILL);
    paint.setColor(Color.YELLOW);
    paint.setTextSize(65);
    paint.setTextAlign(Paint.Align.CENTER);
    myCanvas.drawText(text, 80, 60, paint);
    return myBitmap;
}

From source file:com.handlerexploit.example.InfiniteViewPagerExampleActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from  www. j  a va2s . com

    ViewPager viewPager = (ViewPager) findViewById(R.id.pager);

    PagerAdapter pagerAdapter = new PagerAdapter(this);
    addColorFragment(pagerAdapter, Color.BLUE);
    addColorFragment(pagerAdapter, Color.RED);
    addColorFragment(pagerAdapter, Color.YELLOW);
    addColorFragment(pagerAdapter, Color.GREEN);

    viewPager.setAdapter(new InfinitePagerAdapter(pagerAdapter));
    viewPager.setCurrentItem(pagerAdapter.getCount() * 100, false);
}

From source file:org.chronotext.MobileTest.Bridge.java

public Bridge(Activity activity) {
    super(activity);

    // ---//from ww  w.jav a2s .  c o  m

    switch (testMode) {
    case GLVIEW_ATTACHED_AND_VISIBLE_AT_START:
        hidden = false;
        detached = false;
        break;

    case GLVIEW_ATTACHED_AND_HIDDEN_AT_START:
        hidden = true;
        detached = false;
        break;

    default:
    case GLVIEW_NOT_ATTACHED_AT_START:
        hidden = false;
        detached = true;
        break;
    }

    hasRootView = CAN_BE_HIDDEN || CAN_BE_DETACHED || hidden || detached;

    // ---

    setViewProperties(new GLView.Properties().setEGLContextClientVersion(1).setPreserveEGLContextOnPause(true));

    if (hasRootView) {
        rootView = new RelativeLayout(activity);
        rootView.setBackgroundColor(Color.YELLOW);
        activity.setContentView(rootView);
    }

    if (!detached) {
        if (hidden) {
            getView().setVisibility(View.GONE);
        }

        if (hasRootView) {
            rootView.addView(getView());
        } else {
            activity.setContentView(getView());
        }
    }

    // ---    

    overlayView = new RelativeLayout(activity);
    activity.addContentView(overlayView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    button1 = addButton(100, 100, 1);
    button2 = addButton(100, 200, 2);

    refreshButtons();
}

From source file:ca.farrelltonsolar.classic.MonitorActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    navigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager()
            .findFragmentById(R.id.navigation_drawer);
    // Set up the drawer.
    DrawerLayout layout = (DrawerLayout) findViewById(R.id.drawer_layout);
    navigationDrawerFragment.setUp(R.id.navigation_drawer, layout);
    stl = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
    stl.setDividerColors(Color.RED);
    stl.setSelectedIndicatorColors(Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.YELLOW);
    viewPager = (ViewPager) findViewById(R.id.pager);
    setupActionBar();//from   w ww . j  a  va  2 s.  co m
    Log.d(getClass().getName(), "onCreate");
}