Example usage for android.graphics Color BLACK

List of usage examples for android.graphics Color BLACK

Introduction

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

Prototype

int BLACK

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

Click Source Link

Usage

From source file:com.rks.musicx.ui.adapters.RemoveTabAdapter.java

@Override
public void onBindViewHolder(RemoveTabAdapter.removeViewholder holder, int position) {
    String name = getItem(position);
    holder.tabName.setTypeface(Helper.getFont(getContext()));
    holder.tabName.setText(name);/*from   ww w.j a v  a 2s.  co m*/
    holder.tabName.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
                mDragStartListener.onStartDrag(holder);
            }
            return false;
        }
    });
    if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
        holder.tabName.setTextColor(Color.WHITE);
    } else {
        holder.tabName.setTextColor(Color.BLACK);
    }
}

From source file:com.example.google.maps.folding_map.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

    // Map can be null if there is a Google Play services issue.
    if (mMap != null) {
        // Wait until the map has loaded before we allow it to be folded.
        mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
            @Override/*  w ww. j a  v  a2s .c  o m*/
            public void onMapLoaded() {
                mMapAction.setEnabled(true);
            }
        });
    }

    mFoldingLayout = (FoldingLayout) findViewById(R.id.folding_layout);

    // Wait until the FoldingLayout has be laid out; it needs dimensions.
    mFoldingLayout.getViewTreeObserver()
            .addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                @SuppressWarnings("deprecation")
                @SuppressLint("NewApi")
                @Override
                public void onGlobalLayout() {
                    mFoldingLayout.setNumberOfFolds(3);
                    mFoldingLayout.setBackgroundColor(Color.BLACK);
                    mFoldingLayout.setFoldListener(MainActivity.this);

                    ViewTreeObserver obs = mFoldingLayout.getViewTreeObserver();
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                        obs.removeOnGlobalLayoutListener(this);
                    } else {
                        obs.removeGlobalOnLayoutListener(this);
                    }
                }
            });

    mImageView = (ImageView) findViewById(R.id.image_view);
}

From source file:ca.farrelltonsolar.classic.DayLogCalendar.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    theView = inflater.inflate(R.layout.day_log_calendar, container, false);
    Bundle args = getArguments();/*from  www  . j  av a 2  s .  c  o  m*/
    int monthOffset = args != null ? args.getInt(ARG_MONTH) : 0;
    month = DateTime.now().minusMonths(monthOffset).withTimeAtStartOfDay().withDayOfMonth(1);
    adapter = new CalendarAdapter(this.getActivity(), month);
    GridView gridview = (GridView) theView.findViewById(R.id.gridview);
    gridview.setAdapter(adapter);
    gridview.setVelocityScale(5);

    TextView title = (TextView) theView.findViewById(R.id.title);
    title.setText(month.toString("MMMM yyyy"));
    View linearLayout = theView.findViewById(R.id.headerlayout);
    DateTime days = month;

    for (int i = 0; i < 7; i++) {
        int d = ((i + 6) % 7) + 1;
        days = days.withDayOfWeek(d);
        TextView aDay = new TextView(theView.getContext());
        aDay.setText(DateTimeFormat.forPattern("E").print(days));
        aDay.setGravity(Gravity.CENTER);
        aDay.setTextColor(Color.BLACK);
        aDay.setLayoutParams(new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1));
        ((LinearLayout) linearLayout).addView(aDay);

    }

    return theView;
}

From source file:com.android.gallery3d.v5.filtershow.category.CategoryView.java

public CategoryView(Context context) {
    super(context);
    setOnClickListener(this);
    Resources res = getResources();
    mSelectionStroke = res.getDimensionPixelSize(R.dimen.thumbnail_margin);
    mSelectPaint = new Paint();
    mSelectPaint.setStyle(Paint.Style.FILL);
    mSelectionColor = res.getColor(R.color.filtershow_category_selection);
    mSpacerColor = res.getColor(R.color.filtershow_categoryview_text);

    mSelectPaint.setColor(mSelectionColor);
    mBorderPaint = new Paint(mSelectPaint);
    mBorderPaint.setColor(Color.BLACK);
    mBorderStroke = mSelectionStroke / 2;
}

From source file:com.ece420.lab3.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    status_view = (TextView) findViewById(R.id.statusView);
    queryNativeAudioParameters();/*w ww  .j a  v a 2s. c o  m*/

    // initialize native audio system
    updateNativeAudioUI();
    if (supportRecording) {
        // DARIO
        // 48k and 128
        //            createSLEngine(Integer.parseInt(nativeSampleRate), Integer.parseInt(nativeSampleBufSize));
        createSLEngine(Integer.parseInt(nativeSampleRate), FRAME_SIZE);
    }
    isPlaying = false;

    // STFT portion
    stftView = (ImageView) this.findViewById(R.id.stftView);
    bitmap = Bitmap.createBitmap((int) (FFT_SIZE / 4), (int) 384, Bitmap.Config.ARGB_8888);
    canvas = new Canvas(bitmap);
    canvas.drawColor(Color.BLACK);

    paint = new Paint();
    paint.setColor(Color.GREEN);
    paint.setStyle(Paint.Style.FILL);
    stftView.setImageBitmap(bitmap);

    initializeStftBackgroundThread(10);

    startEcho();
}

From source file:com.ichi2.anki.Whiteboard.java

public Whiteboard(AnkiActivity context, boolean inverted, boolean monochrome) {
    super(context, null);
    mActivity = new WeakReference<>(context);
    mInvertedColors = inverted;/*from w w w.  j  av a  2s .co  m*/
    mMonochrome = monochrome;

    int foregroundColor;
    if (!mInvertedColors) {
        if (mMonochrome) {
            foregroundColor = Color.BLACK;
        } else {
            foregroundColor = ContextCompat.getColor(context, R.color.wb_fg_color);
        }
    } else {
        if (mMonochrome) {
            foregroundColor = Color.WHITE;
        } else {
            foregroundColor = ContextCompat.getColor(context, R.color.wb_fg_color_inv);
        }
    }

    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setDither(true);
    mPaint.setColor(foregroundColor);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    int wbStrokeWidth = AnkiDroidApp.getSharedPrefs(context).getInt("whiteBoardStrokeWidth", 6);
    mPaint.setStrokeWidth((float) wbStrokeWidth);
    createBitmap();
    mPath = new Path();
    mBitmapPaint = new Paint(Paint.DITHER_FLAG);
}

From source file:com.artemchep.horario.ui.fragments.details.DetailsHelper.java

void setAppBarBackgroundColor(@ColorInt int color) {
    color |= 0xFF000000; // ignore alpha bits
    final boolean isColorDark = ColorUtil.isColorDark(color);

    Drawable overflowIcon;//  w  ww.j  a  va2 s.  c o  m
    if (isColorDark) {
        mCollapsingToolbar.setExpandedTitleColor(Color.WHITE);
        mCollapsingToolbar.setCollapsedTitleTextColor(Color.WHITE);
        overflowIcon = ContextCompat.getDrawable(mActivity, R.drawable.ic_dots_vertical_white_24dp);
        if (mSmartTabLayout != null) {
            mSmartTabLayout.setDefaultTabTextColor(Color.WHITE);
            mSmartTabLayout.setSelectedIndicatorColors(Color.WHITE);
        }
    } else {
        mCollapsingToolbar.setExpandedTitleColor(Color.BLACK);
        mCollapsingToolbar.setCollapsedTitleTextColor(Color.BLACK);
        overflowIcon = ContextCompat.getDrawable(mActivity, R.drawable.ic_dots_vertical_black_24dp);
        if (mSmartTabLayout != null) {
            mSmartTabLayout.setDefaultTabTextColor(Color.BLACK);
            mSmartTabLayout.setSelectedIndicatorColors(Color.BLACK);
        }
    }

    mCollapsingToolbar.setContentScrimColor(color);
    if (mBackdropToolbar != null) {
        mBackdropToolbar.setBackgroundColor(color);
    } else
        mAppBar.setBackgroundColor(color);
    mToolbar.setOverflowIcon(overflowIcon);

    if (mActivity.mContainers.hasSingleColumn()) {
        int iconRes;
        if (mActivity.mAppBar.hasGeneralToolbar()) {
            iconRes = isColorDark ? R.drawable.ic_close_white_24dp : R.drawable.ic_close_black_24dp;
        } else
            iconRes = isColorDark ? R.drawable.ic_backburger_white_24dp : R.drawable.ic_backburger_black_24dp;
        Drawable navIcon = ContextCompat.getDrawable(mActivity, iconRes);
        mToolbar.setNavigationIcon(navIcon);
    }

    MenuItem editItem = mToolbar.getMenu().findItem(R.id.action_edit);
    if (editItem != null) {
        Drawable editIcon = isColorDark ? ContextCompat.getDrawable(mActivity, R.drawable.ic_pencil_white_24dp)
                : ContextCompat.getDrawable(mActivity, R.drawable.ic_pencil_black_24dp);
        editItem.setIcon(editIcon);
    }

    MenuItem shareItem = mToolbar.getMenu().findItem(R.id.action_share);
    if (shareItem != null) {
        Drawable shareIcon = isColorDark
                ? ContextCompat.getDrawable(mActivity, R.drawable.ic_share_variant_white_24dp)
                : ContextCompat.getDrawable(mActivity, R.drawable.ic_share_variant_black_24dp);
        shareItem.setIcon(shareIcon);
    }
}

From source file:com.appsimobile.appsii.module.home.SunriseDrawable.java

public SunriseDrawable(Context context) {

    mContext = context;//  w  w  w .  j a  v  a  2  s.com

    Resources res = context.getResources();
    final TypedArray a = context.obtainStyledAttributes(new int[] { R.attr.colorPrimary, R.attr.colorAccent,
            R.attr.colorPrimaryDark, R.attr.appsiHomeWidgetPrimaryColor, });

    int primaryColor = a.getColor(0, Color.BLACK);
    int accentColor = a.getColor(1, Color.BLACK);
    int primaryColorDark = a.getColor(2, Color.BLACK);
    int textColor = a.getColor(3, Color.BLACK);
    a.recycle();

    mIsRtl = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;

    float density = res.getDisplayMetrics().density;
    int sunBounds = (int) (density * 16);
    mTopOffset = (int) (density * 12);
    mLeftOffset = (int) (density * 24);
    mRightOffset = (int) (density * 24);
    mBottomOffset = (int) (density * 24);
    mDotRadius = (int) (density * 2);

    mSunImage = mContext.getResources().getDrawable(R.drawable.ic_weather_clear);
    mSunImage.setBounds(0, 0, sunBounds, sunBounds);

    mArcPaint = new Paint();
    mArcPaint.setColor(primaryColorDark);
    mArcPaint.setStyle(Paint.Style.STROKE);
    mArcPaint.setAntiAlias(true);

    mArcFillPaint = new Paint();
    mArcFillPaint.setColor(primaryColor);
    mArcFillPaint.setAlpha(64);
    mArcFillPaint.setStyle(Paint.Style.FILL);
    mArcFillPaint.setAntiAlias(true);

    mLinePaint = new Paint();
    mLinePaint.setColor(textColor);
    mLinePaint.setAlpha(128);
    mLinePaint.setStyle(Paint.Style.STROKE);

    mDotPaint = new Paint();
    mDotPaint.setStyle(Paint.Style.FILL);
    mDotPaint.setColor(primaryColorDark);
    mDotPaint.setAntiAlias(true);
}

From source file:com.example.georg.theupub.ProfileActivity.java

public static Bitmap toBitmap(BitMatrix matrix) {
    int height = matrix.getHeight();
    int width = matrix.getWidth();
    Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
    for (int x = 0; x < width; x++) {
        for (int y = 0; y < height; y++) {
            bmp.setPixel(x, y, matrix.get(x, y) ? Color.BLACK : Color.WHITE);
        }/*from  w  ww. ja v  a 2s  . c  om*/
    }
    return bmp;
}

From source file:at.amartinz.hardware.sensors.BaseSensor.java

public Drawable getSensorImage() {
    final int color;

    // local tint overrides global tint
    if (mIconTint != Integer.MIN_VALUE) {
        color = mIconTint;//from   w  w w. j av a2 s . com
    } else {
        color = sIconTintGlobal;
    }

    final Drawable drawable = ContextCompat.getDrawable(getContext(), getImageResourceId()).mutate();
    drawable.setColorFilter(new LightingColorFilter(Color.BLACK, color));
    return drawable;
}