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.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager.java
@ReactProp(name = "progressBackgroundColor", defaultInt = Color.TRANSPARENT, customType = "Color") public void setProgressBackgroundColor(ReactSwipeRefreshLayout view, int color) { view.setProgressBackgroundColorSchemeColor(color); }
From source file:com.parse.f8.view.MapsActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); final ActionBar actionBar = getSupportActionBar(); actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); mapsViewPager = (ViewPager) findViewById(R.id.pager); mapsPagerAdapter = new MapsPagerAdapter(getSupportFragmentManager()); mapsViewPager.setAdapter(mapsPagerAdapter); mapsViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override/*from ww w . j a va 2 s .c om*/ public void onPageSelected(int position) { actionBar.setSelectedNavigationItem(position); } }); // Add a tab to the action bar for each subsection for (int i = 0; i < mapsPagerAdapter.getCount(); i++) { actionBar.addTab(actionBar.newTab().setText(mapsPagerAdapter.getPageTitle(i)).setTabListener(this)); } }
From source file:com.bt.heliniumstudentapp.LoginActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); loginContext = this; getWindow().getDecorView().setBackgroundResource(R.color.indigo); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.indigo)); setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.app_name), BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher), ContextCompat.getColor(this, R.color.indigo))); }//w ww . ja v a 2 s. c o m usernameET = (EditText) findViewById(R.id.et_username_la); passwordET = (EditText) findViewById(R.id.et_password_la); final Button loginBtn = (Button) findViewById(R.id.btn_login_la); usernameET.setText(PreferenceManager.getDefaultSharedPreferences(this).getString("username", "")); usernameET.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { loginBtn.setEnabled((usernameET.length() != 0 && passwordET.length() != 0)); } public void afterTextChanged(Editable s) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } }); passwordET.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { loginBtn.setEnabled((usernameET.length() != 0 && passwordET.length() != 0)); } public void afterTextChanged(Editable s) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } }); View.OnClickListener login = new View.OnClickListener() { @Override public void onClick(View v) { refresh(); } }; loginBtn.setOnClickListener(login); }
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}. */// ww w . j ava2s . c om 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) { if (imagePath != null) { Log.w("Helper", "Cannot decode " + imagePath); } else { Log.w("Helper", "Path is null: Cannot decode"); } return null; } if (image.getWidth() != width || image.getHeight() != height) { //Image need to be resized. int scaledWidth = (image.getWidth() * height) / image.getHeight(); int scaledHeight; if ((crop && scaledWidth > width) || (!crop && scaledWidth < width)) { scaledHeight = height; } else { scaledWidth = width; scaledHeight = (image.getHeight() * width) / image.getWidth(); } 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.linkedin.android.eventsapp.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); pager = new ViewPager(this); pager.setId(R.id.pager);/*from w w w .j av a 2 s. co m*/ pager.setOffscreenPageLimit(5); setContentView(pager); final ActionBar bar = getActionBar(); View viewActionBar = getLayoutInflater().inflate(R.layout.layout_action_bar, null); TextView textviewTitle = (TextView) viewActionBar.findViewById(R.id.actionbar_textview); ActionBar.LayoutParams params = new ActionBar.LayoutParams(ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.MATCH_PARENT, Gravity.CENTER); textviewTitle.setText("UPCOMING EVENTS"); bar.setCustomView(viewActionBar, params); bar.setDisplayShowCustomEnabled(true); bar.setDisplayShowTitleEnabled(false); bar.setIcon(new ColorDrawable(Color.TRANSPARENT)); bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#F15153"))); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); mEventTabsAdapter = new com.linkedin.android.eventsapp.EventTabsAdapter(this, pager); SimpleDateFormat ft = new SimpleDateFormat("E dd MMM"); ArrayList<Event> events = EventsManager.getInstance(this).getEvents(); for (Event event : events) { String eventDay = ft.format(new Date(event.getEventDate())); mEventTabsAdapter.addTab(bar.newTab().setText(eventDay), EventFragment.class, event); } }
From source file:com.parse.f8.other.ScheduleActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); scheduleSectionsPagerAdapter = new ScheduleSectionsPagerAdapter(getSupportFragmentManager()); setContentView(R.layout.activity_schedule); actionBar = getSupportActionBar();/* w w w. ja v a2s . c om*/ actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); sectionsViewPager = (ViewPager) findViewById(R.id.schedule_pager); sectionsViewPager.setAdapter(scheduleSectionsPagerAdapter); sectionsViewPager.setOffscreenPageLimit(TRIM_MEMORY_RUNNING_MODERATE); sectionsViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { actionBar.setSelectedNavigationItem(position); } }); // Add a tab to the action bar for each subsection for (int i = 0; i < scheduleSectionsPagerAdapter.getCount(); i++) { ActionBar.Tab scheduleTab = actionBar.newTab().setIcon(scheduleSectionsPagerAdapter.getPageIcon(i)) .setTabListener(this); scheduleTab.getIcon().setAlpha(80); actionBar.addTab(scheduleTab); } }
From source file:com.myfuture.view.ScheduleActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); scheduleSectionsPagerAdapter = new ScheduleSectionsPagerAdapter(getSupportFragmentManager()); setContentView(R.layout.activity_schedule); actionBar = getSupportActionBar();/*from w ww.j a va 2 s. c o m*/ actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); sectionsViewPager = (ViewPager) findViewById(R.id.schedule_pager); sectionsViewPager.setAdapter(scheduleSectionsPagerAdapter); sectionsViewPager.setOffscreenPageLimit(TRIM_MEMORY_RUNNING_MODERATE); sectionsViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { actionBar.setSelectedNavigationItem(position); } }); // Add a tab to the action bar for each subsection for (int i = 0; i < scheduleSectionsPagerAdapter.getCount(); i++) { ActionBar.Tab scheduleTab = actionBar.newTab().setIcon(scheduleSectionsPagerAdapter.getPageIcon(i)) .setTabListener(this); scheduleTab.getIcon().setAlpha(80); actionBar.addTab(scheduleTab); } }
From source file:com.fjn.magazinereturncandidate.fragments.ProductDetailFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { formatCommon = new FormatCommon(); registerLicenseCommon = new RegisterLicenseCommon(); checkDataCommon = new CheckDataCommon(); //Init custom product detail layout View rootView = inflater.inflate(R.layout.fragment_product_detail, container, false); if (getDialog().getWindow() != null) { getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); }/*from w w w. ja v a 2s. co m*/ //Get Id textview Product detail TextView txv_jan_cd = (TextView) rootView.findViewById(R.id.txv_jan_cd); TextView txv_group1_name = (TextView) rootView.findViewById(R.id.txv_group1_name); TextView txv_group2_name = (TextView) rootView.findViewById(R.id.txv_group2_name); TextView txv_product_name = (TextView) rootView.findViewById(R.id.txv_product_name); TextView txv_writer_name = (TextView) rootView.findViewById(R.id.txv_writer_name); TextView txv_publisher_name = (TextView) rootView.findViewById(R.id.txv_publisher_name); TextView txv_publish_date = (TextView) rootView.findViewById(R.id.txv_publish_date); TextView txv_price = (TextView) rootView.findViewById(R.id.txv_price); txv_inventory_number = (TextView) rootView.findViewById(R.id.txv_inventory_number); TextView txv_first_supply_date = (TextView) rootView.findViewById(R.id.txv_first_supply_date); TextView txv_last_supply_date = (TextView) rootView.findViewById(R.id.txv_last_supply_date); TextView txv_last_sales_date = (TextView) rootView.findViewById(R.id.txv_last_sales_date); TextView txv_last_order_date = (TextView) rootView.findViewById(R.id.txv_last_order_date); TextView txv_year_rank = (TextView) rootView.findViewById(R.id.txv_year_rank); //TextView txv_joubi = (TextView) rootView.findViewById(R.id.txv_joubi); TextView txv_total_sales = (TextView) rootView.findViewById(R.id.txv_total_sales); TextView txv_total_supply = (TextView) rootView.findViewById(R.id.txv_total_supply); TextView txv_total_return = (TextView) rootView.findViewById(R.id.txv_total_return); TextView txv_location_id = (TextView) rootView.findViewById(R.id.txv_location_id); Button btn_submit_edit = (Button) rootView.findViewById(R.id.btn_submit_edit); Bundle bundle = getArguments(); if (bundle != null) { //Show year_rank String valueYearRank = bundle.getString(Constants.COLUMN_YEAR_RANK); String showYearRank; if (Constants.VALUE_MAX_YEAR_RANK.equals(valueYearRank)) { showYearRank = Constants.SHOW_MAX_YEAR_RANK; } else { showYearRank = String.format("%s?/%s", formatCommon.formatMoney(valueYearRank), formatCommon.formatMoney(String.valueOf(bundle.getInt(Constants.COLUMN_MAX_YEAR_RANK)))); } //Get bundle janCode String janCode = bundle.getString(Constants.COLUMN_JAN_CD); int lenJanCode = 0; String janCodeResult = ""; if (janCode != null) { lenJanCode = janCode.length(); janCodeResult = janCode.substring(0, lenJanCode - 5); } if (lenJanCode != Constants.JAN_18_CHAR) { janCodeResult = janCode; } txv_jan_cd.setText(janCodeResult); txv_group1_name.setText(bundle.getString(Constants.COLUMN_MEDIA_GROUP1_NAME)); txv_group2_name.setText(bundle.getString(Constants.COLUMN_MEDIA_GROUP2_NAME)); txv_product_name.setText(bundle.getString(Constants.COLUMN_GOODS_NAME)); txv_writer_name.setText(bundle.getString(Constants.COLUMN_WRITER_NAME)); txv_publisher_name.setText(bundle.getString(Constants.COLUMN_PUBLISHER_NAME)); txv_publish_date.setText( formatCommon.formatDate(bundle.getString(Constants.COLUMN_SALES_DATE, Constants.BLANK))); if (Constants.BLANK.equals(bundle.getString(Constants.COLUMN_PRICE))) { txv_price.setText(Constants.BLANK); } else { txv_price.setText(String.format("%s%s", Constants.SYMBOL, formatCommon.formatMoney((bundle.getString(Constants.COLUMN_PRICE))))); } if (bundle.getString(Constants.COLUMN_STOCK_COUNT) == null) { txv_inventory_number.setText(""); txv_inventory_number.append(Constants.BLANK); //focus end text } else { txv_inventory_number.setText(""); txv_inventory_number .append(formatCommon.formatMoney(bundle.getString(Constants.COLUMN_STOCK_COUNT)));//focus end text } txv_first_supply_date.setText( formatCommon.formatDate(bundle.getString(Constants.COLUMN_FIRST_SUPPLY_DATE, Constants.BLANK))); txv_last_supply_date.setText( formatCommon.formatDate(bundle.getString(Constants.COLUMN_LAST_SUPPLY_DATE, Constants.BLANK))); txv_last_sales_date.setText( formatCommon.formatDate(bundle.getString(Constants.COLUMN_LAST_SALES_DATE, Constants.BLANK))); txv_last_order_date.setText( formatCommon.formatDate(bundle.getString(Constants.COLUMN_LAST_ORDER_DATE, Constants.BLANK))); txv_year_rank.setText(showYearRank); //txv_joubi.setText(formatJoubi(bundle.getString(Constants.COLUMN_JOUBI))); txv_total_sales.setText(formatCommon.formatMoney(bundle.getString(Constants.COLUMN_TOTAL_SALES))); txv_total_supply.setText(formatCommon.formatMoney(bundle.getString(Constants.COLUMN_TOTAL_SUPPLY))); txv_total_return.setText(formatCommon.formatMoney(bundle.getString(Constants.COLUMN_TOTAL_RETURN))); txv_location_id.setText(bundle.getString(Constants.COLUMN_LOCATION_ID)); //get position positionEdit = bundle.getInt(Constants.POSITION_EDIT_PRODUCT); //get flag OCR flagSwitchOCR = getArguments().getString(Constants.FLAG_SWITCH_OCR); } loadItems(); // Set adapter for combo box with array ArrayAdapter<String> adapter1 = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, arr); // Set item selected adapter1.setDropDownViewResource(android.R.layout.simple_list_item_single_choice); // Set button click btn_submit_edit.setOnClickListener(this); hsmDecoder = HSMDecoder.getInstance(getActivity()); return rootView; }
From source file:appocorrencias.com.appocorrencias.Activitys.DelayedProgressDialog.java
@Override public void onStart() { super.onStart(); mProgressBar = (ProgressBar) getDialog().findViewById(R.id.progress); if (getDialog().getWindow() != null) { int px = (int) (PROGRESS_CONTENT_SIZE_DP * getResources().getDisplayMetrics().density); getDialog().getWindow().setLayout(px, px); getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); }//from www. jav a2 s.c om }
From source file:com.appeaser.sublimepickerlibrary.utilities.SUtils.java
public static void initializeResources(Context context) { TypedArray a = context.obtainStyledAttributes(new int[] { R.attr.colorAccent, R.attr.colorControlHighlight, R.attr.colorControlActivated, R.attr.colorButtonNormal, android.R.attr.textColorPrimary, android.R.attr.textColorPrimaryInverse, R.attr.colorPrimary, R.attr.colorPrimaryDark, android.R.attr.textColorSecondary, android.R.attr.colorBackground, android.R.attr.textColorSecondaryInverse }); if (a.hasValue(0)) COLOR_ACCENT = a.getColor(0, Color.TRANSPARENT); if (a.hasValue(1)) COLOR_CONTROL_HIGHLIGHT = a.getColor(1, Color.TRANSPARENT); if (a.hasValue(2)) COLOR_CONTROL_ACTIVATED = a.getColor(2, Color.TRANSPARENT); if (a.hasValue(3)) COLOR_BUTTON_NORMAL = a.getColor(3, Color.TRANSPARENT); if (a.hasValue(4)) COLOR_TEXT_PRIMARY = a.getColor(4, Color.TRANSPARENT); if (a.hasValue(5)) COLOR_TEXT_PRIMARY_INVERSE = a.getColor(5, Color.TRANSPARENT); if (a.hasValue(6)) COLOR_PRIMARY = a.getColor(6, Color.TRANSPARENT); if (a.hasValue(7)) COLOR_PRIMARY_DARK = a.getColor(7, Color.TRANSPARENT); if (a.hasValue(8)) COLOR_TEXT_SECONDARY = a.getColor(8, Color.TRANSPARENT); if (a.hasValue(9)) COLOR_BACKGROUND = a.getColor(9, Color.TRANSPARENT); if (a.hasValue(10)) COLOR_TEXT_SECONDARY_INVERSE = a.getColor(10, Color.TRANSPARENT); a.recycle();/* ww w .j a va 2 s . co m*/ CORNER_RADIUS = context.getResources().getDimensionPixelSize(R.dimen.control_corner_material); if (Config.DEBUG) { Log.i(TAG, "COLOR_ACCENT: " + Integer.toHexString(COLOR_ACCENT)); Log.i(TAG, "COLOR_CONTROL_HIGHLIGHT: " + Integer.toHexString(COLOR_CONTROL_HIGHLIGHT)); Log.i(TAG, "COLOR_CONTROL_ACTIVATED: " + Integer.toHexString(COLOR_CONTROL_ACTIVATED)); Log.i(TAG, "COLOR_BUTTON_NORMAL: " + Integer.toHexString(COLOR_BUTTON_NORMAL)); Log.i(TAG, "COLOR_TEXT_PRIMARY: " + Integer.toHexString(COLOR_TEXT_PRIMARY)); Log.i(TAG, "COLOR_TEXT_PRIMARY_INVERSE: " + Integer.toHexString(COLOR_TEXT_PRIMARY_INVERSE)); Log.i(TAG, "COLOR_PRIMARY: " + Integer.toHexString(COLOR_PRIMARY)); Log.i(TAG, "COLOR_PRIMARY_DARK: " + Integer.toHexString(COLOR_PRIMARY_DARK)); Log.i(TAG, "COLOR_TEXT_SECONDARY: " + Integer.toHexString(COLOR_TEXT_SECONDARY)); Log.i(TAG, "COLOR_BACKGROUND: " + Integer.toHexString(COLOR_BACKGROUND)); Log.i(TAG, "COLOR_TEXT_SECONDARY_INVERSE: " + Integer.toHexString(COLOR_TEXT_SECONDARY_INVERSE)); } }