List of usage examples for android.graphics Color TRANSPARENT
int TRANSPARENT
To view the source code for android.graphics Color TRANSPARENT.
Click Source Link
From source file:com.amaze.filemanager.ui.views.drawer.Drawer.java
public Drawer(MainActivity mainActivity) { this.mainActivity = mainActivity; resources = mainActivity.getResources(); dataUtils = DataUtils.getInstance(); drawerHeaderLayout = mainActivity.getLayoutInflater().inflate(R.layout.drawerheader, null); drawerHeaderParent = drawerHeaderLayout.findViewById(R.id.drawer_header_parent); drawerHeaderView = drawerHeaderLayout.findViewById(R.id.drawer_header); drawerHeaderView.setOnLongClickListener(v -> { Intent intent1;//from w ww.j a v a2 s . com if (SDK_INT < Build.VERSION_CODES.KITKAT) { intent1 = new Intent(); intent1.setAction(Intent.ACTION_GET_CONTENT); } else { intent1 = new Intent(Intent.ACTION_OPEN_DOCUMENT); } intent1.addCategory(Intent.CATEGORY_OPENABLE); intent1.setType("image/*"); mainActivity.startActivityForResult(intent1, image_selector_request_code); return false; }); mImageLoader = AppConfig.getInstance().getImageLoader(); navView = mainActivity.findViewById(R.id.navigation); //set width of drawer in portrait to follow material guidelines /*if(!Utils.isDeviceInLandScape(mainActivity)){ setNavViewDimension(navView); }*/ navView.setNavigationItemSelectedListener(this); int accentColor = mainActivity.getAccent(), idleColor; if (mainActivity.getAppTheme().equals(AppTheme.LIGHT)) { idleColor = mainActivity.getResources().getColor(R.color.item_light_theme); } else { idleColor = Color.WHITE; } actionViewStateManager = new ActionViewStateManager(navView, idleColor, accentColor); ColorStateList drawerColors = new ColorStateList( new int[][] { new int[] { android.R.attr.state_checked }, new int[] { android.R.attr.state_enabled }, new int[] { android.R.attr.state_pressed }, new int[] { android.R.attr.state_focused }, new int[] { android.R.attr.state_pressed } }, new int[] { accentColor, idleColor, idleColor, idleColor, idleColor }); navView.setItemTextColor(drawerColors); navView.setItemIconTintList(drawerColors); if (mainActivity.getAppTheme().equals(AppTheme.DARK)) { navView.setBackgroundColor(Utils.getColor(mainActivity, R.color.holo_dark_background)); } else if (mainActivity.getAppTheme().equals(AppTheme.BLACK)) { navView.setBackgroundColor(Utils.getColor(mainActivity, android.R.color.black)); } else { navView.setBackgroundColor(Color.WHITE); } mDrawerLayout = mainActivity.findViewById(R.id.drawer_layout); //mDrawerLayout.setStatusBarBackgroundColor(Color.parseColor((currentTab==1 ? skinTwo : skin))); drawerHeaderView.setBackgroundResource(R.drawable.amaze_header); //drawerHeaderParent.setBackgroundColor(Color.parseColor((currentTab==1 ? skinTwo : skin))); if (mainActivity.findViewById(R.id.tab_frame) != null) { lock(DrawerLayout.LOCK_MODE_LOCKED_OPEN); open(); mDrawerLayout.setScrimColor(Color.TRANSPARENT); mDrawerLayout.post(this::open); } else if (mainActivity.findViewById(R.id.tab_frame) == null) { unlock(); close(); mDrawerLayout.post(this::close); } navView.addHeaderView(drawerHeaderLayout); if (!isDrawerLocked) { mDrawerToggle = new ActionBarDrawerToggle(mainActivity, /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer_l, /* nav drawer image to replace 'Up' caret */ R.string.drawer_open, /* "open drawer" description for accessibility */ R.string.drawer_close /* "close drawer" description for accessibility */ ) { public void onDrawerClosed(View view) { Drawer.this.onDrawerClosed(); } public void onDrawerOpened(View drawerView) { //title.setText("Amaze File Manager"); // creates call to onPrepareOptionsMenu() } }; mDrawerLayout.setDrawerListener(mDrawerToggle); mainActivity.getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_drawer_l); mainActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true); mainActivity.getSupportActionBar().setHomeButtonEnabled(true); mDrawerToggle.syncState(); } }
From source file:com.se.cronus.AbstractCActivity.java
/** * sets up left hand side//from w ww . jav a 2s . co m */ protected void setUpProfile() { profile = new SlidingMenu(this); profile.setSlidingEnabled(true); profile.setMode(SlidingMenu.LEFT); profile.setMenu(com.se.cronus.R.layout.fragment_left); profile.setShadowWidthRes(com.se.cronus.R.dimen.shadow_width); // profile.setShadowDrawable(R.drawable.shadow); profile.setBehindOffsetRes(com.se.cronus.R.dimen.slidingmenu_offset); // profile.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); // profile.setBehindWidth(30); profile.setBehindScrollScale(0.25f); profile.setFadeDegree(0.35f); profile.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN); profile.setBackgroundColor(CUtils.CRONUS_BLUE_DARK); profile.setOnOpenedListener(new OnOpenedListener() { @Override public void onOpened() { onOpenProfile(); } }); profile.setOnClosedListener(new OnClosedListener() { @Override public void onClosed() { onOpenMain(); } }); /*DESIGN SECTION*/ ((TextView) profile.getMenu().findViewById(com.se.cronus.R.id.profile_text1)).setTextColor(Color.WHITE); ((TextView) profile.getMenu().findViewById(com.se.cronus.R.id.profile_text1)).setTypeface(null, Typeface.BOLD); ((TextView) profile.getMenu().findViewById(com.se.cronus.R.id.profile_text1)) .setTextSize(CUtils.FONT_SIZE_LARGE); ((TextView) profile.getMenu().findViewById(com.se.cronus.R.id.profile_text1)) .setTextSize(CUtils.FONT_SIZE_MED); ((TextView) profile.getMenu().findViewById(com.se.cronus.R.id.profile_text2)).setTextColor(Color.WHITE); //setOnClicks profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_facebook).setOnClickListener(this); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_facebook)) .setTextColor(Color.WHITE); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_facebook)).setTypeface(null, Typeface.BOLD); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_facebook)) .setBackgroundColor(Color.TRANSPARENT); profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_twitter).setOnClickListener(this); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_twitter)) .setTextColor(Color.WHITE); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_twitter)).setTypeface(null, Typeface.BOLD); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_twitter)) .setBackgroundColor(Color.TRANSPARENT); profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_pintrest).setOnClickListener(this); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_pintrest)) .setTextColor(Color.WHITE); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_pintrest)).setTypeface(null, Typeface.BOLD); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_pintrest)) .setBackgroundColor(Color.TRANSPARENT); profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_insta).setOnClickListener(this); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_insta)) .setTextColor(Color.WHITE); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_insta)).setTypeface(null, Typeface.BOLD); ((Button) profile.getMenu().findViewById(com.se.cronus.R.id.test_profile_add_insta)) .setBackgroundColor(Color.TRANSPARENT); }
From source file:bottombar.BottomBar.java
private void determineInitialBackgroundColor() { if (isShiftingMode()) { defaultBackgroundColor = primaryColor; }//from ww w .j a va 2s . c o m Drawable userDefinedBackground = getBackground(); boolean userHasDefinedBackgroundColor = userDefinedBackground != null && userDefinedBackground instanceof ColorDrawable; if (userHasDefinedBackgroundColor) { defaultBackgroundColor = ((ColorDrawable) userDefinedBackground).getColor(); setBackgroundColor(Color.TRANSPARENT); } }
From source file:android.support.v17.leanback.app.DetailsSupportFragmentBackgroundController.java
/** * Enables parallax background using a custom cover drawable at top and a custom bottom * drawable. This method must be called before {@link #setupVideoPlayback(PlaybackGlue)}. * * @param coverDrawable Custom cover drawable shown at top. {@link #setCoverBitmap(Bitmap)} * will not work if coverDrawable is not {@link FitWidthBitmapDrawable}; * in that case it's app's responsibility to set content into * coverDrawable.//from w w w . ja va 2 s .c o m * @param bottomDrawable Drawable shown at bottom. {@link #setSolidColor(int)} will not work * if bottomDrawable is not {@link ColorDrawable}; in that case it's app's * responsibility to set content of bottomDrawable. * @param coverDrawableParallaxTarget Target to perform parallax effect within coverDrawable. * Use null for no parallax movement effect. * Example to move bitmap within FitWidthBitmapDrawable: * new ParallaxTarget.PropertyValuesHolderTarget( * coverDrawable, PropertyValuesHolder.ofInt( * FitWidthBitmapDrawable.PROPERTY_VERTICAL_OFFSET, * 0, -120)) * @throws IllegalStateException If {@link #setupVideoPlayback(PlaybackGlue)} was called. */ public void enableParallax(@NonNull Drawable coverDrawable, @NonNull Drawable bottomDrawable, @Nullable ParallaxTarget.PropertyValuesHolderTarget coverDrawableParallaxTarget) { if (mParallaxDrawable != null) { return; } // if bitmap is set before enableParallax, use it as initial value. if (mCoverBitmap != null && coverDrawable instanceof FitWidthBitmapDrawable) { ((FitWidthBitmapDrawable) coverDrawable).setBitmap(mCoverBitmap); } // if solid color is set before enableParallax, use it as initial value. if (mSolidColor != Color.TRANSPARENT && bottomDrawable instanceof ColorDrawable) { ((ColorDrawable) bottomDrawable).setColor(mSolidColor); } if (mPlaybackGlue != null) { throw new IllegalStateException( "enableParallaxDrawable must be called before " + "enableVideoPlayback"); } mParallaxDrawable = new DetailsParallaxDrawable(mFragment.getContext(), mFragment.getParallax(), coverDrawable, bottomDrawable, coverDrawableParallaxTarget); mFragment.setBackgroundDrawable(mParallaxDrawable); // create a VideoHelper with null PlaybackGlue for changing CoverDrawable visibility // before PlaybackGlue is ready. mVideoHelper = new DetailsBackgroundVideoHelper(null, mFragment.getParallax(), mParallaxDrawable.getCoverDrawable()); }
From source file:com.cs.widget.tab.PagerSlidingTabStrip1.java
private void addIconTab(final int position, TextImageRes res) { RadioButton tab = new RadioButton(getContext()); tab.setCompoundDrawablesWithIntrinsicBounds(0, res.getResId(), 0, 0); tab.setButtonDrawable(new ColorDrawable(Color.TRANSPARENT)); tab.setGravity(Gravity.CENTER);//from w ww . j a va 2s . co m tab.setText(res.getText()); tab.setTextColor(getContext().getResources().getColorStateList(res.getTextColorId())); addTab(position, tab); }
From source file:com.bluros.music.fragments.ArtistDetailFragment.java
@Override public void onResume() { super.onResume(); toolbar.setBackgroundColor(Color.TRANSPARENT); if (primaryColor != -1 && getActivity() != null) { collapsingToolbarLayout.setContentScrimColor(primaryColor); String ateKey = Helpers.getATEKey(getActivity()); ATEUtils.setStatusBarColor(getActivity(), ateKey, primaryColor); }//from w w w . java 2 s. co m }
From source file:com.slodin.transalarm.GeofenceTransitionsIntentService.java
/** * Posts a notification in the notification bar when a transition is detected. * If the user clicks the notification, control goes to the MainActivity. *///from w w w . j av a 2 s .c o m private void sendNotificationCurrentLocation(String notificationDetails) { // Create an explicit content Intent that starts the main Activity. Intent notificationIntent = new Intent(getApplicationContext(), calPage.class) .putExtra(Intent.EXTRA_SHORTCUT_NAME, notificationDetails); // Construct a task stack. TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); // Add the main Activity to the task stack as the parent. stackBuilder.addParentStack(MainActivity.class); // Push the content Intent onto the stack. stackBuilder.addNextIntent(notificationIntent); // Get a PendingIntent containing the entire back stack. PendingIntent notificationPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); // Get a notification builder that's compatible with platform versions >= 4 NotificationCompat.Builder builder = new NotificationCompat.Builder(this); // Define the notification settings. builder.setSmallIcon(R.drawable.ic_stat_name) // In a real app, you may want to use a library like Volley // to decode the Bitmap. .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) .setColor(Color.TRANSPARENT).setContentTitle("You are at: " + notificationDetails) .setContentText(getString(R.string.geofence_transition_notification_text)) .setContentIntent(notificationPendingIntent); // Dismiss notification once the user touches it. builder.setAutoCancel(true); // Get an instance of the Notification manager NotificationManager mNotificationManager = (NotificationManager) getSystemService( Context.NOTIFICATION_SERVICE); // Issue the notification mNotificationManager.notify(0, builder.build()); }
From source file:com.nextgis.mobile.fragment.AttributesFragment.java
private void setAttributes() { if (mAttributes == null) return;/* ww w. ja va 2 s . co m*/ mAttributes.removeAllViews(); int[] attrs = new int[] { android.R.attr.textColorPrimary }; TypedArray ta = getContext().obtainStyledAttributes(attrs); String textColor = Integer.toHexString(ta.getColor(0, Color.BLACK)).substring(2); ta.recycle(); final WebView webView = new WebView(getContext()); webView.setVerticalScrollBarEnabled(false); String data = "<!DOCTYPE html><html><head><meta charset='utf-8'><style>body{word-wrap:break-word;color:#" + textColor + ";font-family:Roboto Light,sans-serif;font-weight:300;line-height:1.15em}.flat-table{table-layout:fixed;margin-bottom:20px;width:100%;border-collapse:collapse;border:none;box-shadow:inset 1px -1px #ccc,inset -1px 1px #ccc}.flat-table td{box-shadow:inset -1px -1px #ccc,inset -1px -1px #ccc;padding:.5em}.flat-table tr{-webkit-transition:background .3s,box-shadow .3s;-moz-transition:background .3s,box-shadow .3s;transition:background .3s,box-shadow .3s}</style></head><body><table class='flat-table'><tbody>"; FragmentActivity activity = getActivity(); if (null == activity) return; ((MainActivity) activity).setSubtitle(String.format(getString(R.string.features_count_attributes), mItemPosition + 1, mFeatureIDs.size())); checkNearbyItems(); try { data = parseAttributes(data); } catch (RuntimeException e) { e.printStackTrace(); } data += "</tbody></table></body></html>"; webView.loadDataWithBaseURL(null, data, "text/html", "UTF-8", null); mAttributes.addView(webView); webView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { webView.setBackgroundColor(Color.TRANSPARENT); } public boolean shouldOverrideUrlLoading(WebView view, String url) { view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); return true; } }); IGISApplication app = (GISApplication) getActivity().getApplication(); final Map<String, Integer> mAttaches = new HashMap<>(); PhotoGallery.getAttaches(app, mLayer, mItemId, mAttaches, false); if (mAttaches.size() > 0) { final PhotoPicker gallery = new PhotoPicker(getActivity(), true); int px = ControlHelper.dpToPx(16, getResources()); gallery.setDefaultPreview(true); gallery.setPadding(px, 0, px, 0); gallery.post(new Runnable() { @Override public void run() { gallery.restoreImages(new ArrayList<>(mAttaches.keySet())); } }); mAttributes.addView(gallery); } }
From source file:com.aniruddhc.acemusic.player.Drawers.QueueDrawerFragment.java
/** * Initializes the drag sort list view.//from w w w . ja v a2s .c o m * * @param initViewParams Pass true if the ListView is being * initialized for the very first time * (dividers, background colors and other * layout settings will be applied). Pass * false if the list just needs to be updated * with the current song. */ private void initListViewAdapter(boolean initViewParams) { if (initViewParams) { //Reset the initialization flag. mInitListViewParams = false; if (mApp.getCurrentTheme() == Common.DARK_THEME) { mListView.setDivider(mContext.getResources().getDrawable(R.drawable.list_divider)); } else { mListView.setDivider(mContext.getResources().getDrawable(R.drawable.list_divider_light)); } mListView.setDividerHeight(1); mListView.setFastScrollEnabled(true); //KitKat ListView margins. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { //Calculate navigation bar height. int navigationBarHeight = 0; int resourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { navigationBarHeight = getResources().getDimensionPixelSize(resourceId); } mListView.setClipToPadding(false); mListView.setPadding(0, 0, 0, navigationBarHeight); } } mListViewAdapter = new QueueDrawerAdapter(mContext, mApp.getService().getPlaybackIndecesList()); mListView.setAdapter(mListViewAdapter); mListView.setOnItemClickListener(onClick); mListView.setDropListener(onDrop); mListView.setRemoveListener(onRemove); SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(mListView); simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT); mListView.setFloatViewManager(simpleFloatViewManager); mListView.setVisibility(View.VISIBLE); mEmptyInfoText.setVisibility(View.INVISIBLE); /* * If the drawer is open, the user is probably scrolling through * the list already, so don't move the list to the new position. */ if (!isDrawerOpen()) mListView.setSelection(mApp.getService().getCurrentSongIndex()); }
From source file:com.nbplus.hybrid.BasicWebViewClient.java
public void setBackgroundResource(int resId) { mWebView.setBackgroundColor(Color.TRANSPARENT); mWebView.setBackgroundResource(resId); }