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.pentacog.mctracker.MCServerTrackerActivity.java

/** Called when the activity is first created. */
@Override/*www .java2  s  .  c om*/
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    ListView lv = getListView();
    lv.setTextFilterEnabled(true);
    lv.setCacheColorHint(Color.TRANSPARENT);
    lv.setBackgroundResource(R.drawable.dirt_tile);

    registerForContextMenu(lv);

}

From source file:com.freshdigitable.udonroad.StatusViewBase.java

public StatusViewBase(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    grid = getGrid();// ww  w  . jav  a  2 s. com
    setPadding(grid, grid, grid, grid);
    setBackgroundColor(Color.TRANSPARENT);
    selectedColor = ContextCompat.getColor(context, R.color.twitter_action_normal_transparent);
}

From source file:com.king.base.BaseDialogFragment.java

@Nullable
@Override//www .  j  a  v  a 2 s  .  com
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    super.getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    context = getActivity();
    rootView = inflater.inflate(inflaterRootView(), container, false);

    curPage = 1;
    initUI();
    initData();
    addListeners();
    if (rootView != null)
        return rootView;

    return super.onCreateView(inflater, container, savedInstanceState);
}

From source file:com.john.main.Utils.java

/**
 * Ensures the tint filter is consistent with the current tint color and
 * mode.//from   www. j  a  va 2 s.  co  m
 */
static PorterDuffColorFilter updateTintFilter(Drawable drawable, PorterDuffColorFilter tintFilter,
        ColorStateList tint, Mode tintMode) {
    if (tint == null || tintMode == null) {
        return null;
    }

    final int color = tint.getColorForState(drawable.getState(), Color.TRANSPARENT);

    if (tintFilter == null || !LOLLIPOP_PLUS) { // TODO worth caching them?
        return new PorterDuffColorFilter(color, tintMode);
    }

    tryInvoke(tintFilter, "setColor", INT_ARG, color);
    tryInvoke(tintFilter, "setMode", MODE_ARG, tintMode);
    return tintFilter;
}

From source file:com.money.manager.ex.assetallocation.full.FullAssetAllocationAdapter.java

@Override
public void onBindViewHolder(FullAssetClassViewHolder holder, int position) {
    AssetClassViewModel item = this.model.get(position);

    // color the background, depending on the level.
    switch (item.assetClass.getType()) {
    case Allocation:
        // reset bg color
        holder.listItem.setBackgroundColor(Color.TRANSPARENT);
        break;/*from w ww  .j  a  va  2 s.  c o  m*/

    case Footer:
        holder.listItem.setBackgroundColor(Color.DKGRAY);
        break;

    default:
        int colorDepth = 50 * item.level;
        holder.listItem.setBackgroundColor(Color.argb(225, 0, 100 + colorDepth, 0));
        break;
    }

    holder.assetClassTextView.setText(item.assetClass.getName());
    holder.setAllocationTextView.setText(item.assetClass.getAllocation().toString());

    // Current Allocation
    Money currentAllocation = item.assetClass.getCurrentAllocation();
    String currentAllocationString = currentAllocation == null ? "" : currentAllocation.toString();
    holder.currentAllocationTextView.setText(currentAllocationString);

    // % diff
    Money diff = item.assetClass.getDiffAsPercentOfSet();
    DecimalFormat df = new DecimalFormat("0.00");
    String diffString = df.format(diff.toDouble());
    holder.allocationDiffTextView.setText(diffString);

    // color red/green if under/over the threshold.
    if (diff.toDouble() >= this.differenceThreshold.toDouble()) {
        holder.allocationDiffTextView.setTextColor(Color.GREEN);
    }
    if (diff.toDouble() <= this.differenceThreshold.multiply(-1).toDouble()) {
        holder.allocationDiffTextView.setTextColor(Color.RED);
    }

    holder.setValueTextView.setText(mFormatter.getValueFormattedInBaseCurrency(item.assetClass.getValue()));
    holder.currentValueTextView
            .setText(mFormatter.getValueFormattedInBaseCurrency(item.assetClass.getCurrentValue()));
    holder.valueDiffTextView
            .setText(mFormatter.getValueFormattedInBaseCurrency(item.assetClass.getDifference()));

    holder.setLevel(item.level, this.context);

    //        if (position == expandedPosition) {
    //            holder.valuetPanel.setVisibility(View.VISIBLE);
    //        } else {
    //            holder.valuetPanel.setVisibility(View.GONE);
    //        }
}

From source file:com.slim.slimfilemanager.widget.TabPageIndicator.java

public TabPageIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    setHorizontalScrollBarEnabled(false);

    TypedArray type = context.obtainStyledAttributes(attrs, R.styleable.PageIndicator);

    mSelectedColor = type.getColor(R.styleable.PageIndicator_selectedColor, Color.TRANSPARENT);
    mBackgroundColor = type.getColor(R.styleable.PageIndicator_defaultColor, Color.TRANSPARENT);

    type.recycle();//from www . j a  v  a 2s  . co  m

    mTabLayout = new IndicatorLinearLayout(context, R.attr.tabPageIndicatorStyle);
    addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, MATCH_PARENT));
}

From source file:com.acrylicgoat.bcponline.fragments.CPListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    ListView lv = getListView();/*  ww  w.ja  v  a 2 s.  c  o  m*/
    lv.setCacheColorHint(Color.TRANSPARENT);
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    if (CPUtil.isTabletDevice(getActivity().getWindowManager().getDefaultDisplay(), getActivity())) {
        Category item = contentList.get(0);
        ddgSelectedListener.onDDGSelected(item.getUrl());
        dualFragments = true;
    }
    aBar = sherActivity.getActionBar();

    if (dualFragments) {
        landAdapter = new LandscapeListAdapter(getActivity().getApplicationContext(), contentList);
        setListAdapter(landAdapter);

    } else {
        adapter = new ListAdapter(getActivity().getApplicationContext(), contentList);
        setListAdapter(adapter);
        lv.setBackgroundResource(R.color.color_list_background);
    }

}

From source file:com.facebook.react.uimanager.BaseViewManager.java

@ReactProp(name = PROP_BACKGROUND_COLOR, defaultInt = Color.TRANSPARENT, customType = "Color")
public void setBackgroundColor(T view, int backgroundColor) {
    view.setBackgroundColor(backgroundColor);
}

From source file:Main.java

/**
 * Load the image at {@code imagePath} as a {@link Bitmap}, scaling it to
 * the specified size and preserving the aspect ratio.
 * @param imagePath Path of the image to load.
 * @param width Required width of the resulting {@link Bitmap}.
 * @param height Required height of the resulting {@link Bitmap}.
 * @param fill {@code true} to fill the empty space with transparent color.
 * @param crop {@code true} to crop the image, {@code false} to resize without cutting the image.
 * @return {@link Bitmap} representing the image at {@code imagePath}.
 *///from   w w  w  .j ava 2 s.  co  m
public static Bitmap loadResizedBitmap(String imagePath, int width, int height, boolean fill, boolean crop) {
    Bitmap retVal;

    BitmapFactory.Options opts = new BitmapFactory.Options();
    opts.inSampleSize = getScale(imagePath, width, height);
    opts.inJustDecodeBounds = false;

    Bitmap image = BitmapFactory.decodeFile(imagePath, opts);

    if (image == null) {
        return null;
    }

    if (image.getWidth() != width || image.getHeight() != height) {
        //Image need to be resized.
        //         int scaledWidth = image.getWidth();
        //         int scaledHeight = image.getHeight();
        //         final float factorWidth = scaledWidth / width;
        //         final float factorHeight = scaledHeight / height;
        //final float factor = (scaledWidth / width) - (scaledHeight / height);
        //         final long factor = (scaledWidth * height) - (scaledHeight * width);
        //         if ((crop && factor > 0) || (factor < 0)) {
        //            scaledHeight = (scaledHeight * width) / scaledWidth;
        //            scaledWidth = width;
        //         } else {
        //            scaledWidth = (scaledWidth * height) / scaledHeight;
        //            scaledHeight = height;
        //         }
        int scaledWidth = (image.getWidth() * height) / image.getHeight();
        int scaledHeight; // = (image.getHeight() * width) / image.getWidth();
        if ((crop && scaledWidth > width) || (!crop && scaledWidth < width)) {
            scaledHeight = height;
        } else {
            scaledWidth = width;
            scaledHeight = (image.getHeight() * width) / image.getWidth();
        }
        //image = Bitmap.createScaledBitmap(image, scaledWidth, scaledHeight, true);

        Rect src = new Rect(0, 0, image.getWidth(), image.getHeight());
        Rect dst = new Rect(0, 0, scaledWidth, scaledHeight);

        if (fill) {
            retVal = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
            dst.offset((width - scaledWidth) / 2, (height - scaledHeight) / 2);
        } else {
            retVal = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
        }
        retVal.eraseColor(Color.TRANSPARENT);

        synchronized (canvas) {
            if (antiAliasPaint == null) {
                antiAliasPaint = new Paint();
                antiAliasPaint.setAntiAlias(true);
                antiAliasPaint.setFilterBitmap(true);
                antiAliasPaint.setDither(true);
            }
            canvas.setBitmap(retVal);
            canvas.drawBitmap(image, src, dst, antiAliasPaint);
        }

        image.recycle();
    } else {
        //No need to scale.
        retVal = image;
    }

    return retVal;
}

From source file:com.example.sdave.footballscore.SlidingTabs.SlidingTabsColorsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();/* ww w  .j a v a2  s .co m*/

    if (args != null) {
        league = (League) getArguments().getSerializable("league");
    }

    mTabs.add(new SamplePagerItem("Teams", // Title
            Color.WHITE, // Indicator color
            Color.TRANSPARENT // Divider color
    ));

    mTabs.add(new SamplePagerItem("Fixtures", Color.WHITE, Color.TRANSPARENT));

    mTabs.add(new SamplePagerItem("Standings", Color.WHITE, Color.TRANSPARENT));

}