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.almalence.opencam.SavingService.java

protected void addTimestamp(File file, int exif_orientation) {
    try {//  ww  w  .ja va2 s .  c om
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

        int dateFormat = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampDate, "0"));
        boolean abbreviation = prefs.getBoolean(ApplicationScreen.sTimestampAbbreviation, false);
        int saveGeo = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampGeo, "0"));
        int timeFormat = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampTime, "0"));
        int separator = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampSeparator, "0"));
        String customText = prefs.getString(ApplicationScreen.sTimestampCustomText, "");
        int color = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampColor, "1"));
        int fontSizeC = Integer.parseInt(prefs.getString(ApplicationScreen.sTimestampFontSize, "80"));

        String formattedCurrentDate = "";
        if (dateFormat == 0 && timeFormat == 0 && customText.equals("") && saveGeo == 0)
            return;

        String geoText = "";
        // show geo data on time stamp
        if (saveGeo != 0) {
            Location l = MLocation.getLocation(getApplicationContext());

            if (l != null) {
                if (saveGeo == 2) {
                    Geocoder geocoder = new Geocoder(MainScreen.getMainContext(), Locale.getDefault());
                    List<Address> list = geocoder.getFromLocation(l.getLatitude(), l.getLongitude(), 1);
                    if (!list.isEmpty()) {
                        String country = list.get(0).getCountryName();
                        String locality = list.get(0).getLocality();
                        String adminArea = list.get(0).getSubAdminArea();// city
                        // localized
                        String street = list.get(0).getThoroughfare();// street
                        // localized
                        String address = list.get(0).getAddressLine(0);

                        // replace street and city with localized name
                        if (street != null)
                            address = street;
                        if (adminArea != null)
                            locality = adminArea;

                        geoText = (country != null ? country : "") + (locality != null ? (", " + locality) : "")
                                + (address != null ? (", \n" + address) : "");

                        if (geoText.equals(""))
                            geoText = "lat:" + l.getLatitude() + "\nlng:" + l.getLongitude();
                    }
                } else
                    geoText = "lat:" + l.getLatitude() + "\nlng:" + l.getLongitude();
            }
        }

        String dateFormatString = "";
        String timeFormatString = "";
        String separatorString = ".";
        String monthString = abbreviation ? "MMMM" : "MM";

        switch (separator) {
        case 0:
            separatorString = "/";
            break;
        case 1:
            separatorString = ".";
            break;
        case 2:
            separatorString = "-";
            break;
        case 3:
            separatorString = " ";
            break;
        default:
            separatorString = " ";
        }

        switch (dateFormat) {
        case 1:
            dateFormatString = "yyyy" + separatorString + monthString + separatorString + "dd";
            break;
        case 2:
            dateFormatString = "dd" + separatorString + monthString + separatorString + "yyyy";
            break;
        case 3:
            dateFormatString = monthString + separatorString + "dd" + separatorString + "yyyy";
            break;
        default:
        }

        switch (timeFormat) {
        case 1:
            timeFormatString = " hh:mm:ss a";
            break;
        case 2:
            timeFormatString = " HH:mm:ss";
            break;
        default:
        }

        Date currentDate = Calendar.getInstance().getTime();
        java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat(
                dateFormatString + timeFormatString);
        formattedCurrentDate = simpleDateFormat.format(currentDate);

        formattedCurrentDate += (customText.isEmpty() ? "" : ("\n" + customText))
                + (geoText.isEmpty() ? "" : ("\n" + geoText));

        if (formattedCurrentDate.equals(""))
            return;

        Bitmap sourceBitmap;
        Bitmap bitmap;

        int rotation = 0;
        Matrix matrix = new Matrix();
        if (exif_orientation == ExifInterface.ORIENTATION_ROTATE_90) {
            rotation = 90;
        } else if (exif_orientation == ExifInterface.ORIENTATION_ROTATE_180) {
            rotation = 180;
        } else if (exif_orientation == ExifInterface.ORIENTATION_ROTATE_270) {
            rotation = 270;
        }
        matrix.postRotate(rotation);

        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inMutable = true;

        sourceBitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options);
        bitmap = Bitmap.createBitmap(sourceBitmap, 0, 0, sourceBitmap.getWidth(), sourceBitmap.getHeight(),
                matrix, false);

        sourceBitmap.recycle();

        int width = bitmap.getWidth();
        int height = bitmap.getHeight();

        Paint p = new Paint();

        Canvas canvas = new Canvas(bitmap);

        final float scale = getResources().getDisplayMetrics().density;

        p.setColor(Color.WHITE);
        switch (color) {
        case 0:
            color = Color.BLACK;
            p.setColor(Color.BLACK);
            break;
        case 1:
            color = Color.WHITE;
            p.setColor(Color.WHITE);
            break;
        case 2:
            color = Color.YELLOW;
            p.setColor(Color.YELLOW);
            break;

        }

        if (width > height) {
            p.setTextSize(height / fontSizeC * scale + 0.5f); // convert dps
            // to pixels
        } else {
            p.setTextSize(width / fontSizeC * scale + 0.5f); // convert dps
            // to pixels
        }
        p.setTextAlign(Align.RIGHT);
        drawTextWithBackground(canvas, p, formattedCurrentDate, color, Color.BLACK, width, height);

        Matrix matrix2 = new Matrix();
        matrix2.postRotate(360 - rotation);
        sourceBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix2, false);

        bitmap.recycle();

        FileOutputStream outStream;
        outStream = new FileOutputStream(file);
        sourceBitmap.compress(Bitmap.CompressFormat.JPEG, jpegQuality, outStream);
        sourceBitmap.recycle();
        outStream.flush();
        outStream.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    } catch (OutOfMemoryError e) {
        e.printStackTrace();
    }
}

From source file:com.FluksoViz.FluksoVizActivity.java

private void make_graph_pretty(XYPlot p) {

    p.setDomainStep(XYStepMode.INCREMENT_BY_VAL, 56); // Reduce the number
    // of range labels
    // Plot1.setTicksPerDomainLabel(1);
    p.setDomainValueFormat(new DateFormat_p1());

    p.setRangeStep(XYStepMode.SUBDIVIDE, 5);// Skala Y pionowa
    // Plot1.setRangeStep(XYStepMode.INCREMENT_BY_VAL, 1);
    // Plot1.setTicksPerRangeLabel(1);
    p.getTitleWidget().setClippingEnabled(false);

    p.getTitleWidget().pack();//from w  ww .  j  av  a 2  s .  co  m
    int axis_font_size = 15;
    int title_font_size = 15;
    int domain_font_size = 12;

    if (screen_width == 320) {
        axis_font_size = 12;
        title_font_size = 9;
        domain_font_size = 10;
    }

    p.getTitleWidget().getLabelPaint().setTextSize(title_font_size);
    p.getGraphWidget().getDomainLabelPaint().setTextSize(domain_font_size);
    p.getGraphWidget().getDomainLabelPaint().setColor(Color.WHITE);
    p.getGraphWidget().getRangeLabelPaint().setColor(Color.WHITE);
    p.getGraphWidget().getRangeLabelPaint().setTextSize(axis_font_size);
    p.getGraphWidget().getDomainOriginLabelPaint().setTextSize(domain_font_size);
    p.getGraphWidget().getRangeOriginLabelPaint().setTextSize(axis_font_size);
    p.getGraphWidget().setClippingEnabled(false);

    p.setDomainValueFormat(new DecimalFormat("#"));

    p.getLegendWidget().setVisible(false);
    p.getDomainLabelWidget().setVisible(false);
    p.getRangeLabelWidget().setVisible(false);
    p.getGraphWidget().getGridLinePaint().setPathEffect(new DashPathEffect(new float[] { 1, 2, 1, 2 }, 0));
    p.getBackgroundPaint().setColor(Color.TRANSPARENT);
    p.getGraphWidget().getBackgroundPaint().setColor(Color.TRANSPARENT);
    p.getGraphWidget().getGridBackgroundPaint().setColor(Color.TRANSPARENT);
    p.setGridPadding(0, 10, 0, 0); // left top right bottom
    p.getGraphWidget().getGridLinePaint().setColor(Color.TRANSPARENT);

    if (sensor_number != 4) {
        p.setRangeLowerBoundary(0, BoundaryMode.GROW);// to ustawia
    }

    if (sensor_number == 4) {
        p.addMarker(new YValueMarker(0, "0", new XPositionMetric(-11, XLayoutStyle.ABSOLUTE_FROM_LEFT),
                Color.WHITE, Color.WHITE));
        p.setRangeStep(XYStepMode.SUBDIVIDE, 2);
        p.getGraphWidget().getRangeOriginLinePaint().setAlpha(0);

        series1mFormat = new LineAndPointFormatter( // FAZA
                Color.rgb(0, 220, 0), // line color
                Color.rgb(0, 150, 0), // point color
                null);

        line1mFill.setShader(
                new LinearGradient(0, 0, 0, 200, Color.rgb(0, 200, 0), Color.BLACK, Shader.TileMode.MIRROR));
        series1mFormat.getLinePaint().setStrokeWidth(4);
        series1mFormat.setFillPaint(line1mFill);

        series2mFormat = new LineAndPointFormatter( // faza 2 solar
                Color.rgb(200, 200, 0), // line
                Color.rgb(100, 100, 0), // point color
                null);
        line2mFill.setShader(
                new LinearGradient(0, 150, 0, 120, Color.rgb(250, 250, 0), Color.BLACK, Shader.TileMode.CLAMP));
        series2mFormat.setFillDirection(FillDirection.TOP);
        series2mFormat.setFillPaint(line2mFill);
        series2mFormat.getLinePaint().setStrokeWidth(5);

        series3mFormat = new LineAndPointFormatter( // FAZA 3 formater
                Color.rgb(0, 220, 0), // line color
                Color.rgb(0, 150, 0), // point color
                null);
        line3mFill.setAlpha(255);
        line3mFill.setShader(new LinearGradient(0, 0, 0, 50, Color.BLACK, Color.BLACK, Shader.TileMode.MIRROR));
        series3mFormat.getLinePaint().setStrokeWidth(7);
        series3mFormat.setFillPaint(line3mFill);

        series4mFormat = new LineAndPointFormatter(Color.rgb(0, 140, 220), // line
                Color.rgb(0, 120, 190), // point color
                null);
        line4mFill = new Paint();
        line4mFill.setAlpha(190);
        line4mFill.setShader(new LinearGradient(0, 0, 0, 50, Color.BLACK, Color.BLACK, Shader.TileMode.MIRROR));
        series4mFormat.getLinePaint().setStrokeWidth(5);
        series4mFormat.setFillPaint(line4mFill);
        series4mFormat.setFillDirection(FillDirection.TOP);

        // XYRegionFormatter region4Formatter = new
        // XYRegionFormatter(Color.BLUE);
        // series4mFormat.addRegion(new RectRegion(Double.NEGATIVE_INFINITY,
        // Double.POSITIVE_INFINITY, 0, -1000, "R1"), region4Formatter);

    }

    // p.setRangeLowerBoundary(0, BoundaryMode.GROW);// to ustawia
    // min i max
    // Plot1.setRangeUpperBoundary(11, BoundaryMode.FIXED);

    p.setRangeValueFormat(new DecimalFormat("#"));
    p.setBorderStyle(Plot.BorderStyle.SQUARE, null, null);
    p.setBorderPaint(null);
    p.disableAllMarkup(); // To get rid of them call disableAllMarkup():

}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void onlyForIdaho() {
    byphoneBtnLayout.setVisibility(View.VISIBLE);
    byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
    byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn));
    ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray);
    byphoneBtnLayout.setClickable(false);
    saveAppmtType("video");
    byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
    byvideoBtn.setTextColor(Color.GRAY);
    byvideoBtn.setTextColor(Color.GRAY);
    byvideoBtnLayout.setVisibility(View.VISIBLE);
    byvideoBtnLayout.setOnClickListener(new View.OnClickListener() {
        @Override//w w  w .  java  2 s  .c o  m
        public void onClick(View v) {
            try {
                horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byvideoBtn.setTextColor(Color.WHITE);
                ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white);
                ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_gray);
                byphoneBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
                byphoneBtn.setTextColor(getResources().getColor(R.color.disableBtn));
                byphoneBtnLayout.setVisibility(View.VISIBLE);
                byphoneBtnLayout.setClickable(false);

                horizontalscrollview.setVisibility(View.VISIBLE);
                LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
                if (layout.getChildCount() > 0) {
                    layout.removeAllViews();
                }

                for (TextView tv : videoList) {
                    layout.addView(tv);
                }
                saveConsultationType("Video", MDLiveProviderDetails.this);
                //Enable Request Appointment Button

                horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white);
                selectedTimeslot = false;
                enableReqAppmtBtn();
                clearTimeSlotViews();
                horizontalscrollview.startAnimation(
                        AnimationUtils.loadAnimation(MDLiveProviderDetails.this, R.anim.mdlive_trans_left_in));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:com.zertinteractive.wallpaper.MainActivity.java

@Override
public void onBackPressed() {
    if (isSearchScreenOpen) {
        recyclerView.setBackgroundColor(Color.WHITE);
        recyclerView.setVisibility(View.VISIBLE);
        mAdView.setVisibility(View.VISIBLE);
        searchView.setVisibility(View.GONE);
        progressBar.setVisibility(View.GONE);
        isSearchScreenOpen = false;/*  w w  w.java  2 s.co  m*/
        isSearchingRunning = false;
    } else {
        appExitConfirmDialog();
    }

}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void phsOnlyForPhone() {
    saveAppmtType("phone");
    byvideoBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
    byvideoBtn.setTextColor(getResources().getColor(R.color.disableBtn));
    ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_gray);
    byvideoBtnLayout.setVisibility(View.VISIBLE);
    byvideoBtnLayout.setClickable(false);
    byphoneBtnLayout.setVisibility(View.VISIBLE);
    byphoneBtnLayout.setOnClickListener(new View.OnClickListener() {
        @Override// w  w w  .j ava 2  s .  co  m
        public void onClick(View v) {
            try {
                horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byphoneBtn.setTextColor(Color.WHITE);
                ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_white);
                ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_gray);
                horizontalscrollview.setVisibility(View.VISIBLE);
                byvideoBtnLayout.setVisibility(View.VISIBLE);
                byvideoBtnLayout.setBackgroundResource(R.drawable.disable_round_rect_grey_border);
                byvideoBtn.setTextColor(getResources().getColor(R.color.disableBtn));
                byvideoBtnLayout.setClickable(false);

                LinearLayout layout = (LinearLayout) findViewById(R.id.panelMessageFiles);
                if (layout.getChildCount() > 0) {
                    layout.removeAllViews();
                }
                for (TextView tv : phoneList) {
                    layout.addView(tv);
                }
                saveConsultationType("Phone", MDLiveProviderDetails.this);
                //Enable Request Appointment Button
                enableReqAppmtBtn();
                horizontalscrollview.smoothScrollTo(layout.getChildAt(0).getLeft(), 0);
                ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_white);
                selectedTimeslot = false;
                enableReqAppmtBtn();
                clearTimeSlotViews();
                horizontalscrollview.startAnimation(
                        AnimationUtils.loadAnimation(MDLiveProviderDetails.this, R.anim.mdlive_trans_left_in));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void defaultNowTextPreferences(final TextView timeslotTxt, final String appointmentType) {

    selectedTimeslot = true;//www  .ja va 2s .  c  o  m

    //saveConsultationType(appointmentType);
    saveProviderDetailsForConFirmAppmt(timeslotTxt.getText().toString(),
            ((TextView) findViewById(R.id.dateTxt)).getText().toString().trim(), str_ProfileImg,
            selectedTimestamp, str_phys_avail_id);

    //This is to select and Unselect the Timeslot
    if (previousSelectedTv == null) {
        previousSelectedTv = timeslotTxt;
        timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner);
        timeslotTxt.setTextColor(Color.WHITE);
    } else {
        previousSelectedTv.setBackgroundResource(R.drawable.timeslot_white_rounded_corner);
        previousSelectedTv.setTextColor(Color.GRAY);
        previousSelectedTv = timeslotTxt;
        timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner);
        timeslotTxt.setTextColor(Color.WHITE);
    }

}

From source file:com.amaze.filemanager.activities.MainActivity.java

void initialiseViews() {
    appBarLayout = (AppBarLayout) findViewById(R.id.lin);

    if (!ImageLoader.getInstance().isInited()) {

        ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(this));
    }//from w  w w . j av  a 2  s .c o m
    displayImageOptions = new DisplayImageOptions.Builder().showImageOnLoading(R.drawable.amaze_header)
            .showImageForEmptyUri(R.drawable.amaze_header).showImageOnFail(R.drawable.amaze_header)
            .cacheInMemory(true).cacheOnDisk(true).considerExifParams(true).bitmapConfig(Bitmap.Config.RGB_565)
            .build();

    buttonBarFrame = (FrameLayout) findViewById(R.id.buttonbarframe);
    buttonBarFrame.setBackgroundColor(Color.parseColor(skin));
    drawerHeaderLayout = getLayoutInflater().inflate(R.layout.drawerheader, null);
    drawerHeaderParent = (RelativeLayout) drawerHeaderLayout.findViewById(R.id.drawer_header_parent);
    drawerHeaderView = (View) drawerHeaderLayout.findViewById(R.id.drawer_header);
    drawerHeaderView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            Intent intent;
            if (Build.VERSION.SDK_INT < 19) {
                intent = new Intent();
                intent.setAction(Intent.ACTION_GET_CONTENT);
            } else {
                intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

            }
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.setType("image/*");
            startActivityForResult(intent, image_selector_request_code);
            return false;
        }
    });
    drawerProfilePic = (RoundedImageView) drawerHeaderLayout.findViewById(R.id.profile_pic);
    mGoogleName = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_name);
    mGoogleId = (TextView) drawerHeaderLayout.findViewById(R.id.account_header_drawer_email);
    toolbar = (Toolbar) findViewById(R.id.action_bar);
    setSupportActionBar(toolbar);
    frameLayout = (FrameLayout) findViewById(R.id.content_frame);
    indicator_layout = findViewById(R.id.indicator_layout);
    mDrawerLinear = (ScrimInsetsRelativeLayout) findViewById(R.id.left_drawer);
    if (theme1 == 1)
        mDrawerLinear.setBackgroundColor(Color.parseColor("#303030"));
    else
        mDrawerLinear.setBackgroundColor(Color.WHITE);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackgroundColor(Color.parseColor(skin));
    mDrawerList = (ListView) findViewById(R.id.menu_drawer);
    drawerHeaderView.setBackgroundResource(R.drawable.amaze_header);
    drawerHeaderParent.setBackgroundColor(Color.parseColor(skin));
    if (findViewById(R.id.tab_frame) != null) {
        mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN, mDrawerLinear);
        mDrawerLayout.setScrimColor(Color.TRANSPARENT);
        isDrawerLocked = true;
    }
    mDrawerList.addHeaderView(drawerHeaderLayout);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    View v = findViewById(R.id.fab_bg);
    if (theme1 == 1)
        v.setBackgroundColor(Color.parseColor("#a6ffffff"));
    v.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            floatingActionButton.close(true);
            revealShow(view, false);
        }
    });

    pathbar = (LinearLayout) findViewById(R.id.pathbar);
    buttons = (LinearLayout) findViewById(R.id.buttons);
    scroll = (HorizontalScrollView) findViewById(R.id.scroll);
    scroll1 = (HorizontalScrollView) findViewById(R.id.scroll1);
    scroll.setSmoothScrollingEnabled(true);
    scroll1.setSmoothScrollingEnabled(true);
    ImageView divider = (ImageView) findViewById(R.id.divider1);
    if (theme1 == 0)
        divider.setImageResource(R.color.divider);
    else
        divider.setImageResource(R.color.divider_dark);

    setDrawerHeaderBackground();
    View settingsbutton = findViewById(R.id.settingsbutton);
    if (theme1 == 1) {
        settingsbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) settingsbutton.findViewById(R.id.settingicon))
                .setImageResource(R.drawable.ic_settings_white_48dp);
        ((TextView) settingsbutton.findViewById(R.id.settingtext))
                .setTextColor(getResources().getColor(android.R.color.white));
    }
    settingsbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent in = new Intent(MainActivity.this, Preferences.class);
            finish();
            final int enter_anim = android.R.anim.fade_in;
            final int exit_anim = android.R.anim.fade_out;
            Activity s = MainActivity.this;
            s.overridePendingTransition(exit_anim, enter_anim);
            s.finish();
            s.overridePendingTransition(enter_anim, exit_anim);
            s.startActivity(in);
        }

    });
    View appbutton = findViewById(R.id.appbutton);
    if (theme1 == 1) {
        appbutton.setBackgroundResource(R.drawable.safr_ripple_black);
        ((ImageView) appbutton.findViewById(R.id.appicon)).setImageResource(R.drawable.ic_doc_apk_white);
        ((TextView) appbutton.findViewById(R.id.apptext))
                .setTextColor(getResources().getColor(android.R.color.white));
    }
    appbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            android.support.v4.app.FragmentTransaction transaction2 = getSupportFragmentManager()
                    .beginTransaction();
            transaction2.replace(R.id.content_frame, new AppsList());
            findViewById(R.id.lin).animate().translationY(0).setInterpolator(new DecelerateInterpolator(2))
                    .start();
            pending_fragmentTransaction = transaction2;
            if (!isDrawerLocked)
                mDrawerLayout.closeDrawer(mDrawerLinear);
            else
                onDrawerClosed();
            select = -2;
            adapter.toggleChecked(false);
        }
    });
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));

    // status bar0
    sdk = Build.VERSION.SDK_INT;

    if (sdk == 20 || sdk == 19) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(Color.parseColor(skin));
        FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.drawer_layout)
                .getLayoutParams();
        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
        if (!isDrawerLocked)
            p.setMargins(0, config.getStatusBarHeight(), 0, 0);
    } else if (Build.VERSION.SDK_INT >= 21) {
        colourednavigation = Sp.getBoolean("colorednavigation", true);

        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        //window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (isDrawerLocked) {
            window.setStatusBarColor((skinStatusBar));
        } else
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (colourednavigation)
            window.setNavigationBarColor(skinStatusBar);

    }
}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void clickEventForHorizontalText(final Button timeslotTxt, final String Timestamp,
        final String phys_avail_id) {
    timeslotTxt.setOnClickListener(new View.OnClickListener() {
        @Override//from  ww  w. j  a  v a2  s. c o  m
        public void onClick(View v) {
            selectedTimeslot = true;
            saveProviderDetailsForConFirmAppmt(timeslotTxt.getText().toString(),
                    ((TextView) findViewById(R.id.dateTxt)).getText().toString(), str_ProfileImg, Timestamp,
                    phys_avail_id);
            //This is to select and Unselect the Timeslot
            if (previousSelectedTv == null) {
                previousSelectedTv = timeslotTxt;
                timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner);
                timeslotTxt.setTextColor(Color.WHITE);
            } else {
                previousSelectedTv.setBackgroundResource(R.drawable.timeslot_white_rounded_corner);
                previousSelectedTv.setTextColor(Color.GRAY);
                previousSelectedTv = timeslotTxt;
                timeslotTxt.setBackgroundResource(R.drawable.timeslot_blue_rounded_corner);
                timeslotTxt.setTextColor(Color.WHITE);
            }
            //Enabling or Disabling the Request Appointment Button.
            enableReqAppmtBtn();
        }

    });
}

From source file:com.mdlive.sav.MDLiveProviderDetails.java

private void visibilityBasedOnHorizontalTextView(String position) {
    if (position.equalsIgnoreCase("video")) {
        saveConsultationType("Video", this);
        reqfutureapptBtnLayout.setVisibility(View.GONE);
        byvideoBtnLayout.setVisibility(View.VISIBLE);
        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
        byvideoBtn.setTextColor(Color.WHITE);
        byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
        byphoneBtn.setTextColor(Color.GRAY);
        byvideoBtnLayout.setOnClickListener(new View.OnClickListener() {
            @Override//from www  . ja  v a  2  s  . co m
            public void onClick(View v) {
                byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byvideoBtn.setTextColor(Color.WHITE);
                byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                byphoneBtn.setTextColor(Color.GRAY);
                if (layout.getChildCount() > 0)
                    layout.removeAllViews();

            }
        });
        byphoneBtnLayout.setVisibility(View.VISIBLE);
        byphoneBtnLayout.setClickable(false);

    } else if (position.equalsIgnoreCase("video or phone")) {
        byvideoBtnLayout.setVisibility(View.VISIBLE);
        byvideoBtnLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byvideoBtn.setTextColor(Color.WHITE);
                byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                byphoneBtn.setTextColor(Color.GRAY);
                if (layout.getChildCount() > 0)
                    layout.removeAllViews();
            }
        });
        byphoneBtnLayout.setVisibility(View.VISIBLE);
        byphoneBtnLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byphoneBtn.setTextColor(Color.WHITE);
                byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                byvideoBtn.setTextColor(Color.GRAY);
            }
        });
    } else if (position.equalsIgnoreCase("phone")) {
        saveConsultationType("Phone", this);
        byvideoBtnLayout.setVisibility(View.VISIBLE);
        byvideoBtnLayout.setClickable(false);
        byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
        byvideoBtn.setTextColor(Color.GRAY);
        byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
        byphoneBtn.setTextColor(Color.WHITE);
        byphoneBtnLayout.setVisibility(View.VISIBLE);
        byphoneBtnLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_blue_rounded_corner);
                byphoneBtn.setTextColor(Color.WHITE);
                byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_white_rounded_corner);
                byvideoBtn.setTextColor(Color.GRAY);
            }
        });
    }
}

From source file:cl.gisred.android.LectorInspActivity.java

private void singleTapOnMap() {
    myMapView.setOnSingleTapListener(new OnSingleTapListener() {
        @Override//from  w  ww .j  a  va 2 s.  co m
        public void onSingleTap(float x, float y) {

            if (bMapTap) {

                Point oPoint = myMapView.toMapPoint(x, y);

                if (mBusquedaLayer != null && myMapView.getLayerByID(mBusquedaLayer.getID()) != null)
                    myMapView.removeLayer(mBusquedaLayer);

                if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                    myMapView.removeLayer(mSeleccionLayer);

                if (bCallOut) {

                    if (nIndentify > 0) {

                        mSeleccionLayer = new GraphicsLayer();
                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 12,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);

                        //TODO buscar tramo
                        switch (nIndentify) {
                        case 1:
                            getCalleToDialog(oPoint);
                            break;
                        case 2:
                            getTramoToDialog(oPoint);
                            break;
                        }

                    } else {
                        mSeleccionLayer = new GraphicsLayer();
                        int[] selectedFeatures = oLySelectAsoc.getGraphicIDs(x, y, calcRadio(), 1000);

                        // select the features
                        oLySelectAsoc.clearSelection();
                        oLySelectAsoc.setSelectedGraphics(selectedFeatures, true);

                        if (selectedFeatures.length > 0) {
                            Graphic[] results = oLySelectAsoc.getSelectedFeatures();
                            Callout mapCallout = myMapView.getCallout();
                            mapCallout.hide();

                            for (Graphic graphic : results) {

                                Map<String, Object> attr = graphic.getAttributes();
                                Util oUtil = new Util();
                                CalloutTvClass oCall = oUtil.getCalloutValues(attr);

                                GisTextView tv = new GisTextView(LectorInspActivity.this);
                                tv.setText(oCall.getVista());
                                tv.setHint(oCall.getValor());
                                tv.setIdObjeto(oCall.getIdObjeto());
                                tv.setPoint((Point) graphic.getGeometry());
                                tv.setTipo("nueva");
                                tv.setTextColor(Color.WHITE);

                                tv.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View v) {
                                        oTxtAsoc.setIdObjeto(((GisTextView) v).getIdObjeto());
                                        oTxtAsoc.setText(((GisTextView) v).getHint());
                                        oTxtAsoc.setTipo(((GisTextView) v).getTipo());
                                        oTxtAsoc.setPoint(myMapView.getCallout().getCoordinates());
                                        bCallOut = false;
                                        bMapTap = false;
                                        myMapView.getCallout().hide();
                                        oLySelectAsoc.clearSelection();
                                        dialogCur.show();
                                        if (mSeleccionLayer != null
                                                && myMapView.getLayerByID(mSeleccionLayer.getID()) != null)
                                            myMapView.removeLayer(mSeleccionLayer);

                                        // LINE PRINT
                                        if (mUbicacionLayer != null && oUbicacion != null) {
                                            SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4,
                                                    SimpleLineSymbol.STYLE.DASH);
                                            Polyline oLine = new Polyline();
                                            oLine.startPath(oUbicacion);
                                            oLine.lineTo(oTxtAsoc.getPoint());
                                            Graphic graphicDireccion = new Graphic(oLine, lineSymbol, null);
                                            mUbicacionLayer.addGraphic(graphicDireccion);
                                        }
                                    }
                                });

                                Point point = (Point) graphic.getGeometry();

                                mapCallout.setOffset(0, -3);
                                mapCallout.setCoordinates(point);
                                mapCallout.setMaxHeight(100);
                                mapCallout.setMaxWidth(400);
                                mapCallout.setStyle(R.xml.mycalloutprefs);
                                mapCallout.setContent(tv);

                                mapCallout.show();
                            }
                        } else {
                            getAsocObject(oPoint);
                        }

                        SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 12,
                                SimpleMarkerSymbol.STYLE.CIRCLE);
                        Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                        mSeleccionLayer.addGraphic(resultLocGraphic);

                        myMapView.addLayer(mSeleccionLayer);
                    }

                } else {
                    if (mUbicacionLayer != null && myMapView.getLayerByID(mUbicacionLayer.getID()) != null)
                        myMapView.removeLayer(mUbicacionLayer);

                    oUbicacion = oPoint;
                    mUbicacionLayer = new GraphicsLayer();

                    SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.RED, 12,
                            SimpleMarkerSymbol.STYLE.DIAMOND);
                    Graphic resultLocGraphic = new Graphic(oPoint, resultSymbol);
                    mUbicacionLayer.addGraphic(resultLocGraphic);

                    myMapView.addLayer(mUbicacionLayer);

                    if (R.layout.dialog_poste == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_direccion == idResLayoutSelect) {
                        LyDIRECCIONES.setVisible(true);
                        if (LyDIRECCIONES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyDIRECCIONES.getMinScale() * 0.9);
                    } else if (R.layout.dialog_cliente == idResLayoutSelect
                            || R.layout.dialog_cliente_cnr == idResLayoutSelect) {
                        LyPOSTES.setVisible(true);
                        LyDIRECCIONES.setVisible(true);
                        LyCLIENTES.setVisible(true);

                        if (idResLayoutSelect == R.layout.dialog_cliente_cnr)
                            LyREDBT.setVisible(true);

                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    } else if (R.layout.form_lectores == idResLayoutSelect) {
                        if (LyPOSTES.getMinScale() < myMapView.getScale())
                            myMapView.zoomToScale(oPoint, LyPOSTES.getMinScale() * 0.9);
                    }
                }
            } else {
                if (bVerData) {
                    double nExtendScale = myMapView.getScale();
                    double layerScala = 0;

                    ArrayList<ArcGISDynamicMapServiceLayer> arrayLay = new ArrayList<>();
                    Point oPoint = myMapView.toMapPoint(x, y);

                    if (oLyViewGraphs != null && myMapView.getLayerByID(oLyViewGraphs.getID()) != null)
                        myMapView.removeLayer(oLyViewGraphs);

                    oLyViewGraphs = new GraphicsLayer();
                    SimpleMarkerSymbol oMarketSymbol = new SimpleMarkerSymbol(Color.BLACK, 10,
                            SimpleMarkerSymbol.STYLE.CIRCLE);
                    oMarketSymbol.setOutline(new SimpleLineSymbol(Color.RED, 1, SimpleLineSymbol.STYLE.SOLID));
                    Graphic oGraph = new Graphic(oPoint, oMarketSymbol);
                    oLyViewGraphs.addGraphic(oGraph);

                    myMapView.addLayer(oLyViewGraphs);

                    for (Layer oLayer : myMapView.getLayers()) {

                        if ((oLayer.getName() != null && !oLayer.getName().equalsIgnoreCase("MapaBase"))
                                && oLayer.isVisible()) {

                            if (oLayer.getClass().equals(ArcGISDynamicMapServiceLayer.class)) {
                                for (ArcGISLayerInfo arcGISLayerInfo : ((ArcGISDynamicMapServiceLayer) oLayer)
                                        .getLayers()) {
                                    if (arcGISLayerInfo.isVisible()) {
                                        layerScala = (arcGISLayerInfo.getMinScale() > 0)
                                                ? arcGISLayerInfo.getMinScale()
                                                : 0;
                                        break;
                                    }
                                }

                                layerScala = (layerScala > 0) ? layerScala : nExtendScale;

                                if (nExtendScale <= layerScala) {
                                    arrayLay.add((ArcGISDynamicMapServiceLayer) oLayer);
                                }
                            }
                        }
                    }

                    if (arrayLay.size() > 0) {
                        ArcGISDynamicMapServiceLayer[] aLay = new ArcGISDynamicMapServiceLayer[arrayLay.size()];
                        aLay = arrayLay.toArray(aLay);
                        getInfoObject(oPoint, aLay);
                    } else {
                        Toast.makeText(getApplicationContext(), "No hay capas visibles", Toast.LENGTH_SHORT)
                                .show();
                    }
                }
            }
        }
    });
}