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.CloudRecognition.CloudReco.java
@Override public void onInitARDone(SampleApplicationException exception) { if (exception == null) { initApplicationAR();/*from w w w. j a v a2 s .c o m*/ // Now add the GL surface view. It is important // that the OpenGL ES surface view gets added // BEFORE the camera is started and video // background is configured. addContentView(mGlView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); // Start the camera: try { vuforiaAppSession.startAR(CameraDevice.CAMERA.CAMERA_DEFAULT); } catch (SampleApplicationException e) { Log.e(LOGTAG, e.getString()); } boolean result = CameraDevice.getInstance() .setFocusMode(CameraDevice.FOCUS_MODE.FOCUS_MODE_CONTINUOUSAUTO); if (result) mContAutofocus = true; else Log.e(LOGTAG, "Unable to enable continuous autofocus"); mUILayout.bringToFront(); // Hides the Loading Dialog loadingDialogHandler.sendEmptyMessage(HIDE_LOADING_DIALOG); mUILayout.setBackgroundColor(Color.TRANSPARENT); mSampleAppMenu = new SampleAppMenu(this, this, "SIABRA Discover", mGlView, mUILayout, null); setSampleAppMenuSettings(); } else { Log.e(LOGTAG, exception.getString()); if (mInitErrorCode != 0) { showErrorMessage(mInitErrorCode, 10, true); } else { finish(); } } }
From source file:com.timemachine.controller.ControllerActivity.java
private void setupUI() { // Set layout listener View controllerView = findViewById(R.id.controllerView); ViewTreeObserver vto = controllerView.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override//from w w w. j ava2s. c om public void onGlobalLayout() { runOnUiThread(new Runnable() { public void run() { locationSliderHeight = locationSlider.getHeight(); originLocationSliderContainerY = locationSliderContainer.getY(); originPlayPauseButtonY = playPause.getY(); minLocationSliderContainerY = originLocationSliderContainerY; maxLocationSliderContainerY = originLocationSliderContainerY + locationSliderHeight; midLocationSliderContainerY = (minLocationSliderContainerY + maxLocationSliderContainerY) / 2; } }); System.out.println("locationSliderHeight: " + locationSliderHeight); System.out.println("locationSliderContainerY: " + originLocationSliderContainerY); locationSlider.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); // Connect to controller.html controllerURL = "http://" + ipText + ":8080/controller.html"; locationSlider = (WebView) findViewById(R.id.webview); locationSliderContainer = (FrameLayout) findViewById(R.id.sliderContainer); locationSlider.setBackgroundColor(Color.TRANSPARENT); locationSlider.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); locationSlider.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { System.out.println("onReceivedError"); showConnectDialog("Error while connecting to controller. Connect again."); } @Override public void onLoadResource(WebView view, String url) { if (url.contains("thumbnail")) isMasterConnected = true; } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { isMasterConnectedTimerTask = null; isMasterConnectedTimerTask = new TimerTask() { @Override public void run() { if (isMasterConnected == false) showConnectDialog("Master is not loaded in the browser. Connect again."); } }; isMasterConnectedTimer.schedule(isMasterConnectedTimerTask, 6000); } @Override public void onPageFinished(WebView view, String url) { if (url.contains(controllerURL)) { drag.setVisibility(View.VISIBLE); playPause.setVisibility(View.VISIBLE); loadPreferences(); } super.onPageFinished(view, url); } }); try { locationSlider.loadUrl(controllerURL); } catch (Exception e) { e.printStackTrace(); } // Set JavaScript Interface locationSlider.addJavascriptInterface(this, "androidObject"); WebSettings webSettings = locationSlider.getSettings(); webSettings.setJavaScriptEnabled(true); // Set the play-pause button playPause = (ImageButton) findViewById(R.id.playPauseButton); playPause.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { socket.emit("handlePlayPauseServer"); } }); socket.emit("setControllerPlayButton"); // Set the drag button drag = (ImageButton) findViewById(R.id.drag); drag.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { dragYDiffBetweenFingerAndSliderTop = locationSliderContainer.getY() - event.getRawY(); dragYDiffBetweenFingerAndPlayPauseTop = playPause.getY() - event.getRawY(); } if (event.getAction() == MotionEvent.ACTION_MOVE) { // Move the slider based on current finger location float newSliderY = event.getRawY() + dragYDiffBetweenFingerAndSliderTop; float newPlayPauseY = event.getRawY() + dragYDiffBetweenFingerAndPlayPauseTop; if (newSliderY > minLocationSliderContainerY && newSliderY < maxLocationSliderContainerY) { locationSliderContainer.setY(newSliderY); playPause.setY(newPlayPauseY); } } if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getEventTime() - event.getDownTime() <= tapTimeout) { // Tap is detected, toggle the slider System.out.println("onTap"); runOnUiThread(new Runnable() { public void run() { toggleSlider(); } }); } else { // Not a tap gesture, slide up or down based on the slider's current position if (locationSliderContainer.getY() > midLocationSliderContainerY) slideDown(); else slideUp(); } } return true; } }); // Set the Google map setUpMapIfNeeded(); }
From source file:com.gmail.walles.johan.batterylogger.BatteryPlotFragment.java
private LineAndPointFormatter getDrainFormatter() { LineAndPointFormatter drainFormatter = new LineAndPointFormatter(); drainFormatter.setPointLabelFormatter(new PointLabelFormatter()); drainFormatter.setPointLabeler(new PointLabeler() { @Override//from w w w. j a v a 2s.co m public String getLabel(XYSeries xySeries, int i) { return ""; } }); drainFormatter.getLinePaint().setStrokeWidth(0); drainFormatter.getLinePaint().setColor(Color.TRANSPARENT); drainFormatter.getVertexPaint().setColor(Color.rgb(0x00, 0x44, 0x00)); drainFormatter.getVertexPaint().setStrokeWidth(4); drainFormatter.getFillPaint().setColor(Color.TRANSPARENT); drainFormatter.getPointLabelFormatter().getTextPaint().setColor(Color.WHITE); return drainFormatter; }
From source file:com.shollmann.igcparser.ui.activity.FlightPreviewActivity.java
private void displayLinesAndAreas(List<ILatLonRecord> waypoints) { try {// w ww . java2s .c o m PolylineOptions polyline = new PolylineOptions() .width(ResourcesHelper.getDimensionPixelSize(this, R.dimen.task_line_width)) .color(getResources().getColor(R.color.task_line)); for (int i = 0; i < waypoints.size(); i++) { CRecordWayPoint cRecordWayPoint = (CRecordWayPoint) waypoints.get(i); if (cRecordWayPoint.getType() == CRecordType.START || cRecordWayPoint.getType() == CRecordType.TURN || cRecordWayPoint.getType() == CRecordType.FINISH) { polyline.add(new LatLng(waypoints.get(i).getLatLon().getLat(), waypoints.get(i).getLatLon().getLon())); } if (cRecordWayPoint.getType() == CRecordType.TURN) { googleMap.addCircle(new CircleOptions() .center(new LatLng(waypoints.get(i).getLatLon().getLat(), waypoints.get(i).getLatLon().getLon())) .radius(TaskConfig.getAreaWidth()).strokeColor(Color.TRANSPARENT) .strokeWidth(getResources().getDimensionPixelSize(R.dimen.task_line_width)) .fillColor(getResources().getColor(R.color.task_fill_color))); } } googleMap.addPolyline(polyline); } catch (Throwable t) { Logger.logError("Error trying to draw waypoints: " + t.getMessage()); } }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
public static int getColorBackgroundCacheHint(final Context context) { final TypedArray a = context.obtainStyledAttributes(new int[] { android.R.attr.colorBackgroundCacheHint }); final int color = a.getColor(0, Color.TRANSPARENT); a.recycle();/*from w ww. jav a2 s . c o m*/ return color; }
From source file:com.ibuildapp.romanblack.FanWallPlugin.FanWallPlugin.java
private void initializeUI() { setContentView(R.layout.romanblack_fanwall_main); mainlLayout = (LinearLayout) findViewById(R.id.romanblack_fanwall_main); mainlLayout.setBackgroundColor(Statics.color1); // less then android L if (android.os.Build.VERSION.SDK_INT <= 20) { InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE); SoftKeyboard softKeyboard;/*from ww w. j ava 2 s .co m*/ softKeyboard = new SoftKeyboard(mainlLayout, im); softKeyboard.setSoftKeyboardCallback(new SoftKeyboard.SoftKeyboardChanged() { @Override public void onSoftKeyboardHide() { Message msg = handler.obtainMessage(HANDLE_TAP_BAR, 1, 0); handler.sendMessage(msg); } @Override public void onSoftKeyboardShow() { Message msg = handler.obtainMessage(HANDLE_TAP_BAR, 0, 0); handler.sendMessage(msg); } }); } bottomBarHodler = (LinearLayout) findViewById(R.id.romanblack_fanwall_main_bottom_bar); TextView noMsgText = (TextView) findViewById(R.id.romanblack_fanwall_nomessages_text); // top bar setTopBarLeftButtonText(getResources().getString(R.string.common_home_upper), true, new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); // set title if (TextUtils.isEmpty(widget.getTitle())) setTopBarTitle(getString(R.string.fanwall_talks)); else setTopBarTitle(widget.getTitle()); imageHolder = (LinearLayout) findViewById(R.id.fanwall_image_holder); userImage = (ImageView) findViewById(R.id.fanwall_user_image); closeBtn = (ImageView) findViewById(R.id.fanwall_close_image); closeBtn.setOnClickListener(this); chooserHolder = (LinearLayout) findViewById(R.id.fanwall_chooser_holder); openBottom = (LinearLayout) findViewById(R.id.romanblack_fanwall_open_bottom); openBottom.setOnClickListener(this); enableGpsCheckbox = (CheckBox) findViewById(R.id.romanblack_fanwall_enable_gps_checkbox); enableGpsCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (b) { if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { final AlertDialog.Builder builder = new AlertDialog.Builder(FanWallPlugin.this); builder.setMessage(getString(R.string.enable_gps_msg)).setCancelable(false) .setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() { public void onClick(@SuppressWarnings("unused") final DialogInterface dialog, @SuppressWarnings("unused") final int id) { startActivityForResult( new Intent( android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), GPS_SETTINGS_ACTIVITY); } }).setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() { public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) { enableGpsCheckbox.setChecked(false); dialog.dismiss(); } }); final AlertDialog alert = builder.create(); alert.show(); } else { Prefs.with(FanWallPlugin.this).save(Prefs.KEY_GPS, true); } } else Prefs.with(FanWallPlugin.this).save(Prefs.KEY_GPS, false); } }); enableGpsCheckbox.setChecked(Prefs.with(FanWallPlugin.this).getBoolean(Prefs.KEY_GPS, false)); galleryChooser = (LinearLayout) findViewById(R.id.romanblack_fanwall_gallery); galleryChooser.setOnClickListener(this); photoChooser = (LinearLayout) findViewById(R.id.romanblack_fanwall_make_photo); photoChooser.setOnClickListener(this); postMsg = (LinearLayout) findViewById(R.id.romanblack_fanwall_send_post); postMsg.setOnClickListener(this); editMsg = (EditText) findViewById(R.id.romanblack_fanwall_edit_msg); editMsg.addTextChangedListener(FanWallPlugin.this); tabHolder = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_holder); tabHolder.setBackgroundColor(res.getColor(R.color.black_50_trans)); LinearLayout separator = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_holder_separator); separator.setBackgroundColor(res.getColor(R.color.white_30_trans)); LinearLayout separatorUp = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_holder_up); LinearLayout separatorDown = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_holder_down); tabMapLayout = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_map_layout); tabMapLayout.setOnClickListener(this); tabPhotosLayout = (LinearLayout) findViewById(R.id.romanblack_fanwall_tab_photos_layout); tabPhotosLayout.setOnClickListener(this); if (Statics.isSchemaDark) { separatorUp.setBackgroundColor(res.getColor(R.color.white_20_trans)); separatorDown.setBackgroundColor(res.getColor(R.color.white_20_trans)); int temp = Color.WHITE & 0x00ffffff; int result = temp | 0x80000000; noMsgText.setTextColor(result); } else { separatorUp.setBackgroundColor(res.getColor(R.color.black_20_trans)); separatorDown.setBackgroundColor(res.getColor(R.color.black_20_trans)); int temp = Color.BLACK & 0x00ffffff; int result = temp | 0x80000000; noMsgText.setTextColor(result); } noMessagesLayout = (LinearLayout) findViewById(R.id.romanblack_fanwall_main_nomessages_layout); messageListLayoutRoot = (FrameLayout) findViewById(R.id.romanblack_fanwall_messagelist_list_layout); messageList = (PullToRefreshListView) findViewById(R.id.romanblack_fanwall_messagelist_pulltorefresh); messageList.setDivider(null); messageList.setBackgroundColor(Color.TRANSPARENT); messageList.setDrawingCacheBackgroundColor(Color.TRANSPARENT); ILoadingLayout loadingLayout = messageList.getLoadingLayoutProxy(); if (Statics.isSchemaDark) { loadingLayout.setHeaderColor(Color.WHITE); } else { loadingLayout.setHeaderColor(Color.BLACK); } //messageList.set adapter = new MainLayoutMessagesAdapter(FanWallPlugin.this, messageList, messages, widget); adapter.setInnerInterface(new MainLayoutMessagesAdapter.onEndReached() { @Override public void endReached() { if (!refreshingBottom) refreshBottom(); } }); messageList.setAdapter(adapter); messageList.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() { @Override public void onRefresh(PullToRefreshBase<ListView> refreshView) { refreshTop(); } }); if (Statics.canEdit.compareToIgnoreCase("all") == 0) { bottomBarHodler.setVisibility(View.VISIBLE); } else { bottomBarHodler.setVisibility(View.GONE); } // start downloading messages // exactly in create() method!!! handler.sendEmptyMessage(SHOW_PROGRESS_DIALOG); refreshMessages(); }
From source file:com.saulcintero.moveon.fragments.Summary4.java
private XYMultipleSeriesRenderer getRenderer() { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); XYSeriesRenderer r = new XYSeriesRenderer(); TypedValue outValue1 = new TypedValue(); TypedValue outValue2 = new TypedValue(); TypedValue outValue3 = new TypedValue(); TypedValue outValue4 = new TypedValue(); mContext.getResources().getValue(R.dimen.xy_chart_text_size_value, outValue1, true); mContext.getResources().getValue(R.dimen.xy_labels_text_size_value, outValue2, true); mContext.getResources().getValue(R.dimen.xy_axis_title_text_size_value, outValue3, true); mContext.getResources().getValue(R.dimen.xy_legend_text_size_value, outValue4, true); float xyChartTextSizeValue = outValue1.getFloat(); float xyLabelsTextSizeValue = outValue1.getFloat(); float xyAxisTitleTextSizeValue = outValue1.getFloat(); float xyLegendTextSizeValue = outValue1.getFloat(); r = new XYSeriesRenderer(); r.setColor(Color.rgb(255, 124, 0)); r.setFillPoints(true);//from w ww .java 2 s .c o m r.setLineWidth(2.5f); r.setDisplayChartValues(true); r.setChartValuesTextSize(xyChartTextSizeValue); renderer.addSeriesRenderer(r); renderer.setAxesColor(Color.WHITE); renderer.setLabelsColor(Color.LTGRAY); renderer.setBackgroundColor(Color.TRANSPARENT); renderer.setTextTypeface("sans_serif", Typeface.BOLD); renderer.setLabelsTextSize(xyLabelsTextSizeValue); renderer.setAxisTitleTextSize(xyAxisTitleTextSizeValue); renderer.setLegendTextSize(xyLegendTextSizeValue); renderer.setXTitle(FunctionUtils.capitalizeFirtsLetter(getString(R.string.minutes))); renderer.setYTitle(getString(R.string.beats)); renderer.setXLabels(20); renderer.setYLabels(20); renderer.setYLabelsAlign(Align.LEFT); renderer.setShowGrid(false); renderer.setXAxisMin((timeList.get(0) / 60)); renderer.setXAxisMax((float) ((float) timeList.get(timeList.size() - 1) / 60)); renderer.setYAxisMin(min_hr); renderer.setYAxisMax(max_hr); return renderer; }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
public static int getCardBackgroundColor(final Context context) { final TypedArray a = context.obtainStyledAttributes(new int[] { R.attr.cardItemBackgroundColor }); final int color = a.getColor(0, Color.TRANSPARENT); a.recycle();/* w w w .j a v a 2 s . c o m*/ final int themeAlpha = getThemeAlpha(context); return themeAlpha << 24 | (0x00FFFFFF & color); }
From source file:com.dm.material.dashboard.candybar.activities.CandyBarMainActivity.java
@Override public void onSearchExpanded(boolean expand) { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); mIsMenuVisible = !expand;/*from w w w.j a va 2 s . c o m*/ if (expand) { toolbar.setNavigationIcon(R.drawable.ic_toolbar_back); toolbar.setNavigationOnClickListener(view -> onBackPressed()); } else { SoftKeyboardHelper.closeKeyboard(this); ColorHelper.setTransparentStatusBar(this, Color.TRANSPARENT); toolbar.setNavigationIcon(R.drawable.ic_toolbar_navigation); toolbar.setNavigationOnClickListener(view -> mDrawerLayout.openDrawer(GravityCompat.START)); } mDrawerLayout .setDrawerLockMode(expand ? DrawerLayout.LOCK_MODE_LOCKED_CLOSED : DrawerLayout.LOCK_MODE_UNLOCKED); supportInvalidateOptionsMenu(); }
From source file:com.lemon.lime.MainActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { final View coordinatorLayoutView = findViewById(R.id.snackbarPosition); switch (item.getItemId()) { case R.id.back: mWebView.goBack();/*from w w w.ja v a2 s .com*/ break; case R.id.forward: mWebView.goForward(); break; case R.id.reload: mWebView.reload(); break; case R.id.new_tab: Intent c = new Intent(this, MainActivity.class); startActivityForResult(c, RESULT_SETTINGS); break; case R.id.add_bookmark: Intent book = new Intent(this, BookMarkActivity.class); startActivityForResult(book, RESULT_SETTINGS); break; case R.id.share: String url = mWebView.getUrl().toString(); ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); clipboard.setText(url); Snackbar snackbar = Snackbar.make(coordinatorLayoutView, R.string.clipboard, Snackbar.LENGTH_LONG); snackbar.show(); break; case R.id.menu_settings: Intent i = new Intent(this, UserSettingActivity.class); startActivityForResult(i, RESULT_SETTINGS); break; case R.id.invert: if (night == 0) { getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.BLACK)); mWebView.setBackgroundColor(Color.parseColor("#000000")); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setNavigationBarColor(Color.BLACK); window.setStatusBarColor(Color.BLACK); } night = 1; } else { getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#7AB317"))); mWebView.setBackgroundColor(Color.TRANSPARENT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setNavigationBarColor(Color.parseColor("#7AB317")); window.setStatusBarColor(Color.parseColor("#7AB317")); } night = 0; } break; case R.id.hide: View decorView = window.getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; decorView.setSystemUiVisibility(uiOptions); getSupportActionBar().hide(); break; case R.id.easteregg: Toast.makeText(this, "( Y )", Toast.LENGTH_SHORT).show(); mPlayer.start(); addBarGraphRenderers(); break; } return true; }