Example usage for android.graphics Color parseColor

List of usage examples for android.graphics Color parseColor

Introduction

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

Prototype

@ColorInt
public static int parseColor(@Size(min = 1) String colorString) 

Source Link

Document

Parse the color string, and return the corresponding color-int.

Usage

From source file:com.example.search.car.pools.welcome.java

private void showSearchDialog() {
    promptsView = new Dialog(this);
    promptsView.requestWindowFeature(Window.FEATURE_NO_TITLE);
    promptsView.setContentView(R.layout.search);
    promptsView.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

    RelativeLayout rl = (RelativeLayout) promptsView.findViewById(R.id.RelativeLayout1);
    rl.setBackgroundColor(Color.parseColor("#00000000"));
    l_1 = (LinearLayout) promptsView.findViewById(R.id.dgdf);
    l_2 = (LinearLayout) promptsView.findViewById(R.id.ddf);
    l_3 = (LinearLayout) promptsView.findViewById(R.id.gdf);
    et_from = (EditText) promptsView.findViewById(R.id.et_search_from);
    et_to = (EditText) promptsView.findViewById(R.id.et_search_to);
    sp_city = (TextView) promptsView.findViewById(R.id.sp_sec_city);
    sp_category = (TextView) promptsView.findViewById(R.id.sp_category);
    sp_search_for = (TextView) promptsView.findViewById(R.id.sp_search_for);
    b_search = (Button) promptsView.findViewById(R.id.b_search);
    close = (RelativeLayout) promptsView.findViewById(R.id.iv_close);
    close.setVisibility(View.VISIBLE);
    close.setOnClickListener(this);
    b_search.setOnClickListener(this);
    sp_city.setOnClickListener(this);
    sp_category.setOnClickListener(this);
    sp_search_for.setOnClickListener(this);
    l_1.setOnClickListener(this);
    l_2.setOnClickListener(this);
    l_3.setOnClickListener(this);
    Typeface tf = Typeface.createFromAsset(welcome.this.getAssets(), "AvenirLTStd_Book.otf");
    et_from.setTypeface(tf);/*from   w w w  . j av  a 2  s . co  m*/
    b_search.setTypeface(tf);
    et_to.setTypeface(tf);
    sp_category.setTypeface(tf);
    sp_city.setTypeface(tf);
    sp_search_for.setTypeface(tf);
    promptsView.show();
}

From source file:com.flipzu.flipzu.Player.java

private void setFinishedBanner(boolean finished) {

    int color = Color.parseColor("#FFFFFF");
    if (finished) {
        setLiveVisible(false);/*from   w  ww. j  a  va  2s.c o  m*/
        //         if (isScreenReaderActive()) {
        //            XXX
        //            showFinishedDialog();
        //         }
        updateBanner(getText(R.string.flipzu_finished).toString(), color);
    } else {
        updateBanner("", color);
    }
}

From source file:com.huofu.RestaurantOS.ui.splash.activate.java

/****
 * ???/*ww w.j av a2s.co m*/
 */
public void dealQrcodeExpired() {
    textviewScanStauts.setTextColor(getResources().getColor(R.color.Ponceau));
    textviewScanStauts.setText("??");
    stopQrScanTimer();

    //Drawable d1 = new BitmapDrawable(bitmapNowQrcode);
    Drawable d2 = activate.this.getResources().getDrawable(R.drawable.refresh);
    //Drawable[] array = new Drawable[]{d1,d2};
    Drawable[] array = new Drawable[] { d2 };

    //LayerDrawable ld = new LayerDrawable(array);
    imageViewQrcode.setBackgroundDrawable(d2);

    OnClickListener ocl = new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            // TODO Auto-generated method stub
            activate.qrcodeCreateTime = 0;
            CommonUtils.LogWuwei(tag, "\n\n\n\n\n?\n\n\n\n");
            CommonUtils.sendMsg("", GET_QRCODE, mUiHandler);

            textviewScanStauts.setTextColor(Color.parseColor("#898989"));
            textviewScanStauts.setText("???");
        }
    };

    imageViewQrcode.setOnClickListener(ocl);
    textviewScanStauts.setOnClickListener(ocl);
}

From source file:com.flipzu.flipzu.Player.java

private void updateTimer(String position, String duration) {
    debug.logV(TAG, "updateTimer called with " + position + "/" + duration);
    int color = Color.parseColor("#FFFFFF");
    updateBanner(position + "/" + duration, color);
}

From source file:com.flipzu.flipzu.Recorder.java

public void showFlipzuTipsOffline(LinearLayout cc, LayoutParams params, String msg) {
    final float scale = getResources().getDisplayMetrics().density;
    final int pixel_5 = 5 / (int) (scale + 0.5f);

    LinearLayout cl = new LinearLayout(Recorder.this);
    cl.setOrientation(LinearLayout.HORIZONTAL);
    cl.setPadding(0, 0, 0, pixel_5);//from www  . j  a v a2  s.  c o  m

    /* comment */
    String tips_username = "Flipzu Tips";

    TextView comment_tv = new TextView(Recorder.this);
    comment_tv.setLayoutParams(params);
    comment_tv.setText(tips_username + ": " + msg, TextView.BufferType.SPANNABLE);
    comment_tv.setTextColor(Color.parseColor("#656565"));
    Spannable comment_span = (Spannable) comment_tv.getText();
    comment_span.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, comment_tv.getText().length(),
            Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    comment_span.setSpan(new ForegroundColorSpan(Color.parseColor("#182e5b")), 0, tips_username.length(),
            Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    comment_tv.setText(comment_span);
    cl.addView(comment_tv);

    cc.addView(cl);
}

From source file:com.cwp.cmoneycharge.activity.AddPayActivity.java

public void VoiceSuccess() { // ??
    if (DialogShowUtil.dialoggettype() != null) {
        type = DialogShowUtil.dialoggettype();
    }//ww w.  j  av  a 2s  .co  m
    VoiceDefault = DialogShowUtil.dialogVoiceDefault();
    String textreMark = txtMark.getText().toString();

    if (typemode == "add") { // ?
        if (type == "pay") { // 
            rb1.setChecked(true);
            // corporation_fl.setVisibility(View.GONE);
            // address_fl.setVisibility(View.VISIBLE);
            spdatalist = ptypeDAO.getPtypeName(userid);
            txtMoney.setText(VoiceSave[1]);// ?
            txtMoney.setTextColor(Color.parseColor("#5ea98d"));
            if (VoiceDefault == "notype") { // 
                spType.setSelection(Integer.parseInt(VoiceSave[5]));// 
            } else {
                spType.setSelection(Integer.parseInt(VoiceSave[0]));// 
            }
            txtMark.setText(textreMark + " " + VoiceSave[2]);// 
        } else { // 
            rb2.setChecked(true);
            // corporation_fl.setVisibility(View.VISIBLE);
            // address_fl.setVisibility(View.GONE);
            spdatalist = ptypeDAO.getPtypeName(userid);
            txtMoney.setText(VoiceSave[1]);// ?
            txtMoney.setTextColor(Color.parseColor("#ffff0000"));
            if (VoiceDefault == "notype") { // 
                spType.setSelection(Integer.parseInt(VoiceSave[5]));// 
            } else {
                spType.setSelection(Integer.parseInt(VoiceSave[4]));// 
            }
            txtMark.setText(textreMark + " " + VoiceSave[2]);// 
        }
    } else { // ?
        if (type == "pay") { // 
            rb1.setChecked(true);
            // ?
            spdatalist = ptypeDAO.getPtypeName(userid);
            spdata = spdatalist.toArray(new String[spdatalist.size()]);// tb_itypeid?
            adapter = new ArrayAdapter<String>(AddPayActivity.this, R.layout.spinner, spdata); // ??
            spType.setAdapter(adapter);
            txtMoney.setText(VoiceSave[1]);// ?
            txtMoney.setTextColor(Color.parseColor("#5ea98d"));
            if (VoiceDefault == "notype") { // 
                spType.setSelection(Integer.parseInt(VoiceSave[5]));// 
            } else {
                spType.setSelection(Integer.parseInt(VoiceSave[0]));// 
            }
            txtMark.setText(textreMark + " " + VoiceSave[2]);// 
        } else { // 
            // ?
            rb2.setChecked(true);
            spdatalist = itypeDAO.getItypeName(userid);
            spdata = spdatalist.toArray(new String[spdatalist.size()]);// tb_itypeid?
            adapter = new ArrayAdapter<String>(AddPayActivity.this, R.layout.spinner, spdata); // ??
            spType.setAdapter(adapter);
            txtMoney.setText(VoiceSave[1]);// ?
            txtMoney.setTextColor(Color.parseColor("#ffff0000"));
            if (VoiceDefault == "notype") { // 
                spType.setSelection(Integer.parseInt(VoiceSave[5]));// 
            } else {
                spType.setSelection(Integer.parseInt(VoiceSave[4]));// 
            }
            txtMark.setText(textreMark + " " + VoiceSave[2]);// 
        }
    }
}

From source file:com.egloos.hyunyi.musicinfo.LinkPopUp.java

private void adjBottomColor(Drawable d) {
    Bitmap b = ((BitmapDrawable) d).getBitmap();
    int b_sum = 0;
    int g_sum = 0;
    int r_sum = 0;

    for (int i = 0; i < 10; i++) {
        int x = (int) ((double) b.getWidth() * Math.random());
        int y = (int) ((double) b.getHeight() * Math.random());
        int pixel = b.getPixel(x, y);

        int redValue = Color.red(pixel);
        int blueValue = Color.blue(pixel);
        int greenValue = Color.green(pixel);

        b_sum += blueValue;//from www  .ja  v a 2s  .  co  m
        g_sum += greenValue;
        r_sum += redValue;
    }

    int av_r = r_sum / 10;
    int av_g = g_sum / 10;
    int av_b = b_sum / 10;

    iBottomPanel.setBackgroundColor(Color.rgb(av_r, av_g, av_b));
    ArtistImage.setBackgroundColor(Color.rgb(av_r, av_g, av_b));

    int ave_sum = (av_b + av_g + av_r);
    Log.d("musicInfo", "ave_sum = " + ave_sum);

    if (ave_sum > 400) {
        tEchoNest.setTextColor(Color.parseColor("#8f363c6b"));
        for (int i = 0; i < lLinkList.getChildCount(); i++) {
            ((TextView) lLinkList.getChildAt(i)).setTextColor(Color.DKGRAY);
        }
    } else {
        tEchoNest.setTextColor(Color.parseColor("#8fc9cfff"));
        for (int i = 0; i < lLinkList.getChildCount(); i++) {
            ((TextView) lLinkList.getChildAt(i)).setTextColor(Color.LTGRAY);
        }
    }
}

From source file:com.example.search.car.pools.welcome.java

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    Fragment fragment = null;//from  ww w.j  a  va2 s  .c o  m
    if ((v.equals(l_1) || (v.equals(sp_city)))) {
        String[] city = { "Delhi/NCR", "Bengaluru", "Kolkata", "Mumbai", "Pune", "Ahmedabad" };
        dialog("City", city, sp_city);
    } else if ((v.equals(l_2) || (v.equals(sp_category)))) {
        String[] category = { "All", "Carpool", "Cab", "Rideshare" };
        dialog("Category", category, sp_category);
    } else if ((v.equals(l_3) || (v.equals(sp_search_for)))) {
        String[] search_for = { "Seeker", "Provider", "Both" };
        dialog(" Search For", search_for, sp_search_for);
    } else if (v.equals(close)) {
        promptsView.dismiss();
    } else if (v.equals(rlCities)) {
        layout = "Cities";
        fragment = new Cities();
        frag_tag = "Cities";
        set_fragment(fragment);
        mDrawerLayout.closeDrawer(mDrawerList);
        // getActionBar().setTitle("Cities");
        svg_cities = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.city1);
        iv_cities.setImageDrawable(svg_cities.createPictureDrawable());
        rlCities.setBackgroundColor(Color.parseColor("#00ca98"));
        l_cities.setBackground(getResources().getDrawable(R.drawable.white_circle_side_menu));

        svg_dashboard = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.dashboard);
        iv_dashboard.setImageDrawable(svg_dashboard.createPictureDrawable());
        rlDashboard.setBackgroundColor(Color.parseColor("#2C3E50"));
        l_dashboard.setBackground(getResources().getDrawable(R.drawable.search_blue));
        svg_search = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.search);
        iv_search.setImageDrawable(svg_search.createPictureDrawable());
        rlSearch.setBackgroundColor(Color.parseColor("#2C3E50"));
        l_search.setBackground(getResources().getDrawable(R.drawable.search_blue));
    } else if (v.equals(rlDashboard)) {
        if (task.getString("user_id", null) != null) {
            //            layout = "Dashboard";
            //            fragment = new dashboard();
            //            frag_tag = "Dashboard";
            //            // getActionBar().setTitle("My Profile");
            //            set_fragment(fragment);
            //            mDrawerLayout.closeDrawer(mDrawerList);
            //            svg_dashboard = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.dashboard1);
            //            iv_dashboard.setImageDrawable(svg_dashboard.createPictureDrawable());
            //            rlDashboard.setBackgroundColor(Color.parseColor("#00ca98"));
            //            l_dashboard.setBackground(getResources().getDrawable(R.drawable.white_circle_side_menu));
            //
            //            svg_cities = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.city);
            //            iv_cities.setImageDrawable(svg_cities.createPictureDrawable());
            //            rlCities.setBackgroundColor(Color.parseColor("#2C3E50"));
            //            l_cities.setBackground(getResources().getDrawable(R.drawable.search_blue));
            //            svg_search = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.search);
            //            iv_search.setImageDrawable(svg_search.createPictureDrawable());
            //            rlSearch.setBackgroundColor(Color.parseColor("#2C3E50"));
            //            l_search.setBackground(getResources().getDrawable(R.drawable.search_blue));
            Intent i = new Intent(welcome.this, dashboard_main.class);
            i.putExtra("edit", "1");
            startActivity(i);
            mDrawerLayout.closeDrawer(mDrawerList);
        } else {
            Toast.makeText(welcome.this, "Please Login First", Toast.LENGTH_SHORT).show();
            mDrawerLayout.closeDrawer(mDrawerList);
        }
    } else if (v.equals(rlSearch)) {
        layout = "Search";
        frag_tag = "Search";
        fragment = new Search();
        set_fragment(fragment);
        mDrawerLayout.closeDrawer(mDrawerList);
        // getActionBar().setTitle("Search");

        svg_search = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.search1);
        iv_search.setImageDrawable(svg_search.createPictureDrawable());
        rlSearch.setBackgroundColor(Color.parseColor("#00ca98"));
        l_search.setBackground(getResources().getDrawable(R.drawable.white_circle_side_menu));

        svg_dashboard = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.dashboard);
        iv_dashboard.setImageDrawable(svg_dashboard.createPictureDrawable());
        rlDashboard.setBackgroundColor(Color.parseColor("#2C3E50"));
        l_dashboard.setBackground(getResources().getDrawable(R.drawable.search_blue));
        svg_cities = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.city);
        iv_cities.setImageDrawable(svg_cities.createPictureDrawable());
        rlCities.setBackgroundColor(Color.parseColor("#2C3E50"));
        l_cities.setBackground(getResources().getDrawable(R.drawable.search_blue));
    } else if (v.equals(rlProfile_login) || v.equals(profile_login)) {
        if (task.getString("user_id", null) == null) {
            Intent i = new Intent(getBaseContext(), user_login.class);
            i.putExtra("frag_id", frag_id);
            startActivity(i);
        }
        mDrawerLayout.closeDrawer(mDrawerList);
    }
    //      else if (v.equals(rlEditProfile)) {
    //         if (task.getString("user_id", null) != null) {
    //            Intent i = new Intent(welcome.this, dashboard_main.class);
    //            i.putExtra("edit", "3");
    //            startActivity(i);
    //         } else {
    //            Toast.makeText(welcome.this, "Please Login First", Toast.LENGTH_SHORT).show();
    //         }
    //         mDrawerLayout.closeDrawer(mDrawerList);
    //      } 
    else if (v.equals(login) || v.equals(rlLogin)) {
        if (task.getString("user_id", null) != null && login.getText().toString().contentEquals("Logout")) {
            SharedPreferences.Editor editor = getSharedPreferences("user", MODE_PRIVATE).edit();
            editor.clear();
            editor.commit();
            login.setText("Login");
            rlDashboard.setVisibility(View.GONE);
            //            rlEditProfile.setVisibility(View.GONE);

            if (layout.contentEquals("Dashboard") || frag_tag.contentEquals("Dashboard")) {
                // highlight search menu on slider during on resume
                // change fragment to search
                FragmentManager fm = getFragmentManager();
                FragmentTransaction fragmentTransaction = fm.beginTransaction();
                fragmentTransaction.replace(R.id.content_frame, new Search());
                fragmentTransaction.commit();
                svg_search = SVGParser.getSVGFromResource(welcome.this.getResources(), R.raw.search1);
                iv_search.setImageDrawable(svg_search.createPictureDrawable());
                rlSearch.setBackgroundColor(Color.parseColor("#00ca98"));
                l_search.setBackground(getResources().getDrawable(R.drawable.white_circle_side_menu));
            }

            iv_login.setImageDrawable(svg_login.createPictureDrawable());
            rlProfile.setVisibility(View.GONE);
            rlProfile_login.setVisibility(View.VISIBLE);
            if (frag_id == 6) {
                Intent i_user = new Intent(getBaseContext(), user_login.class);
                i_user.putExtra("frag_id", frag_id);
                startActivity(i_user);
            }
        } else {
            Intent i = new Intent(getBaseContext(), user_login.class);
            i.putExtra("frag_id", frag_id);
            startActivity(i);
        }
        mDrawerLayout.closeDrawer(mDrawerList);
    } else if (v.equals(b_search)) {
        if (sp_city.getText().toString().toUpperCase().equals("SELECT CITY")) {
            Toast.makeText(welcome.this, "First Select the City", Toast.LENGTH_LONG).show();
        } else {
            Intent i = new Intent(welcome.this, search_result.class);
            i.putExtra("city", sp_city.getText().toString());
            i.putExtra("category", sp_category.getText().toString());
            i.putExtra("search_for", sp_search_for.getText().toString());
            i.putExtra("from", et_from.getText().toString());
            i.putExtra("to", et_to.getText().toString());
            i.putExtra("frag_id", 1);
            i.putExtra("company_id", 0);

            startActivity(i);
            promptsView.dismiss();
        }
    } else if (v.equals(l_nav_search) || v.equals(ib_search)) {
        final int DELAY = 200;
        // ColorDrawable f = new
        // ColorDrawable(Color.parseColor("#0087ca"));
        // ColorDrawable f1 = new
        // ColorDrawable(Color.parseColor("#3398ca"));
        AnimationDrawable a = new AnimationDrawable();
        a.addFrame(d1, DELAY);
        a.addFrame(d2, DELAY);
        a.setOneShot(true);
        l_nav_search.setBackground(a);
        a.start();
        showSearchDialog();
    } else if (v.equals(l_handle) || v.equals(ib_handle)) {
        final int DELAY = 200;
        // ColorDrawable f = new
        // ColorDrawable(Color.parseColor("#0087ca"));
        // ColorDrawable f1 = new
        // ColorDrawable(Color.parseColor("#3398ca"));

        AnimationDrawable a = new AnimationDrawable();
        a.addFrame(d1, DELAY);
        a.addFrame(d2, DELAY);
        a.setOneShot(true);
        l_handle.setBackground(a);
        a.start();
        if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
            mDrawerLayout.closeDrawer(mDrawerList);
        } else {
            mDrawerLayout.openDrawer(mDrawerList);
        }
    } else if (v.equals(l_menu) || v.equals(ib_menu)) {
        final int DELAY = 200;
        // for light background
        // ColorDrawable f = new
        // ColorDrawable(Color.parseColor("#0087ca"));
        // ColorDrawable f1 = new
        // ColorDrawable(Color.parseColor("#3398ca"));
        AnimationDrawable a = new AnimationDrawable();
        a.addFrame(d1, DELAY);
        a.addFrame(d2, DELAY);
        a.setOneShot(true);
        l_menu.setBackground(a);
        a.start();

        final PopupMenu popup = new PopupMenu(welcome.this, v);
        popup.getMenuInflater().inflate(R.menu.main, popup.getMenu());

        bedMenuItem = popup.getMenu().findItem(R.id.menu_login);
        final SharedPreferences task = getSharedPreferences("user", MODE_PRIVATE);
        popup.getMenu().findItem(R.id.menu_add_new_list).setVisible(!(task.getString("user_id", null) == null));
        popup.getMenu().findItem(R.id.menu_dashboard).setVisible(!(task.getString("user_id", null) == null));

        if (task.getString("user_id", null) != null) {
            bedMenuItem.setTitle("Logout");
            login.setText("Logout");
            iv_login.setImageDrawable(svg_logout.createPictureDrawable());
            rlProfile.setVisibility(View.VISIBLE);
            rlProfile_login.setVisibility(View.GONE);
            rlDashboard.setVisibility(View.VISIBLE);
            //            rlEditProfile.setVisibility(View.VISIBLE);
            set_data();
        } else {
            bedMenuItem.setTitle("Login/Register");
            login.setText("Login");
            iv_login.setImageDrawable(svg_login.createPictureDrawable());
            rlDashboard.setVisibility(View.GONE);
            //            rlEditProfile.setVisibility(View.GONE);
            rlProfile.setVisibility(View.GONE);
            rlProfile_login.setVisibility(View.VISIBLE);
        }

        if (task.getString("user_id", null) != null) {
            popup.getMenu().findItem(R.id.menu_login).setTitle("Logout");
        } else {
            popup.getMenu().findItem(R.id.menu_login).setTitle("Login/Register");
        }
        popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {

            @Override
            public boolean onMenuItemClick(MenuItem item) {
                // TODO Auto-generated method stub
                int id = item.getItemId();
                Intent i;
                switch (id) {
                case R.id.menu_add_new_list:
                    if (task.getString("user_id", null) != null) {
                        i = new Intent(welcome.this, create_activity.class);
                        startActivity(i);
                    } else {
                        Toast.makeText(welcome.this, "Login first", Toast.LENGTH_SHORT).show();
                    }

                    return true;
                case R.id.menu_dashboard:
                    if (task.getString("user_id", null) != null) {
                        i = new Intent(welcome.this, dashboard_main.class);
                        i.putExtra("edit", "12344");
                        startActivity(i);
                    } else {
                        Toast.makeText(welcome.this, "Please Login first", Toast.LENGTH_LONG).show();
                    }
                    return true;
                case R.id.menu_login:
                    if (bedMenuItem.getTitle().equals("Logout")) {
                        SharedPreferences.Editor editor = getSharedPreferences("user", MODE_PRIVATE).edit();
                        editor.clear();
                        editor.commit();
                        // bedMenuItem.setTitle("Login/Register");
                        login.setText("Login");
                        rlDashboard.setVisibility(View.GONE);
                        //                     rlEditProfile.setVisibility(View.GONE);

                        if (layout.contentEquals("Dashboard") || frag_tag.contentEquals("Dashboard")) {
                            // highlight search menu on slider during on
                            // resume
                            // change fragment to search
                            FragmentManager fm = getFragmentManager();
                            FragmentTransaction fragmentTransaction = fm.beginTransaction();
                            fragmentTransaction.replace(R.id.content_frame, new Search());
                            fragmentTransaction.commit();
                            SVG svg_search = SVGParser.getSVGFromResource(welcome.this.getResources(),
                                    R.raw.search1);
                            iv_search.setImageDrawable(svg_search.createPictureDrawable());
                            rlSearch.setBackgroundColor(Color.parseColor("#00ca98"));
                            l_search.setBackground(
                                    getResources().getDrawable(R.drawable.white_circle_side_menu));
                        }

                        iv_login.setImageDrawable(svg_login.createPictureDrawable());
                        rlProfile.setVisibility(View.GONE);
                        rlProfile_login.setVisibility(View.VISIBLE);
                        if (frag_id == 6) {
                            Intent i_user = new Intent(getBaseContext(), user_login.class);
                            i_user.putExtra("frag_id", frag_id);
                            startActivity(i_user);
                        }
                    } else {
                        i = new Intent(getBaseContext(), user_login.class);
                        i.putExtra("frag_id", frag_id);
                        startActivity(i);
                    }
                    return true;
                }
                return false;
            }
        });
        popup.show();
        // } else {
        // openOptionsMenu();
        // }
    }

}

From source file:com.samknows.measurement.activity.SamKnowsAggregateStatViewerActivity.java

private void graphsSetup() {

    // get data//w  ww. j a  va  2 s  . c  o m

    data = new JSONObject();

    graph1 = (WebView) subview.findViewById(R.id.download_graph);
    graph2 = (WebView) subview.findViewById(R.id.upload_graph);
    graph3 = (WebView) subview.findViewById(R.id.latency_graph);
    graph4 = (WebView) subview.findViewById(R.id.packetloss_graph);
    graph5 = (WebView) subview.findViewById(R.id.jitter_graph);

    graphHandler1 = new SamKnowsGraph(graph1);
    graphHandler2 = new SamKnowsGraph(graph2);
    graphHandler3 = new SamKnowsGraph(graph3);
    graphHandler4 = new SamKnowsGraph(graph4);
    graphHandler5 = new SamKnowsGraph(graph5);
    graphHandler5 = new SamKnowsGraph(graph5);

    graph1.setVerticalScrollBarEnabled(false);
    graph1.setHorizontalScrollBarEnabled(false);
    graph1.setBackgroundColor(Color.parseColor("#dddddd"));
    graphHandler1.setTag("download");
    graphHandler1.setDateFormat(new SKDateFormat(context).getJSDateFormat());

    graph1.getSettings().setJavaScriptEnabled(true);
    graph1.addJavascriptInterface(graphHandler1, "graphHandler");
    graph1.loadUrl("file:///android_res/raw/graphs.html");

    graph2.setVerticalScrollBarEnabled(false);
    graph2.setHorizontalScrollBarEnabled(false);
    graph2.setBackgroundColor(Color.parseColor("#dddddd"));
    graphHandler2.setTag("upload");
    graphHandler2.setDateFormat(new SKDateFormat(context).getJSDateFormat());

    graph2.getSettings().setJavaScriptEnabled(true);
    graph2.addJavascriptInterface(graphHandler2, "graphHandler");
    graph2.loadUrl("file:///android_res/raw/graphs.html");

    graph3.setVerticalScrollBarEnabled(false);
    graph3.setHorizontalScrollBarEnabled(false);
    graph3.setBackgroundColor(Color.parseColor("#dddddd"));
    graphHandler3.setTag("latency");
    graphHandler3.setDateFormat(new SKDateFormat(context).getJSDateFormat());

    graph3.getSettings().setJavaScriptEnabled(true);
    graph3.addJavascriptInterface(graphHandler3, "graphHandler");
    graph3.loadUrl("file:///android_res/raw/graphs.html");

    graph4.setVerticalScrollBarEnabled(false);
    graph4.setHorizontalScrollBarEnabled(false);
    graph4.setBackgroundColor(Color.parseColor("#dddddd"));
    graphHandler4.setTag("packetloss");
    graphHandler4.setDateFormat(new SKDateFormat(context).getJSDateFormat());

    graph4.getSettings().setJavaScriptEnabled(true);
    graph4.addJavascriptInterface(graphHandler4, "graphHandler");
    graph4.loadUrl("file:///android_res/raw/graphs.html");

    graph5.setVerticalScrollBarEnabled(false);
    graph5.setHorizontalScrollBarEnabled(false);
    graph5.setBackgroundColor(Color.parseColor("#dddddd"));
    graphHandler5.setTag("jitter");
    graphHandler5.setDateFormat(new SKDateFormat(context).getJSDateFormat());

    graph5.getSettings().setJavaScriptEnabled(true);
    graph5.addJavascriptInterface(graphHandler5, "graphHandler");
    graph5.loadUrl("file:///android_res/raw/graphs.html");

}