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:org.akvo.caddisfly.sensor.colorimetry.strip.widget.PercentageMeterView.java

@Override
public void onDraw(@NonNull Canvas canvas) {

    if (Float.isNaN(percentage)) {
        return;/* w  w w . ja va2 s . com*/
    }

    double number = (100 - percentage) * NUMBER_OF_BARS * PERCENT;

    canvas.save();

    // Set each dot's diameter to half the canvas height
    canvas.translate(
            canvas.getWidth() / 2f - ((canvas.getHeight() / 2f + GUTTER_SPACE) * ((NUMBER_OF_BARS - 1) / 2f)),
            0);

    for (double i = 0; i < NUMBER_OF_BARS; i++) {

        // Reset color
        paint.setColor(Color.LTGRAY);

        if (number >= 0) {
            if (i < 2) {
                // Red if number is lower than i + 1
                // 2 red dots if number < 1 or 1 red dot if number > 1
                if (number <= i + 1) {
                    paint.setColor(red);
                }
            } else if (i < 4) {
                // Orange if number between 1 and 4
                // if number == 1.5 then 1 red followed by orange dot
                // if number == 2.5 then 2 orange dots
                // if number == 3.5 then 1 orange dot
                if (number >= i - 1 && number <= i + 2) {
                    paint.setColor(orange);
                }
            } else {
                if (number > i) {
                    // Green if number larger than 3 but yellow if number exceeds optimum
                    if (number > NUMBER_OF_BARS) {
                        paint.setColor(Color.YELLOW);
                    } else {
                        paint.setColor(green);
                    }
                }
            }
        }

        canvas.drawCircle(0, canvas.getHeight() / 2f, canvas.getHeight() / 4f, paint);

        // Position next circle
        canvas.translate(canvas.getHeight() / 2f + GUTTER_SPACE, 0);
    }

    canvas.restore();

    super.onDraw(canvas);
}

From source file:org.schabi.newpipe.report.ErrorActivity.java

public static void reportError(final Context context, final List<Throwable> el, final Class returnAcitivty,
        View rootView, final ErrorInfo errorInfo) {

    if (rootView != null) {
        Snackbar.make(rootView, R.string.error_snackbar_message, Snackbar.LENGTH_LONG)
                .setActionTextColor(Color.YELLOW)
                .setAction(R.string.error_snackbar_action, new View.OnClickListener() {
                    @Override//from w  w w . j  a  v  a 2s .  c  om
                    public void onClick(View v) {
                        ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
                        ac.returnActivity = returnAcitivty;
                        Intent intent = new Intent(context, ErrorActivity.class);
                        intent.putExtra(ERROR_INFO, errorInfo);
                        intent.putExtra(ERROR_LIST, elToSl(el));
                        context.startActivity(intent);
                    }
                }).show();
    } else {
        ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
        ac.returnActivity = returnAcitivty;
        Intent intent = new Intent(context, ErrorActivity.class);
        intent.putExtra(ERROR_INFO, errorInfo);
        intent.putExtra(ERROR_LIST, elToSl(el));
        context.startActivity(intent);
    }
}

From source file:client.smrtms.com.smrtms_client.fragment.TabsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**/* w  w w. j  a va 2  s . c  om*/
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new PagerItem(getString(R.string.tab_map), // Title
            Color.BLUE, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new PagerItem(getString(R.string.tab_contacts), // Title
            Color.YELLOW, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new PagerItem(getString(R.string.tab_events), // Title
            Color.GREEN, // Indicator color
            Color.GRAY // Divider color
    ));
    // END_INCLUDE (populate_tabs)
}

From source file:com.marakana.android.yamba.StatusFragment.java

void setCount() {
    int n = MAX_CHARS - status.getText().toString().length();
    count.setText(String.valueOf(n));

    int color = Color.GREEN;
    if (MIN_CHARS >= n) {
        color = Color.RED;//  w  w  w.j  av  a 2  s.co  m
    } else if (WARN_CHARS >= n) {
        color = Color.YELLOW;
    }
    count.setTextColor(color);
}

From source file:com.lpii.evma.view.organizer.SlidingTabsColorsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**//from   w w  w  .ja v  a2  s .  co  m
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem(getString(R.string.organizer_overview), // Title
            Color.BLUE, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.organizer_infos), // Title
            Color.RED, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.organizer_Forfaits), // Title
            Color.YELLOW, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.organizer_attendees), // Title
            Color.GREEN, // Indicator color
            Color.GRAY // Divider color
    ));

}

From source file:com.example.android.slidingtabscolors.SlidingTabsColorsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**/*from  w ww  . j ava  2  s.c  o m*/
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem(getString(R.string.tab_stream), // Title
            Color.BLUE, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_messages), // Title
            Color.RED, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_photos), // Title
            Color.YELLOW, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_notifications), // Title
            Color.GREEN, // Indicator color
            Color.GRAY // Divider color
    ));
    // END_INCLUDE (populate_tabs)
}

From source file:com.example.usuario.interactivemenu.fragment.AccederContainFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**//  w  w  w.  j av a 2s.co  m
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem(getString(R.string.tab_stream), // Title
            Color.BLUE, // Indicator color
            Color.DKGRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_messages), // Title
            Color.RED, // Indicator color
            Color.DKGRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_photos), // Title
            Color.YELLOW, // Indicator color
            Color.DKGRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_notifications), // Title
            Color.GREEN, // Indicator color
            Color.DKGRAY // Divider color
    ));
    // END_INCLUDE (populate_tabs)
}

From source file:com.infoprima.android.advtabcolor.SlidingTabsColorsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**//from   w  ww.j  a v a  2 s. co  m
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem(getString(R.string.tab_stream), // Title
            Color.BLUE, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_messages), // Title
            Color.RED, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_products), // Title
            Color.YELLOW, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_notifications), // Title
            Color.GREEN, // Indicator color
            Color.GRAY // Divider color
    ));

    mTabs.add(new SamplePagerItem(getString(R.string.tab_getjson), // Title
            Color.BLACK, // Indicator color
            Color.GRAY // Divider color
    ));
    // END_INCLUDE (populate_tabs)
}

From source file:com.esri.arcgisruntime.sample.colormaprenderer.MainActivity.java

/**
 * Loads ShastaBW.tif as a Raster and adds it to a new RasterLayer. RasterLayer is then added to the map as an
 * operational layer. A List of color values is created (0-149: red) (150-250: yellow). The List is passed to a new
 * ColorMapRenderer, which is then set to the RasterLayer Rendererer. Map viewpoint is then set based on Raster
 * geometry./*ww  w .  j a  v a2  s  . co m*/
 */
private void loadRaster() {
    // create a raster from a local raster file
    Raster raster = new Raster(buildRasterPath());
    // create a raster layer
    final RasterLayer rasterLayer = new RasterLayer(raster);
    // create a Map with imagery basemap
    ArcGISMap map = new ArcGISMap(Basemap.createImagery());
    // add the map to a map view
    mMapView.setMap(map);
    // add the raster as an operational layer
    map.getOperationalLayers().add(rasterLayer);
    // create a color map where values 0-149 are red (Color.RED) and 150-250 are yellow (Color.Yellow)
    List<Integer> colors = new ArrayList<>();
    for (int i = 0; i <= 250; i++) {
        if (i < 150) {
            colors.add(i, Color.RED);
        } else {
            colors.add(i, Color.YELLOW);
        }
    }
    // create a colormap renderer
    ColormapRenderer colormapRenderer = new ColormapRenderer(colors);
    // set the ColormapRenderer on the RasterLayer
    rasterLayer.setRasterRenderer(colormapRenderer);
    // set Viewpoint on the Raster
    rasterLayer.addDoneLoadingListener(new Runnable() {
        @Override
        public void run() {
            if (rasterLayer.getLoadStatus() == LoadStatus.LOADED) {
                mMapView.setViewpointGeometryAsync(rasterLayer.getFullExtent(), 50);
            } else {
                String error = "RasterLayer failed to load: " + rasterLayer.getLoadError().getMessage();
                Log.e(TAG, error);
                Toast.makeText(MainActivity.this, error, Toast.LENGTH_LONG).show();
            }
        }
    });
}

From source file:com.crs4.roodin.moduletester.CustomView.java

/**
 * @param canvas//w  w w  .j  av a2 s.  co  m
 */
private void drawRadar(Canvas canvas) {
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setColor(Color.RED);
    paint.setAlpha(100);

    float rotation = currentRotation; //gRotationZ_deg + initialMapRotation;

    for (int i = -35; i < 35; i = i + 2) {
        float arrowX1 = (float) (translateX - Math.sin(Math.toRadians(rotation + i)) * 45);
        float arrowY1 = (float) (translateY - Math.cos(Math.toRadians(rotation + i)) * 45);
        canvas.drawLine(translateX, translateY, arrowX1, arrowY1, paint);

    }

    paint.setAlpha(100);
    paint.setColor(Color.RED);
    canvas.drawCircle(translateX, translateY, 7, paint);

    paint.setColor(Color.YELLOW);
    canvas.drawCircle(translateX, translateY, 6, paint);

    paint.setColor(Color.RED);
    canvas.drawCircle(translateX, translateY, 1, paint);
}