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:ccv.checkhelzio.nuevaagendacucsh.transitions.FabTransition.java

public FabTransition(Context context, AttributeSet attrs) {
    super(context, attrs);
    TypedArray a = null;/*  ww  w.  j  a  v a  2 s .c  om*/
    try {
        a = context.obtainStyledAttributes(attrs, R.styleable.FabTransition);
        if (!a.hasValue(R.styleable.FabTransition_fabColor) || !a.hasValue(R.styleable.FabTransition_fabIcon)) {
            throw new IllegalArgumentException("Must provide both color & icon.");
        }
        color = a.getColor(R.styleable.FabTransition_fabColor, Color.TRANSPARENT);
        icon = a.getResourceId(R.styleable.FabTransition_fabIcon, 0);
        setPathMotion(new GravityArcMotion());
        if (getDuration() < 0) {
            setDuration(DEFAULT_DURATION);
        }
    } finally {
        if (a != null) {
            a.recycle();
        }
    }
}

From source file:com.moodstocks.phonegap.plugin.MoodstocksPlugin.java

public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {

    if (action.equals(OPEN)) {
        this.open(callbackContext);

        return true;
    } else if (action.equals(SYNC)) {
        this.syncCallback = callbackContext;
        this.sync();

        return true;
    } else if (action.equals(SCAN)) {
        MoodstocksPlugin.setOverlay(this.webView);
        MoodstocksPlugin.overlay.setBackgroundColor(Color.TRANSPARENT);

        MoodstocksPlugin.setScanCallback(callbackContext);
        this.scan(args);

        return true;
    } else if (action.equals(PAUSE)) {
        this.pause(callbackContext);

        return true;
    } else if (action.equals(RESUME)) {
        this.resume(callbackContext);

        return true;
    } else if (action.equals(DISMISS)) {
        this.dismiss(callbackContext);

        return true;
    }// www.j  av a 2 s  .com

    return true;
}

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

/**
 *   (drawable) ? Action Bar.  ? Android 5.0    ??   android:attr/textColorPrimary
 * @param theme /*from ww  w .  jav  a 2  s .  c o m*/
 * @param resources ??
 * @param attrId id  (R.attr.[...])
 * @return  Drawable ? ,  null, ?  ? 
 */
public static Drawable getActionbarIcon(Theme theme, Resources resources, int attrId) {
    try {
        int id = getThemeResId(theme, attrId);
        Drawable drawable = ResourcesCompat.getDrawable(resources, id, theme);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            int color = getThemeColor(theme, android.R.attr.textColorPrimary, Color.TRANSPARENT);
            if (color != Color.TRANSPARENT) {
                drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
            }
        }
        return drawable;
    } catch (Exception e) {
        return null;
    }
}

From source file:ameircom.keymedia.Activity.transition.FabTransform.java

public FabTransform(Context context, AttributeSet attrs) {
    super(context, attrs);
    TypedArray a = null;/*  w ww  . j  a  va  2s. c om*/
    try {
        a = context.obtainStyledAttributes(attrs, R.styleable.FabTransform);
        if (!a.hasValue(R.styleable.FabTransform_fabColor) || !a.hasValue(R.styleable.FabTransform_fabIcon)) {
            throw new IllegalArgumentException("Must provide both color & icon.");
        }
        color = a.getColor(R.styleable.FabTransform_fabColor, Color.TRANSPARENT);
        icon = a.getResourceId(R.styleable.FabTransform_fabIcon, 0);
        setPathMotion(new GravityArcMotion());
        if (getDuration() < 0) {
            setDuration(DEFAULT_DURATION);
        }
    } finally {
        a.recycle();
    }
}

From source file:com.procleus.brime.ui.LabelsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    ((MainActivity) getActivity()).setActionBarTitle("Labels");
    ((MainActivity) getActivity()).showFloatingActionButton(true);
    final View v = inflater.inflate(R.layout.labels_gragment, container, false);
    final NotesDbHelperOld tn = new NotesDbHelperOld(getActivity());

    labelsRetrieved = new ArrayList<String>();
    labelsRetrieved = tn.retrieveLabel();

    listView = (ListView) v.findViewById(R.id.listLabel);
    final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getContext(),
            android.R.layout.simple_list_item_1, labelsRetrieved);
    listView.setAdapter(arrayAdapter);//from w  w w .  j a  v  a 2 s  .c  o  m
    ImageButton addLabelBtn = (ImageButton) v.findViewById(R.id.addLabelBtn);

    addLabelBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            addLabelFunc(v, tn);
        }
    });

    /*/WORK OF LONG ITEM CLICK LISTENER*/

    listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
        @Override
        public boolean onItemLongClick(final AdapterView<?> parent, View view, final int position, long id) {

            final Dialog dialog = new Dialog(getContext());
            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
            dialog.setCancelable(false);
            dialog.setContentView(R.layout.dialog_label);
            dialog.show();

            final Button negative = (Button) dialog.findViewById(R.id.btn_no_label);
            final Button positive = (Button) dialog.findViewById(R.id.btn_yes_label);

            negative.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    dialog.dismiss();

                }
            });

            positive.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    Log.i("brinjal", "Yes");

                    tn.deleteTextNote(String.valueOf(parent.getItemAtPosition(position)));
                    final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getContext(),
                            android.R.layout.simple_list_item_1, labelsRetrieved);
                    listView.setAdapter(arrayAdapter);
                    dialog.dismiss();

                }

            });

            return true;

        }
    });

    return v;
}

From source file:com.chenenyu.areapicker.AreaPicker.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    return dialog;
}

From source file:com.groupme.sdk.activity.GroupCreateActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_groupcreate);

    GroupMeConnect connect = GroupMeConnect.getInstance(this);

    if (!connect.hasValidSession()) {
        /* fire off the authentication activity. */
        startActivityForResult(new Intent(this, AuthorizeActivity.class), AuthorizeActivity.REQUEST_LOGIN);
    }/*from  w w w .  j  a v  a2 s  .c o m*/

    mCreateButton = (Button) findViewById(R.id.btn_create_group_alt);
    mCreateButton.setEnabled(false);

    mGroupNameEntry = (EditText) findViewById(R.id.group_name_entry);
    mGroupNameEntry.addTextChangedListener(new TextWatcher() {
        public void onTextChanged(CharSequence str, int start, int before, int count) {
            if (!TextUtils.isEmpty(mGroupNameEntry.getText().toString())) {
                if (mContacts != null && mContacts.size() != 0) {
                    mCreateButton.setEnabled(true);
                } else {
                    mCreateButton.setEnabled(false);
                }
            } else {
                mCreateButton.setEnabled(false);
            }
        }

        public void afterTextChanged(Editable s) {

        }

        public void beforeTextChanged(CharSequence str, int start, int before, int count) {

        }
    });

    getListView().setBackgroundColor(Color.TRANSPARENT);
    getListView().setCacheColorHint(Color.TRANSPARENT);
}

From source file:com.heneryh.aquanotes.ui.livestock.ContentFragment.java

/** This is where we initialize the fragment's UI and attach some
 * event listeners to UI components./* w  w w  . java 2s.  co m*/
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mContentView = inflater.inflate(R.layout.content_welcome, null);
    final ImageView imageView = (ImageView) mContentView.findViewById(R.id.image);
    mContentView.setDrawingCacheEnabled(false);

    // Handle drag events when a list item is dragged into the view
    mContentView.setOnDragListener(new View.OnDragListener() {
        public boolean onDrag(View view, DragEvent event) {
            switch (event.getAction()) {
            case DragEvent.ACTION_DRAG_ENTERED:
                view.setBackgroundColor(getResources().getColor(R.color.drag_active_color));
                break;

            case DragEvent.ACTION_DRAG_EXITED:
                view.setBackgroundColor(Color.TRANSPARENT);
                break;

            case DragEvent.ACTION_DRAG_STARTED:
                return processDragStarted(event);

            case DragEvent.ACTION_DROP:
                view.setBackgroundColor(Color.TRANSPARENT);
                return processDrop(event, imageView);
            }
            return false;
        }
    });

    // Show/hide the system status bar when single-clicking a photo.
    mContentView.setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            if (mCurrentActionMode != null) {
                // If we're in an action mode, don't toggle the action bar
                return;
            }

            if (mSystemUiVisible) {
                setSystemUiVisible(false);
            } else {
                setSystemUiVisible(true);
            }
        }
    });

    // When long-pressing a photo, activate the action mode for selection, showing the
    // contextual action bar (CAB).
    mContentView.setOnLongClickListener(new View.OnLongClickListener() {
        public boolean onLongClick(View view) {
            if (mCurrentActionMode != null) {
                return false;
            }

            mCurrentActionMode = getActivity().startActionMode(mContentSelectionActionModeCallback);
            view.setSelected(true);
            return true;
        }
    });

    return mContentView;
}

From source file:ameircom.keymedia.Activity.transition.FabTransform.java

/**
 * Create a {@link FabTransform} from the supplied {@code activity} extras and set as its
 * shared element enter/return transition.
 *///  w  w w .j  a  va 2  s. co m
public static boolean setup(@NonNull Activity activity, @Nullable View target) {
    final Intent intent = activity.getIntent();
    if (!intent.hasExtra(EXTRA_FAB_COLOR) || !intent.hasExtra(EXTRA_FAB_ICON_RES_ID)) {
        return false;
    }

    final int color = intent.getIntExtra(EXTRA_FAB_COLOR, Color.TRANSPARENT);
    final int icon = intent.getIntExtra(EXTRA_FAB_ICON_RES_ID, -1);
    final FabTransform sharedEnter = new FabTransform(color, icon);
    if (target != null) {
        sharedEnter.addTarget(target);
    }
    activity.getWindow().setSharedElementEnterTransition(sharedEnter);
    return true;
}

From source file:com.khoai.bus.ui.IconGenerator.java

/**
 * Creates an icon with the current content and style.
 * <p/>//from   w ww  .ja  v  a 2 s .c  om
 * This method is useful if a custom view has previously been set, or if text content is not
 * applicable.
 */
public Bitmap makeIcon() {
    int measureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
    mContainer.measure(measureSpec, measureSpec);

    int measuredWidth = mContainer.getMeasuredWidth();
    int measuredHeight = mContainer.getMeasuredHeight();

    mContainer.layout(0, 0, measuredWidth, measuredHeight);

    if (mRotation == 1 || mRotation == 3) {
        measuredHeight = mContainer.getMeasuredWidth();
        measuredWidth = mContainer.getMeasuredHeight();
    }

    Bitmap r = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888);
    r.eraseColor(Color.TRANSPARENT);

    Canvas canvas = new Canvas(r);

    if (mRotation == 0) {
        // do nothing
    } else if (mRotation == 1) {
        canvas.translate(measuredWidth, 0);
        canvas.rotate(90);
    } else if (mRotation == 2) {
        canvas.rotate(180, measuredWidth / 2, measuredHeight / 2);
    } else {
        canvas.translate(0, measuredHeight);
        canvas.rotate(270);
    }
    mContainer.draw(canvas);
    return r;
}