Example usage for android.graphics Color CYAN

List of usage examples for android.graphics Color CYAN

Introduction

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

Prototype

int CYAN

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

Click Source Link

Usage

From source file:curso.and17.PolygonDemoActivity.java

private void setUpMap() {
    // Create a rectangle with two rectangular holes.
    mMap.addPolygon(new PolygonOptions().addAll(createCWRectangle(new LatLng(-20, 130), 5, 5))
            .addHole(createCWRectangle(new LatLng(-20, 130), 3, 3)).fillColor(Color.CYAN)
            .strokeColor(Color.BLUE).strokeWidth(5));

    // Create an ellipse centered at Sydney.
    PolygonOptions options = new PolygonOptions();
    int numPoints = 400;
    float semiHorizontalAxis = 10f;
    float semiVerticalAxis = 5f;
    double phase = 2 * Math.PI / numPoints;
    for (int i = 0; i <= numPoints; i++) {
        options.add(new LatLng(SYDNEY.latitude + semiVerticalAxis * Math.sin(i * phase),
                SYDNEY.longitude + semiHorizontalAxis * Math.cos(i * phase)));
    }/*ww w  .j av  a  2 s .c om*/

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = mMap.addPolygon(
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
}

From source file:com.example.mapdemo.PolygonDemoActivity.java

private void setUpMap() {
    // Create a rectangle with two rectangular holes.
    mMap.addPolygon(new PolygonOptions().addAll(createRectangle(new LatLng(-20, 130), 5, 5))
            .addHole(createRectangle(new LatLng(-22, 128), 1, 1))
            .addHole(createRectangle(new LatLng(-18, 133), 0.5, 1.5)).fillColor(Color.CYAN)
            .strokeColor(Color.BLUE).strokeWidth(5));

    // Create a rectangle centered at Sydney.
    PolygonOptions options = new PolygonOptions().addAll(createRectangle(SYDNEY, 5, 8));

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = mMap.addPolygon(/* w  ww  .  j av a2 s .  c  om*/
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
}

From source file:com.google.mcommerce.sample.android.chapter09.googleMap.PolygonDemoActivity.java

private void setUpMap() {
    // Create a rectangle with two rectangular holes.
    mMap.addPolygon(new PolygonOptions().addAll(createRectangle(new LatLng(-20, 130), 5, 5))
            .addHole(createRectangle(new LatLng(-22, 128), 1, 1))
            .addHole(createRectangle(new LatLng(-18, 133), 0.5, 1.5)).fillColor(Color.CYAN)
            .strokeColor(Color.BLUE).strokeWidth(5));

    // Create an ellipse centered at Sydney.
    PolygonOptions options = new PolygonOptions();
    int numPoints = 400;
    float semiHorizontalAxis = 10f;
    float semiVerticalAxis = 5f;
    double phase = 2 * Math.PI / numPoints;
    for (int i = 0; i <= numPoints; i++) {
        options.add(new LatLng(SYDNEY.latitude + semiVerticalAxis * Math.sin(i * phase),
                SYDNEY.longitude + semiHorizontalAxis * Math.cos(i * phase)));
    }//from  w w w .  ja  v a2  s  . c  om

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = mMap.addPolygon(
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
}

From source file:com.cyrilmottier.android.polaris2demo.PolygonDemoActivity.java

private void setUpMap() {
    // Create a rectangle with two rectangular holes.
    mMap.addPolygon(new PolygonOptions().addAll(createCWRectangle(new LatLng(-20, 130), 5, 5))
            .addHole(createCWRectangle(new LatLng(-22, 128), 1, 1))
            .addHole(createCWRectangle(new LatLng(-18, 133), 0.5, 1.5)).fillColor(Color.CYAN)
            .strokeColor(Color.BLUE).strokeWidth(5));

    // Create an ellipse centered at Sydney.
    PolygonOptions options = new PolygonOptions();
    int numPoints = 400;
    float semiHorizontalAxis = 10f;
    float semiVerticalAxis = 5f;
    double phase = 2 * Math.PI / numPoints;
    for (int i = 0; i <= numPoints; i++) {
        options.add(new LatLng(SYDNEY.latitude + semiVerticalAxis * Math.sin(i * phase),
                SYDNEY.longitude + semiHorizontalAxis * Math.cos(i * phase)));
    }// w  w  w. ja v  a2 s . com

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = mMap.addPolygon(
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
}

From source file:com.ickphum.android.isoview.IsoCanvas.java

public IsoCanvas(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.IsoCanvas, defStyle, defStyle);

    try {//from   w w w .  j  av  a2s .c om
        mBackgroundLineColor = a.getColor(R.styleable.IsoCanvas_backgroundLineColor, mBackgroundLineColor);
    } finally {
        a.recycle();
    }

    mPaints[0] = new Paint();
    mPaints[0].setColor(Color.CYAN);
    mPaints[0].setStyle(Paint.Style.FILL);

    float mHalfWidth = (float) 4.9;
    float mHalfHeight = (float) 5.6;
    float quarter_height = mHalfHeight / 2;

    for (int i = 0; i < 3; i++) {
        mPaths[i] = new Path();
    }

    mPaths[0].moveTo(0, 0);
    mPaths[0].lineTo(-mHalfWidth, -quarter_height);
    mPaths[0].lineTo(-mHalfWidth, quarter_height);
    mPaths[0].lineTo(0, quarter_height * 2);
    mPaths[0].setFillType(Path.FillType.WINDING);

    mPaths[1].moveTo(0, 0);
    mPaths[1].lineTo(10, 0);
    mPaths[1].lineTo(10, 10);
    mPaths[1].lineTo(0, 10);
    mPaths[1].lineTo(0, 0);
    mPaths[1].setFillType(Path.FillType.WINDING);

    initPaints();

    // Sets up interactions
    if (!this.isInEditMode()) {
        mScaleGestureDetector = new ScaleGestureDetector(context, mScaleGestureListener);
        mGestureDetector = new GestureDetectorCompat(context, mGestureListener);
    }

}

From source file:org.messic.android.activities.fragments.ExploreFragment.java

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

    getMessicService();//  ww  w.  j  a  va  2 s  . c om

    ListView gv = (ListView) rootView.findViewById(R.id.explore_lvitems);
    sa = new AlbumAdapter(getActivity(), new AlbumAdapter.EventListener() {

        public void textTouch(MDMAlbum album) {
            AlbumController.getAlbumInfo(ExploreFragment.this.getActivity(), album.getSid());
        }

        public void coverTouch(MDMAlbum album) {
            musicSrv.getPlayer().addAlbum(album);
            Toast.makeText(getActivity(), getResources().getText(R.string.player_added) + album.getName(),
                    Toast.LENGTH_SHORT).show();
        }

        public void coverLongTouch(MDMAlbum album) {
            List<MDMSong> songs = album.getSongs();
            for (int i = 0; i < songs.size(); i++) {
                MDMSong song = songs.get(i);
                song.setAlbum(album);
                musicSrv.getPlayer().addSong(song);
            }
        }
    });
    gv.setAdapter(sa);

    final SwipeRefreshLayout srl = (SwipeRefreshLayout) rootView.findViewById(R.id.explore_swipe);
    srl.setColorSchemeColors(Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);
    srl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        public void onRefresh() {
            new Handler().post(new Runnable() {
                public void run() {
                    if (getActivity() != null) {
                        View v = getActivity().findViewById(R.id.explore_progress);
                        if (v != null) {
                            v.setVisibility(View.VISIBLE);
                            controller.getExploreAlbums(sa, getActivity(), ExploreFragment.this, true, srl);
                        }
                    }
                }
            });
        }
    });

    return rootView;
}

From source file:org.messic.android.activities.fragments.RandomFragment.java

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

    getMessicService();/*from  w  ww .ja  v  a2 s.  c  om*/

    GridView gv = (GridView) rootView.findViewById(R.id.random_gvitems);
    sa = new SongAdapter(getActivity(), new SongAdapter.EventListener() {

        public void textTouch(MDMSong song, int index) {
            AlbumController.getAlbumInfo(RandomFragment.this.getActivity(), song.getAlbum().getSid());
        }

        public void coverTouch(MDMSong song, int index) {
            musicSrv.getPlayer().addSong(song);
            Toast.makeText(getActivity(), getResources().getText(R.string.player_added) + song.getName(),
                    Toast.LENGTH_SHORT).show();
        }

        public void coverLongTouch(MDMSong song, int index) {
            musicSrv.getPlayer().addAndPlay(song);
        }

        public void elementRemove(MDMSong song, int index) {
            // TODO Auto-generated method stub

        }

        public void playlistTouch(MDMPlaylist playlist, int index) {
            // TODO Auto-generated method stub

        }
    });
    gv.setAdapter(sa);

    final SwipeRefreshLayout srl = (SwipeRefreshLayout) rootView.findViewById(R.id.random_swipe);
    srl.setColorSchemeColors(Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);

    srl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        public void onRefresh() {
            new Handler().post(new Runnable() {
                public void run() {
                    if (getActivity() != null) {
                        View rp = getActivity().findViewById(R.id.random_progress);
                        if (rp != null) {
                            rp.setVisibility(View.VISIBLE);
                            controller.getRandomMusic(sa, getActivity(), RandomFragment.this, true, srl);
                        }
                    }
                }
            });
        }
    });

    return rootView;
}

From source file:org.messic.android.activities.fragments.PlaylistFragment.java

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

    getMessicService();//  w  w w .  j a v a2  s . com

    ExpandableListView gv = (ExpandableListView) rootView.findViewById(R.id.playlist_elistview);
    if (sa == null) {
        sa = new PlaylistAdapter(getActivity(), new SongAdapter.EventListener() {

            public void textTouch(MDMSong song, int index) {
                AlbumController.getAlbumInfo(PlaylistFragment.this.getActivity(), song.getAlbum().getSid());
            }

            public void coverTouch(MDMSong song, int index) {
                musicSrv.getPlayer().addSong(song);
                Toast.makeText(getActivity(), getResources().getText(R.string.player_added) + song.getName(),
                        Toast.LENGTH_SHORT).show();
            }

            public void coverLongTouch(MDMSong song, int index) {
                musicSrv.getPlayer().addAndPlay(song);
            }

            public void elementRemove(MDMSong song, int index) {
                // TODO Auto-generated method stub
            }

            public void playlistTouch(MDMPlaylist playlist, int index) {
                musicSrv.getPlayer().addPlaylist(playlist);
                Toast.makeText(getActivity(),
                        getResources().getText(R.string.player_added) + playlist.getName(), Toast.LENGTH_SHORT)
                        .show();
            }
        });
    }
    gv.setAdapter(sa);

    final SwipeRefreshLayout srl = (SwipeRefreshLayout) rootView.findViewById(R.id.playlist_swipe);
    // sets the colors used in the refresh animation
    srl.setColorSchemeColors(Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);
    srl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        public void onRefresh() {
            new Handler().post(new Runnable() {
                public void run() {
                    getActivity().findViewById(R.id.playlist_progress).setVisibility(View.VISIBLE);
                    controller.getPlaylistMusic(sa, getActivity(), PlaylistFragment.this, true, srl);
                }
            });
        }
    });

    return rootView;
}

From source file:org.messic.android.activities.fragments.PlayQueueFragment.java

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

    getMessicService();//  w  w  w  .  j  a v a 2s.  c  o  m

    ListView gv = (ListView) rootView.findViewById(R.id.queue_lvitems);
    if (sa == null) {
        sa = new SongAdapter(getActivity(), new SongAdapter.EventListener() {

            public void textTouch(MDMSong song, int index) {
                AlbumController.getAlbumInfo(PlayQueueFragment.this.getActivity(), song.getAlbum().getSid());
            }

            public void coverTouch(MDMSong song, int index) {
                musicSrv.getPlayer().setSong(index);
                musicSrv.getPlayer().playSong();
            }

            public void coverLongTouch(MDMSong song, int index) {
                musicSrv.getPlayer().setSong(index);
                musicSrv.getPlayer().playSong();
            }

            public void elementRemove(MDMSong song, int index) {
                sa.removeElement(index);
                musicSrv.getPlayer().removeSong(index);
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        sa.notifyDataSetChanged();
                    }
                });

            }

            public void playlistTouch(MDMPlaylist playlist, int index) {
                // TODO Auto-generated method stub

            }
        }, SongAdapterType.detailed);
        if (musicSrv != null) {
            sa.setCurrentSong(musicSrv.getPlayer().getCursor());
        }
    }
    gv.setAdapter(sa);

    final SwipeRefreshLayout srl = (SwipeRefreshLayout) rootView.findViewById(R.id.queue_swipe);
    srl.setColorSchemeColors(Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);
    srl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        public void onRefresh() {
            new Handler().post(new Runnable() {
                public void run() {
                    getActivity().findViewById(R.id.queue_progress).setVisibility(View.VISIBLE);
                    controller.getQueueSongs(sa, getActivity(), PlayQueueFragment.this, true, srl, musicSrv);
                }
            });
        }
    });

    return rootView;
}

From source file:com.presisco.example.slidingtabsicons.slidingtabsicons.SlidingTabsIconsFragment.java

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

    // BEGIN_INCLUDE (populate_tabs)
    /**/*ww  w. j a  v a2 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("Title1", Color.BLUE, Color.GRAY, R.drawable.tabs_title_icon1,
            R.drawable.tabs_title_selected1));

    mTabs.add(new SamplePagerItem("Title2", Color.CYAN, Color.BLACK, R.drawable.tabs_title_icon2,
            R.drawable.tabs_title_selected2));

    mTabs.add(new SamplePagerItem("Title3", Color.GREEN, Color.MAGENTA, R.drawable.tabs_title_icon3,
            R.drawable.tabs_title_selected3));
    //        mTabs.add(new SamplePagerItem(
    //                getString(R.string.tab_stream), // Title
    //                Color.BLUE, // Indicator color
    //                Color.GRAY // Divider color
    //        ));
    // END_INCLUDE (populate_tabs)
}