List of usage examples for android.graphics Color BLACK
int BLACK
To view the source code for android.graphics Color BLACK.
Click Source Link
From source file:com.mbientlab.metawear.app.CustomFragment.java
@Override protected void resetData(boolean clearData) { dataSet.clear();/* www .ja v a 2 s .c o m*/ showLog("Called resetData"); if (clearData) { sampleCount = 0; chartXValues.clear(); x0.clear(); x1.clear(); x2.clear(); x3.clear(); } ArrayList<LineDataSet> spinAxisData = new ArrayList<>(); spinAxisData.add(new LineDataSet(x0, srcIndex == 0 ? "w" : "heading")); spinAxisData.get(0).setColor(Color.BLACK); spinAxisData.get(0).setDrawCircles(false); spinAxisData.add(new LineDataSet(x1, srcIndex == 0 ? "x" : "pitch")); spinAxisData.get(1).setColor(Color.RED); spinAxisData.get(1).setDrawCircles(false); spinAxisData.add(new LineDataSet(x2, srcIndex == 0 ? "y" : "roll")); spinAxisData.get(2).setColor(Color.GREEN); spinAxisData.get(2).setDrawCircles(false); spinAxisData.add(new LineDataSet(x3, srcIndex == 0 ? "z" : "yaw")); spinAxisData.get(3).setColor(Color.BLUE); spinAxisData.get(3).setDrawCircles(false); LineData data = new LineData(chartXValues); for (LineDataSet set : spinAxisData) { data.addDataSet(set); } data.setDrawValues(false); chart.setData(data); }
From source file:com.makotojava.android.debate.PolicySpeechFragment.java
private SpeechCountDownTimerWithAlarm createNegPrepCountDownTimer(final long durationInMillis) { Log.i(TAG, "Creating Negative Prep Timer..."); SpeechCountDownTimerWithAlarm ret = new SpeechCountDownTimerWithAlarm(durationInMillis, getCountdownInterval(), new SpeechCountDownTimerCallback() { //private static final long serialVersionUID = 1L; @Override/*from w w w .ja va 2s. c o m*/ public void update(long millisUntilFinished) { updateTimerTextView(_negativePrepTimerTextView, millisUntilFinished); getPolicySpeechSingleton().setNegativePrepRemainingTime(millisUntilFinished); // Animate the timer when < 1 minute to go if (getSystemOptions().animateWhenTimerBelowThreshold()) { if (millisUntilFinished < NUMBER_OF_MILLIS_IN_ONE_MINUTE) { if (((millisUntilFinished / 1000) % 60 % 2) == 0) _negativePrepTimerTextView.setTextColor(Color.RED); else _negativePrepTimerTextView.setTextColor(Color.BLACK); } } } @Override public void done() { Log.i(TAG, "Negative Prep Timer is done!"); getPolicySpeechSingleton().setNegativePrepRemainingTime(0); getNegativePrepTimer().exhaust(); if (getSystemOptions().notifyAtTimerExpiration()) { getNegativePrepTimer().playNotification(getActivity()); } _negativePrepTimerTextView.setTextColor(Color.RED); manageState(); } }); return ret; }
From source file:com.eurotong.orderhelperandroid.OrderMenuActivity.java
void SetStyleForOrderedMenu(VMMenulistOrder menu, TextView textViewOrderCount) { if (menu.OrderCount > 0) { textViewOrderCount.setTextColor(Color.RED); //textViewOrderCount.setTextSize((float) (textCountSize*1.5)); //textViewOrderCount.setTextSize((float) (textCountSize)); textViewOrderCount.setTypeface(null, Typeface.BOLD); } else {//from w w w .j a va 2s .c om textViewOrderCount.setTextColor(Color.BLACK); //textViewOrderCount.setTextSize((float) (textCountSize)); textViewOrderCount.setTypeface(null, Typeface.NORMAL); } }
From source file:net.phase.wallet.Currency.java
@Override public View getView(int position, View convertView, ViewGroup parent) { double exchrate = Currency.getRate(context.getActiveCurrency()); LayoutInflater inflater = LayoutInflater.from(context); View v = inflater.inflate(R.layout.walletlayout, null); v.setLongClickable(true);//from w w w . j av a 2 s . co m v.setOnClickListener(context); v.setTag(position); DecimalFormat df = new DecimalFormat(WalletActivity.decimalString(decimalpoints)); TextView balanceTextView = (TextView) v.findViewById(R.id.walletBalanceText); balanceTextView.setText(df.format(wallets[position].balance / BalanceRetriever.SATOSHIS_PER_BITCOIN)); TextView curTextView = (TextView) v.findViewById(R.id.walletCurText); curTextView.setTextSize(10); if (exchrate != 0) { curTextView.setText( "(" + df.format(wallets[position].balance * exchrate / BalanceRetriever.SATOSHIS_PER_BITCOIN) + context.getActiveCurrency() + ")"); } else { curTextView.setText(""); } balanceTextView.setTextSize(20); balanceTextView.setTextColor(Color.GREEN); TextView nameTextView = (TextView) v.findViewById(R.id.walletNameText); nameTextView.setText(wallets[position].name); nameTextView.setTextColor(Color.BLACK); nameTextView.setTextSize(16); TextView lastUpdatedTextView = (TextView) v.findViewById(R.id.lastUpdatedText); lastUpdatedTextView.setTextColor(Color.GRAY); lastUpdatedTextView.setTextSize(8); lastUpdatedTextView.setText("Last Updated: " + getTimeStampString(wallets[position].lastUpdated)); TextView infoTextView = (TextView) v.findViewById(R.id.infoText); infoTextView.setTextColor(Color.GRAY); infoTextView.setTextSize(8); infoTextView.setText( wallets[position].keys.length + " keys (" + wallets[position].getActiveKeyCount() + " in use)"); TextView txLastUpdatedTextView = (TextView) v.findViewById(R.id.txLastUpdatedText); txLastUpdatedTextView.setTextColor(Color.GRAY); txLastUpdatedTextView.setTextSize(8); TextView txInfoTextView = (TextView) v.findViewById(R.id.txInfoText); txInfoTextView.setTextColor(Color.GRAY); txInfoTextView.setTextSize(8); if (wallets[position].transactions != null && wallets[position].transactions.length > 0) { txLastUpdatedTextView.setText( "Last Transaction: " + getTimeStampString(Transaction.latest(wallets[position].transactions))); txInfoTextView.setText(wallets[position].transactions.length + " transactions (" + Transaction.compressTransactions(wallets[position].transactions).length + " unique)"); } else { txLastUpdatedTextView.setText(""); txInfoTextView.setText(""); } Button button = (Button) v.findViewById(R.id.updateButton); button.setTag(position); button.setOnClickListener(context); return v; }
From source file:com.mobicage.rogerthat.plugins.friends.ServiceActionMenuActivity.java
private void populateScreen(final ServiceMenu menu) { menuBrandingHash = menu.branding;//from ww w . j av a 2 s. co m final FriendsPlugin friendsPlugin = mService.getPlugin(FriendsPlugin.class); final MessagingPlugin messagingPlugin = mService.getPlugin(MessagingPlugin.class); final FriendStore store = friendsPlugin.getStore(); List<Cell> usedCells = new ArrayList<Cell>(); if (page == 0) { addAboutHandler(usedCells, menu.aboutLabel); addHistoryHandler(usedCells, store, menu.messagesLabel); addCallHandler(menu, usedCells, menu.callLabel); if (CloudConstants.isYSAAA()) { addScanHandler(menu, usedCells, null); } else { addShareHandler(menu, usedCells, menu.shareLabel); } } boolean[] rows = new boolean[] { false, false, false }; if (page == 0) rows[0] = true; for (final ServiceMenuItem item : menu.itemList) { rows[(int) item.coords[1]] = true; final Cell cell = cells[(int) item.coords[0]][(int) item.coords[1]]; View.OnClickListener onClickListener = new SafeViewOnClickListener() { @Override public void safeOnClick(View v) { pressMenuItem(menu, messagingPlugin, store, item); } }; ((View) cell.icon.getParent()).setOnClickListener(onClickListener); cell.icon.setImageBitmap(BitmapFactory.decodeByteArray(item.icon, 0, item.icon.length)); cell.icon.setVisibility(View.VISIBLE); cell.label.setText(item.label); cell.label.setVisibility(View.VISIBLE); usedCells.add(cell); } for (int i = 2; i >= 0; i--) { if (rows[i]) break; tableRows[i].setVisibility(View.GONE); } boolean showBranded = false; boolean useDarkScheme = false; Integer menuItemColor = null; if (menu.branding != null) { try { BrandingMgr brandingMgr = messagingPlugin.getBrandingMgr(); Friend friend = store.getExistingFriend(email); if (brandingMgr.isBrandingAvailable(menu.branding)) { BrandingResult br = brandingMgr.prepareBranding(menu.branding, friend, false); WebSettings settings = branding.getSettings(); settings.setJavaScriptEnabled(false); settings.setBlockNetworkImage(false); branding.setVisibility(View.VISIBLE); branding.setVerticalScrollBarEnabled(false); final int displayWidth = UIUtils.getDisplayWidth(this); final int calculatedHeight = BrandingMgr.calculateHeight(br, displayWidth); final long start = System.currentTimeMillis(); branding.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() { @Override public boolean onPreDraw() { int height = branding.getMeasuredHeight(); if (height > calculatedHeight * 90 / 100 || System.currentTimeMillis() - start > 3000) { if (calculatedHeight > 0) { setBrandingHeight(height); } else { mService.postDelayedOnUIHandler(new SafeRunnable() { @Override protected void safeRun() throws Exception { setBrandingHeight(branding.getMeasuredHeight()); } }, 100); } branding.getViewTreeObserver().removeOnPreDrawListener(this); } return false; } }); branding.loadUrl("file://" + br.file.getAbsolutePath()); if (br.color != null) { branding.setBackgroundColor(br.color); activity.setBackgroundColor(br.color); } if (br.scheme == ColorScheme.dark) { for (Cell cell : usedCells) { cell.label.setTextColor(darkSchemeTextColor); cell.label.setShadowLayer(2, 1, 1, Color.BLACK); } useDarkScheme = true; } menuItemColor = br.menuItemColor; final ImageView watermarkView = (ImageView) findViewById(R.id.watermark); if (br.watermark != null) { BitmapDrawable watermark = new BitmapDrawable(getResources(), BitmapFactory.decodeFile(br.watermark.getAbsolutePath())); watermark.setGravity(Gravity.BOTTOM | Gravity.RIGHT); watermarkView.setImageDrawable(watermark); final LayoutParams layoutParams = watermarkView.getLayoutParams(); layoutParams.width = layoutParams.height = displayWidth; } else { watermarkView.setImageDrawable(null); } showBranded = true; } else { friend.actionMenu = menu; friend.actionMenu.items = menu.itemList.toArray(new ServiceMenuItemTO[] {}); brandingMgr.queue(friend); } } catch (BrandingFailureException e) { L.bug("Could not display service action menu with branding.", e); } } if (!showBranded) { setNavigationBarVisible(AppConstants.SHOW_NAV_HEADER); setNavigationBarTitle(menu.name); title.setVisibility(View.GONE); title.setText(menu.name); } for (final Cell cell : usedCells) { final View p = (View) cell.icon.getParent(); final Drawable d = getResources().getDrawable( useDarkScheme ? R.drawable.mc_smi_background_light : R.drawable.mc_smi_background_dark); p.setBackgroundDrawable(d); } if (menuItemColor == null) menuItemColor = Color.parseColor("#646464"); for (Cell cell : new Cell[] { cells[0][0], cells[1][0], cells[2][0], cells[3][0] }) cell.faIcon.setTextColor(menuItemColor); if (menu.maxPage > 0) { for (int i = 0; i <= menu.maxPage; i++) { ImageView bolleke = (ImageView) getLayoutInflater().inflate(R.layout.page, pages, false); if (page == i) { if (useDarkScheme) { bolleke.setImageResource(R.drawable.current_page_dark); } else { bolleke.setImageResource(R.drawable.current_page_light); } } else { if (useDarkScheme) { bolleke.setImageResource(R.drawable.other_page_dark); } else { bolleke.setImageResource(R.drawable.other_page_light); } } pages.addView(bolleke); } pages.setVisibility(View.VISIBLE); } final int leftPage = page - 1; final int rightPage = page + 1; final String service = email; Slider instance = new Slider(this, this, page == menu.maxPage ? null : new Slider.Swiper() { @Override public Intent onSwipe() { return new Intent(ServiceActionMenuActivity.this, ServiceActionMenuActivity.class) .putExtra(SERVICE_EMAIL, service).putExtra(MENU_PAGE, rightPage); } }, page == 0 ? null : new Slider.Swiper() { @Override public Intent onSwipe() { return new Intent(ServiceActionMenuActivity.this, ServiceActionMenuActivity.class) .putExtra(SERVICE_EMAIL, service).putExtra(MENU_PAGE, leftPage); } }); mGestureScanner = new GestureDetector(this, instance); }
From source file:com.htc.dotdesign.DrawingView.java
private Bitmap handlePicture() { Paint paint = new Paint(); Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); int[][] mCloneArray = new int[mRowSize][mColSize]; float left = 0; float top = 0; float right = sDotPixelWidth; float bottom = sDotPixelHeight; for (int row = 0; row < mRowSize; ++row) { for (int col = 0; col < mColSize; ++col) { if (mImgDotMatrix[row][col] == Color.TRANSPARENT) { mCloneArray[row][col] = Color.BLACK; } else { mCloneArray[row][col] = mImgDotMatrix[row][col]; }//from www . j a va 2s. c o m paint.setColor(mCloneArray[row][col]); canvas.drawRect(left, top, right, bottom, paint); left += sDotPixelWidth; right += sDotPixelWidth; } left = 0; right = sDotPixelWidth; top += sDotPixelHeight; bottom += sDotPixelHeight; } return bitmap; }
From source file:cl.gisred.android.MicroMedidaActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LicenseResult licenseResult = ArcGISRuntime.setClientId(CLIENT_ID); LicenseLevel licenseLevel = ArcGISRuntime.License.getLicenseLevel(); if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.BASIC) { //Toast.makeText(getApplicationContext(), "Licencia bsica vlida", Toast.LENGTH_SHORT).show(); } else if (licenseResult == LicenseResult.VALID && licenseLevel == LicenseLevel.STANDARD) { //Toast.makeText(getApplicationContext(), "Licencia standard vlida", Toast.LENGTH_SHORT).show(); }/*w ww. ja v a2 s .c o m*/ setContentView(R.layout.activity_micro); Toolbar toolbar = (Toolbar) findViewById(R.id.apptool); setSupportActionBar(toolbar); /*Get Credenciales String*/ Bundle bundle = getIntent().getExtras(); usuar = bundle.getString("usuario"); passw = bundle.getString("password"); modulo = bundle.getString("modulo"); empresa = bundle.getString("empresa"); //Set Credenciales setCredenciales(usuar, passw); //Set Mapa setMap(R.id.map, 0xffffff, 0xffffff, 10, 10, false, true); choices = 0; if (Build.VERSION.SDK_INT >= 23) verifPermisos(); else initGeoposition(); setLayersURL(this.getResources().getString(R.string.url_Mapabase), "MAPABASE"); setLayersURL(this.getResources().getString(R.string.url_token), "TOKENSRV"); setLayersURL(this.getResources().getString(R.string.url_EquiposLinea), "EQUIPOS_LINEA"); setLayersURL(this.getResources().getString(R.string.url_TRAMOS), "TRAMOS"); setLayersURL(this.getResources().getString(R.string.url_EquiposPTO), "EQUIPOS_PTO"); setLayersURL(this.getResources().getString(R.string.url_Nodos), "NODOS"); setLayersURL(this.getResources().getString(R.string.url_Luminarias), "LUMINARIAS"); setLayersURL(this.getResources().getString(R.string.url_Clientes), "CLIENTES"); setLayersURL(this.getResources().getString(R.string.url_Concesiones), "CONCESIONES"); setLayersURL(this.getResources().getString(R.string.url_Direcciones), "DIRECCIONES"); setLayersURL(this.getResources().getString(R.string.url_medidores), "MEDIDORES"); setLayersURL(this.getResources().getString(R.string.url_Stx), "STX"); setLayersURL(this.getResources().getString(R.string.url_ECSE_varios), "ECSE"); setLayersURL(this.getResources().getString(R.string.url_Electrodependientes), "ELECTRODEP"); //Agrega layers dinmicos. addLayersToMap(credenciales, "DYNAMIC", "MAPABASECHQ", din_urlMapaBase, null, true); addLayersToMap(credenciales, "DYNAMIC", "SED", din_urlEquiposPunto, null, true); addLayersToMap(credenciales, "DYNAMIC", "SSEE", din_urlEquiposPunto, null, false); addLayersToMap(credenciales, "DYNAMIC", "SALIDAALIM", din_urlEquiposPunto, null, false); addLayersToMap(credenciales, "DYNAMIC", "REDMT", din_urlTramos, null, false); addLayersToMap(credenciales, "DYNAMIC", "REDBT", din_urlTramos, null, true); addLayersToMap(credenciales, "DYNAMIC", "REDAP", din_urlTramos, null, false); addLayersToMap(credenciales, "DYNAMIC", "POSTES", din_urlNodos, null, true); addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_LINEA", din_urlEquiposLinea, null, false); addLayersToMap(credenciales, "DYNAMIC", "EQUIPOS_PTO", din_urlEquiposPunto, null, false); addLayersToMap(credenciales, "DYNAMIC", "LUMINARIAS", din_urlLuminarias, null, false); addLayersToMap(credenciales, "DYNAMIC", "CLIENTES", din_urlClientes, null, false); addLayersToMap(credenciales, "DYNAMIC", "MEDIDORES", din_urlMedidores, null, false); addLayersToMap(credenciales, "DYNAMIC", "CONCESIONES", din_urlConcesiones, null, false); addLayersToMap(credenciales, "DYNAMIC", "DIRECCIONES", din_urlDirecciones, null, false); addLayersToMap(credenciales, "DYNAMIC", "EMPALMES", din_urlClientes, null, false); addLayersToMap(credenciales, "DYNAMIC", "REDSTX", din_urlStx, null, false); addLayersToMap(credenciales, "DYNAMIC", "TORRESSTX", din_urlStx, null, false); addLayersToMap(credenciales, "DYNAMIC", "ENCUESTADO", din_urlECSE, null, false); addLayersToMap(credenciales, "DYNAMIC", "REEMPLAZO", din_urlECSE, null, false); addLayersToMap(credenciales, "DYNAMIC", "ELECTRODEP", din_urlElectroDep, null, false); //Aade Layer al Mapa myMapView.addLayer(mRoadBaseMaps, 0); myMapView.addLayer(LySED, 1); myMapView.addLayer(LySSEE, 2); myMapView.addLayer(LySALIDAALIM, 3); myMapView.addLayer(LyPOSTES, 4); myMapView.addLayer(LyREDMT, 5); myMapView.addLayer(LyREDBT, 6); myMapView.addLayer(LyREDAP, 7); myMapView.addLayer(LyEQUIPOSLINEA, 8); myMapView.addLayer(LyEQUIPOSPTO, 9); myMapView.addLayer(LyLUMINARIAS, 10); myMapView.addLayer(LyCLIENTES, 11); myMapView.addLayer(LyMEDIDORES, 12); myMapView.addLayer(LyCONCESIONES, 13); myMapView.addLayer(LyDIRECCIONES, 14); myMapView.addLayer(LyEMPALMES, 15); myMapView.addLayer(LyREDSTX, 16); myMapView.addLayer(LyTORRESSTX, 17); myMapView.addLayer(LyENCUESTA, 18); myMapView.addLayer(LyREEMPLAZO, 19); myMapView.addLayer(LyELECTRODEP, 20); final FloatingActionButton btnGps = (FloatingActionButton) findViewById(R.id.action_gps); btnGps.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { alertNoGps(); } toogleGps(v); } }); btnGps.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Toast.makeText(getApplicationContext(), "Funcin Gps", Toast.LENGTH_SHORT).show(); return true; } }); final FloatingActionButton btnVerData = (FloatingActionButton) findViewById(R.id.action_ver_data); btnVerData.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { toogleData(v); } }); btnVerData.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Toast.makeText(getApplicationContext(), "Ver Datos", Toast.LENGTH_SHORT).show(); return true; } }); drawOk = new ShapeDrawable(new OvalShape()); drawOk.getPaint().setColor(getResources().getColor(R.color.colorPrimary)); drawNo = new ShapeDrawable(new OvalShape()); drawNo.getPaint().setColor(getResources().getColor(R.color.black_overlay)); menuMicroActions = (FloatingActionsMenu) findViewById(R.id.micro_actions); menuMultipleActions = (FloatingActionsMenu) findViewById(R.id.multiple_actions); fabShowDialog = (FloatingActionButton) findViewById(R.id.action_show_dialog); if (fabShowDialog != null) fabShowDialog.setVisibility(View.GONE); fabShowForm = (FloatingActionButton) findViewById(R.id.action_show_form); if (fabShowForm != null) fabShowForm.setVisibility(View.GONE); fabVerCapas = (FloatingActionButton) findViewById(R.id.action_ver_capa); if (fabVerCapas != null) fabVerCapas.setVisibility(View.GONE); fabNavRoute = (FloatingActionButton) findViewById(R.id.action_nav_route); if (fabNavRoute != null) { fabNavRoute.setVisibility(View.GONE); fabNavRoute.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (myMapView != null && myMapView.getCallout().isShowing()) { Point p = (Point) GeometryEngine.project(myMapView.getCallout().getCoordinates(), wm, egs); Util.QueryNavigation(MicroMedidaActivity.this, p); } } }); fabNavRoute.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Toast.makeText(getApplicationContext(), "Ir a Ruta", Toast.LENGTH_SHORT).show(); return true; } }); } if (modulo.replace(" ", "_").equals(modMicroMed)) { setLayersURL(this.getResources().getString(R.string.srv_MicroMed), "SRV_MICROMED"); setLayersURL(this.getResources().getString(R.string.srv_Postes), "SRV_POSTES"); setLayersURL(this.getResources().getString(R.string.srv_Direcciones), "SRV_DIRECCIONES"); setLayersURL(this.getResources().getString(R.string.srv_ZoneLimit), "SRV_ZONELIMIT"); addLayersToMap(credenciales, "FEATURE", "ADDMICROMED", srv_microMedida, null, true); addLayersToMap(credenciales, "FEATURE", "ADDPOSTE", srv_urlPostes, null, true); addLayersToMap(credenciales, "FEATURE", "ADDADDRESS", srv_urlDireccion, null, true); addLayersToMap(credenciales, "FEATURE", "ADDZONELIMIT", srv_zoneLimit, null, true); myMapView.addLayer(LyAddMicroMed, 21); myMapView.addLayer(LyAddPoste, 22); myMapView.addLayer(LyAddDireccion, 23); myMapView.addLayer(LyAddZoneLimit, 24); arrayfaseConex = getResources().getStringArray(R.array.fase_conexion_insp); arrayObservacion = getResources().getStringArray(R.array.observacion_mm); arrayMarcaMed = getResources().getStringArray(R.array.marca_mm); arrayEstado = getResources().getStringArray(R.array.estado_lectura); arrayWidgets = bundle.getStringArrayList("widgets"); arrayModulos = bundle.getStringArrayList("modulos"); formCrear = new Dialog(MicroMedidaActivity.this); fabShowForm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { bMapTap = false; bCallOut = false; myMapView.getCallout().hide(); if (oUbicacion != null) { btnUbicacion.setColorFilter(Color.BLACK); setEnabledDialog(true); } formCrear.show(); } }); FloatingActionButton oFabLimit = (FloatingActionButton) findViewById(R.id.action_limitezona); oFabLimit.setIconDrawable(drawOk); oFabLimit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { abrirFormLimite(v); } }); FloatingActionButton oFabForm = (FloatingActionButton) findViewById(R.id.action_form); oFabForm.setIconDrawable(drawOk); oFabForm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { abrirFormIngreso(v); } }); FloatingActionButton oFabDenuncio = (FloatingActionButton) findViewById(R.id.action_denuncio); oFabDenuncio.setIconDrawable(drawNo); oFabDenuncio.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //abrirFormDenuncio(v); Snackbar.make(v, "No tiene acceso a sta opcin", Snackbar.LENGTH_SHORT).show(); menuMicroActions.collapse(); } }); if (arrayModulos != null && arrayModulos.size() > 0 && arrayModulos.contains(empresa + "@" + modIngreso)) { arrayTipoPoste = getResources().getStringArray(R.array.tipo_poste); arrayTension = getResources().getStringArray(R.array.tipo_tension); arrayTipoEdif = getResources().getStringArray(R.array.tipo_edificacion); arrayMedidor = getResources().getStringArray(R.array.tipo_medidor); arrayEmpalme = getResources().getStringArray(R.array.tipo_empalme); arrayTecMedidor = getResources().getStringArray(R.array.tec_medidor); arrayTipoCnr = getResources().getStringArray(R.array.tipo_cnr); arrayTipoFase = getResources().getStringArray(R.array.fase_conexion); dialogCrear = new Dialog(MicroMedidaActivity.this); fabShowDialog.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { bMapTap = false; bCallOut = false; myMapView.getCallout().hide(); if (oUbicacion != null) { btnUbicacion.setColorFilter(Color.BLACK); setEnabledDialog(true); } dialogCrear.show(); if (mSeleccionLayer != null && myMapView.getLayerByID(mSeleccionLayer.getID()) != null) myMapView.removeLayer(mSeleccionLayer); } }); fabVerCapas.setVisibility(View.VISIBLE); fabVerCapas.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { toogleCapas(v); } }); fabVerCapas.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Toast.makeText(getApplicationContext(), "Ver Capas de Ingreso", Toast.LENGTH_SHORT).show(); return true; } }); final FloatingActionButton actionA = (FloatingActionButton) findViewById(R.id.action_a); final FloatingActionButton actionB = (FloatingActionButton) findViewById(R.id.action_b); final FloatingActionButton actionC = (FloatingActionButton) findViewById(R.id.action_c); final FloatingActionButton actionD = (FloatingActionButton) findViewById(R.id.action_d); setOpcion(actionA, null); setOpcion(actionB, null); setOpcion(actionC, modIngreso + "_TECNO"); setOpcion(actionD, modIngreso + "_CNR"); setLayersURL(this.getResources().getString(R.string.srv_Clientes), "SRV_CLIENTES"); setLayersURL(this.getResources().getString(R.string.srv_Union_012), "SRV_UNIONES"); setLayersURL(din_urlTramos, "TRAMOS"); setLayersURL(this.getResources().getString(R.string.url_Mapabase), "SRV_CALLES"); setLayersURL(this.getResources().getString(R.string.srv_ClientesCnr), "SRV_CLIENTESCNR"); addLayersToMap(credenciales, "FEATURE", "ADDCLIENTE", srv_urlClientes, null, true); addLayersToMap(credenciales, "FEATURE", "ADDUNION", srv_urlUnion012, null, true); addLayersToMap(credenciales, "FEATURE", "ASOCTRAMO", LyREDBT.getUrl(), null, false); addLayersToMap(credenciales, "FEATURE", "ASOCCALLE", srv_calles, null, false); addLayersToMap(credenciales, "FEATURE", "ADDCLIENTECNR", srv_urlClientesCnr, null, true); myMapView.addLayer(LyAddCliente, 25); myMapView.addLayer(LyAddUnion, 26); myMapView.addLayer(LyAsocTramo, 27); myMapView.addLayer(LyAsocCalle, 28); myMapView.addLayer(LyAddClienteCnr, 29); setLayerAddToggle(false); } else { bIngCliente = false; menuMultipleActions.setVisibility(View.GONE); //Informar al usuario que carece de permisos para ver y usar la capa de ingreso clientes comun } } else { menuMicroActions.setVisibility(View.GONE); } }
From source file:com.t2.androidspineexample.AndroidSpineExampleActivity.java
private void generateChart() { // Set up chart XYMultipleSeriesDataset deviceDataset = new XYMultipleSeriesDataset(); XYMultipleSeriesRenderer deviceRenderer = new XYMultipleSeriesRenderer(); LinearLayout layout = (LinearLayout) findViewById(R.id.deviceChart); if (mDeviceChartView != null) { layout.removeView(mDeviceChartView); }/*from www.ja va 2 s. co m*/ if (true) { mDeviceChartView = ChartFactory.getLineChartView(this, deviceDataset, deviceRenderer); mDeviceChartView.setBackgroundColor(Color.BLACK); layout.addView(mDeviceChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); } deviceRenderer.setShowLabels(false); deviceRenderer.setMargins(new int[] { 0, 5, 5, 0 }); deviceRenderer.setShowAxes(true); deviceRenderer.setShowLegend(false); deviceRenderer.setZoomEnabled(false, false); deviceRenderer.setPanEnabled(false, false); deviceRenderer.setYAxisMin(0); // deviceRenderer.setYAxisMax(1000); // This is set rather arbitrarily based on observed resistance values in the log deviceRenderer.setYAxisMax(8000000); deviceDataset.addSeries(mSeries); XYSeriesRenderer seriesRenderer = new XYSeriesRenderer(); seriesRenderer.setColor(Color.WHITE); seriesRenderer.setPointStyle(PointStyle.CIRCLE); deviceRenderer.addSeriesRenderer(seriesRenderer); }
From source file:ca.zadrox.dota2esportticker.ui.BaseActivity.java
protected void onActionBarAutoShowOrHide(boolean shown) { if (mStatusBarColorAnimator != null) { mStatusBarColorAnimator.cancel(); }// w w w .ja va 2 s. com mStatusBarColorAnimator = ObjectAnimator .ofInt((mDrawerLayout != null) ? mDrawerLayout : mLUtils, (mDrawerLayout != null) ? "statusBarBackgroundColor" : "statusBarColor", shown ? Color.BLACK : mNormalStatusBarColor, shown ? mNormalStatusBarColor : Color.BLACK) .setDuration(250); if (mDrawerLayout != null) { mStatusBarColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { ViewCompat.postInvalidateOnAnimation(mDrawerLayout); } }); } mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) { mStatusBarColorAnimator.start(); } updateSwipeRefreshProgressBarTop(); for (View view : mHideableHeaderViews) { if (shown) { view.animate().translationY(0).alpha(1).setDuration(HEADER_HIDE_ANIM_DURATION) .setInterpolator(new DecelerateInterpolator()); } else { view.animate().translationY(-UIUtils.calculateActionBarSize(this)).alpha(1) .setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator()); } } }
From source file:com.aujur.ebookreader.Configuration.java
public int getBackgroundColor() { return getProfileSetting(KEY_BACKGROUND, Color.WHITE, Color.BLACK); }