List of usage examples for android.widget ScrollView setBackgroundColor
@RemotableViewMethod public void setBackgroundColor(@ColorInt int color)
From source file:org.de.jmg.learn._MainActivity.java
private void flashwords() throws Exception { Runnable r;/*w w w. j av a2 s. c o m*/ final RelativeLayout layout = (RelativeLayout) findViewById(R.id.layoutMainParent); assert layout != null; layout.setBackgroundColor(_main.Colors.get(ColorItems.background_wrong).ColorValue); final ScrollView layoutScroll = (ScrollView) findViewById(R.id.layoutMain); assert layoutScroll != null; layoutScroll.setBackgroundColor(_main.Colors.get(ColorItems.background_wrong).ColorValue); final RelativeLayout layoutButtons = (RelativeLayout) findViewById(R.id.layoutButtons); assert layoutButtons != null; layoutButtons.setVisibility(View.GONE); View tb = _main.findViewById(R.id.action_bar); tb.setVisibility(View.GONE); _txtMeaning1.setBackgroundResource(0); _txtMeaning2.setBackgroundResource(0); _txtMeaning3.setBackgroundResource(0); if (_isSmallDevice) { _txtKom.setVisibility(View.GONE); } _txtWord.requestFocus(); long delay = 0; for (int i = 0; i < _main.PaukRepetitions; i++) { // _txtWord.setBackgroundResource(R.layout.roundedbox); r = new showWordBordersTask(); rFlashs.add(r); handler.postDelayed(r, delay); delay += _main.DisplayDurationWord * 1000 * (_main.blnTextToSpeech ? 20 : 1); r = new hideWordBordersTask(); rFlashs.add(r); handler.postDelayed(r, delay); BorderedEditText Beds[] = { _txtMeaning1, _txtMeaning2, _txtMeaning3 }; for (int ii = 0; ii < _vok.getAnzBed(); ii++) { if (!libString.IsNullOrEmpty(_vok.getBedeutungen()[ii])) { r = new showBedBordersTask(Beds[ii]); rFlashs.add(r); handler.postDelayed(r, delay); delay += _main.DisplayDurationBed * 1000 * (_main.blnTextToSpeech ? 20 : 1); r = new hideBedBordersTask(Beds[ii]); rFlashs.add(r); handler.postDelayed(r, delay); } } } r = new resetLayoutTask(layout); rFlashs.add(r); handler.postDelayed(r, delay); delay += 1000; }
From source file:give_me_coins.dashboard.MainScreen.java
@Override public boolean onOptionsItemSelected(MenuItem item) { // Handle presses on the action bar items ScrollView summary = (ScrollView) findViewById(R.id.summary_layout); ScrollView dashBoard = (ScrollView) findViewById(R.id.dashboard_layout); boolean change = false; switch (item.getItemId()) { case R.id.ltc_menu: coin_select = 1;//from w ww .j a v a 2 s . c om Toast.makeText(this, "Coin changed to LTC", Toast.LENGTH_LONG).show(); if (API_key_saved.contains("api-btc")) { API_key_saved = API_key_saved.replace("api-btc", "api-ltc"); change = true; } if (API_key_saved.contains("api-ftc")) { API_key_saved = API_key_saved.replace("api-ftc", "api-ltc"); change = true; } GMCPoolService.url_fixed = URL + "/pool/api-ltc"; clearPoolServiceVars(); mAppSectionsPagerAdapter.notifyDataSetChanged(); int ltcColor = getResources().getColor(R.color.ltc); if (dashBoard != null) { dashBoard.setBackgroundColor(ltcColor); } if (summary != null) { summary.setBackgroundColor(ltcColor); } return true; case R.id.btc_menu: coin_select = 2; Toast.makeText(this, "Coin changed to BTC", Toast.LENGTH_LONG).show(); if (API_key_saved.contains("api-ltc")) { API_key_saved = API_key_saved.replace("api-ltc", "api-btc"); change = true; } if (API_key_saved.contains("api-ftc")) { API_key_saved = API_key_saved.replace("api-ftc", "api-btc"); change = true; } GMCPoolService.url_fixed = URL + "/pool/api-btc"; clearPoolServiceVars(); mAppSectionsPagerAdapter.notifyDataSetChanged(); int btcColor = getResources().getColor(R.color.btc); if (dashBoard != null) { dashBoard.setBackgroundColor(btcColor); } if (summary != null) { summary.setBackgroundColor(btcColor); } return true; case R.id.ftc_menu: coin_select = 3; Toast.makeText(this, "Coin changed to FTC", Toast.LENGTH_LONG).show(); if (API_key_saved.contains("api-ltc")) { API_key_saved = API_key_saved.replace("api-ltc", "api-ftc"); change = true; } if (API_key_saved.contains("api-btc")) { API_key_saved = API_key_saved.replace("api-btc", "api-ftc"); change = true; } GMCPoolService.url_fixed = URL + "/pool/api-ftc"; clearPoolServiceVars(); mAppSectionsPagerAdapter.notifyDataSetChanged(); int ftcColor = getResources().getColor(R.color.ftc); if (dashBoard != null) { dashBoard.setBackgroundColor(ftcColor); } if (summary != null) { summary.setBackgroundColor(ftcColor); } return true; default: mAppSectionsPagerAdapter.notifyDataSetChanged(); return super.onOptionsItemSelected(item); } /* * case R.id.refresh: updateNow(); return true; */ }