List of usage examples for android.graphics Color YELLOW
int YELLOW
To view the source code for android.graphics Color YELLOW.
Click Source Link
From source file:com.example.sujit.customerapp.Get_Taxi.java
public void drawPath(String result) { //Getting both the coordinates LatLng from = new LatLng(currentLatitude, currentLongitude); LatLng to = new LatLng(destnLatitude, destnLongitude); //Calculating the distance in meters Double distance = (SphericalUtil.computeDistanceBetween(from, to)); //Displaying the distance Toast.makeText(this, String.valueOf(distance + " Meters"), Toast.LENGTH_LONG).show(); showDialog(distance);/*from w w w. j a va 2s. co m*/ try { //Parsing json final JSONObject json = new JSONObject(result); JSONArray routeArray = json.getJSONArray("routes"); JSONObject routes = routeArray.getJSONObject(0); JSONObject overviewPolylines = routes.getJSONObject("overview_polyline"); String encodedString = overviewPolylines.getString("points"); List<LatLng> list = decodePoly(encodedString); Polyline line = mGoogleMap .addPolyline(new PolylineOptions().addAll(list).width(8).color(Color.YELLOW).geodesic(true)); } catch (JSONException e) { e.printStackTrace(); } }
From source file:com.byagowi.persiancalendar.view.QiblaCompassView.java
public void drawSun(Canvas canvas) { sunPaint.reset();// ww w .ja v a 2 s . c o m sunPaint.setColor(Color.YELLOW); sunPaint.setStyle(Paint.Style.FILL_AND_STROKE); // Horizontal sunPosition = new Horizontal(225, 45); if (sunPosition.getElevation() > -10) { canvas.rotate((float) sunPosition.getAzimuth() - 360, px, py); sunPaint.setPathEffect(dashPath); int ry = (int) (((90 - sunPosition.getElevation()) / 90) * Radius); canvas.drawCircle(px, py - ry, r, sunPaint); dashedPaint.setColor(Color.YELLOW); canvas.drawLine(px, py - Radius, px, py + Radius, dashedPaint); sunPaint.setPathEffect(null); canvas.restore(); } }
From source file:com.aidilab.ble.fragment.DeviceViewFragment.java
/** * Handle changes in sensor values//from ww w. j a v a 2s .c o m * */ public void onCharacteristicChanged(String uuidStr, SensorsValues sv) { Point3D v; String msg; Integer button; int batteryLevel; if (uuidStr.equals(UUID_ALL_DATA.toString())) { // accelerometro msg = decimal.format(sv.getAccelerometer().x) + "\n" + decimal.format(sv.getAccelerometer().y) + "\n" + decimal.format(sv.getAccelerometer().z) + "\n"; //mAcc.setText(msg); accBarGraph.setData(sv.getAccelerometer().x, sv.getAccelerometer().y, sv.getAccelerometer().z); // PER IL VIDEO LEGO IL MAGNETOMETRO AI DATI DELL ACCELEROMETRO // magnetometro if (isMagnetometerBroken) { msg = decimal.format(sv.getAccelerometer().z * 123) + "\n" + decimal.format(sv.getAccelerometer().y * 123) + "\n" + decimal.format(sv.getAccelerometer().x * 123) + "\n"; } else { msg = decimal.format(sv.getMagnetometer().x) + "\n" + decimal.format(sv.getMagnetometer().y) + "\n" + decimal.format(sv.getMagnetometer().z) + "\n"; } //mMag.setText(msg); magBarGraph.setData(sv.getAccelerometer().z * 123, sv.getAccelerometer().x * 60, sv.getAccelerometer().y * 123); batteryLevel = BatteryData.getBatteryPercentage(sv.getBatteryVoltage()); msg = batteryLevel + " %"; mBat.setText(msg); if (batteryLevel < 15) mBatteryLayout.setBackgroundColor(0x55000000 + Color.RED); else if (batteryLevel < 40) mBatteryLayout.setBackgroundColor(0x55000000 + Color.YELLOW); else mBatteryLayout.setBackgroundColor(0x55000000 + Color.GREEN); // bottone button = sv.getButton(); switch (button) { case 0: mBut.setText("released"); break; case 1: mBut.setText("pressed"); break; default: throw new UnsupportedOperationException(); } mActivity.detectSequence(sv); } }
From source file:com.techno.jay.codingcontests.Home.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); FirebaseApp.initializeApp(this); FontChangeCrawler fontChanger = new FontChangeCrawler(getAssets(), "fonts/ProductSans-Regular.ttf"); fontChanger.replaceFonts((ViewGroup) this.findViewById(android.R.id.content)); //==2) for fragment hoy to==== //== fontChanger.replaceFonts((ViewGroup) this.getView()); //===3) for adepterview and handlerview na use mate==== //==convertView = inflater.inflate(R.layout.listitem, null); //==fontChanger.replaceFonts((ViewGroup)convertView); bp = new BillingProcessor(Home.this, Const.LICENSE_KEY, Home.this); /*bp.consumeAsync(inventory.getPurchase(SKU_GAS), mConsumeFinishedListener);*/ bp.consumePurchase(Const.Product_Plan_Unlimitedversion); Toolbar toolbar = (Toolbar) this.findViewById(R.id.toolbar); setSupportActionBar(toolbar);// ww w .j a va 2 s . c o m getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setIcon(R.drawable.appicon); /* if (Build.VERSION.SDK_INT >= 21) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(Color.parseColor("#1976D2")); window.setNavigationBarColor(Color.parseColor("#1976D2")); }*/ sharepref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE); if (Build.VERSION.SDK_INT >= 23) { if (checkSelfPermission( android.Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[] { android.Manifest.permission.READ_PHONE_STATE }, PERMISSIONS_REQUEST_READ_PHONE_STATE); } else { getDeviceImei(); } } else { getDeviceImei(); } databaseReferenceUser = FirebaseDatabase.getInstance().getReference("Users"); //databaseReferenceUser.keepSynced(true); token = FirebaseInstanceId.getInstance().getToken(); SimpleDateFormat format_diffrent = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); Date now = new Date(); date = format_diffrent.format(now); // creating connection detector class instance ConnectionDetector cd = new ConnectionDetector(getApplicationContext()); // get Internet status isInternetPresent = cd.isConnectingToInternet(); if (isInternetPresent) { // Internet Connection is Present // make HTTP requests //refreshedToken = FirebaseInstanceId.getInstance().getToken(); databaseReferenceUser.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { // Get user value if (dataSnapshot.hasChild(str_IMEI)) { String IMEI_no = dataSnapshot.child("IMEI").getValue(String.class); String date_got = dataSnapshot.child("date").getValue(String.class); Log.d("date got", date_got); String status_got = dataSnapshot.child("status").getValue(String.class); Toast.makeText(Home.this, " Already registered. ! ", Toast.LENGTH_LONG).show(); SimpleDateFormat myFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); try { Date date1 = myFormat.parse(date_got); Date date2 = myFormat.parse(date); long diff = date2.getTime() - date1.getTime(); System.out.println("Days: " + TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)); long days_count = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); if (days_count > 10 && status_got.equalsIgnoreCase("inactive")) { promptForUpgrade(); } } catch (ParseException e) { e.printStackTrace(); } } } @Override public void onCancelled(DatabaseError databaseError) { // Log.w("TAG", "getUser:onCancelled", databaseError.toException()); // new Signup_async().execute(); } }); } else { Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), " Sorry! No Internet!!!", Snackbar.LENGTH_LONG); // Changing message text color snackbar.setActionTextColor(Color.BLUE); // Changing action button text color View sbView = snackbar.getView(); TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text); textView.setTextColor(Color.YELLOW); snackbar.show(); Toast.makeText(Home.this, " No Internet Connection!!!. ", Toast.LENGTH_LONG).show(); } Set<String> set = sharepref.getStringSet("arraylist", null); List<String> sposers = new ArrayList<String>(set); String[] apossor_arry = new String[sposers.size()]; apossor_arry = sposers.toArray(apossor_arry); FragmentTransaction tx; tx = getSupportFragmentManager().beginTransaction(); tx.replace(R.id.frame, new MainHomeFragmentFirebase()); tx.commit(); searchView = (MaterialSearchView) findViewById(R.id.search_view); searchView.setVoiceSearch(false); searchView.setHint("Enter Coding website/technology"); searchView.setCursorDrawable(R.drawable.custome_cursor); searchView.setSuggestions(apossor_arry); searchView.setEllipsize(true); searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { Snackbar.make(findViewById(android.R.id.content), "Query: " + query, Snackbar.LENGTH_LONG).show(); Intent result = new Intent(Home.this, ResultContestLink.class); result.putExtra("query", query); startActivity(result); overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); return false; } @Override public boolean onQueryTextChange(String newText) { //Do some magic return false; } }); searchView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() { @Override public void onSearchViewShown() { //Do some magic } @Override public void onSearchViewClosed() { //Do some magic } }); drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle Toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) { @Override public void onDrawerClosed(View drawerView) { // Code here will be triggered once the drawer closes as we dont want anything to happen so we leave this blank super.onDrawerClosed(drawerView); } @Override public void onDrawerOpened(View drawerView) { // Code here will be triggered once the drawer open as we dont want anything to happen so we leave this blank super.onDrawerOpened(drawerView); } }; //Setting the actionbarToggle to drawer layout drawer.setDrawerListener(Toggle); //calling sync state is necessay or else your hamburger icon wont show up Toggle.syncState(); databaseReferenceEventData = FirebaseDatabase.getInstance().getReference("Contest").child("objects"); databaseReferenceEventData.keepSynced(true); //Initializing NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); Menu m = navigationView.getMenu(); for (int i = 0; i < m.size(); i++) { MenuItem mi = m.getItem(i); //for aapplying a font to subMenu ... SubMenu subMenu = mi.getSubMenu(); if (subMenu != null && subMenu.size() > 0) { for (int j = 0; j < subMenu.size(); j++) { MenuItem subMenuItem = subMenu.getItem(j); applyFontToMenuItem(subMenuItem); } } //the method we have create in activity applyFontToMenuItem(mi); } View header = navigationView.getHeaderView(0); tv_total_sponsers = (TextView) header.findViewById(R.id.tv_total_sponsers); tv_total_contests = (TextView) header.findViewById(R.id.tv_total_contests); tv_total_sponsers.setText("Total Contests websites : " + sharepref.getString("totalsposor", "NA")); // navigationView.setNavigationItemSelectedListener(this); //Setting Navigation View Item Selected Listener to handle the item click of the navigation menu assert navigationView != null; navigationView.setCheckedItem(R.id.nav_home); navigationView.getMenu().getItem(0).setChecked(true); navigationView.setItemIconTintList(null); navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { // This method will trigger on item Click of navigation menu @Override public boolean onNavigationItemSelected(MenuItem menuItem) { navigationView.getMenu().getItem(0).setChecked(false); //Checking if the item is in checked state or not, if not make it in checked state if (activeMenuItem != null) activeMenuItem.setChecked(false); activeMenuItem = menuItem; menuItem.setChecked(true); //else menuItem.setChecked(true); //Closing drawer on item click drawer.closeDrawers(); Fragment fragment = null; FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); //Check to see which item was being clicked and perform appropriate action switch (menuItem.getItemId()) { //Replacing the main content with ContentFragment Which is our Inbox View; case R.id.nav_home: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); fragment = new MainHomeFragmentFirebase(); break; case R.id.nav_longcompetition: fragment = new LongtermCompetition(); break; case R.id.nav_exit: System.exit(0); getIntent().setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); break; case R.id.nav_running: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); fragment = new LiveContests(); break; case R.id.nav_past: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); fragment = new CompletedContest(); break; case R.id.nav_share: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); Intent intentshare = new Intent(Intent.ACTION_SEND); intentshare.setType("text/plain"); intentshare.putExtra(Intent.EXTRA_TEXT, "Best Competitive Programming news/reminder app for Coders.World wide coding competitions and hiring challenges.Solve the challenges and get chance to win awesome prizes and also hired by world famous MNCs(i.e AMAZON , IBM , intel , google , SAP many more...).\n\n\n" + "https://play.google.com/store/apps/details?id=com.techno.jay.codingcontests&hl=en" + "\n\n-developed by Technocrats Appware"); startActivity(Intent.createChooser(intentshare, "Share")); break; case R.id.nav_feedback: final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object try { startActivity( new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); } catch (Exception e) { // Log.d("TAG","Message ="+e); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse( "https://play.google.com/store/apps/details?id=com.techno.jay.codingcontests&hl=en"))); } break; case R.id.nav_hiring: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); Intent result = new Intent(Home.this, ResultContestLink.class); result.putExtra("query", "hiring"); startActivity(result); overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); break; case R.id.nav_setting: Intent seting = new Intent(Home.this, Setting_app.class); startActivity(seting); overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); break; case R.id.nav_aboutus: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); fragment = new Aboutus(); break; /*case R.id.nav_aboutus: // Toast.makeText(getApplicationContext(),"Shop",Toast.LENGTH_SHORT).show(); fragment= new Aboutus_fragment(); break; case R.id.spam: Toast.makeText(getApplicationContext(),"Spam Selected",Toast.LENGTH_SHORT).show(); return true;*/ default: Toast.makeText(getApplicationContext(), "Coming Soon...", Toast.LENGTH_SHORT).show(); break; } if (fragment != null) { fragmentTransaction.replace(R.id.frame, fragment); //getSupportFragmentManager().beginTransaction().replace(R.id.frame, fragment).addToBackStack(null).commit(); fragmentTransaction.addToBackStack(null).commit(); getSupportActionBar().setTitle("Coding Contests"); } else { menuItem.setChecked(false); } return true; } }); }
From source file:eu.codeplumbers.cosi.activities.NoteDetailsActivity.java
private void setupEditor() { findViewById(R.id.action_undo).setOnClickListener(new View.OnClickListener() { @Override/*from w w w. j a v a 2s . com*/ public void onClick(View v) { body.undo(); } }); findViewById(R.id.action_redo).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.redo(); } }); findViewById(R.id.action_bold).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setBold(); } }); findViewById(R.id.action_italic).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setItalic(); } }); findViewById(R.id.action_subscript).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setSubscript(); } }); findViewById(R.id.action_superscript).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setSuperscript(); } }); findViewById(R.id.action_strikethrough).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setStrikeThrough(); } }); findViewById(R.id.action_underline).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setUnderline(); } }); findViewById(R.id.action_heading1).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(1); } }); findViewById(R.id.action_heading2).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(2); } }); findViewById(R.id.action_heading3).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(3); } }); findViewById(R.id.action_heading4).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(4); } }); findViewById(R.id.action_heading5).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(5); } }); findViewById(R.id.action_heading6).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setHeading(6); } }); findViewById(R.id.action_txt_color).setOnClickListener(new View.OnClickListener() { private boolean isChanged; @Override public void onClick(View v) { body.setTextColor(isChanged ? Color.BLACK : Color.RED); isChanged = !isChanged; } }); findViewById(R.id.action_bg_color).setOnClickListener(new View.OnClickListener() { private boolean isChanged; @Override public void onClick(View v) { body.setTextBackgroundColor(isChanged ? Color.TRANSPARENT : Color.YELLOW); isChanged = !isChanged; } }); findViewById(R.id.action_indent).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setIndent(); } }); findViewById(R.id.action_outdent).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setOutdent(); } }); findViewById(R.id.action_align_left).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setAlignLeft(); } }); findViewById(R.id.action_align_center).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setAlignCenter(); } }); findViewById(R.id.action_align_right).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setAlignRight(); } }); findViewById(R.id.action_blockquote).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setBlockquote(); } }); findViewById(R.id.action_insert_bullets).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setBullets(); } }); findViewById(R.id.action_insert_numbers).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.setNumbers(); } }); findViewById(R.id.action_insert_image).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.insertImage("http://www.1honeywan.com/dachshund/image/7.21/7.21_3_thumb.JPG", "dachshund"); } }); findViewById(R.id.action_insert_link).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.insertLink("https://github.com/wasabeef", "wasabeef"); } }); findViewById(R.id.action_insert_checkbox).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { body.insertTodo(); } }); }
From source file:me.chenjiayang.myleancloud.Main2Activity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); tag_main2 = this; chart = (BarChart) findViewById(R.id.main2_barChart); chart.getAxisRight().setEnabled(false); // ??? ?? chart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM); /***//* w w w. j av a 2s .c o m*/ ArrayList<BarEntry> entries = new ArrayList<>();//? ArrayList<String> xVals = new ArrayList<>();//?? random = new Random();//? for (int i = 0; i < 12; i++) { float profit = random.nextFloat() * 100; //entries.add(BarEntry(float val,int positon); entries.add(new BarEntry(profit, i)); xVals.add((i + 1) + ""); } dataSet = new BarDataSet(entries, ""); dataSet.setColors(ColorTemplate.COLORFUL_COLORS); data = new BarData(xVals, dataSet); chart.setData(data); //Y?animateY(int time); chart.animateY(3000); //?? chart.setDescription(""); now_drive_car = (TextView) findViewById(R.id.now_drive_car); now_gas_num = (TextView) findViewById(R.id.now_gas_num); now_mile_num = (TextView) findViewById(R.id.now_mile_num); now_engine_situation = (TextView) findViewById(R.id.now_engine_situation); now_trans_situation = (TextView) findViewById(R.id.now_trans_situation); nav_settings = (BootstrapButton) findViewById(R.id.main2_nav_settings); nav_quit = (BootstrapButton) findViewById(R.id.main2_nav_quit); //main2_pic_hint = (TextView) findViewById(R.id.main2_pic_hint_bg); //main2_pic_hint.getBackground().setAlpha(80); nav_quit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); if (MusicActivity.music_tag == null) { System.exit(0); } else { MusicActivity.music_tag.finish(); System.exit(0); } } }); nav_settings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Main2Activity.this, SettingsActivity.class)); } }); change_car = (BootstrapButton) findViewById(R.id.main2_change_car); change_car.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AVQuery<AVObject> query = new AVQuery<>("Car"); query.whereEqualTo("currUserID", AVUser.getCurrentUser().getObjectId()); query.findInBackground(new FindCallback<AVObject>() { @Override public void done(List<AVObject> list, AVException e) { if (list.size() < 1) { ToastUtil.show(Main2Activity.this, "You haven't bound any cars"); } else if (list.size() == 1) { ToastUtil.show(Main2Activity.this, "You have just one car"); } else { items = new String[list.size()]; car_id = new String[list.size()]; int i = 0; for (AVObject ao : list) { items[i] = ao.get("CarName").toString(); car_id[i] = ao.getObjectId(); i++; } dialog_change_car(); } } }); } }); SubMenuFourImg(); setNowDriving(); three_btn(); mRollViewPager = (RollPagerView) findViewById(R.id.roll_view_pager); // mRollViewPager.setPlayDelay(3000); //? mRollViewPager.setAnimationDurtion(500); //? mRollViewPager.setAdapter(new TestLoopAdapter(mRollViewPager)); //?? // // // //?? mRollViewPager.setHintView(new ColorPointHintView(this, Color.YELLOW, Color.WHITE)); mRollViewPager.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(int position) { //ToastUtil.show(Main2Activity.this,"click on"+position); AVQuery<AVObject> query = new AVQuery<>("News"); query.whereEqualTo("index", position + 1); query.findInBackground(new FindCallback<AVObject>() { @Override public void done(List<AVObject> list, AVException e) { if (list.size() == 1) { news = new Bundle(); news.putString("maintenanceID", list.get(0).getObjectId()); news.putString("main_title", list.get(0).getString("title")); news.putString("main_author", list.get(0).getString("Author")); news.putString("main_p1", list.get(0).getString("P1")); news.putString("main_p2", list.get(0).getString("P2")); news.putString("main_p3", list.get(0).getString("P3")); news.putString("main_p4", list.get(0).getString("P4")); news.putString("main_p5", list.get(0).getString("P5")); news.putString("main_url", list.get(0).getString("url")); Intent intent = new Intent(Main2Activity.this, MaintenItemActivity.class); intent.putExtra("mainten", news); startActivity(intent); } } }); } }); //swipselector(); //??id saveInsID(); //??? pushMsg(); setNoticeImg(); //Toolbar? ToolBarOperation(); setNavViewCount(); // weather(); //Sun_Rotate(); }
From source file:com.ezio.multiwii.Main.PadMainMultiWiiActivity.java
void updateDashboard1() { if (PRVp == null) { PRVp = (PitchRollView) findViewById(R.id.PRVp); PRVp.SetColor(Color.GREEN); PRVr = (PitchRollView) findViewById(R.id.PRVr); PRVr.SetColor(Color.GREEN); pitchRollCircle = (PitchRollCircleView) findViewById(R.id.PitchRollCircle); pitchRollCircle.SetColor(Color.GREEN); compass = (CompassView) findViewById(R.id.Mag); compass.SetColor(Color.GREEN, Color.YELLOW); myCompass = (CompassView) findViewById(R.id.CompassView02); myCompass.SetColor(Color.GRAY, Color.LTGRAY); myCompass.SetText("N"); baro = (TextView) findViewById(R.id.textViewBaro); BattVoltageTV = (TextView) findViewById(R.id.TextViewBattVoltage); PowerSumTV = (TextView) findViewById(R.id.TextViewPowerSum); }/*from w ww. j a v a 2 s. co m*/ myAzimuth = (float) (app.sensors.Heading); if (app.D) { app.mw.angy = app.sensors.Pitch; app.mw.angx = app.sensors.Roll; } PRVp.SetAngle(app.mw.angy); PRVr.SetAngle(app.mw.angx); pitchRollCircle.SetRollPitch(app.mw.angx, app.mw.angy); if (app.MagMode == 1) { compass.SetHeading(-app.mw.head); compass.SetText(""); } else { compass.SetHeading(myAzimuth - app.mw.head); compass.SetText("FRONT"); } myCompass.SetHeading(myAzimuth); baro.setText(String.format("%.2f", app.mw.alt)); BattVoltageTV.setText(String.valueOf((float) (app.mw.bytevbat / 10.0))); PowerSumTV.setText(String.valueOf(app.mw.pMeterSum)); }
From source file:ca.farrelltonsolar.classic.HourLogChart.java
private LinearSeries getLinearSeries(short[] timeStamps, float[] yAxis) { // Create the data points boolean pointsAdded = false; LinearSeries series = new LinearSeries(); series.setLineColor(Color.YELLOW); series.setLineWidth(4);/*from w w w . ja va2 s . c om*/ if (timeStamps != null && yAxis != null && yAxis.length >= timeStamps.length) { short offset = 1440; // 24 hrs ago for (int i = 0; i < timeStamps.length; i++) { short t = timeStamps[i]; t = (short) (offset - t); series.addPoint(new LinearSeries.LinearPoint(t, yAxis[i])); pointsAdded = true; } } if (pointsAdded == false) { // default to test pattern for (double i = 0d; i <= (2d * Math.PI); i += 0.1d) { series.addPoint(new LinearSeries.LinearPoint(i, Math.sin(i))); // test pattern } } return series; }
From source file:ca.farrelltonsolar.classic.DayLogChart.java
private LinearSeries getLinearSeries(float[] yAxis, float factor) { // Create the data points LinearSeries series = new LinearSeries(); series.setLineColor(Color.YELLOW); series.setLineWidth(4);/*w w w . j av a 2s .c om*/ if (yAxis != null && yAxis.length >= 24) { for (int i = 0; i < 24; i++) { series.addPoint(new LinearSeries.LinearPoint(23 - i, yAxis[i] / factor)); } } else { // default to test pattern for (double i = 0d; i <= (2d * Math.PI); i += 0.1d) { series.addPoint(new LinearSeries.LinearPoint(i, Math.sin(i))); // test pattern } } return series; }
From source file:com.hmatalonga.greenhub.util.Notifier.java
public static void batteryWarningTemperature(final Context context) { if (sNotificationManager == null) { sNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); }/* ww w. jav a2 s.c o m*/ NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_alert_circle_white_24dp) .setContentTitle(context.getString(R.string.notif_battery_warning)) .setContentText(context.getString(R.string.notif_battery_warm)).setAutoCancel(true) .setOngoing(false).setLights(Color.YELLOW, 500, 2000).setVibrate(new long[] { 0, 400, 1000 }) .setPriority(SettingsUtils.fetchNotificationsPriority(context)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mBuilder.setVisibility(Notification.VISIBILITY_PUBLIC); } // Creates an explicit intent for an Activity in your app Intent resultIntent = new Intent(context, MainActivity.class); resultIntent.putExtra("tab", 2); // The stack builder object will contain an artificial back stack for the // started Activity. // This ensures that navigating backward from the Activity leads out of // your application to the Home screen. TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); // Adds the back stack for the Intent (but not the Intent itself) stackBuilder.addParentStack(InboxActivity.class); // Adds the Intent that starts the Activity to the top of the stack stackBuilder.addNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); mBuilder.setContentIntent(resultPendingIntent); // Because the ID remains unchanged, the existing notification is updated. Notification notification = mBuilder.build(); notification.flags |= Notification.FLAG_ONLY_ALERT_ONCE; sNotificationManager.notify(Config.NOTIFICATION_TEMPERATURE_WARNING, notification); }