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.devalladolid.musictoday.subfragments.QuickControlsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_playback_controls, container, false);
    this.rootView = rootView;

    mPlayPause = (PlayPauseButton) rootView.findViewById(R.id.play_pause);
    mPlayPauseExpanded = (PlayPauseButton) rootView.findViewById(R.id.playpause);
    playPauseWrapper = rootView.findViewById(R.id.play_pause_wrapper);
    playPauseWrapperExpanded = rootView.findViewById(R.id.playpausewrapper);
    playPauseWrapper.setOnClickListener(mPlayPauseListener);
    playPauseWrapperExpanded.setOnClickListener(mPlayPauseExpandedListener);
    mProgress = (ProgressBar) rootView.findViewById(R.id.song_progress_normal);
    mSeekBar = (SeekBar) rootView.findViewById(R.id.song_progress);
    mTitle = (TextView) rootView.findViewById(R.id.title);
    mArtist = (TextView) rootView.findViewById(R.id.artist);
    mTitleExpanded = (TextView) rootView.findViewById(R.id.song_title);
    mArtistExpanded = (TextView) rootView.findViewById(R.id.song_artist);
    mAlbumArt = (ImageView) rootView.findViewById(R.id.album_art_nowplayingcard);
    mBlurredArt = (ImageView) rootView.findViewById(R.id.blurredAlbumart);
    next = (MaterialIconView) rootView.findViewById(R.id.next);
    previous = (MaterialIconView) rootView.findViewById(R.id.previous);
    topContainer = rootView.findViewById(R.id.topContainer);

    LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mProgress.getLayoutParams();
    mProgress.measure(0, 0);/*from w w  w  .j  ava  2s .  co  m*/
    layoutParams.setMargins(0, -(mProgress.getMeasuredHeight() / 2), 0, 0);
    mProgress.setLayoutParams(layoutParams);

    mPlayPause.setColor(Config.accentColor(getActivity(), Helpers.getATEKey(getActivity())));
    mPlayPauseExpanded.setColor(Color.WHITE);

    mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            if (b) {
                MusicPlayer.seek((long) i);
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });

    next.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    MusicPlayer.next();
                }
            }, 200);

        }
    });

    previous.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    MusicPlayer.previous(getActivity(), false);
                }
            }, 200);

        }
    });

    ((BaseActivity) getActivity()).setMusicStateListenerListener(this);

    if (PreferencesUtility.getInstance(getActivity()).isGesturesEnabled()) {
        new SlideTrackSwitcher() {
            @Override
            public void onClick() {
                NavigationUtils.navigateToNowplaying(getActivity(), false);
            }
        }.attach(rootView.findViewById(R.id.root_view));
    }

    return rootView;
}

From source file:com.conferenceengineer.android.iosched.ui.ScheduleFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_list_with_empty_container, container,
            false);/*from  w w w  . j  a v  a  2s. c o  m*/
    inflater.inflate(R.layout.empty_waiting_for_sync, (ViewGroup) root.findViewById(android.R.id.empty), true);
    root.setBackgroundColor(Color.WHITE);
    ListView listView = (ListView) root.findViewById(android.R.id.list);
    listView.setItemsCanFocus(true);
    listView.setCacheColorHint(Color.WHITE);
    listView.setSelector(android.R.color.transparent);

    return root;
}

From source file:com.app.learn.Util.SlidingTabLayout.java

/**
 * Create a default view to be used for tabs. This is called if a custom tab view is not set via
 * {@link #setCustomTabView(int, int)}./*from  w  w w. j av a2s .c om*/
 */
protected TextView createDefaultTabView(Context context) {
    TextView textView;
    textView = new TextView(context);
    textView.setGravity(Gravity.CENTER);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
    textView.setTypeface(Typeface.DEFAULT_BOLD);

    textView.setTextColor(Color.WHITE); // \(^o^)/ ???? TextColor

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        // If we're running on Honeycomb or newer, then we can use the Theme's
        // selectableItemBackground to ensure that the View has a pressed state
        TypedValue outValue = new TypedValue();
        getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
        textView.setBackgroundResource(outValue.resourceId);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        // If we're running on ICS or newer, enable all-caps to match the Action Bar tab style
        textView.setAllCaps(true);
    }

    int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
    textView.setPadding(padding, padding, padding, padding);

    return textView;
}

From source file:com.aegiswallet.utils.BasicUtils.java

public static Bitmap encodeAsBitmap(String contents, BarcodeFormat format, int dimension) {

    Bitmap bitmap = null;/*from   w w w.j  a v  a 2 s.  c  o m*/

    try {
        final Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
        //hints.put(EncodeHintType.MARGIN, 0);
        hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
        final BitMatrix result = qrCodeWriter.encode(contents, BarcodeFormat.QR_CODE, dimension, dimension,
                hints);

        final int width = result.getWidth();
        final int height = result.getHeight();
        final int[] pixels = new int[width * height];

        for (int y = 0; y < height; y++) {
            final int offset = y * width;
            for (int x = 0; x < width; x++) {
                pixels[offset + x] = result.get(x, y) ? Color.BLACK : Color.WHITE;
            }
        }

        bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
        return bitmap;

    } catch (WriterException e) {
        Log.e("Basic Utils", "cannot write to bitmap " + e.getMessage());
    }
    return bitmap;
}

From source file:com.co.iatech.crm.sugarmovil.activities.ui.SlidingTabLayout.java

/**
 * Create a default view to be used for tabs. This is called if a custom tab view is not set via
 * {@link #setCustomTabView(int, int)}.//  w  ww.j  av  a  2  s .  co m
 */
protected TextView createDefaultTabView(Context context) {
    TextView textView = new TextView(context);
    textView.setGravity(Gravity.CENTER);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
    textView.setTypeface(Typeface.DEFAULT_BOLD);
    textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    TypedValue outValue = new TypedValue();
    getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
    textView.setBackgroundResource(outValue.resourceId);
    textView.setTextColor(Color.WHITE);
    textView.setAllCaps(true);

    int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
    textView.setPadding(padding, padding, padding, padding);
    Log.d("TABS", " Crea default TabView");
    return textView;
}

From source file:com.coreview.views.SlidingTabLayout.java

/**
 * Create a default view to be used for tabs. This is called if a custom tab view is not set via
 * {@link #setCustomTabView(int, int)}./*from   w w w .ja va2s  . c  o  m*/
 */
protected TextView createDefaultTabView(Context context) {
    TextView textView = new TextView(context);
    textView.setGravity(Gravity.CENTER);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
    textView.setTypeface(Typeface.DEFAULT_BOLD);
    textView.setTextColor(Color.WHITE);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        // If we're running on Honeycomb or newer, then we can use the Theme's
        // selectableItemBackground to ensure that the View has a pressed state
        TypedValue outValue = new TypedValue();
        getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
        textView.setBackgroundResource(outValue.resourceId);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        // If we're running on ICS or newer, enable all-caps to match the Action Bar tab style
        textView.setAllCaps(true);
    }

    int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
    textView.setPadding(padding, padding, padding, padding);

    return textView;
}

From source file:com.antonioleiva.materializeyourapp.DetailActivity.java

/**
 * It seems that the ActionBar view is reused between activities. Changes need to be reverted,
 * or the ActionBar will be transparent when we go back to Main Activity
 *//*from  w  ww  .  ja v  a  2s .c  o m*/
private void restablishActionBar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().getReturnTransition().addListener(new TransitionAdapter() {
            @Override
            public void onTransitionEnd(Transition transition) {
                toolbar.setTitleTextColor(Color.WHITE);
                toolbar.getBackground().setAlpha(255);
            }
        });
    }
}

From source file:com.android.inputmethod.latin.suggestions.SuggestionStripView.java

public SuggestionStripView(final Context context, final AttributeSet attrs, final int defStyle) {
    super(context, attrs, defStyle);

    final LayoutInflater inflater = LayoutInflater.from(context);
    inflater.inflate(R.layout.suggestions_strip, this);

    mSuggestionsStrip = (ViewGroup) findViewById(R.id.suggestions_strip);
    mVoiceKey = (ImageButton) findViewById(R.id.suggestions_strip_voice_key);
    mImportantNoticeStrip = findViewById(R.id.important_notice_strip);
    mStripVisibilityGroup = new StripVisibilityGroup(this, mSuggestionsStrip, mImportantNoticeStrip);

    for (int pos = 0; pos < SuggestedWords.MAX_SUGGESTIONS; pos++) {
        final TextView word = new TextView(context, null, R.attr.suggestionWordStyle);
        word.setContentDescription(getResources().getString(R.string.spoken_empty_suggestion));
        word.setOnClickListener(this);
        word.setOnLongClickListener(this);
        mWordViews.add(word);/*from  www  .j  a  v a2 s.c om*/
        final View divider = inflater.inflate(R.layout.suggestion_divider, null);
        mDividerViews.add(divider);
        final TextView info = new TextView(context, null, R.attr.suggestionWordStyle);
        info.setTextColor(Color.WHITE);
        info.setTextSize(TypedValue.COMPLEX_UNIT_DIP, DEBUG_INFO_TEXT_SIZE_IN_DIP);
        mDebugInfoViews.add(info);
    }

    mLayoutHelper = new SuggestionStripLayoutHelper(context, attrs, defStyle, mWordViews, mDividerViews,
            mDebugInfoViews);

    mMoreSuggestionsContainer = inflater.inflate(R.layout.more_suggestions, null);
    mMoreSuggestionsView = (MoreSuggestionsView) mMoreSuggestionsContainer
            .findViewById(R.id.more_suggestions_view);
    mMoreSuggestionsBuilder = new MoreSuggestions.Builder(context, mMoreSuggestionsView);

    final Resources res = context.getResources();
    mMoreSuggestionsModalTolerance = res
            .getDimensionPixelOffset(R.dimen.config_more_suggestions_modal_tolerance);
    mMoreSuggestionsSlidingDetector = new GestureDetector(context, mMoreSuggestionsSlidingListener);

    final TypedArray keyboardAttr = context.obtainStyledAttributes(attrs, R.styleable.Keyboard, defStyle,
            R.style.SuggestionStripView);
    final Drawable iconVoice = keyboardAttr.getDrawable(R.styleable.Keyboard_iconShortcutKey);
    keyboardAttr.recycle();
    mVoiceKey.setImageDrawable(iconVoice);
    mVoiceKey.setOnClickListener(this);
}

From source file:br.com.laboratorio.hemope.View.SlidingTabLayout.java

/**
 * Create a default view to be used for tabs. This is called if a custom tab view is not set via
 * {@link #setCustomTabView(int, int)}./* w w w.  j a  v a 2  s. c  om*/
 */
protected TextView createDefaultTabView(Context context) {
    TextView textView = new TextView(context);
    textView.setGravity(Gravity.CENTER);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
    textView.setTypeface(Typeface.DEFAULT_BOLD);
    textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    TypedValue outValue = new TypedValue();
    getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
    textView.setBackgroundResource(outValue.resourceId);
    textView.setAllCaps(true);
    textView.setTextColor(Color.WHITE);

    int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
    textView.setPadding(padding, padding, padding, padding);

    return textView;
}

From source file:com.google.zxing.client.android.CaptureActivity.java

private void initConView() {
    mToolView = new ViewToolView(this, mData, toolListener);
    RelativeLayout.LayoutParams toolParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT);/*www  . jav a 2 s.  c o  m*/
    int top = (int) getResources().getDimension(EUExUtil.getResDimenID("plugin_uexscanner_tool_top"));
    int left = (int) getResources().getDimension(EUExUtil.getResDimenID("plugin_uexscanner_tool_left"));
    toolParams.setMargins(left, top, left, 0);
    mToolView.setId(1);
    mToolView.setLayoutParams(toolParams);
    mConRel.addView(mToolView);

    viewfinderView = new ViewfinderView(this, mData);
    RelativeLayout.LayoutParams viewParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT);
    viewParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    viewfinderView.setLayoutParams(viewParams);
    mConRel.addView(viewfinderView);

    mGalleryPic = new ImageView(this);
    RelativeLayout.LayoutParams picParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT);
    picParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    picParams.addRule(RelativeLayout.BELOW, 1);
    picParams.setMargins(left, top, left, top);
    mGalleryPic.setLayoutParams(picParams);
    mConRel.addView(mGalleryPic);

    mGalleryPic.setVisibility(View.GONE);

    mFailText = new TextView(this);
    RelativeLayout.LayoutParams failTextParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT);
    failTextParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    mFailText.setLayoutParams(failTextParams);
    mFailText.setGravity(Gravity.CENTER);
    mFailText.setTextColor(Color.WHITE);
    mFailText.setTextSize(25);
    mConRel.addView(mFailText);

    mFailText.setVisibility(View.GONE);
    mFailText.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mFailText.setVisibility(View.GONE);
            mGalleryPic.setVisibility(View.GONE);
        }
    });

}