Example usage for android.graphics Color TRANSPARENT

List of usage examples for android.graphics Color TRANSPARENT

Introduction

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

Prototype

int TRANSPARENT

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

Click Source Link

Usage

From source file:com.shizhefei.view.coolrefreshview.header.MaterialProgressDrawable.java

private void setUp(final double diameter) {
    if (mBackgroundColor != Color.TRANSPARENT) {
        final int shadowYOffset = Utils.dipToPix(mContext, Y_OFFSET);
        final int shadowXOffset = Utils.dipToPix(mContext, X_OFFSET);
        int mShadowRadius = Utils.dipToPix(mContext, SHADOW_RADIUS);
        OvalShape oval = new OvalShadow(mShadowRadius, (int) diameter);
        mShadow = new ShapeDrawable(oval);
        if (Build.VERSION.SDK_INT >= 11) {
            mParent.setLayerType(View.LAYER_TYPE_SOFTWARE, mShadow.getPaint());
        }/*from   w w  w  .  j a  v  a 2 s .c  o m*/
        mShadow.getPaint().setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset, KEY_SHADOW_COLOR);
    }

}

From source file:com.android.launcher3.Hotseat.java

public void updateColor(ExtractedColors extractedColors, boolean animate) {
    if (!mHasVerticalHotseat) {
        int color = extractedColors.getColor(ExtractedColors.HOTSEAT_INDEX, Color.TRANSPARENT);
        if (mBackgroundColorAnimator != null) {
            mBackgroundColorAnimator.cancel();
        }// w w w  .  ja  v a  2s  .  co m
        if (!animate) {
            setBackgroundColor(color);
        } else {
            mBackgroundColorAnimator = ValueAnimator.ofInt(mBackgroundColor, color);
            mBackgroundColorAnimator.setEvaluator(new ArgbEvaluator());
            mBackgroundColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    mBackground.setColor((Integer) animation.getAnimatedValue());
                }
            });
            mBackgroundColorAnimator.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mBackgroundColorAnimator = null;
                }
            });
            mBackgroundColorAnimator.start();
        }
        mBackgroundColor = color;
    }
}

From source file:com.lean56.andplug.app.view.WechatTab.java

private void setTabsValue() {
    DisplayMetrics dm = getResources().getDisplayMetrics();
    setShouldExpand(true);/*from  w w  w. j a v  a2s.  c o  m*/
    setDividerColor(Color.TRANSPARENT);
    setUnderlineHeight((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, dm));
    setIndicatorHeight((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 3, dm));
    setTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 16, dm));
    setIndicatorColor(Color.WHITE);
    setSelectedTextColor(Color.WHITE);
    setTabBackground(0);
}

From source file:com.garrocho.MapActivity.java

public void addMarkerForFence(SimpleGeofence fence) {
    if (fence != null) {
        mMap.addMarker(new MarkerOptions().position(new LatLng(fence.getLatitude(), fence.getLongitude()))
                .title("GeoFence " + fence.getId()).snippet("Radius: " + fence.getRadius())).showInfoWindow();

        CircleOptions circleOptions = new CircleOptions()
                .center(new LatLng(fence.getLatitude(), fence.getLongitude())).radius(fence.getRadius())
                .fillColor(0x40ff0000).strokeColor(Color.TRANSPARENT).strokeWidth(2);

        Circle circle = mMap.addCircle(circleOptions);
    }/*from w  w w .jav a 2  s .  c om*/
}

From source file:com.dm.wallpaper.board.fragments.CategoryWallpapersFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_wallpaper_search_sort, menu);
    MenuItem search = menu.findItem(R.id.menu_search);
    MenuItem sort = menu.findItem(R.id.menu_sort);

    int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
    search.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_search, color));
    sort.setIcon(DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_sort, color));

    mSearchView = (SearchView) search.getActionView();
    mSearchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_SEARCH);
    mSearchView.setQueryHint(getActivity().getResources().getString(R.string.menu_search));
    mSearchView.setMaxWidth(Integer.MAX_VALUE);

    ViewHelper.setSearchViewTextColor(mSearchView, color);
    ViewHelper.setSearchViewBackgroundColor(mSearchView, Color.TRANSPARENT);
    ViewHelper.setSearchViewCloseIcon(mSearchView,
            DrawableHelper.getTintedDrawable(getActivity(), R.drawable.ic_toolbar_close, color));
    ViewHelper.setSearchViewSearchIcon(mSearchView, null);

    mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override/*w ww  . j a v  a 2 s. co m*/
        public boolean onQueryTextChange(String string) {
            filterSearch(string);
            return true;
        }

        @Override
        public boolean onQueryTextSubmit(String string) {
            mSearchView.clearFocus();
            return true;
        }
    });
}

From source file:cn.figo.mydemo.ui.activity.VideoActivity.java

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

    mSettings = new Settings(this);

    //      handle arguments
    mVideoPath = getIntent().getStringExtra("videoPath");

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        String scheme = mVideoUri.getScheme();
        if (TextUtils.isEmpty(scheme)) {
            Log.e(TAG, "Null unknown ccheme\n");
            finish();/* w  w w.  j a v  a2s. c o  m*/
            return;
        }
        if (scheme.equals(ContentResolver.SCHEME_ANDROID_RESOURCE)) {
            mVideoPath = mVideoUri.getPath();
        } else if (scheme.equals(ContentResolver.SCHEME_CONTENT)) {
            Log.e(TAG, "Can not resolve content below Android-ICS\n");
            finish();
            return;
        } else {
            Log.e(TAG, "Unknown scheme " + scheme + "\n");
            finish();
            return;
        }
    }

    Intent intent = getIntent();
    String intentAction = intent.getAction();
    if (!TextUtils.isEmpty(intentAction)) {
        if (intentAction.equals(Intent.ACTION_VIEW)) {
            mVideoPath = intent.getDataString();
        } else if (intentAction.equals(Intent.ACTION_SEND)) {
            mVideoUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                String scheme = mVideoUri.getScheme();
                if (TextUtils.isEmpty(scheme)) {
                    Log.e(TAG, "Null unknown ccheme\n");
                    finish();
                    return;
                }
                if (scheme.equals(ContentResolver.SCHEME_ANDROID_RESOURCE)) {
                    mVideoPath = mVideoUri.getPath();
                } else if (scheme.equals(ContentResolver.SCHEME_CONTENT)) {
                    Log.e(TAG, "Can not resolve content below Android-ICS\n");
                    finish();
                    return;
                } else {
                    Log.e(TAG, "Unknown scheme " + scheme + "\n");
                    finish();
                    return;
                }
            }
        }
    }

    if (!TextUtils.isEmpty(mVideoPath)) {
        new RecentMediaStorage(this).saveUrlAsync(mVideoPath);
    }

    // init UI
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ActionBar actionBar = getSupportActionBar();
    mMediaController = new AndroidMediaController(this, false);
    mMediaController.setSupportActionBar(actionBar);

    mToastTextView = (TextView) findViewById(R.id.toast_text_view);
    mHudView = (TableLayout) findViewById(R.id.hud_view);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mRightDrawer = (ViewGroup) findViewById(R.id.right_drawer);

    mDrawerLayout.setScrimColor(Color.TRANSPARENT);

    new RecentMediaStorage(this).saveUrlAsync(mVideoPath);

    // init player
    IjkMediaPlayer.loadLibrariesOnce(null);
    IjkMediaPlayer.native_profileBegin("libijkplayer.so");

    mVideoView = (IjkVideoView) findViewById(R.id.video_view);
    mVideoView.setMediaController(mMediaController);
    mVideoView.setHudView(mHudView);

    mVideoView.toggleAspectRatio();

    if (mVideoPath != null)
        mVideoView.setVideoPath(mVideoPath);
    else if (mVideoUri != null)
        mVideoView.setVideoURI(mVideoUri);
    else {
        Log.e(TAG, "Null Data Source\n");
        finish();
        return;
    }

    initDanmaku();

}

From source file:it.iziozi.iziozi.gui.IOBoardFragment.java

private View buildView(boolean editMode) {

    this.homeRows.clear();
    final List<IOSpeakableImageButton> mButtons = new ArrayList<IOSpeakableImageButton>();
    List<IOSpeakableImageButton> configButtons = this.mBoard.getButtons();

    ViewGroup mainView = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.table_main_layout,
            null);// ww  w  . j  a v a 2s . co  m

    LinearLayout tableContainer = new LinearLayout(getActivity());
    LinearLayout.LayoutParams mainParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT);
    tableContainer.setLayoutParams(mainParams);
    tableContainer.setOrientation(LinearLayout.VERTICAL);

    for (int i = 0; i < this.mBoard.getRows(); i++) {

        LinearLayout rowLayout = new LinearLayout(getActivity());
        LinearLayout.LayoutParams rowParams = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.f);
        rowLayout.setLayoutParams(rowParams);
        rowLayout.setOrientation(LinearLayout.HORIZONTAL);
        Random color = new Random();
        rowLayout.setBackgroundColor(Color.WHITE);
        tableContainer.addView(rowLayout);
        this.homeRows.add(rowLayout);
    }

    for (int j = 0; j < this.homeRows.size(); j++) {
        LinearLayout homeRow = this.homeRows.get(j);

        for (int i = 0; i < this.mBoard.getCols(); i++) {
            LinearLayout btnContainer = new LinearLayout(getActivity());
            LinearLayout.LayoutParams btnContainerParams = new LinearLayout.LayoutParams(0,
                    LinearLayout.LayoutParams.MATCH_PARENT, 1.f);
            btnContainer.setLayoutParams(btnContainerParams);
            btnContainer.setOrientation(LinearLayout.VERTICAL);
            btnContainer.setGravity(Gravity.CENTER);

            homeRow.addView(btnContainer);

            final IOSpeakableImageButton imgButton = (configButtons.size() > 0
                    && configButtons.size() > mButtons.size()) ? configButtons.get(mButtons.size())
                            : new IOSpeakableImageButton(getActivity());
            imgButton.setmContext(getActivity());
            imgButton.setShowBorder(IOConfiguration.getShowBorders());
            if (IOGlobalConfiguration.isEditing)
                imgButton.setImageDrawable(getResources().getDrawable(R.drawable.logo_org));
            else
                imgButton.setImageDrawable(null);
            imgButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
            imgButton.setBackgroundColor(Color.TRANSPARENT);

            if (imgButton.getmImageFile() != null && imgButton.getmImageFile().length() > 0) {

                if (!new File(imgButton.getmImageFile()).exists()) {
                    if (mAlertDialog == null || !mAlertDialog.isShowing()) {
                        mAlertDialog = new AlertDialog.Builder(getActivity()).setCancelable(true)
                                .setTitle(getString(R.string.image_missing))
                                .setMessage(getString(R.string.image_missing_text))
                                .setNegativeButton(getString(R.string.continue_string), null).create();
                        mAlertDialog.show();
                    }

                    //download image

                    if (isExternalStorageReadable()) {

                        File baseFolder = new File(Environment.getExternalStorageDirectory() + "/"
                                + IOApplication.APPLICATION_FOLDER + "/pictograms");
                        Character pictoChar = imgButton.getmImageFile()
                                .charAt(imgButton.getmImageFile().lastIndexOf("/") + 1);
                        File pictoFolder = new File(baseFolder + "/" + pictoChar + "/");

                        if (isExternalStorageWritable()) {

                            pictoFolder.mkdirs();

                            //download it

                            AsyncHttpClient client = new AsyncHttpClient();
                            client.get(imgButton.getmUrl(),
                                    new FileAsyncHttpResponseHandler(new File(imgButton.getmImageFile())) {
                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                Throwable throwable, File file) {
                                            Toast.makeText(getActivity(),
                                                    getString(R.string.download_error) + file.toString(),
                                                    Toast.LENGTH_LONG).show();
                                        }

                                        @Override
                                        public void onSuccess(int statusCode, Header[] headers,
                                                File downloadedFile) {

                                            if (new File(imgButton.getmImageFile()).exists()) {
                                                imgButton.setImageBitmap(
                                                        BitmapFactory.decodeFile(imgButton.getmImageFile()));
                                            } else {
                                                Toast.makeText(getActivity(),
                                                        getString(R.string.image_save_error),
                                                        Toast.LENGTH_SHORT).show();
                                            }
                                        }
                                    });
                        } else {

                            Toast.makeText(getActivity(), getString(R.string.image_save_error),
                                    Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_SHORT)
                                .show();
                    }

                } else
                    imgButton.setImageBitmap(BitmapFactory.decodeFile(imgButton.getmImageFile()));
            }

            ViewGroup parent = (ViewGroup) imgButton.getParent();

            if (parent != null)
                parent.removeAllViews();

            btnContainer.addView(imgButton);

            mButtons.add(imgButton);

            imgButton.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    int index = mButtons.indexOf(v);
                    if (mListener != null)
                        mListener.tapOnSpeakableButton(mButtons.get(index), mBoardLevel);
                }
            });
        }
    }

    this.mBoard.setButtons(mButtons.size() > configButtons.size() ? mButtons : configButtons);

    return tableContainer;
}

From source file:com.bili.diushoujuaner.widget.waveswipe.WaveSwipeRefreshLayout.java

@Override
public boolean onPreDraw() {
    getViewTreeObserver().removeOnPreDrawListener(this);
    mWaveView.bringToFront();//from w w  w  . ja va  2s  .c  o m
    mCircleView.bringToFront();
    if (mIsManualRefresh) {
        mIsManualRefresh = false;
        mWaveView.manualRefresh();
        reInitCircleView();
        mCircleView.setBackgroundColor(Color.TRANSPARENT);
        mCircleView.setTranslationY(mWaveView.getCurrentCircleCenterY() + mCircleView.getHeight() / 2);
        animateOffsetToCorrectPosition();
    }
    return false;
}

From source file:com.microntek.music.MusicActivity.java

private void updateStatusBarColor() {
    if (mBrowsePanelActive || MusicUtils.getCurrentAlbumId() < 0) {
        updateStatusBarColor(Color.TRANSPARENT);
    } else {/* w  w  w.  j  a va  2s  .c  o m*/
        new AsyncTask<Void, Void, BitmapWithColors>() {
            @Override
            protected BitmapWithColors doInBackground(Void... params) {
                ImageFetcher imageFetcher = ImageFetcher.getInstance(MusicActivity.this);
                final BitmapWithColors bitmap = imageFetcher.getArtwork(MusicUtils.getAlbumName(),
                        MusicUtils.getCurrentAlbumId(), MusicUtils.getArtistName(), true);
                return bitmap;
            }

            @Override
            protected void onPostExecute(BitmapWithColors bmc) {
                updateVisualizerColor(bmc != null ? bmc.getVibrantColor() : Color.TRANSPARENT);
                updateStatusBarColor(bmc != null ? bmc.getVibrantDarkColor() : Color.TRANSPARENT);
            }
        }.execute();
    }
}

From source file:com.nttec.everychan.ui.theme.CustomThemeHelper.java

public static void setCustomTheme(Context context, SparseIntArray customAttrs) {
    if (customAttrs == null || customAttrs.size() == 0) {
        currentAttrs = null;//w ww  .ja v a 2  s .c  om
        return;
    }

    TypedValue tmp = new TypedValue();
    context.getTheme().resolveAttribute(android.R.attr.textColorPrimary, tmp, true);
    int textColorPrimaryOriginal = (tmp.type >= TypedValue.TYPE_FIRST_COLOR_INT
            && tmp.type <= TypedValue.TYPE_LAST_COLOR_INT) ? tmp.data : Color.TRANSPARENT;
    int textColorPrimaryOverridden = customAttrs.get(android.R.attr.textColorPrimary, textColorPrimaryOriginal);

    try {
        processWindow(context, customAttrs, textColorPrimaryOriginal, textColorPrimaryOverridden);
    } catch (Exception e) {
        Logger.e(TAG, e);
    }

    CustomThemeHelper instance = new CustomThemeHelper(context, customAttrs, textColorPrimaryOriginal,
            textColorPrimaryOverridden);
    LayoutInflaterCompat.setFactory(instance.inflater, instance);
    currentAttrs = customAttrs;
}