private void updateViewVisibility() { mViewSwitcher.reset(); if (mStatus == null) { mViewSwitcher.setDisplayedChild(0); } else { mViewSwitcher.setDisplayedChild(1); mTweetFeedListAdapter.notifyDataSetChanged(); } }
public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if (row == null) { LayoutInflater inflater = context.getLayoutInflater(); row = inflater.inflate(R.layout.list_row, null); } else row.setTag(""); // when reused, don't pretend to be something else TextView name = (TextView) row.findViewById(R.id.row_label); name.setText(mItems.get(position).mLabel); if (mLoadingBar == position || mItems.get(position).icon() == R.drawable.now_playing || mItems.get(position).icon() == R.drawable.now_paused) { ViewSwitcher switcher = (ViewSwitcher) row.findViewById(R.id.row_view_switcher); row.findViewById(R.id.row_view_switcher).setVisibility(View.VISIBLE); switcher.setDisplayedChild(mLoadingBar == position ? 1 : 0); ((ImageView) row.findViewById(R.id.row_disclosure_icon)) .setImageResource(mItems.get(position).icon()); } else { row.findViewById(R.id.row_view_switcher).setVisibility(View.GONE); } row.findViewById(R.id.row_icon).setVisibility(View.VISIBLE); ((ImageView) row.findViewById(R.id.row_icon)).setScaleType(ImageView.ScaleType.CENTER); ((ImageView) row.findViewById(R.id.row_icon)).setImageResource(R.drawable.list_icon_station); if (position == mItems.size() - 1) { row.setBackgroundResource(R.drawable.list_entry_rounded_bottom); row.setTag("bottom"); } else row.setBackgroundResource(R.drawable.list_entry); return row; }
public void onClick(View arg0) { // wird die Raumnummer gedrückt wird der Slider geöffnet oder geschlossen if (arg0 == raumnummer) { SlidingDrawer slider = (SlidingDrawer) findViewById(R.id.slidingDrawer1); slider.animateOpen(); } // wechselt zum if (arg0 == raum) { switcher.setDisplayedChild(0); } // wechselt zum Campus Display if (arg0 == flip_1_2 || arg0 == flip_3_2 || arg0 == cam_camp || arg0 == raum_camp) { flip.setDisplayedChild(1); } // wechselt zur Kamera Sicht if (arg0 == flip_2_1 || arg0 == camp_cam) { flip.setDisplayedChild(0); } // wechselt raumplan if (arg0 == flip_2_3 || arg0 == camp_raum) { flip.setDisplayedChild(2); // Beispiel raumplan ImageView bsp = (ImageView) findViewById(R.id.image_raumplan_scroll); if (nummer.equals("341")) { bsp.setBackgroundResource(R.drawable.ic2_stundenplan); } } }
// once TTS engine is loaded @Override public void onLoaded(boolean loaded) { if (loaded) { runOnUiThread( new Runnable() { @Override public void run() { // hide the loading screen when loaded switcher.showNext(); } }); } else { // reset the loading screen switcher.setDisplayedChild(1); } }
public void markAsDone(InstallResult result) { mSwitcher.setDisplayedChild(1); mFairyAnimation.stop(); switch (result.getResult()) { case OK: final View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { setResult(RESULT_OK); finish(); } }; mButtonStartApp.setOnClickListener(onClickListener); mFairyContainer.setOnClickListener(onClickListener); mTextViewSpeechBubble.setText(R.string.start_app); break; case NOT_ENOUGH_DISK_SPACE: String errorMsg = getString(R.string.install_error_disk_space); final long diff = result.getNeededSpace() - result.getFreeSpace(); errorMsg = String.format(errorMsg, (diff / (1024 * 1024))); mTextViewSpeechBubble.setText(errorMsg); mButtonStartApp.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { setResult(RESULT_CANCELED); finish(); } }); break; case UNSPEZIFIED_ERROR: errorMsg = getString(R.string.install_error); mTextViewSpeechBubble.setText(errorMsg); mButtonStartApp.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { setResult(RESULT_CANCELED); finish(); } }); break; } }
@Override protected void onResume() { switcher.setDisplayedChild(0); loadTTS(); super.onResume(); }
private void setShowLog(boolean showLog) { this.showLog = showLog; detailsSwitcher.setDisplayedChild(showLog ? DETAILS_PAGE_LOG : DETAILS_PAGE_BUTTON); }
private void onDownloadStarted() { switcher.setDisplayedChild(PAGE_PROGRESS); resetProgress(); }
private void onDownloadDone() { switcher.setDisplayedChild(PAGE_INFO); setShowLog(false); }
/** Wird der Button suchen gedrückt wird ein Event ausgelöst der eine neue Activity startet */ public void onClick(View arg0) { if (arg0 == suchen) { Intent in = new Intent(GastFrageSicht.this, CamNavSicht.class); if (choice == 1) { try { // kontrolliere ob die Nummer auch stimmt, wenn ja gib sie weiter an // die nächste Activity und starte sie if (h.beuthCheck(text.getText().toString())) { in.putExtra("Nummer", text.getText().toString()); startActivity(in); } else { // Dialog Fehler if (KontoControl.getSPRACHE().equals("english")) { Toast toast = Toast.makeText(this, "Sorry, this room does not exist!", Toast.LENGTH_SHORT); toast.show(); } else { Toast toast = Toast.makeText( this, "Tut mir leid. Diesen Raum gibt es nicht!", Toast.LENGTH_SHORT); toast.show(); } } } catch (StringIndexOutOfBoundsException e) { if (KontoControl.getSPRACHE().equals("english")) { Toast toast = Toast.makeText(this, "No room number was entered.", Toast.LENGTH_SHORT); toast.show(); } else { Toast toast = Toast.makeText(this, "Es wurde keine Raumnummer eingegeben.", Toast.LENGTH_SHORT); toast.show(); } } } if (choice == 2) { in.putExtra("Nummer", spinVorlesung.getSelectedItem().toString()); startActivity(in); } if (choice == 3) { if (!spinBeRaeume.getSelectedItem().toString().equals("Keine")) { in.putExtra("Nummer", spinBeRaeume.getSelectedItem().toString()); startActivity(in); } else { // Dialog Fehler if (KontoControl.getSPRACHE().equals("english")) { Toast toast = Toast.makeText(this, "There are no special rooms.", Toast.LENGTH_SHORT); toast.show(); } else { Toast toast = Toast.makeText(this, "Keine besonderen Räume vorhanden.", Toast.LENGTH_SHORT); toast.show(); } } } } if (arg0 == hausSwitcher) { if (index == 1) { hausSwitcher.setDisplayedChild(1); index = 0; } else { hausSwitcher.setDisplayedChild(0); index = 1; } } if (arg0 == r1) { r1.setBackgroundResource(R.drawable.radio_button_an); text.setBackgroundColor(Color.WHITE); spinZeit.setEnabled(false); spinVorlesung.setEnabled(false); spinBeRaeume.setEnabled(false); r2.setBackgroundResource(R.drawable.radio_button_aus); r3.setBackgroundResource(R.drawable.radio_button_aus); choice = 1; } if (arg0 == r2) { r2.setBackgroundResource(R.drawable.radio_button_an); text.setBackgroundColor(Color.DKGRAY); spinZeit.setEnabled(true); spinVorlesung.setEnabled(true); spinBeRaeume.setEnabled(false); r1.setBackgroundResource(R.drawable.radio_button_aus); r3.setBackgroundResource(R.drawable.radio_button_aus); choice = 2; } if (arg0 == r3) { r3.setBackgroundResource(R.drawable.radio_button_an); text.setBackgroundColor(Color.DKGRAY); spinZeit.setEnabled(false); spinVorlesung.setEnabled(false); spinBeRaeume.setEnabled(true); r1.setBackgroundResource(R.drawable.radio_button_aus); r2.setBackgroundResource(R.drawable.radio_button_aus); choice = 3; } }
public void showProgressBar() { viewSwitcher.setDisplayedChild(PROGRESS_VIEW); }
public void showButton() { viewSwitcher.setDisplayedChild(BUTTON_VIEW); }