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.presisco.example.slidingtabsicons.slidingtabsicons.SlidingTabsIconsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // BEGIN_INCLUDE (populate_tabs)
    /**//from w  w w.j a  v a  2s .co  m
     * Populate our tab list with tabs. Each item contains a title, indicator color and divider
     * color, which are used by {@link SlidingTabLayout}.
     */
    mTabs.add(new SamplePagerItem("Title1", Color.BLUE, Color.GRAY, R.drawable.tabs_title_icon1,
            R.drawable.tabs_title_selected1));

    mTabs.add(new SamplePagerItem("Title2", Color.CYAN, Color.BLACK, R.drawable.tabs_title_icon2,
            R.drawable.tabs_title_selected2));

    mTabs.add(new SamplePagerItem("Title3", Color.GREEN, Color.MAGENTA, R.drawable.tabs_title_icon3,
            R.drawable.tabs_title_selected3));
    //        mTabs.add(new SamplePagerItem(
    //                getString(R.string.tab_stream), // Title
    //                Color.BLUE, // Indicator color
    //                Color.GRAY // Divider color
    //        ));
    // END_INCLUDE (populate_tabs)
}

From source file:org.lol.reddit.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;

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    final String title;

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

    if (!isModmail) {
        title = getString(R.string.mainmenu_inbox);
    } else {/*from   www.java 2  s  . co m*/
        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.rks.musicx.ui.adapters.SongListAdapter.java

@Override
public void onBindViewHolder(SongListAdapter.SongViewHolder holder, int position) {
    Song song = getItem(position);// ww  w  .j a v  a2  s.co  m
    if (layout == R.layout.song_list) {
        holder.SongTitle.setText(song.getTitle());
        holder.SongArtist.setText(song.getArtist());
        ArtworkUtils.ArtworkLoader(getContext(), 300, 600, song.getAlbum(), song.getAlbumId(), new palette() {
            @Override
            public void palettework(Palette palette) {

            }
        }, holder.SongArtwork);
        holder.menu.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_menu));
        Drawable drawable = holder.menu.getDrawable();
        int accentColor = Config.accentColor(getContext(), Helper.getATEKey(getContext()));
        if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
            drawable.setTint(Color.WHITE);
            holder.SongTitle.setTextColor(Color.WHITE);
            holder.SongArtist.setTextColor(ContextCompat.getColor(getContext(), R.color.darkthemeTextColor));
            holder.itemView.setBackgroundColor(storeChecked.get(position)
                    ? ContextCompat.getColor(getContext(), R.color.translucent_white_8p)
                    : Color.TRANSPARENT);
        } else {
            drawable.setTint(ContextCompat.getColor(getContext(), R.color.MaterialGrey));
            holder.SongTitle.setTextColor(Color.BLACK);
            holder.SongArtist.setTextColor(Color.DKGRAY);
            holder.itemView
                    .setBackgroundColor(storeChecked.get(position) ? Helper.getColorWithAplha(accentColor, 0.7f)
                            : Color.TRANSPARENT);
        }
    }
    if (layout == R.layout.detail_list) {
        holder.SongTitle.setText(song.getTitle());
        holder.SongArtist.setText(song.getArtist());
        holder.number.setText(position + 1 + ".");
        holder.menu.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_menu));
        Drawable drawable = holder.menu.getDrawable();
        if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
            drawable.setTint(Color.WHITE);
            holder.SongTitle.setTextColor(Color.WHITE);
            holder.number.setTextColor(Color.WHITE);
            holder.SongArtist.setTextColor(ContextCompat.getColor(getContext(), R.color.darkthemeTextColor));
        } else {
            drawable.setTint(ContextCompat.getColor(getContext(), R.color.MaterialGrey));
            holder.SongTitle.setTextColor(Color.BLACK);
            holder.number.setTextColor(Color.BLACK);
            holder.SongArtist.setTextColor(Color.DKGRAY);
        }
    }
    if (layout == R.layout.item_grid_view || layout == R.layout.recent_list) {
        int pos = holder.getAdapterPosition();
        if (lastpos < pos) {
            for (Animator animator : getAnimator(holder.songView)) {
                animator.setDuration(duration);
                animator.setInterpolator(interpolator);
                animator.start();
            }
        }
        holder.SongTitle.setText(song.getTitle());
        holder.SongArtist.setText(song.getArtist());
        ArtworkUtils.ArtworkLoader(getContext(), 300, 600, song.getAlbum(), song.getAlbumId(), new palette() {
            @Override
            public void palettework(Palette palette) {
                final int[] colors = Helper.getAvailableColor(getContext(), palette);
                holder.songView.setBackgroundColor(colors[0]);
                holder.SongTitle.setTextColor(Helper.getTitleTextColor(colors[0]));
                holder.SongArtist.setTextColor(Helper.getTitleTextColor(colors[0]));
                Helper.animateViews(getContext(), holder.itemView, colors[0]);
            }
        }, holder.songGridArtwork);
        holder.menu.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_menu));
        holder.menu.setVisibility(View.VISIBLE);
        Drawable drawable = holder.menu.getDrawable();
        if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
            drawable.setTint(Color.WHITE);
        }
    }
}

From source file:com.djoin.parking.parking.java

@SuppressLint("NewApi")
@Override//from w w  w  .  j av a2 s  . c o  m
public void init(CordovaWebView webView, CordovaWebViewClient webViewClient,
        CordovaChromeClient webChromeClient) {
    LOG.d(TAG, "CordovaActivity.init()");

    // Set up web container
    this.appView = webView;
    this.appView.setId(100);

    //js?
    this.appView.addJavascriptInterface(new JsInterface(), "jsinterface");

    this.appView.setWebViewClient(webViewClient);
    this.appView.setWebChromeClient(webChromeClient);
    webViewClient.setWebView(this.appView);
    webChromeClient.setWebView(this.appView);

    this.appView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT, 1.0F));

    if (this.getBooleanProperty("disallowOverscroll", false)) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
            this.appView.setOverScrollMode(CordovaWebView.OVER_SCROLL_NEVER);
        }
    }

    // Add web view but make it invisible while loading URL
    this.appView.setVisibility(View.INVISIBLE);

    View v = getLayoutInflater().inflate(R.layout.main, null);

    mDrawerLayout = (DrawerLayout) v.findViewById(R.id.drawer_layout);
    myroot = (LinearLayout) v.findViewById(R.id.content_frame);
    mLeftNav = (ListView) v.findViewById(R.id.left_nav);

    mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

    myroot.setBackgroundColor(Color.BLACK);

    setTheme(R.style.gray);

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

    myroot.addView(this.appView);

    setContentView(mDrawerLayout);
    // Clear cancel flag
    this.cancelLoadUrl = false;

}

From source file:com.hro.museapp.map.ClusteringMapActivity.java

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

    listType = getIntent().getIntExtra("type", TYPE_ALL);

    ActionBar actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    FragmentManager fm = getSupportFragmentManager();
    SupportMapFragment f = (SupportMapFragment) fm.findFragmentById(R.id.map);
    map = f.getExtendedMap();/*  w  w w  . ja v a 2s. c  om*/

    gps = new GPSTracker(ClusteringMapActivity.this);
    //gps = PlacesLoader.getGPS();

    // mapView = (MapView) this.findViewById(R.id.map);

    float cameraZoom = 8;
    LatLng cameraLatLng = new LatLng(52.281602, 5.503235);
    if (savedInstanceState != null) {
        double savedLat = savedInstanceState.getDouble("lat");
        double savedLng = savedInstanceState.getDouble("lng");
        cameraLatLng = new LatLng(savedLat, savedLng);

        cameraZoom = savedInstanceState.getFloat("zoom", 12);
    }
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(cameraLatLng, cameraZoom));

    map.setClustering(new ClusteringSettings().iconDataProvider(new DemoIconProvider(getResources()))
            .addMarkersDynamically(true));
    map.setMyLocationEnabled(true);

    map.setInfoWindowAdapter(new InfoWindowAdapter() {

        private TextView tv;
        {
            tv = new TextView(ClusteringMapActivity.this);
            tv.setTextColor(Color.BLACK);
        }

        private Collator collator = Collator.getInstance();
        private Comparator<Marker> comparator = new Comparator<Marker>() {
            public int compare(Marker lhs, Marker rhs) {
                String leftTitle = lhs.getTitle();
                String rightTitle = rhs.getTitle();
                if (leftTitle == null && rightTitle == null) {
                    return 0;
                }
                if (leftTitle == null) {
                    return 1;
                }
                if (rightTitle == null) {
                    return -1;
                }
                return collator.compare(leftTitle, rightTitle);
            }
        };

        @Override
        public View getInfoWindow(Marker marker) {
            return null;
        }

        @Override
        public View getInfoContents(Marker marker) {
            if (marker.isCluster()) {
                List<Marker> markers = marker.getMarkers();
                int i = 0;
                String text = "";
                while (i < 3 && markers.size() > 0) {
                    Marker m = Collections.min(markers, comparator);
                    String title = m.getTitle();
                    if (title == null) {
                        break;
                    }
                    text += title + "\n";
                    markers.remove(m);
                    i++;
                }
                if (text.length() == 0) {
                    text = "Markers with mutable data";
                } else if (markers.size() > 0) {
                    text += "and " + markers.size() + " more...";
                } else {
                    text = text.substring(0, text.length() - 1);
                }
                tv.setText(text);
                return tv;
            } else {
                String title = marker.getTitle();
                tv.setText(title);
                return tv;
            }
        }
    });

    map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

        @Override
        public void onInfoWindowClick(Marker marker) {
            if (marker.isCluster()) {
                List<Marker> markers = marker.getMarkers();
                Builder builder = LatLngBounds.builder();
                for (Marker m : markers) {
                    builder.include(m.getPosition());
                }
                LatLngBounds bounds = builder.build();
                map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds,
                        getResources().getDimensionPixelSize(R.dimen.padding)));
            } else {
                // String title = marker.getTitle();
                // String mid = MarkerGenerator.mapPlaceToId.get(title);
                String mid = (String) marker.getData();

                Intent in = new Intent(getApplicationContext(), ShowPlaceActivity.class);
                // sending mid to next activity
                in.putExtra(MarkerGenerator.TAG_MID, mid);

                // starting new activity and expecting some response back
                startActivityForResult(in, 100);
            }
        }
    });

    // MarkerGenerator.addMarkers(map);
    new AddMarkersInBackground().execute();

}

From source file:com.ffmpeger.card.utils.LPreviewUtilsBase.java

public int getStatusBarColor() {
    if (!hasL()) {
        // On pre-L devices, you can have any status bar color so long as it's black.
        return Color.BLACK;
    }//w w w.  j a v a2  s  .  c o m

    return mActivity.getWindow().getStatusBarColor();
}

From source file:com.eng.arab.translator.androidtranslator.translate.TranslateViewActivity.java

private void initTranslatorPanel() {
    mainPanel = (LinearLayout) findViewById(R.id.activity_translator_translate);

    srcCard = (CardView) findViewById(R.id.src_card);
    srcToolbar = (Toolbar) findViewById(R.id.src_toolbar);
    srcToolbar.inflateMenu(R.menu.src_card);
    srcToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
        @Override//from   ww  w . j  a v a2s.  c o  m
        public boolean onMenuItemClick(MenuItem item) {
            switch (item.getItemId()) {
            case R.id.action_paste:
                srcText.setText(readFromClipboard());
                trgText.setTextColor(Color.BLACK);// Set Default Color
                showAToast("Pasted");
                break;
            /*case R.id.action_share:
                if (keyboard_flag == 0) {
                    hideSoftKeyboard();
                    keyboard_flag = 1;
                }
                else keyboard_flag = 0;
                Toast.makeText(TranslateViewActivity.this,"Share",Toast.LENGTH_SHORT).show();
                break;*/
            case R.id.action_clear:
                showAToast("Cleared");
                srcText.setText("");
                trgText.setTextColor(Color.BLACK);// Set Default Color
                //trgText.setText("");
                break;
            }
            return true;
        }
    });
    srcToolbar.setOnClickListener(this);
    srcToolbar.setTitle("ARABIC");/**UPPER Text to translate*/
    srcContent = (LinearLayout) findViewById(R.id.src_translate_content);

    translateButton = (Button) findViewById(R.id.main_translate_button);
    translateButton.setOnClickListener(this);

    trgCard = (CardView) findViewById(R.id.translate_trg_card);
    trgToolbar = (Toolbar) findViewById(R.id.translate_trg_toolbar);
    trgToolbar.inflateMenu(R.menu.trg_card);
    trgToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            switch (item.getItemId()) {

            case R.id.action_trg_audio:
                //Toast.makeText(TranslateViewActivity.this,"TRG AUDIO",Toast.LENGTH_SHORT).show();
                speakEnglishTranslation();
                break;
            case R.id.action_copy:
                android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(
                        Context.CLIPBOARD_SERVICE);
                clipboard.setText(trgText.getText());
                showAToast("English translation copied");
                trgText.setTextColor(Color.BLUE); // Set color as Higlight
                break;
            /*case R.id.action_share:
                Toast.makeText(TranslateViewActivity.this,"Share",Toast.LENGTH_SHORT).show();
                final Intent intent = new Intent(Intent.ACTION_SEND);
                intent.setType("text/plain");
                intent.putExtra(Intent.EXTRA_TEXT, trgText.getText().toString());
                startActivity(Intent.createChooser(intent, getResources().getText(R.string.share_with)));
                break;*/
            }
            return true;
        }
    });
    trgToolbar.setOnClickListener(this);
    trgToolbar.setTitle("ENGLISH");/**LOWER Translated*/
    trgContent = (LinearLayout) findViewById(R.id.trg_content);

    srcText = (EditText) findViewById(R.id.src_text);

    trgTextScroll = (ScrollView) findViewById(R.id.trg_text_scroll);
    trgText = (TextView) findViewById(R.id.trg_text);

    mainPanel.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
        private int trgCardPreEditingVisibility;

        @Override
        public void onGlobalLayout() {
            final int heightDiffPx = mainPanel.getRootView().getHeight() - mainPanel.getHeight();
            final int heightDiffDp = (int) (heightDiffPx
                    / (getResources().getDisplayMetrics().densityDpi / 160f));
            if (heightDiffDp > 150 && !editing) { // if more than 150 dps, its probably a keyboard...
                editing = true;
                trgCardPreEditingVisibility = trgCard.getVisibility();
                trgCard.setVisibility(View.GONE);
                //                    updateSrcToolbar();
            } else if (heightDiffDp < 150 && editing) {
                editing = false;
                trgCard.setVisibility(trgCardPreEditingVisibility);
                srcText.clearFocus();
                //                    updateSrcToolbar();
            }
        }

    });

    final Intent intent = getIntent();
    if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(intent.getType())) {
        srcText.setText(intent.getStringExtra(Intent.EXTRA_TEXT));
    }
    //snackBar();
}

From source file:com.nextgis.maplibui.formcontrol.Sign.java

protected void init() {
    //1. get clean
    int[] attrs = new int[] { R.attr.ic_clear };
    TypedArray ta = getContext().obtainStyledAttributes(attrs);
    mCleanImage = ta.getDrawable(0);/*from   w  w  w . j  a  v  a 2 s.  c  o m*/
    ta.recycle();

    mClearBuff = (int) (getContext().getResources().getDisplayMetrics().density * CLEAR_BUFF_DP);
    mClearImageSize = (int) (getContext().getResources().getDisplayMetrics().density * CLEAR_IMAGE_SIZE_DP);

    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(3);
    mPaint.setDither(true);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);

    boolean bDark = PreferenceManager.getDefaultSharedPreferences(getContext())
            .getString(SettingsConstantsUI.KEY_PREF_THEME, "light").equals("dark");
    if (bDark)
        mPaint.setColor(Color.WHITE);
    else
        mPaint.setColor(Color.BLACK);

    mPath = new Path();
    mPaths.add(mPath);
}

From source file:com.github.dfa.diaspora_android.ui.theme.ThemeHelper.java

public static void updateRadioGroupColor(RadioGroup radioGroup) {
    if (radioGroup != null && Build.VERSION.SDK_INT >= 21) {
        for (int i = 0; i < radioGroup.getChildCount(); ++i) {
            RadioButton btn = ((RadioButton) radioGroup.getChildAt(i));
            btn.setButtonTintList(new ColorStateList(
                    new int[][] { new int[] { -android.R.attr.state_enabled },
                            new int[] { android.R.attr.state_enabled } },
                    new int[] { Color.BLACK, ThemeHelper.getAccentColor() }));
            btn.invalidate();/*from w  w  w .j  a  va  2  s .co  m*/
        }
    }
}

From source file:com.mk4droid.IMC_Utils.GEO.java

/**
 * Draw polygon borders on the map defining the municipality
 * /*from www .  j  av a 2  s . co m*/
 * @param mgmap
 * @param resources
 */
public static Polygon MakeBorders(GoogleMap mgmap, Resources res) {

    String str = "";
    // parse from raw.polygoncoords.txt
    try {
        InputStream in_s = res.openRawResource(R.raw.polygoncoords);
        byte[] b = new byte[in_s.available()];
        in_s.read(b);
        str = new String(b);
    } catch (Exception e) {
        Log.e("Error", "can't read polygon.");
    }

    Polygon mPoly = null;

    if (options == null) {
        if (str.length() > 0) {
            String[] points = str.split(" ");
            options = new PolygonOptions();
            for (int i = 0; i < points.length; i = i + 2)
                options.add(new LatLng(Double.parseDouble(points[i + 1]), Double.parseDouble(points[i])));
        }
    }

    if (mgmap != null)
        mPoly = mgmap.addPolygon(
                options.strokeWidth(4).strokeColor(Color.BLACK).fillColor(Color.argb(10, 0, 100, 0)));

    return mPoly;
}