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:org.quantumbadger.redreader.activities.InboxListingActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {

    PrefsUtility.applyTheme(this);
    super.onCreate(savedInstanceState);

    final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    final boolean solidblack = PrefsUtility.appearance_solidblack(this, sharedPreferences)
            && PrefsUtility.appearance_theme(this, sharedPreferences) == PrefsUtility.AppearanceTheme.NIGHT;

    getActionBar().setHomeButtonEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);

    final String title;

    isModmail = getIntent() != null && getIntent().getBooleanExtra("modmail", false);

    if (!isModmail) {
        title = getString(R.string.mainmenu_inbox);
    } else {//w w  w .j a v  a2  s.  com
        title = getString(R.string.mainmenu_modmail);
    }

    OptionsMenuUtility.fixActionBar(this, title);

    headerItems = PrefsUtility.appearance_comment_header_items(this, sharedPreferences);
    headerItems.remove(PrefsUtility.AppearanceCommentHeaderItems.SCORE);

    final LinearLayout outer = new LinearLayout(this);
    outer.setOrientation(android.widget.LinearLayout.VERTICAL);

    if (solidblack) {
        outer.setBackgroundColor(Color.BLACK);
    }

    loadingView = new LoadingView(this, getString(R.string.download_waiting), true, true);

    notifications = new LinearLayout(this);
    notifications.setOrientation(android.widget.LinearLayout.VERTICAL);
    notifications.addView(loadingView);

    final ListView lv = new ListView(this);

    lv.setSmoothScrollbarEnabled(false);
    lv.setVerticalFadingEdgeEnabled(false);

    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            final Object item = lv.getAdapter().getItem(position);

            if (item != null && item instanceof RedditPreparedInboxItem) {
                ((RedditPreparedInboxItem) item).handleInboxClick(InboxListingActivity.this);
            }
        }
    });

    adapter = new InboxListingAdapter(this, this);
    lv.setAdapter(adapter);

    registerForContextMenu(lv);

    outer.addView(notifications);
    outer.addView(lv);

    makeFirstRequest(this);

    setContentView(outer);
}

From source file:com.am.pagergradienttab.view.PagerGradientTabStrip.java

public PagerGradientTabStrip(Context context, AttributeSet attrs) {
    super(context, attrs);
    density = getResources().getDisplayMetrics().density;
    final TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
    textSize = a.getDimensionPixelSize(0, (int) (16 * density));
    textColorSelected = a.getColor(1, Color.BLACK);
    textColorNormal = Color.argb(Color.alpha(0x80000000), Color.red(textColorSelected),
            Color.green(textColorSelected), Color.blue(textColorSelected));
    a.recycle();// ww w. ja  v a 2 s  .  co  m
    mTextPaint.setAntiAlias(true);

    intervalWidth = (int) (0 * density);
    indicatorPadding = (int) (10 * density);
    indicatorHeight = (int) (3 * density);
    underLineHeight = (int) (2 * density);
}

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

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setHasOptionsMenu(false);/* www  . ja v a 2s . c om*/
    setRetainInstance(false);
    s = new Shortcuts(getActivity());
    Calendar calendar = Calendar.getInstance();
    Sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int hour = calendar.get(Calendar.HOUR_OF_DAY);
    theme = Integer.parseInt(Sp.getString("theme", "0"));
    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.activity_main_swipe_refresh_layout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            refresh();
        }
    });
    theme1 = theme;
    if (theme == 2) {
        if (hour <= 6 || hour >= 18) {
            theme1 = 1;
        } else
            theme1 = 0;
    }
    if (theme1 == 1) {
        getActivity().getWindow().getDecorView().setBackgroundColor(Color.BLACK);
        listview.setBackgroundColor(Color.BLACK);
    }
    m = (MainActivity) getActivity();
    m.supportInvalidateOptionsMenu();
    Animation animation1 = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_newtab);
    FloatingActionButton floatingActionButton = (FloatingActionButton) rootView.findViewById(R.id.fab);
    floatingActionButton.show(true);
    floatingActionButton.setColorNormal(Color.parseColor(((MainActivity) getActivity()).skin));
    floatingActionButton.setColorPressed(Color.parseColor(((MainActivity) getActivity()).skin));

    floatingActionButton.setAnimation(animation1);
    //getActivity().findViewById(R.id.fab).setVisibility(View.VISIBLE);
    listview.setHasFixedSize(true);
    getActivity().findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            final MaterialDialog.Builder ba1 = new MaterialDialog.Builder(getActivity());
            ba1.title(utils.getString(getActivity(), R.string.addbook));
            View v = getActivity().getLayoutInflater().inflate(R.layout.dialog, null);
            final EditText edir = (EditText) v.findViewById(R.id.newname);
            edir.setHint(utils.getString(getActivity(), R.string.enterpath));
            ba1.customView(v, true);
            if (theme1 == 1)
                ba1.theme(Theme.DARK);
            ba1.negativeText(R.string.cancel);
            ba1.positiveText(R.string.create);
            String skin = Sp.getString("skin_color", "#03A9F4");
            ba1.positiveColor(Color.parseColor(skin));
            ba1.negativeColor(Color.parseColor(skin));
            ba1.callback(new MaterialDialog.ButtonCallback() {
                @Override
                public void onPositive(MaterialDialog materialDialog) {
                    try {
                        File a = new File(edir.getText().toString());
                        if (a.isDirectory()) {
                            s.addS(a);
                            b.items.add(a);
                            b.notifyDataSetChanged();
                            Toast.makeText(getActivity(), utils.getString(getActivity(), R.string.success),
                                    Toast.LENGTH_LONG).show();
                        } else {
                            Toast.makeText(getActivity(), utils.getString(getActivity(), R.string.invalid_dir),
                                    Toast.LENGTH_LONG).show();
                        }
                    } catch (Exception e) {
                        // TODO Auto-generated catch block
                        Toast.makeText(getActivity(), utils.getString(getActivity(), R.string.error),
                                Toast.LENGTH_LONG).show();
                    }
                    m.updateDrawer();
                }

                @Override
                public void onNegative(MaterialDialog materialDialog) {

                }
            });
            ba1.build().show();

        }
    });

    icons = new IconUtils(Sp, getActivity());
    if (savedInstanceState == null)
        refresh();
    else {
        bx = utils.toFileArray(savedInstanceState.getStringArrayList("bx"));
        refresh(bx);
        linearLayoutManager.scrollToPositionWithOffset(savedInstanceState.getInt("index"),
                savedInstanceState.getInt("top"));
    }

}

From source file:com.pseudosudostudios.jdd.fragments.ScoreFragment.java

private void shareStories() {
    // View stuff
    View myView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE))
            .inflate(R.layout.social_share_root, null);
    final EditText input = (EditText) myView.findViewById(R.id.colorInputET);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
        input.setTextColor(Color.BLACK);
    final EditText messageBox = (EditText) myView.findViewById(R.id.social_message);
    // set which is visible
    if (!isGoogleSignedIn()) {
        Toast.makeText(getActivity(), R.string.no_sign_in, Toast.LENGTH_SHORT).show();
        return;/*from   w ww .ja va 2s  .com*/
    }
    // AlertDialog stuff
    AlertDialog.Builder build = new AlertDialog.Builder(getActivity());

    build.setTitle("Select your service").setPositiveButton("OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            String message = messageBox.getText().toString();
            publishGoogle(message);
        }
    }).setView(myView).show();
}

From source file:gov.sfmta.sfpark.DetailViewActivity.java

public TextView normalText(String val) {
    TextView ntv = new TextView(this);
    ntv.setPadding(8, 7, 5, 7);/*w  w w.  ja  v a  2  s. c  om*/
    ntv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT));
    ntv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
    ntv.setTextColor(Color.BLACK);
    ntv.setText(val);
    return ntv;
}

From source file:com.magicwindow.deeplink.ui.CircleProgressBar.java

private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = context.obtainStyledAttributes(attrs,
            com.magicwindow.deeplink.R.styleable.CircleProgressBar, defStyleAttr, 0);
    final float density = getContext().getResources().getDisplayMetrics().density;

    mBackGroundColor = a.getColor(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_background_color,
            DEFAULT_CIRCLE_BG_LIGHT);//from  ww  w. j a va  2 s .  c  o m

    mProgressColor = a.getColor(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress_color,
            DEFAULT_CIRCLE_BG_LIGHT);//ToDO 

    mInnerRadius = a.getDimensionPixelOffset(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_inner_radius, -1);

    mProgressStokeWidth = a.getDimensionPixelOffset(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress_stoke_width,
            (int) (STROKE_WIDTH_LARGE * density));
    mArrowWidth = a.getDimensionPixelOffset(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_arrow_width, -1);
    mArrowHeight = a.getDimensionPixelOffset(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_arrow_height, -1);
    mTextSize = a.getDimensionPixelOffset(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress_text_size,
            (int) (DEFAULT_TEXT_SIZE * density));
    mTextColor = a.getColor(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress_text_color,
            Color.BLACK);

    mShowArrow = a.getBoolean(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_show_arrow, false);
    mCircleBackgroundEnabled = a.getBoolean(
            com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_enable_circle_background, true);

    mProgress = a.getInt(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress, 0);
    mMax = a.getInt(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_max, 100);
    int textVisible = a
            .getInt(com.magicwindow.deeplink.R.styleable.CircleProgressBar_mlpb_progress_text_visibility, 1);
    if (textVisible != 1) {
        mIfDrawText = true;
    }

    mTextPaint = new Paint();
    mTextPaint.setStyle(Paint.Style.FILL);
    mTextPaint.setColor(mTextColor);
    mTextPaint.setTextSize(mTextSize);
    mTextPaint.setAntiAlias(true);
    a.recycle();
    mProgressDrawable = new MaterialProgressDrawable(getContext(), this);
    super.setImageDrawable(mProgressDrawable);
}

From source file:com.dena.app.bootloadhid.MainFragment.java

public void setFilePath(String path) {
    mFilePath = path;/* w  w w . jav a2  s  . c  om*/
    if (null != path && 0 < path.length()) {
        Logger.i("file=" + path);
        mInstructions1View.setTextColor(Color.GRAY);
        mFileNameView.setText(new File(path).getName());
    } else {
        mInstructions1View.setTextColor(Color.BLACK);
        mFileNameView.setText("");
    }
}

From source file:com.github.piasy.rxqrcode.RxQrCode.java

/**
 * @Deprecated use {@link #generateQrCodeFile(Context, String, int, int)} to avoid bitmap
 * management.// w  w w . j  a  v  a2  s. c  o  m
 */
@Deprecated
public static Observable<Bitmap> generateQrCode(String content, int width, int height) {
    return Observable.fromEmitter(emitter -> {
        MultiFormatWriter writer = new MultiFormatWriter();
        try {
            BitMatrix bm = writer.encode(content, BarcodeFormat.QR_CODE, QR_CODE_LENGTH, QR_CODE_LENGTH,
                    Collections.singletonMap(EncodeHintType.MARGIN, 0));
            Bitmap bitmap = Bitmap.createBitmap(QR_CODE_LENGTH, QR_CODE_LENGTH, Bitmap.Config.ARGB_8888);

            for (int i = 0; i < QR_CODE_LENGTH; i++) {
                for (int j = 0; j < QR_CODE_LENGTH; j++) {
                    bitmap.setPixel(i, j, bm.get(i, j) ? Color.BLACK : Color.WHITE);
                }
            }
            emitter.onNext(Bitmap.createScaledBitmap(bitmap, width, height, true));
            emitter.onCompleted();
        } catch (WriterException e) {
            emitter.onError(e);
        }
    }, Emitter.BackpressureMode.BUFFER);
}

From source file:net.reichholf.dreamdroid.fragment.ScreenShotFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.screenshot, null);

    mImageView = (ImageView) view.findViewById(R.id.screenshoot);
    mImageView.setBackgroundColor(Color.BLACK);

    Bundle extras = getArguments();/*  w w w .  jav a  2s  .c o m*/

    if (extras == null) {
        extras = new Bundle();
    }

    mType = extras.getInt(KEY_TYPE, TYPE_ALL);
    mFormat = extras.getInt(KEY_FORMAT, FORMAT_PNG);
    mSize = extras.getInt(KEY_SIZE, 720);
    mFilename = extras.getString(KEY_FILENAME);

    if (savedInstanceState != null) {
        mRawImage = savedInstanceState.getByteArray("rawImage");
    } else if (mRawImage == null) {
        mRawImage = new byte[0];
    }
    mAttacher = new PhotoViewAttacher(mImageView);
    return view;
}

From source file:com.androidhuman.circlerefreshlayout.MaterialProgressDrawable.java

public MaterialProgressDrawable(Context context, View parent) {
    mParent = parent;//from  w  w  w . j a v  a  2s.com
    mResources = context.getResources();

    mRing = new Ring(mCallback);
    mRing.setColors(new int[] { Color.BLACK });

    updateSizes(DEFAULT);
    setupAnimators();
}