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.mitre.holdshort.MainActivity.java

private void startMainActivity() {

    // Set screen layout
    setContentView(R.layout.main);/*from   w ww  . ja v  a 2s .c o  m*/
    imageHelper = new ImageHelper();
    summaryGestureDetector = new GestureDetector(new summaryGester());

    // Get Reference to Shared Preferences file
    auralAlerts = settings.getBoolean("auralAlerts", true);
    settings.edit().putBoolean("auralAlerts", auralAlerts);
    announceRWY = settings.getBoolean("announceRWY", true);
    settings.edit().putBoolean("announceRWY", announceRWY);

    // Airport ID
    airportID = (TextView) findViewById(R.id.airportID);
    airportID.setText("K" + airport);

    // SpeechButton
    speechBtn = (ImageView) findViewById(R.id.speechBtn);
    speechBtn.setOnClickListener(speechBtnClickListener);

    // Get open close button
    openClose = (TextView) findViewById(R.id.openClose);
    openClose.setText("close");
    // openClose.setTextColor(Color.argb(200, 255, 255, 255));
    openClose.setOnClickListener(openCloseListener);

    // departure runway button
    depRwyBtn = (TextView) findViewById(R.id.depRwyBtn);
    depRwyBtn.setOnClickListener(depRwyListener);
    depRwyBtn.setText("Departure Rwy");
    depRwyBtn.setBackgroundResource(R.drawable.hatched_small_bg_layer);
    depRwyBtn.setPadding(10, 5, 10, 5);

    // info button - used to start prefs activity
    infoBtn = (ImageButton) findViewById(R.id.info_btn);
    // infoBtn.setBackgroundColor(Color.rgb(0,0,0));
    infoBtn.setOnClickListener(settingsMenuListener);

    // taxi button - used to start Taxi instruction activity
    taxiBtn = (ImageButton) findViewById(R.id.taxi_btn);
    // taxiBtn.setBackgroundColor(Color.rgb(0,0,0));
    taxiBtn.setOnClickListener(taxiBtnListener);

    // summary info - when drawer is closed
    summaryBar = (RelativeLayout) findViewById(R.id.summaryBar);
    summaryBar.setOnTouchListener(summaryTouchListener);
    runwayContainer = (LinearLayout) findViewById(R.id.holder);
    innerHolder = (LinearLayout) findViewById(R.id.innerHolder);
    slidingPanel = (SlidingPanel) findViewById(R.id.slidingDrawer);

    // header
    header = (RelativeLayout) findViewById(R.id.header);
    headerDropShadow = (View) findViewById(R.id.header_drop_shadow);
    slidingPanel.setHeaderDropShadow(headerDropShadow);
    slidingPanel.setRunwayContainer(runwayContainer);
    slidingPanel.setOpenCloseTextView(openClose);
    slidingPanel.setHandler(this.handler);

    summaryInfo = (RelativeLayout) findViewById(R.id.summary_info);
    summary_index = (TextView) findViewById(R.id.summary_index);
    summary_thumb = (TextView) findViewById(R.id.summary_thumb);
    summary_thumb.setWidth(90);

    // Taxi path area
    taxiClearance = (TextView) findViewById(R.id.taxiClearance);
    taxiClearance.setTextSize(12);
    taxiClearance.setPadding(5, 0, 5, 0);
    taxiClearance.setTextColor(Color.WHITE);
    // taxiClearance.setBackgroundColor(Color.rgb(0,0,0));
    taxiClearance.setOnClickListener(taxiPathListener);

    // Airport Diagram
    plateView = (AirportPlateView) findViewById(R.id.plateView);
    // Set up the nav control for the moving map
    // this is used when ownship is off screen
    navControl = (ImageView) findViewById(R.id.showNavBtn);
    plateView.setNavControls(navControl);
    navControl.setVisibility(ImageView.INVISIBLE);
    navControl.setOnClickListener(navControlListener);

    // // Lat/Lon Ref 1 SFO
    Point latLon1 = new Point(37.627827, -122.366794);
    Point latLon2 = new Point(37.606827, -122.380724);
    XYPoint xy1 = new XYPoint(134, 173);
    XYPoint xy2 = new XYPoint(340, 281);

    // Lat/Lon Ref 1 HEF
    // Point latLon1 = new Point(38.727680,-77.518803);
    // Point latLon2 = new Point(38.714041,-77.508976);
    // XYPoint xy1 = new XYPoint(140,187);
    // XYPoint xy2 = new XYPoint(322,513);
    plateView.geoReference(latLon1, latLon2, xy1, xy2);

    Location loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    plateView.updatePosition(loc.getBearing(), loc.getLatitude(), loc.getLongitude());

    // navView.setScroll(plateView);
    TextView emptyPlate = (TextView) findViewById(R.id.emptyPlate);

    if (!(plateView.setImage(airport))) {
        // Place holder if no plate is available
        emptyPlate.setVisibility(View.VISIBLE);
        plateView.setVisibility(View.GONE);

    } else {
        // Show plate. Hide placeholder
        plateView.setImage(airport);
        emptyPlate.setVisibility(View.GONE);
    }

    // Create logger for alerts
    alertLogger = new AlertLogger(airport, MainActivity.this);

    // Alert Panels
    alertScreen = (RelativeLayout) findViewById(R.id.alertScreen);
    betaControls = (LinearLayout) findViewById(R.id.betaControls);
    goodAlert = (TextView) findViewById(R.id.goodAlert);
    goodAlert.setOnClickListener(alertResponseListener);
    badAlert = (TextView) findViewById(R.id.badAlert);
    badAlert.setOnClickListener(alertResponseListener);
    lateAlert = (TextView) findViewById(R.id.lateAlert);
    lateAlert.setOnClickListener(alertResponseListener);
    earlyAlert = (TextView) findViewById(R.id.earlyAlert);
    earlyAlert.setOnClickListener(alertResponseListener);

    miniAlert = (TextView) findViewById(R.id.miniAlertText);
    miniAlert.setOnClickListener(maximizeAlert);

    holdShort = (LinearLayout) findViewById(R.id.holdShort);
    holdShort.getChildAt(0).setBackgroundDrawable(imageHelper
            .getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.alert), 10));
    holdShort.setOnClickListener(minimizeAlert);
    noClearance = (LinearLayout) findViewById(R.id.noClearance);
    noClearance.setOnClickListener(minimizeAlert);
    noClearance.getChildAt(0).setBackgroundDrawable(imageHelper
            .getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.alert), 10));
    crossingAlert = (LinearLayout) findViewById(R.id.crossingAlert);
    noTakeoffClearance = (LinearLayout) findViewById(R.id.noTakeoffClearance);
    noTakeoffClearance.getChildAt(0).setBackgroundDrawable(imageHelper
            .getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.alert), 10));
    noTakeoffClearance.setOnClickListener(minimizeAlert);
    disabled_gps = (LinearLayout) findViewById(R.id.disabled_gps);
    disabled_gps.getChildAt(0).setBackgroundDrawable(imageHelper
            .getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.disabled), 10));
    disabled_gps.setOnClickListener(minimizeAlert);

    disabled_speed = (LinearLayout) findViewById(R.id.disabled_speed);
    disabled_speed.getChildAt(0).setBackgroundDrawable(imageHelper
            .getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.disabled), 10));
    disabled_speed.setOnClickListener(minimizeAlert);

    // Instantiate media player & set completion listener
    mp = new MediaPlayer();
    mp.setOnCompletionListener(alertPlaybackListener);

    // Instruction List instantiation
    instructionList = new ArrayList<String>();

    setUpRunways();
    slidingPanel.setOnTouchListener(summaryTouchListener);
    // Instantiate Alert Manager
    alertManager = new AlertManager(rwyMgr);

    allSetUp = true;
}

From source file:com.breel.wearables.shadowclock.graphics.ShapeShadow.java

private void setupPaint() {
    boundsPathPaint.setColor(Color.RED);
    boundsPathPaint.setStyle(Paint.Style.STROKE);
    boundsPathPaint.setStrokeWidth(2);//  w w w. j  a  v  a  2 s  .  c om

    shapePathPaint.setColor(Color.WHITE);
    shapePathPaint.setStyle(Paint.Style.FILL);

    shadowPathPaint.setColor(Color.BLUE);
    shadowPathPaint.setStyle(Paint.Style.FILL);

    setupBlur(3.0f);

    gradientHelperPaint.setColor(Color.BLUE);
    gradientHelperPaint.setStyle(Paint.Style.FILL);

    boundsPath.reset();
    boundsPath.moveTo(0, 0);
    boundsPath.lineTo(100, 0);
    boundsPath.lineTo(100, 100);
    boundsPath.lineTo(0, 100);
    boundsPath.close();

    shapeColor = this.context.getResources().getColor(R.color.ambientModeTypeface);
}

From source file:com.android.deskclock.Utils.java

/**
 * For screensavers to dim the lights if necessary.
 */// w w  w .  j  a  v  a 2 s .  c o m
public static void dimClockView(boolean dim, View clockView) {
    Paint paint = new Paint();
    paint.setColor(Color.WHITE);
    paint.setColorFilter(new PorterDuffColorFilter((dim ? 0x40FFFFFF : 0xC0FFFFFF), PorterDuff.Mode.MULTIPLY));
    clockView.setLayerType(View.LAYER_TYPE_HARDWARE, paint);
}

From source file:net.networksaremadeofstring.rhybudd.RhybuddDock.java

private void drawScale(Canvas canvas, Boolean Colors, int Count, int Max) {
    RectF faceRect = new RectF();
    faceRect.set(10, 10, 190, 190);/*from  w  w  w  . j  av  a2  s . c  o  m*/

    Paint scalePaint = new Paint();
    scalePaint.setStyle(Paint.Style.STROKE);
    scalePaint.setColor(getResources().getColor(R.color.WarningGreen));
    scalePaint.setStrokeWidth(1);
    scalePaint.setAntiAlias(true);

    scalePaint.setTextSize(12);
    scalePaint.setTypeface(Typeface.createFromAsset(this.getAssets(), "fonts/chivo.ttf"));
    scalePaint.setTextAlign(Paint.Align.CENTER);

    float scalePosition = 10;
    RectF scaleRect = new RectF();
    scaleRect.set(faceRect.left + scalePosition, faceRect.top + scalePosition, faceRect.right - scalePosition,
            faceRect.bottom - scalePosition);

    if (!Colors)
        scalePaint.setColor(Color.WHITE);

    scalePaint.setStrokeWidth(2);
    canvas.save(Canvas.MATRIX_SAVE_FLAG);
    for (int i = 0; i < Max; ++i) {
        if (Colors) {
            if (i > 20)
                scalePaint.setColor(getResources().getColor(R.color.WarningYellow));

            if (i > 40)
                scalePaint.setColor(getResources().getColor(R.color.WarningOrange));

            if (i > 60)
                scalePaint.setColor(getResources().getColor(R.color.WarningRed));
        }

        canvas.drawLine(100, 20, 100, 18, scalePaint);
        int divisor = 5;

        if (Max > 100)
            divisor = 25;

        if (i % divisor == 0) {
            canvas.drawText(Integer.toString(i), 100, 16, scalePaint);
        }

        canvas.rotate((360.0f / Max), 100, 100);
    }

    canvas.restore();
}

From source file:com.fvd.nimbus.PaintActivity.java

/** Called when the activity is first created. */
@Override/*ww w .j av  a 2  s  .c o  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up );
    overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    try {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    } catch (Exception e) {
        e.printStackTrace();
    }
    ctx = this;
    prefs = PreferenceManager.getDefaultSharedPreferences(this);
    dWidth = prefs.getInt("dWidth", 2);
    fWidth = prefs.getInt("fWidth", 1);
    dColor = prefs.getInt(pColor, Color.RED);
    saveFormat = Integer.parseInt(prefs.getString("saveFormat", "1"));
    serverHelper.getInstance().setCallback(this, this);
    serverHelper.getInstance().setMode(saveFormat);
    setContentView(R.layout.screen_edit);
    drawer = (DrawerLayout) findViewById(R.id.root);
    findViewById(R.id.bDraw1).setOnClickListener(this);
    findViewById(R.id.bDraw2).setOnClickListener(this);
    findViewById(R.id.bDraw3).setOnClickListener(this);
    findViewById(R.id.bDraw4).setOnClickListener(this);
    findViewById(R.id.bDraw5).setOnClickListener(this);
    findViewById(R.id.bDraw6).setOnClickListener(this);
    findViewById(R.id.bDraw8).setOnClickListener(this);
    findViewById(R.id.bColor1).setOnClickListener(this);
    findViewById(R.id.bColor2).setOnClickListener(this);
    findViewById(R.id.bColor3).setOnClickListener(this);
    findViewById(R.id.bColor4).setOnClickListener(this);
    findViewById(R.id.bColor5).setOnClickListener(this);
    paletteButton = (CircleButton) findViewById(R.id.bToolColor);
    paletteButton.setOnClickListener(this);

    paletteButton_land = (CircleButton) findViewById(R.id.bToolColor_land);
    //paletteButton_land.setOnClickListener(this);

    ((SeekBar) findViewById(R.id.seekBarLine)).setProgress(dWidth * 10);
    ((SeekBar) findViewById(R.id.seekBarType)).setProgress(fWidth * 10);

    ((TextView) findViewById(R.id.tvTextType)).setText(String.format("%d", 40 + fWidth * 20));

    findViewById(R.id.bUndo).setOnClickListener(this);
    findViewById(R.id.btnBack).setOnClickListener(this);
    findViewById(R.id.bClearAll).setOnClickListener(this);
    findViewById(R.id.bTurnLeft).setOnClickListener(this);
    findViewById(R.id.bTurnRight).setOnClickListener(this);
    findViewById(R.id.bDone).setOnClickListener(this);
    findViewById(R.id.bApplyText).setOnClickListener(this);

    ((ImageButton) findViewById(R.id.bStroke)).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            v.setSelected(!v.isSelected());
        }
    });

    lineWidthListener = new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            // TODO Auto-generated method stub
            if (true || fromUser) {
                /*dWidth = (progress/10);
                 drawView.setWidth((dWidth+1)*5);*/
                dWidth = progress;
                drawView.setWidth(dWidth);
                Editor e = prefs.edit();
                e.putInt("dWidth", dWidth);
                e.commit();
            }

        }
    };

    ((SeekBar) findViewById(R.id.seekBarLine)).setOnSeekBarChangeListener(lineWidthListener);
    ((SeekBar) findViewById(R.id.ls_seekBarLine)).setOnSeekBarChangeListener(lineWidthListener);

    fontSizeListener = new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            // TODO Auto-generated method stub

            if (fromUser) {
                fWidth = progress / 10;
                int c = 40 + fWidth * 20;
                drawView.setFontSize(c);
                Editor e = prefs.edit();
                e.putInt("fWidth", fWidth);
                e.commit();
                try {
                    ((TextView) findViewById(R.id.tvTextType)).setText(String.format("%d", c));
                    ((TextView) findViewById(R.id.ls_tvTextType)).setText(String.format("%d", c));
                } catch (Exception ex) {

                }

            }
        }
    };

    ((SeekBar) findViewById(R.id.seekBarType)).setOnSeekBarChangeListener(fontSizeListener);
    ((SeekBar) findViewById(R.id.ls_seekBarType)).setOnSeekBarChangeListener(fontSizeListener);

    drawView = (DrawView) findViewById(R.id.painter);
    drawView.setWidth((dWidth + 1) * 5);
    drawView.setFontSize(40 + fWidth * 20);

    setBarConfig(getResources().getConfiguration().orientation);

    findViewById(R.id.bEditPage).setOnClickListener(this);
    findViewById(R.id.bToolColor).setOnClickListener(this);
    findViewById(R.id.bErase).setOnClickListener(this);
    findViewById(R.id.bToolShape).setOnClickListener(this);
    findViewById(R.id.bToolText).setOnClickListener(this);
    findViewById(R.id.bToolCrop).setOnClickListener(this);
    findViewById(R.id.btnBack).setOnClickListener(this);
    findViewById(R.id.bDone).setOnClickListener(this);
    findViewById(R.id.btnShare).setOnClickListener(this);
    findViewById(R.id.bSave2SD).setOnClickListener(this);
    findViewById(R.id.bSave2Nimbus).setOnClickListener(this);

    userMail = prefs.getString("userMail", "");
    userPass = prefs.getString("userPass", "");
    sessionId = prefs.getString("sessionId", "");

    appSettings.sessionId = sessionId;
    appSettings.userMail = userMail;
    appSettings.userPass = userPass;

    storePath = "";
    Intent intent = getIntent();
    String action = intent.getAction();
    String type = intent.getType();
    //storePath= intent.getPackage().getClass().toString();
    if ((Intent.ACTION_VIEW.equals(action) || Intent.ACTION_SEND.equals(action)
            || "com.onebit.nimbusnote.EDIT_PHOTO".equals(action)) && type != null) {
        if (type.startsWith("image/")) {
            Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
            if (imageUri == null)
                imageUri = intent.getData();
            if (imageUri != null) {
                String url = Uri.decode(imageUri.toString());
                if (url.startsWith(CONTENT_PHOTOS_URI_PREFIX)) {
                    url = getPhotosPhotoLink(url);
                } //else url=Uri.decode(url);

                ContentResolver cr = getContentResolver();
                InputStream is;

                try {
                    is = cr.openInputStream(Uri.parse(url));
                    if ("com.onebit.nimbusnote.EDIT_PHOTO".equals(action))
                        storePath = " ";//getGalleryPath(Uri.parse(url));
                    Bitmap bmp = BitmapFactory.decodeStream(is);
                    if (bmp.getWidth() != -1 && bmp.getHeight() != -1)
                        drawView.setBitmap(bmp, 0);
                } catch (Exception e) {
                    appSettings.appendLog("paint:onCreate  " + e.getMessage());
                }
            }
        }
    } else {
        String act = getIntent().getExtras().getString("act");
        if ("photo".equals(act)) {
            getPhoto();
        } else if ("picture".equals(act)) {
            getPicture();
        } else {
            String filePath = getIntent().getExtras().getString("path");
            boolean isTemp = getIntent().getExtras().getBoolean("temp");
            domain = getIntent().getExtras().getString("domain");
            if (domain == null)
                domain = serverHelper.getDate();
            if (filePath.contains("://")) {
                Bitmap bmp = helper.LoadImageFromWeb(filePath);
                if (bmp != null) {
                    drawView.setBitmap(bmp, 0);
                }
            } else {
                File file = new File(filePath);
                if (file.exists()) {
                    try {
                        int orient = helper.getOrientationFromExif(filePath);
                        Bitmap bmp = helper.decodeSampledBitmap(filePath, 1000, 1000);
                        if (bmp != null) {
                            drawView.setBitmap(bmp, orient);
                        }
                    } catch (Exception e) {
                        appSettings.appendLog("paint.onCreate()  " + e.getMessage());
                    }
                    if (isTemp)
                        file.delete();
                }
            }
        }
    }

    drawView.setBackgroundColor(Color.WHITE);
    drawView.requestFocus();
    drawView.setColour(dColor);
    setPaletteColor(dColor);

    drawView.setSelChangeListener(new shapeSelectionListener() {

        @Override
        public void onSelectionChanged(int shSize, int fSize, int shColor) {
            setSelectedFoot(0);
            setLandToolSelected(R.id.bEditPage_land);
            //updateColorDialog(shSize!=-1?(shSize/5)-1:dWidth, fSize!=-1?(fSize-40)/20:fWidth, shColor!=0?colorToId(shColor):dColor);
            dColor = shColor;
            ccolor = shColor;
            int sw = shSize != -1 ? shSize : dWidth;
            canChange = false;
            ((SeekBar) findViewById(R.id.seekBarLine)).setProgress(sw);
            ((SeekBar) findViewById(R.id.ls_seekBarLine)).setProgress(sw);
            setPaletteColor(dColor);
            drawView.setColour(dColor);
            canChange = true;
        }

        @Override
        public void onTextChanged(String text, boolean stroke) {

            if (findViewById(R.id.text_field).getVisibility() != View.VISIBLE) {
                hideTools();

                findViewById(R.id.bStroke).setSelected(stroke);
                ((EditText) findViewById(R.id.etEditorText)).setText(text);
                findViewById(R.id.text_field).setVisibility(View.VISIBLE);
                findViewById(R.id.etEditorText).requestFocus();
                ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))
                        .showSoftInput(findViewById(R.id.etEditorText), 0);
                findViewById(R.id.bToolText).postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        setSelectedFoot(2);

                    }
                }, 100);

            }
        }

    });

    setColorButtons(dColor);

    //mPlanetTitles = getResources().getStringArray(R.array.lmenu_paint);

    /*ListView listView = (ListView) findViewById(R.id.left_drawer);
    listView.setAdapter(new DrawerMenuAdapter(this,getResources().getStringArray(R.array.lmenu_paint)));
    listView.setOnItemClickListener(this);*/
}

From source file:com.agenmate.lollipop.addedit.AddEditFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        getActivity().onBackPressed();//  w  w w .ja v a 2 s . c  o  m
        return true;
    case R.id.action_save:
        String title = emptyStringChecker(titleEdit.getText().toString());
        if (title == null) {
            Snackbar.make(background, "Title can't be Empty", Snackbar.LENGTH_LONG).show();
            return true;
        }
        String description = emptyStringChecker(descEdit.getText().toString());
        int priority = getPriority();

        long dueAt = getDueDate();
        if (dueAt < 0) {
            Snackbar.make(background, "Not enough time to complete task at due date", Snackbar.LENGTH_LONG)
                    .show();
            return true;
        }

        presenter.saveTask(title, description, priority, selectedColor, dueAt, hasAlarm, isCompleted);

        return true;
    case R.id.action_alarm:
        if (!hasAlarm) {
            if (getDueDate() < 0) {
                Snackbar.make(background, "Not enough time to complete task at due date", Snackbar.LENGTH_LONG)
                        .show();
                return true;
            }
        }
        boolean setWhite = selectedColor == 0 || selectedColor == 5 || selectedColor == 6;
        item.setIcon(hasAlarm ? R.drawable.ic_alarm_off : R.drawable.ic_alarm_on);
        Drawable drawable = item.getIcon();
        drawable.mutate();
        drawable.setColorFilter(setWhite ? Color.WHITE : Color.BLACK, PorterDuff.Mode.SRC_ATOP);
        hasAlarm = !hasAlarm;
        return true;

    case R.id.action_delete:
        presenter.deleteTask();
        return true;
    }
    return super.onOptionsItemSelected(item);
}

From source file:com.amaze.filemanager.fragments.ProcessViewer.java

public void processExtractResults(DataPackage dataPackage) {
    if (!running)
        return;/*www .  ja  v a2  s.c  o m*/
    if (getResources() == null)
        return;
    final int id = dataPackage.getId();

    if (!CancelledExtractIds.contains(id)) {
        if (ExtractIds.contains(id)) {

            boolean completed = dataPackage.isCompleted();
            View process = rootView.findViewWithTag("extract" + id);
            if (completed) {
                rootView.removeViewInLayout(process);
                ExtractIds.remove(ExtractIds.indexOf(id));
            } else {
                String name = dataPackage.getName();
                int p1 = dataPackage.getP1();
                long p3 = dataPackage.getTotal();
                long p2 = dataPackage.getDone();
                ProgressBar p = (ProgressBar) process.findViewById(R.id.progressBar1);
                if (p1 <= 100) {
                    ((TextView) process.findViewById(R.id.progressText)).setText(
                            utils.getString(getActivity(), R.string.extracting) + "\n" + name + "\n" + p1 + "%"
                                    + "\n" + utils.readableFileSize(p2) + "/" + utils.readableFileSize(p3));

                    p.setProgress(p1);
                }
            }
        } else {
            CardView root = (CardView) getActivity().getLayoutInflater().inflate(R.layout.processrow, null);
            root.setTag("extract" + id);

            ImageView progressImage = ((ImageView) root.findViewById(R.id.progressImage));
            ImageButton cancel = (ImageButton) root.findViewById(R.id.delete_button);
            TextView progressText = (TextView) root.findViewById(R.id.progressText);

            if (mainActivity.theme1 == 1) {

                root.setCardBackgroundColor(R.color.cardView_foreground);
                root.setCardElevation(0f);
                cancel.setImageResource(R.drawable.ic_action_cancel);
                progressText.setTextColor(Color.WHITE);
                progressImage.setImageResource(R.drawable.ic_doc_compressed);
            } else {

                // cancel has default src set for light theme
                progressText.setTextColor(Color.BLACK);
                progressImage.setImageResource(R.drawable.ic_doc_compressed_black);
            }

            cancel.setOnClickListener(new View.OnClickListener() {

                public void onClick(View p1) {
                    Toast.makeText(getActivity(), utils.getString(getActivity(), R.string.stopping),
                            Toast.LENGTH_LONG).show();
                    Intent i = new Intent("excancel");
                    i.putExtra("id", id);
                    getActivity().sendBroadcast(i);
                    rootView.removeView(rootView.findViewWithTag("extract" + id));

                    ExtractIds.remove(ExtractIds.indexOf(id));
                    CancelledExtractIds.add(id);
                    // TODO: Implement this method
                }
            });

            String name = dataPackage.getName();
            int p1 = dataPackage.getP1();

            ((TextView) root.findViewById(R.id.progressText))
                    .setText(utils.getString(getActivity(), R.string.extracting) + "\n" + name);
            ProgressBar p = (ProgressBar) root.findViewById(R.id.progressBar1);
            p.setProgress(p1);
            ExtractIds.add(id);
            rootView.addView(root);
        }
    }
}

From source file:com.amaze.filemanager.fragments.ProcessViewerFragment.java

/**
 * Initialize chart for the first time/*from  www  .j  a  va2  s .  c  om*/
 * @param totalBytes maximum value for x-axis
 */
private void chartInit(long totalBytes) {
    mLineChart.setBackgroundColor(accentColor);
    mLineChart.getLegend().setEnabled(false);

    // no description text
    mLineChart.getDescription().setEnabled(false);

    XAxis xAxis = mLineChart.getXAxis();
    YAxis yAxisLeft = mLineChart.getAxisLeft();
    mLineChart.getAxisRight().setEnabled(false);
    yAxisLeft.setTextColor(Color.WHITE);
    yAxisLeft.setAxisLineColor(Color.TRANSPARENT);
    yAxisLeft.setTypeface(Typeface.DEFAULT_BOLD);
    yAxisLeft.setGridColor(Utils.getColor(getContext(), R.color.white_translucent));

    xAxis.setAxisMaximum(FileUtils.readableFileSizeFloat(totalBytes));
    xAxis.setAxisMinimum(0.0f);
    xAxis.setAxisLineColor(Color.TRANSPARENT);
    xAxis.setGridColor(Color.TRANSPARENT);
    xAxis.setTextColor(Color.WHITE);
    xAxis.setTypeface(Typeface.DEFAULT_BOLD);
    mLineChart.setData(mLineData);
    mLineChart.invalidate();
}

From source file:com.example.SmartBoard.DrawingView.java

public boolean drawPoint(float x, float y, int action, int color, String mode, int brushSize, String clientID) {

    mX = x;/*from ww w .  j a  va 2 s  .c om*/
    mY = y;

    Path path = clientPaths.get(clientID);
    if (path == null) {
        path = new Path();
        clientPaths.put(clientID, path);
    }
    drawPathRecv = path;

    setDrawPaintRecv(color, mode, brushSize);
    switch (action) {
    case MotionEvent.ACTION_DOWN:
        drawPathRecv.moveTo(x, y);
        break;
    case MotionEvent.ACTION_MOVE:
        drawPathRecv.lineTo(x, y);
        break;
    case MotionEvent.ACTION_UP:
        drawCanvas.drawPath(drawPathRecv, drawPaintSender);
        drawPathRecv.reset();
        break;
    case CLEAR_SCREEN:
        drawCanvas.drawColor(Color.WHITE);
        break;
    default:
        //draw nothing
    }

    invalidate();
    return true;
}

From source file:com.spoiledmilk.ibikecph.favorites.EditFavoriteFragment.java

protected int getSelectedTextColor() {
    return Color.WHITE;
}