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.example.test2969mediabrowser.UnderlinePageIndicator.java
@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (mViewPager == null) { return;/*from w w w.ja v a 2 s. c o m*/ } final int count = mViewPager.getAdapter().getCount(); if (count == 0) { return; } if (mCurrentPage >= count) { setCurrentItem(count - 1); return; } final int width = getWidth(); int height = getHeight(); final int paddingLeft = getPaddingLeft(); final float pageWidth = (getWidth() - paddingLeft - getPaddingRight()) / (1f * count); final float left = paddingLeft + pageWidth * (mCurrentPage + mPositionOffset); final float right = left + pageWidth; final float top = getPaddingTop(); final float bottom = getHeight() - getPaddingBottom(); // canvas.drawRect(left, top, right, bottom, mPaint); //===================================add by joe 20150918 start============ // mPath.reset(); mPath.moveTo(0, height * 4 / 5); mPath.lineTo(width, height * 4 / 5); mPath.lineTo(width, height); mPath.lineTo(0, height); mPath.close(); mPaint.setColor(Color.BLACK); canvas.drawPath(mPath, mPaint); // mPath.reset(); mPath.moveTo(left + 50, height * 5 / 6); mPath.lineTo(right - 50, height * 5 / 6); mPath.lineTo(right - 50, height); mPath.lineTo(left + 50, height); mPath.close();//#ff3b8eb9 canvas.drawPath(mPath, mPaintFooterLine); //?text mPaintText.setColor(getResources().getColor(R.color.blue_select)); mPaintText.setTextSize(22); FontMetricsInt fontMetrics = mPaintText.getFontMetricsInt(); Rect targetRect = new Rect((int) left, (int) top, (int) right, (int) (height * 4 / 5)); int baseline = targetRect.top + (targetRect.bottom - targetRect.top - fontMetrics.bottom + fontMetrics.top) / 2 - fontMetrics.top; // ?drawTexttargetRect.centerX() mPaintText.setTextAlign(Paint.Align.CENTER); String tittle = (mCurrentPage + 1) + " / " + mViewPager.getAdapter().getCount(); canvas.drawText(tittle, (left + right - tittle.length()) / 2, height * 3 / 5, mPaintText); //===================================add by joe 20150918 end================== }
From source file:com.mumu.joshautomation.HeadService.java
private void initGamePanelViews() { mHeadIconList = new ArrayList<>(); mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE); // Head Icon/* w w w .java2 s . c o m*/ HeadIconView headIcon = new HeadIconView(new ImageView(this), mWindowManager, 0, 0); headIcon.getImageView().setImageResource(R.mipmap.ic_launcher); headIcon.setOnTapListener(new HeadIconView.OnTapListener() { @Override public void onTap(View view) { configHeadIconShowing( (getCurrentHeadIconVisibility() == HeadIconView.VISIBLE ? HeadIconView.INVISIBLE : HeadIconView.VISIBLE)); } @Override public void onLongPress(View view) { showExitConfirmDialog(); } }); mHeadIconList.add(headIcon); // Message Text Icon HeadIconView msgText = new HeadIconView(new TextView(this), mWindowManager, 140, 45); msgText.getTextView().setTextColor(Color.BLACK); msgText.getView().setBackgroundColor(Color.WHITE); mHeadIconList.add(msgText); // Capture Icon HeadIconView captureIcon = new HeadIconView(new ImageView(this), mWindowManager, 0, 120); captureIcon.getImageView().setImageResource(R.drawable.ic_menu_camera); captureIcon.setOnTapListener(new HeadIconView.OnTapListener() { @Override public void onTap(View view) { configCapture(); } @Override public void onLongPress(View view) { } }); mHeadIconList.add(captureIcon); // Setting Icon HeadIconView settingIcon = new HeadIconView(new ImageView(this), mWindowManager, 120, 120); settingIcon.getImageView().setImageResource(R.drawable.ic_menu_settings); settingIcon.setOnTapListener(new HeadIconView.OnTapListener() { @Override public void onTap(View view) { configSettings(false); } @Override public void onLongPress(View view) { Log.d(TAG, "config setting icon"); configSettings(true); } }); mHeadIconList.add(settingIcon); // Start and Stop control Icon HeadIconView startIcon = new HeadIconView(new ImageView(this), mWindowManager, 240, 120); startIcon.getImageView().setImageResource(R.drawable.ic_play); startIcon.setOnTapListener(new HeadIconView.OnTapListener() { @Override public void onTap(View view) { configScriptStatus(); } @Override public void onLongPress(View view) { } }); mHeadIconList.add(startIcon); // Share the same on move listener for moving at the same time HeadIconView.OnMoveListener moveListener = new HeadIconView.OnMoveListener() { @Override public void onMove(HeadIconView view, int initialX, int initialY, float initialTouchX, float initialTouchY, MotionEvent event) { // we limit the initiator of moving to only head icon if (view == mHeadIconList.get(IDX_HEAD_ICON)) { for (HeadIconView icon : mHeadIconList) { icon.moveIconDefault(initialX, initialY, initialTouchX, initialTouchY, event); } } } }; // Set all to add for (HeadIconView icon : mHeadIconList) { icon.addView(); icon.setOnMoveListener(moveListener); } // Set default visibility configHeadIconShowing(HeadIconView.VISIBLE); }
From source file:edu.mum.ml.group7.guessasketch.android.EasyPaint.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // it removes the title from the actionbar(more space for icons?) // this.getActionBar().setDisplayShowTitleEnabled(false); pixels5 = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics()); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); LinearLayout parent = new LinearLayout(this); parent.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); parent.setOrientation(LinearLayout.VERTICAL); LinearLayout scrollViewParent = new LinearLayout(this); scrollViewParent.setLayoutParams(/*from www .ja v a 2s. c om*/ new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); scrollViewParent.setOrientation(LinearLayout.HORIZONTAL); HorizontalScrollView predictionsHorizontalScrollView = new HorizontalScrollView(this); //predictionsHorizontalScrollView.setLayoutParams(new ViewGroup.LayoutParams()); predictions = new LinearLayout(this); LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); params.gravity = Gravity.CENTER_VERTICAL; predictions.setLayoutParams(params); predictions.setOrientation(LinearLayout.HORIZONTAL); resetPredictionsView(predictions, true); predictionsHorizontalScrollView.addView(predictions); saveButton = new Button(this); saveButton.setText("Send Feedback"); predictionsHorizontalScrollView.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 10.0f)); saveButton.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, 1.0f)); saveButton.setVisibility(View.INVISIBLE); FrameLayout frameLayout = new FrameLayout(this); frameLayout .setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT)); frameLayout.addView(saveButton); loader = new ProgressBar(this); loader.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); loader.setIndeterminate(true); loader.setVisibility(ProgressBar.INVISIBLE); frameLayout.addView(loader); scrollViewParent.addView(predictionsHorizontalScrollView); scrollViewParent.addView(frameLayout); contentView = new MyView(this); parent.addView(scrollViewParent); parent.addView(contentView); setContentView(parent); otherLabelOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Log.e("Clicked", "Other Label label '" + (String) view.getTag() + "'"); sendScreenshot(false, feedbackType, (String) view.getTag()); } }; mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor(Color.BLACK); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(DEFAULT_BRUSH_SIZE); // Where did these magic numbers come from? What do they mean? Can I change them? ~TheOpenSourceNinja // Absolutely random numbers in order to see the emboss. asd! ~Valerio mEmboss = new EmbossMaskFilter(new float[] { 1, 1, 1 }, 0.4f, 6, 3.5f); mBlur = new BlurMaskFilter(5, BlurMaskFilter.Blur.NORMAL); if (isFirstTime()) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(R.string.app_name); alert.setMessage(R.string.app_description); alert.setNegativeButton(R.string.continue_button, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { Toast.makeText(getApplicationContext(), R.string.here_is_your_canvas, Toast.LENGTH_SHORT) .show(); } }); alert.show(); } else { Toast.makeText(getApplicationContext(), R.string.here_is_your_canvas, Toast.LENGTH_SHORT).show(); } loadFromIntents(); }
From source file:com.usertaxi.TaxiOntheWay_Activity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_taxiontheway); taxiOntheWay_activity_instance = this; AppPreferences.setApprequestTaxiScreen(TaxiOntheWay_Activity.this, true); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setTitleTextColor(Color.BLACK); setSupportActionBar(toolbar);//from w ww .j av a2 s . c o m String title = getString(R.string.title_activity_taxidetail); getSupportActionBar().setTitle(title); fab_menu = (FloatingActionsMenu) findViewById(R.id.fab_menu); FloatingActionButton fab_msg = (FloatingActionButton) findViewById(R.id.fab_message); FloatingActionButton fab_call = (FloatingActionButton) findViewById(R.id.fab_call); FloatingActionButton fab_cancel = (FloatingActionButton) findViewById(R.id.fab_cancel); textheader = (TextView) findViewById(R.id.textheader); textname = (TextView) findViewById(R.id.name_text); textmobilenumber = (TextView) findViewById(R.id.mobile_text); textcompanyname = (TextView) findViewById(R.id.companyname); texttaxinumber = (TextView) findViewById(R.id.taxinumber); mtextnamehead = (TextView) findViewById(R.id.namehead); mtextcompanyhead = (TextView) findViewById(R.id.companyhead); mtextmobilehead = (TextView) findViewById(R.id.mobilehead); mtexttexinumhead = (TextView) findViewById(R.id.taxiplatthead); mdriverlicense = (TextView) findViewById(R.id.driverlicense); medriverinsurance = (TextView) findViewById(R.id.driverinsurance); mdriverimage = (ImageView) findViewById(R.id.driver_image); map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); map.setMapType(GoogleMap.MAP_TYPE_NORMAL); getLocation(); Typeface tf = Typeface.createFromAsset(this.getAssets(), "Montserrat-Regular.ttf"); textheader.setTypeface(tf); mtextnamehead.setTypeface(tf); mtextcompanyhead.setTypeface(tf); mtextmobilehead.setTypeface(tf); mtexttexinumhead.setTypeface(tf); textname.setTypeface(tf); textmobilenumber.setTypeface(tf); textcompanyname.setTypeface(tf); texttaxinumber.setTypeface(tf); mdriverlicense.setTypeface(tf); medriverinsurance.setTypeface(tf); Intent intent = getIntent(); String data = intent.getStringExtra("data"); Log.d("data value", data + ""); //caceldialog(); JSONObject jsonObject = null; try { jsonObject = new JSONObject(data); AppPreferences.setAcceptdriverId(TaxiOntheWay_Activity.this, jsonObject.getString("driverId")); Log.d("driverid---", AppPreferences.getAcceptdriverId(TaxiOntheWay_Activity.this)); drivermobile = jsonObject.getString("mobile"); drivername = jsonObject.getString("username"); drivercompanyname = jsonObject.getString("taxicompany"); drivertaxiname = jsonObject.getString("vehicalname"); drivertexinumber = jsonObject.getString("vehicle_number"); //driverlatitude = jsonObject.getDouble("latitude"); //driverlongitude = jsonObject.getDouble("longitude"); driverimage = jsonObject.getString("driverImage"); SourceAddress = jsonObject.getString("source_address"); sourcelatitude = jsonObject.getDouble("source_latitude"); sourcelongitude = jsonObject.getDouble("source_longitude"); driverlicense = jsonObject.getString("driverlicense"); driverinsurance = jsonObject.getString("driverinsurance"); // Log.d("longitudeeeee:------", String.valueOf(jsonObject.getDouble("longitude"))); final LatLng loc = new LatLng(new Double(sourcelatitude), new Double(sourcelongitude)); map.moveCamera(CameraUpdateFactory.newLatLngZoom(loc, 15)); final MarkerOptions marker = new MarkerOptions().position(loc).title(SourceAddress); // marker.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)); marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.pin_three)); map.addMarker(marker); textname.setText(drivername); textmobilenumber.setText(drivermobile); textcompanyname.setText(drivercompanyname); texttaxinumber.setText(drivertexinumber); mdriverlicense.setText(driverlicense); medriverinsurance.setText(driverinsurance); if (mdriverlicense.length() == 0) { mdriverlicense.setVisibility(View.GONE); } if (medriverinsurance.length() == 0) { medriverinsurance.setVisibility(View.GONE); } //taxiname.setText(drivertaxiname); Intent intent1 = new Intent(TaxiOntheWay_Activity.this, DriverService.class); intent1.putExtra("driverId", jsonObject.getString("driverId")); startService(intent1); if (driverimage.equalsIgnoreCase("")) { mdriverimage.setImageResource(R.drawable.ic_action_user); } else { Picasso.with(getApplicationContext()).load(driverimage).error(R.drawable.ic_action_user) .resize(200, 200).into(mdriverimage); } Timer timer; TimerTask task; int delay = 10000; int period = 10000; timer = new Timer(); timer.scheduleAtFixedRate(task = new TimerTask() { public void run() { runOnUiThread(new Runnable() { @Override public void run() { loc2 = new LatLng(new Double(AppPreferences.getCurrentlat(TaxiOntheWay_Activity.this)), new Double(AppPreferences.getCurrentlong(TaxiOntheWay_Activity.this))); if (marker1 == null) { marker1 = map.addMarker(new MarkerOptions().position(loc2).title(drivername) .icon(BitmapDescriptorFactory.fromResource(R.drawable.drivertaxi))); } animateMarker(marker1, loc2, false); /* try{ String url = Function.getDirectionsUrl(new LatLng(Double.parseDouble(AppPreferences.getPreviouslat(getApplicationContext())), Double.parseDouble(AppPreferences.getPreviouslong(getApplicationContext()))), new LatLng(Double.parseDouble(AppPreferences.getCurrentlat(getApplicationContext())), Double.parseDouble(AppPreferences.getCurrentlong(getApplicationContext())))); RoutesDownloadTask downloadTask = new RoutesDownloadTask(TaxiOntheWay_Activity.this); downloadTask.execute(url); }catch(Exception e) { e.printStackTrace(); }*/ } }); } }, delay, period); } catch (JSONException e) { e.printStackTrace(); } /////////////notification dataend/////////////// fab_cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { initiatePopupWindowcanceltaxi(); } }); fab_msg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { initiatePopupWindowsendmesage(); } }); fab_call.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:" + drivermobile)); startActivity(callIntent); } }); moveMarkerList = new ArrayList<LatLng>(); // moveRoadMarker(); }
From source file:com.health.openscale.gui.GraphFragment.java
private void generateLineData(Calendar calMonth) { scaleDataList = openScale.getScaleDataOfMonth(calYears.get(Calendar.YEAR), calMonth.get(Calendar.MONTH)); float maxValue = openScale.getMaxValueOfScaleData(calYears.get(Calendar.YEAR), calMonth.get(Calendar.MONTH)); SimpleDateFormat day_date = new SimpleDateFormat("dd", Locale.getDefault()); Calendar calDays = (Calendar) calMonth.clone(); calDays.set(Calendar.DAY_OF_MONTH, 1); int maxDays = calDays.getActualMaximum(Calendar.DAY_OF_MONTH); List<AxisValue> axisValues = new ArrayList<AxisValue>(); for (int i = 0; i < maxDays; i++) { String day_name = day_date.format(calDays.getTime()); axisValues.add(new AxisValue(i, day_name.toCharArray())); calDays.add(Calendar.DAY_OF_MONTH, 1); }//from w w w .java 2s . c om List<PointValue> valuesWeight = new ArrayList<PointValue>(); List<PointValue> valuesFat = new ArrayList<PointValue>(); List<PointValue> valuesWater = new ArrayList<PointValue>(); List<PointValue> valuesMuscle = new ArrayList<PointValue>(); List<Line> lines = new ArrayList<Line>(); Calendar calDB = Calendar.getInstance(); for (ScaleData scaleEntry : scaleDataList) { calDB.setTime(scaleEntry.date_time); valuesWeight.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH) - 1, scaleEntry.weight)); valuesFat.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH) - 1, scaleEntry.fat)); valuesWater.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH) - 1, scaleEntry.water)); valuesMuscle.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH) - 1, scaleEntry.muscle)); } Line lineWeight = new Line(valuesWeight).setColor(Utils.COLOR_VIOLET).setCubic(true) .setHasLabels(prefs.getBoolean("labelsEnable", true)) .setFormatter(new SimpleValueFormatter(1, false, null, null)); Line lineFat = new Line(valuesFat).setColor(Utils.COLOR_ORANGE).setCubic(true) .setHasLabels(prefs.getBoolean("labelsEnable", true)) .setFormatter(new SimpleValueFormatter(1, false, null, null)); Line lineWater = new Line(valuesWater).setColor(Utils.COLOR_BLUE).setCubic(true) .setHasLabels(prefs.getBoolean("labelsEnable", true)) .setFormatter(new SimpleValueFormatter(1, false, null, null)); Line lineMuscle = new Line(valuesMuscle).setColor(Utils.COLOR_GREEN).setCubic(true) .setHasLabels(prefs.getBoolean("labelsEnable", true)) .setFormatter(new SimpleValueFormatter(1, false, null, null)); activeLines = new ArrayList<lines>(); if (prefs.getBoolean("weightEnable", true)) { lines.add(lineWeight); activeLines.add(GraphFragment.lines.WEIGHT); } if (prefs.getBoolean("fatEnable", true)) { lines.add(lineFat); activeLines.add(GraphFragment.lines.FAT); } if (prefs.getBoolean("waterEnable", true)) { lines.add(lineWater); activeLines.add(GraphFragment.lines.WATER); } if (prefs.getBoolean("muscleEnable", true)) { lines.add(lineMuscle); activeLines.add(GraphFragment.lines.MUSCLE); } LineChartData lineData = new LineChartData(lines); lineData.setAxisXBottom(new Axis(axisValues).setHasLines(true).setTextColor(Color.BLACK)); lineData.setAxisYLeft(new Axis().setHasLines(true).setMaxLabelChars(3).setTextColor(Color.BLACK)); chartTop.setLineChartData(lineData); chartTop.setViewportCalculationEnabled(false); if (maxValue == 0.0) { maxValue = 100; } else { maxValue += 20; } Viewport v = new Viewport(0, (int) maxValue, maxDays - 1, 0); chartTop.setMaximumViewport(v); chartTop.setCurrentViewport(v, true); chartTop.setZoomType(ZoomType.HORIZONTAL); }
From source file:com.nextgis.mobile.fragment.AttributesFragment.java
private void setAttributes() { if (mAttributes == null) return;//from ww w. j a va2 s . c o 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.coupondunia.restaurants.offers.views.SlidingTabLayout.java
private void populateTabStrip() { final PagerAdapter adapter = mViewPager.getAdapter(); final OnClickListener tabClickListener = new TabClickListener(); for (int i = 0; i < adapter.getCount(); i++) { View tabView = null;/* ww w.ja va 2 s. c om*/ TextView tabTitleView = null; if (mTabViewLayoutId != 0) { // If there is a custom tab view layout id set, try and inflate it tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip, false); tabTitleView = (TextView) tabView.findViewById(mTabViewTextViewId); } if (tabView == null) { tabView = createDefaultTabView(getContext()); } if (tabTitleView == null && TextView.class.isInstance(tabView)) { tabTitleView = (TextView) tabView; } if (mDistributeEvenly) { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabView.getLayoutParams(); lp.width = 0; lp.weight = 1; } assert tabTitleView != null; tabTitleView.setText(adapter.getPageTitle(i)); tabTitleView.setTextColor(Color.BLACK); tabView.setOnClickListener(tabClickListener); String desc = mContentDescriptions.get(i, null); if (desc != null) { tabView.setContentDescription(desc); } mTabStrip.addView(tabView); if (i == mViewPager.getCurrentItem()) { tabView.setSelected(true); } } }
From source file:com.phonegap.DroidGap.java
/** * Called when the activity is first created. * //from w ww. j a va 2 s .com * @param savedInstanceState */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); //getWindow().requestFeature(Window.FEATURE_NO_TITLE); //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); // This builds the view. We could probably get away with NOT having a LinearLayout, but I like having a bucket! root = new LinearLayout(this); //Disable ScrollBar root.setVerticalScrollBarEnabled(false); root.setHorizontalScrollBarEnabled(false); root.setOrientation(LinearLayout.VERTICAL); root.setBackgroundColor(Color.BLACK); root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F)); // If url was passed in to intent, then init webview, which will load the url Bundle bundle = this.getIntent().getExtras(); if (bundle != null) { String url = bundle.getString("url"); if (url != null) { this.init(); } } // Setup the hardware volume controls to handle volume control setVolumeControlStream(AudioManager.STREAM_MUSIC); }
From source file:edu.winlab.minijarvis.activity.CameraActivity.java
public void setBackground() { background = new Paint(); background.setColor(Color.BLACK); background.setStyle(Paint.Style.FILL); background.setStrokeWidth(5);/*from w w w .j a va 2s. com*/ }
From source file:terse.a1.TerseActivity.java
@Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); glSurfaceView = null; // Forget gl on new activity. requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); if (savedInstanceState != null && savedInstanceState.containsKey("TerseActivity")) { taSaveMe = savedInstanceState.getString("TerseActivity"); } else {//from w w w .j a v a 2 s.com taSaveMe = null; } Runnable bg = new Runnable() { @Override public void run() { resetTerp(); } }; Runnable fg = new Runnable() { @Override public void run() { Intent intent = getIntent(); Uri uri = intent.getData(); Bundle extras = intent.getExtras(); String path = uri == null ? "/" : uri.getPath(); String query = uri == null ? "" : uri.getQuery(); viewPath(path, query, extras, savedInstanceState); } }; if (terp == null) { TextView tv = new TextView(TerseActivity.this); tv.setText(Static.fmt("Building new TerseTalk VM for world <%s>...", world)); tv.setTextAppearance(this, R.style.teletype); tv.setBackgroundColor(Color.BLACK); tv.setTextColor(Color.DKGRAY); tv.setTextSize(24); setContentView(tv); setContentViewThenBgThenFg("ResetSplash", tv, bg, fg); } else { fg.run(); } }