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:cn.finalteam.galleryfinal.widget.FloatingActionButton.java

Drawable getIconDrawable() {
    if (mIcon != 0) {
        return ContextCompat.getDrawable(getContext(), mIcon);
    } else {//  w ww  .j a  v  a 2 s  . c  o  m
        return new ColorDrawable(Color.TRANSPARENT);
    }
}

From source file:com.example.android.wifidirect.WiFiDirectActivity.java

private void setTabsValue() {
    // Tab?/*from   w ww . ja v  a2 s  .  co m*/
    tabs.setShouldExpand(true);
    // Tab?
    tabs.setDividerColor(Color.TRANSPARENT);
    // Tab
    tabs.setUnderlineHeight((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, dm));
    // Tab Indicator
    tabs.setIndicatorHeight((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, dm));
    // Tab?
    tabs.setTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 16, dm));
    // Tab Indicator
    tabs.setIndicatorColor(Color.parseColor("#45c01a"));
    // Tab ()
    tabs.setSelectedTextColor(Color.parseColor("#45c01a"));
    // ?Tab
    tabs.setTabBackground(0);

    //?tab
    tabs.setTabPaddingLeftRight(36);

    // tab?tab?tab???
    //tabs.setShouldExpand(true);

}

From source file:com.base.view.slidemenu.SlideMenu.java

public SlideMenu(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    // we want to draw drop shadow of content
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mVelocityTracker = VelocityTracker.obtain();
    mContentHitRect = new Rect();
    mEdgeSlideDetectRect = new Rect();
    STATUS_BAR_HEIGHT = (int) getStatusBarHeight(context);
    setWillNotDraw(false);/*from w  ww .  j a v a 2  s.c  o  m*/

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SlideMenu, defStyle, 0);

    // Set the shadow attributes
    setPrimaryShadowWidth(a.getDimension(R.styleable.SlideMenu_primaryShadowWidth, 30));
    setSecondaryShadowWidth(a.getDimension(R.styleable.SlideMenu_secondaryShadowWidth, 30));

    Drawable primaryShadowDrawable = a.getDrawable(R.styleable.SlideMenu_primaryShadowDrawable);
    if (null == primaryShadowDrawable) {
        primaryShadowDrawable = new GradientDrawable(Orientation.LEFT_RIGHT,
                new int[] { Color.TRANSPARENT, Color.argb(99, 0, 0, 0) });
    }
    setPrimaryShadowDrawable(primaryShadowDrawable);

    Drawable secondaryShadowDrawable = a.getDrawable(R.styleable.SlideMenu_secondaryShadowDrawable);
    if (null == secondaryShadowDrawable) {
        secondaryShadowDrawable = new GradientDrawable(Orientation.LEFT_RIGHT,
                new int[] { Color.argb(99, 0, 0, 0), Color.TRANSPARENT });
    }
    setSecondaryShadowDrawable(secondaryShadowDrawable);

    int interpolatorResId = a.getResourceId(R.styleable.SlideMenu_interpolator, -1);
    setInterpolator(-1 == interpolatorResId ? DEFAULT_INTERPOLATOR
            : AnimationUtils.loadInterpolator(context, interpolatorResId));

    mSlideDirectionFlag = a.getInt(R.styleable.SlideMenu_slideDirection,
            FLAG_DIRECTION_LEFT | FLAG_DIRECTION_RIGHT);

    setEdgeSlideEnable(a.getBoolean(R.styleable.SlideMenu_edgeSlide, false));
    setEdgetSlideWidth(a.getDimensionPixelSize(R.styleable.SlideMenu_edgeSlideWidth, 100));
    a.recycle();

    setFocusable(true);
    setFocusableInTouchMode(true);
}

From source file:com.iislab.junyeop_imaciislab.moneyball.Moneyball.SlidingTabsBasicFragment.java

/**
 * This is called after the {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)} has finished.
 * Here we can pick out the {@link View}s we need to configure from the content view.
 *
 * We set the {@link ViewPager}'s adapter to be an instance of {@link SamplePagerAdapter}. The
 * {@link SlidingTabLayout} is then given the {@link ViewPager} so that it can populate itself.
 *
 * @param view View created in {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}
 *///from ww w. j  a  va2 s  .  c  o m
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    // BEGIN_INCLUDE (setup_viewpager)
    // Get the ViewPager and set it's PagerAdapter so that it can display items
    mViewPager = (ViewPager) view.findViewById(R.id.viewpager);
    mViewPager.setAdapter(new SamplePagerAdapter());
    // END_INCLUDE (setup_viewpager)

    // BEGIN_INCLUDE (setup_slidingtablayout)
    // Give the SlidingTabLayout the ViewPager, this must be done AFTER the ViewPager has had
    // it's PagerAdapter set.
    mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);
    mSlidingTabLayout.setCustomTabView(R.layout.custom_tab_title, R.id.tabtext, R.id.tabimage);

    mSlidingTabLayout.setSelectedIndicatorColors(Color.TRANSPARENT);
    mSlidingTabLayout.setDistributeEvenly(true);
    mSlidingTabLayout.setViewPager(mViewPager);
    // END_INCLUDE (setup_slidingtablayout)

    sharedPreferences = getActivity().getSharedPreferences("login_info", Context.MODE_PRIVATE);
    final String username = sharedPreferences.getString("username", null);

    long now = System.currentTimeMillis();
    Date date = new Date(now);
    SimpleDateFormat CurDateFormat = new SimpleDateFormat("yyyy MM dd?");
    String strCurDate = "Today " + CurDateFormat.format(date) + "\tUser : " + username;
    TextView textView = (TextView) view.findViewById(R.id.today);
    textView.setText(strCurDate);

    Button BuyMoneyball = (Button) view.findViewById(R.id.buy_moneyball_btn);
    BuyMoneyball.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getActivity(), BuyingMoneyballActivity.class);
            startActivity(intent);
            getActivity().overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
        }
    });
    TextView moneyballNow = (TextView) view.findViewById(R.id.moneyball_now);
    moneyballNow.setText(moneyToString(sharedPreferences.getInt("money", 0)));
}

From source file:com.musenkishi.wally.activities.ImageDetailsActivity.java

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

    setToolbar((Toolbar) findViewById(R.id.toolbar));

    if (getToolbar() != null) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(Color.TRANSPARENT);
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }/*from  w ww  .j a  va  2s  . c  om*/
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getToolbar().setPadding(0, getStatusBarHeight(), 0, 0);
        }
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setTitle("");
    }

    final Intent intent = getIntent();
    String action = intent.getAction();

    if (Intent.ACTION_VIEW.equals(action)) {
        pageUri = Uri.parse(intent.getDataString());
        if ("wally".equalsIgnoreCase(pageUri.getScheme())) {
            pageUri = pageUri.buildUpon().scheme("http").build();
        }
    }

    setupViews();
    setupHandlers();

    Size size = new Size(16, 9);

    if (intent.hasExtra(INTENT_EXTRA_IMAGE)) {
        final Image image = intent.getParcelableExtra(INTENT_EXTRA_IMAGE);
        final Bitmap thumbBitmap = WallyApplication.getBitmapThumb();

        if (thumbBitmap != null) {

            size = fitToWidthAndKeepRatio(image.getWidth(), image.getHeight());

            photoView.getLayoutParams().width = size.getWidth();
            photoView.getLayoutParams().height = size.getHeight();

            Bitmap blurBitMap;
            try {
                blurBitMap = Blur.apply(imageHolder.getContext(), thumbBitmap);
            } catch (ArrayIndexOutOfBoundsException e) {
                //Blur couldn't be applied. Show regular thumbnail instead.
                blurBitMap = thumbBitmap;
            }
            photoView.setImageBitmap(blurBitMap);
        }
    }
    setupPaddings(size, false);

    if (savedInstanceState == null) {
        getPage(pageUri.toString());
    } else if (savedInstanceState.containsKey(STATE_IMAGE_PAGE)) {
        imagePage = savedInstanceState.getParcelable(STATE_IMAGE_PAGE);
    }

    if (imagePage != null) {
        Message msgObj = uiHandler.obtainMessage();
        msgObj.what = MSG_PAGE_FETCHED;
        msgObj.obj = imagePage;
        uiHandler.sendMessage(msgObj);
    } else {
        getPage(pageUri.toString());
    }

}

From source file:android.support.design.internal.NavigationMenuItemView.java

private StateListDrawable createDefaultBackground() {
    TypedValue value = new TypedValue();
    if (getContext().getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.colorControlHighlight,
            value, true)) {//  ww  w .  j  a va2  s .  c  om
        StateListDrawable drawable = new StateListDrawable();
        drawable.addState(CHECKED_STATE_SET, new ColorDrawable(value.data));
        drawable.addState(EMPTY_STATE_SET, new ColorDrawable(Color.TRANSPARENT));
        return drawable;
    }
    return null;
}

From source file:com.insthub.O2OMobile.Activity.F0_ProfileActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.f0_profile);
    mUserId = getIntent().getIntExtra(USER_ID, 0);
    mServiceType = (SERVICE_TYPE) getIntent().getSerializableExtra(O2OMobileAppConst.SERVICE_TYPE);
    mListview = (ListView) findViewById(R.id.profile_listview);
    mHelp = (Button) findViewById(R.id.btn_help);
    LayoutInflater layoutInflater = LayoutInflater.from(this);
    mHeaderView = layoutInflater.inflate(R.layout.f0_profile_header, null);
    mBack = (ImageView) mHeaderView.findViewById(R.id.top_view_back);
    mSetting = (ImageView) mHeaderView.findViewById(R.id.top_view_setting);
    mAvatar = (RoundedWebImageView) mHeaderView.findViewById(R.id.iv_avarta);
    mName = (TextView) mHeaderView.findViewById(R.id.tv_name);
    mBalance = (TextView) mHeaderView.findViewById(R.id.tv_balance);
    mSignature = (TextView) mHeaderView.findViewById(R.id.tv_signature);
    mBrief = (TextView) mHeaderView.findViewById(R.id.tv_brief);
    mBrief_detail = (TextView) mHeaderView.findViewById(R.id.brief_detail);
    //        mMyCash = (RelativeLayout) mHeaderView.findViewById(R.id.my_cash);
    mComment = (RelativeLayout) mHeaderView.findViewById(R.id.comment);
    mCommentCount = (TextView) mHeaderView.findViewById(R.id.tv_comment_count);
    mCommentGoodrate = (TextView) mHeaderView.findViewById(R.id.tv_comment_goodrate);
    mComplain = (TextView) mHeaderView.findViewById(R.id.complain);
    mGridviewServiceList = (MyGridView) mHeaderView.findViewById(R.id.grid_view_service_list);
    mGridview = (LinearLayout) mHeaderView.findViewById(R.id.gridview);
    mBirefLayout = (LinearLayout) mHeaderView.findViewById(R.id.ll_brief);
    mRefresh = (ImageView) mHeaderView.findViewById(R.id.refresh);
    mGridviewServiceList.setSelector(new ColorDrawable(Color.TRANSPARENT));
    mListview.addHeaderView(mHeaderView);
    mListview.setAdapter(null);/*from  w ww .  j a  v  a2s . c  o  m*/
    mUserBalance = new UserBalanceModel(this);
    mUserBalance.addResponseListener(this);
    mUserBalance.getProfile(mUserId);
    mBack.setOnClickListener(this);
    mSetting.setOnClickListener(this);
    mBrief_detail.setOnClickListener(this);
    mHelp.setOnClickListener(this);
    mComment.setOnClickListener(this);
    mComplain.setOnClickListener(this);
    mAvatar.setOnClickListener(this);
    mRefresh.setOnClickListener(this);
    if (mUserId != SESSION.getInstance().uid) {
        mSetting.setVisibility(View.GONE);
        mComplain.setVisibility(View.VISIBLE);
    } else {
        mUserBalance.get();
    }
    EventBus.getDefault().register(this);
}

From source file:com.money.manager.ex.reports.PieChartFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    //return buildChart();
    mLayout = (LinearLayout) inflater.inflate(R.layout.chart_pie_fragment, container, false);

    mChart = (PieChart) mLayout.findViewById(R.id.chartPie);
    mChart.setUsePercentValues(true);/*  ww  w  .  ja va2s .  co m*/

    // change the color of the center-hole
    mChart.setHoleColor(Color.TRANSPARENT);

    mChart.setHoleRadius(30f);
    mChart.setDescription("");

    mChart.setDrawCenterText(true);

    mChart.setDrawHoleEnabled(true);

    mChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    mChart.setRotationEnabled(true);

    // mChart.setUnit(" ");
    // mChart.setDrawUnitsInChart(true);

    // add a selection listener
    mChart.setOnChartValueSelectedListener(this);
    // mChart.setTouchEnabled(false);

    //mChart.setCenterText("MPAndroidChart\nLibrary");

    mChart.animateXY(1500, 1500);

    return mLayout;
}

From source file:com.drjane.promise.ui.fragment.CalendarFragment.java

private void initGridView() {
    // ??/*from   w  ww.j av a2  s. c  o  m*/
    WindowManager windowManager = getActivity().getWindowManager();
    Display display = windowManager.getDefaultDisplay();
    int Width = display.getWidth();
    int Height = display.getHeight();

    mGridView = new CustomGridView(getActivity());
    mGridView.setNumColumns(7);
    mGridView.setColumnWidth(40);
    // gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
    if (Width == 720 && Height == 1280) {
        mGridView.setColumnWidth(40);
    }
    mGridView.setGravity(Gravity.CENTER_VERTICAL);
    mGridView.setSelector(new ColorDrawable(Color.TRANSPARENT));
    // gridView
    mGridView.setVerticalSpacing(1);
    mGridView.setHorizontalSpacing(1);

    mHandler.post(new Runnable() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            mGridView.setAdapter(calendarGridViewAdapter);

        }
    });
}

From source file:com.bitants.wally.activities.ImageDetailsActivity.java

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

    setToolbar((Toolbar) findViewById(R.id.toolbar));

    if (getToolbar() != null) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(Color.TRANSPARENT);
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }/*from  w ww. ja  v  a 2  s  .  co m*/
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getToolbar().setPadding(0, getStatusBarHeight(), 0, 0);
        }
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setTitle("");
    }

    final Intent intent = getIntent();
    String action = intent.getAction();

    if (Intent.ACTION_VIEW.equals(action)) {
        pageUri = Uri.parse(intent.getDataString());
        if ("wally".equalsIgnoreCase(pageUri.getScheme())) {
            pageUri = pageUri.buildUpon().scheme("http").build();
        }
    }

    setupViews();
    setupHandlers();

    Size size = new Size(16, 9);

    if (intent.hasExtra(INTENT_EXTRA_IMAGE)) {
        final Image image = intent.getParcelableExtra(INTENT_EXTRA_IMAGE);
        final Bitmap thumbBitmap = WallyApplication.getBitmapThumb();

        if (thumbBitmap != null) {

            size = fitToWidthAndKeepRatio(image.getWidth(), image.getHeight());

            imageSize = size;

            photoView.getLayoutParams().width = size.getWidth();
            photoView.getLayoutParams().height = size.getHeight();

            Bitmap blurBitMap;
            try {
                blurBitMap = Blur.apply(imageHolder.getContext(), thumbBitmap);
            } catch (ArrayIndexOutOfBoundsException e) {
                //Blur couldn't be applied. Show regular thumbnail instead.
                blurBitMap = thumbBitmap;
            }
            photoView.setImageBitmap(blurBitMap);
        }
    }
    setupPaddings(size, false);

    if (savedInstanceState == null) {
        getPage(pageUri.toString());
    } else if (savedInstanceState.containsKey(STATE_IMAGE_PAGE)) {
        imagePage = savedInstanceState.getParcelable(STATE_IMAGE_PAGE);
    }

    if (imagePage != null) {
        Message msgObj = uiHandler.obtainMessage();
        msgObj.what = MSG_PAGE_FETCHED;
        msgObj.obj = imagePage;
        uiHandler.sendMessage(msgObj);
    } else {
        getPage(pageUri.toString());
    }

}