Java 类android.widget.ToggleButton 实例源码

项目:quickblox-android    文件:AudioConversationFragment.java   
@Override
protected void initViews(View view) {
    super.initViews(view);
    timerChronometer = (Chronometer) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.chronometer_timer_audio_call);

    ImageView firstOpponentAvatarImageView = (ImageView) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.image_caller_avatar);
    firstOpponentAvatarImageView.setBackgroundDrawable(UiUtils.getColorCircleDrawable(opponents.get(0).getId()));

    alsoOnCallText = (TextView) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.text_also_on_call);
    setVisibilityAlsoOnCallTextView();

    firstOpponentNameTextView = (TextView) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.text_caller_name);
    firstOpponentNameTextView.setText(opponents.get(0).getFullName());

    otherOpponentsTextView = (TextView) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.text_other_inc_users);
    otherOpponentsTextView.setText(getOtherOpponentsNames());

    audioSwitchToggleButton = (ToggleButton) view.findViewById(com.mobilemaster.quickblox.groupchatwebrtc.R.id.toggle_speaker);
    audioSwitchToggleButton.setVisibility(View.VISIBLE);

    actionButtonsEnabled(false);
}
项目:HighSchoolScienceBowlPractice-Android    文件:StudyModeSettingsPage.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_study_mode_settings_page);

    biologyButton = (ToggleButton) findViewById(R.id.biologyButton);
    chemistryButton = (ToggleButton) findViewById(R.id.chemistryButton);
    earthAndSpaceButton = (ToggleButton) findViewById(R.id.earthAndSpaceButton);
    energyButton = (ToggleButton) findViewById(R.id.energyButton);
    mathButton = (ToggleButton) findViewById(R.id.mathButton);
    physicsButton = (ToggleButton) findViewById(R.id.physicsButton);
    randomButton = (ToggleButton) findViewById(R.id.randomButton);

    roundNumPicker = (NumberPicker) findViewById(R.id.roundNumPicker);
    roundNumPicker.setMinValue(0);
    roundNumPicker.setMaxValue(roundOptions.length-1);
    roundNumPicker.setWrapSelectorWheel(false);
    roundNumPicker.setDisplayedValues(roundOptions);

    menuButton = (Button) findViewById(R.id.menuButton);
}
项目:GitHub    文件:MockLocationsActivity.java   
private void initViews() {
    latitudeInput = (EditText) findViewById(R.id.latitude_input);
    longitudeInput = (EditText) findViewById(R.id.longitude_input);
    mockLocationView = (TextView) findViewById(R.id.mock_location_view);
    updatedLocationView = (TextView) findViewById(R.id.updated_location_view);
    mockModeToggleButton = (ToggleButton) findViewById(R.id.toggle_button);
    setLocationButton = (Button) findViewById(R.id.set_location_button);

    mockModeToggleButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            setMockMode(isChecked);
            setLocationButton.setEnabled(isChecked);
        }
    });
    setLocationButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            addMockLocation();
        }
    });
}
项目:GitHub    文件:AnimationControlsManager.java   
public AnimationControlsManager(
    AnimatedDrawable2 animatedDrawable,
    @Nullable SeekBar seekBar,
    @Nullable ToggleButton playPauseToggleButton,
    @Nullable View resetButton) {
  mAnimatedDrawable = animatedDrawable;
  mSeekBar = seekBar;
  mPlayPauseToggleButton = playPauseToggleButton;
  mResetButton = resetButton;

  setupPlayPauseToggleButton();
  setupResetButton();
  setupSeekBar();

  mAnimatedDrawable.setAnimationListener(mAnimationListener);
  updateBackendData(mAnimatedDrawable.getAnimationBackend());
}
项目:GitHub    文件:MediaControlFragment.java   
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  ImageView imageView = (ImageView) view.findViewById(R.id.animation_container);

  // Create a new animated drawable. The backend will be set by the backend configurator.
  mAnimatedDrawable = new AnimatedDrawable2();

  imageView.setImageDrawable(mAnimatedDrawable);

  mAnimationControlsManager = new AnimationControlsManager(
      mAnimatedDrawable,
      (SeekBar) view.findViewById(R.id.seekbar),
      (ToggleButton) view.findViewById(R.id.playpause),
      view.findViewById(R.id.reset));

  new SampleAnimationBackendConfigurator(
      (Spinner) view.findViewById(R.id.spinner),
      this);
}
项目:LiveNotes    文件:KeySigDialogFragment.java   
private void initializeViews(Dialog dialog) {
    major = (ToggleButton) dialog.findViewById(R.id.major);
    minor = (ToggleButton) dialog.findViewById(R.id.minor);
    dialog.findViewById(R.id.major_parent).setOnClickListener(__ -> onMajorClicked());
    dialog.findViewById(R.id.minor_parent).setOnClickListener(__ -> onMinorClicked());

    keySigImage = (ImageView) dialog.findViewById(R.id.key_sig_image);

    key = (NumberPicker) dialog.findViewById(R.id.key);
    key.setWrapSelectorWheel(false);
    key.setMinValue(0);
    key.setMaxValue(KeySigHandler.FIFTHS.length - 1);

    major.setChecked(false);
    onMajorClicked();
    key.setOnValueChangedListener(this);
    key.setValue(6);
}
项目:mousetodon    文件:MouseApp.java   
public void mute(final View v) {
    final NextAction dumbaction = new NextAction() {
        public void run(String res) {}
    };
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            ToggleButton tb = (ToggleButton)v;
            if (tb.isChecked()) {
                connect.muteUser(VisuUser.curuserid, dumbaction);
                message("muting user "+VisuUser.curuserid);
            } else {
                connect.unmuteUser(VisuUser.curuserid, dumbaction);
                message("unmuting user "+VisuUser.curuserid);
            }
        }
    });
}
项目:LocationProvider    文件:LocationTrackActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_track);
    tbTrack = (ToggleButton) findViewById(R.id.tb_track);
    tvMessage = (TextView) findViewById(R.id.tv_location_message);

    tbTrack.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                startTrack();
            } else {
                stopTrack();
            }
        }

    });
}
项目:mousetodon    文件:MouseApp.java   
public void follow(final View v) {
    final NextAction dumbaction = new NextAction() {
        public void run(String res) {}
    };
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            ToggleButton tb = (ToggleButton)v;
            if (tb.isChecked()) {
                connect.followUser(VisuUser.curuserid, dumbaction);
                message("following user "+VisuUser.curuserid);
            } else {
                connect.unfollowUser(VisuUser.curuserid, dumbaction);
                message("unfollowing user "+VisuUser.curuserid);
            }
        }
    });
}
项目:FakeLock    文件:MyItemRecyclerViewAdapter.java   
public ViewHolder(View view) {
    super(view);
    mView = view;
    appNameTextView = (TextView) view.findViewById(R.id.appNameTextView);
    appPackageNameTextView = (TextView) view.findViewById(R.id.appPackageNameTextView);
    appIconImageView = (ImageView) view.findViewById(R.id.appIconImageView);
    hideAppToggleButton = (ToggleButton) view.findViewById(R.id.hideAppToggleButton);

    hideAppToggleButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            String packageName = appPackageNameTextView.getText().toString();
            if (isChecked) {
                hideAppsPreferenceUtility.addAppToHiddenAppsList(packageName);
            } else {
                hideAppsPreferenceUtility.removeAppToHiddenAppsList(packageName);
            }
        }
    });
}
项目:Hexis    文件:ModifyItemDialogFragment.java   
/**
 * Select a Quadrant, and update the ToggleButtons to reflect user choice.
 *
 * @param n Selected Quadrant
 */
protected void selectQuadrant(int n) {
  // Set selectedQuadrant to what the user chose
  selectedQuadrant = n;

  // Create an array of the ToggleButtons for easy updating
  ToggleButton[] arr = {quadOne, quadTwo, quadThree, quadFour};

  // Update the ToggleButtons based on if they were selected or not
  for (int i = 0; i < arr.length; i++) {
    if (i == selectedQuadrant) {
      arr[i].setChecked(true);
    } else {
      arr[i].setChecked(false);
    }
  }
}
项目:HighSchoolScienceBowlPractice-Android    文件:QuizModeSettingsPage.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_quiz_mode_settings);

    biologyButton = (ToggleButton) findViewById(R.id.biologyButton);
    chemistryButton = (ToggleButton) findViewById(R.id.chemistryButton);
    earthAndSpaceButton = (ToggleButton) findViewById(R.id.earthAndSpaceButton);
    energyButton = (ToggleButton) findViewById(R.id.energyButton);
    mathButton = (ToggleButton) findViewById(R.id.mathButton);
    physicsButton = (ToggleButton) findViewById(R.id.physicsButton);
    randomButton = (ToggleButton) findViewById(R.id.randomButton);

    tossupTimeSpinner = (Spinner) findViewById(R.id.tossupTimeSelector);
    bonusTimeSpinner = (Spinner) findViewById(R.id.bonusTimeSelector);

    menuButton = (Button) findViewById(R.id.menuButton);
}
项目:thesis-project    文件:StudentViewActivity.java   
public void init() {
    recyclerView = (RecyclerView) findViewById(R.id.student_recyclerview);
    btnSearch = (ToggleButton)findViewById(R.id.btn_search_student);
    btnSearchOk = (Button)findViewById(R.id.btn_search_ok_student);
    btnBack = (Button) findViewById(R.id.btn_back_student);
    editTextSearch =(EditText)findViewById(R.id.etxt_search_student);
    frameLayoutSearch = (FrameLayout)findViewById(R.id.frame_search_student);
    txtMsgContent = (TextView) findViewById(R.id.message_label_stud);

    frameLayoutSearch.setVisibility(View.GONE);
    txtMsgContent.setVisibility(View.INVISIBLE);

    btnSearch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked)
                frameLayoutSearch.setVisibility(View.VISIBLE);
            else
                frameLayoutSearch.setVisibility(View.GONE);
        }
    });
}
项目:thesis-project    文件:ScheduleViewActivity.java   
public void init() {
    recyclerView = (RecyclerView) findViewById(R.id.teacher_schedule_recyclerview);
    btnSearch = (ToggleButton) findViewById(R.id._btn_search_schedule);
    btnSearchOk = (Button) findViewById(R.id._btn_search_ok_schedule);
    btnBack = (Button) findViewById(R.id.btn_back_schedule);
    editTextSearch = (EditText) findViewById(R.id.etxt_search_schedule);
    frameLayoutSearch = (FrameLayout) findViewById(R.id.frame_search_schedule);
    txtMsgContent = (TextView) findViewById(R.id.message_label_sc1);

    frameLayoutSearch.setVisibility(View.GONE);
    txtMsgContent.setVisibility(View.INVISIBLE);

    btnSearch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked)
                frameLayoutSearch.setVisibility(View.VISIBLE);
            else
                frameLayoutSearch.setVisibility(View.GONE);
        }
    });
}
项目:thesis-project    文件:ExamInputAdapter.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:ProjectInputAdapter.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:ActivityInputAdapter.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:AssignmentInputAdapterF.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:QuizInputAdapter.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:ExamInputAdapterF.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:AssignmentInputAdapter.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:QuizInputAdapterF.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:ActivityInputAdapterF.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:ProjectInputAdapterF.java   
StudentAdapterViewHolder(View itemView) {
    super(itemView);
    studentImage = (ImageView) itemView.findViewById(R.id.f_data_student_profile);
    studentDetail = (TextView) itemView.findViewById(R.id.input_cardview_name);
    editText = (EditText) itemView.findViewById(R.id.input_cardview_score);
    layout = (LinearLayout) itemView.findViewById(R.id.input_cardview_layout);
    txInit = (TextView) itemView.findViewById(R.id.input_cardview_init);
    btnMic = (ToggleButton) itemView.findViewById(R.id.input_cardview_mic);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBarney);
    btnMic.setOnCheckedChangeListener(this);

    speech = SpeechRecognizer.createSpeechRecognizer(context);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
}
项目:thesis-project    文件:MainActivity2.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btnSearch = (ToggleButton) findViewById(R.id.btn_search_class);
    btnSearchOk = (Button) findViewById(R.id._btn_search_ok_class);
    btnBack = (Button) findViewById(R.id.btn_back_student);

    editTextSearch = (EditText) findViewById(R.id.etxt_search_class);
    frameLayoutSearch = (FrameLayout) findViewById(R.id.frame_search_class);
    tabLayout = (TabLayout) findViewById(R.id.tabs);
    viewPager = (ViewPager) findViewById(R.id.viewpager);
    setupViewPager(viewPager);
    tabLayout.setupWithViewPager(viewPager);
    setupTabIcons();

    frameLayoutSearch.setVisibility(View.GONE);
    btnSearch.setOnCheckedChangeListener(this);


}
项目:buildAPKsSamples    文件:WalkieTalkieActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.walkietalkie);

    ToggleButton pushToTalkButton = (ToggleButton) findViewById(R.id.pushToTalk);
    pushToTalkButton.setOnTouchListener(this);

    // Set up the intent filter.  This will be used to fire an
    // IncomingCallReceiver when someone calls the SIP address used by this
    // application.
    IntentFilter filter = new IntentFilter();
    filter.addAction("android.SipDemo.INCOMING_CALL");
    callReceiver = new IncomingCallReceiver();
    this.registerReceiver(callReceiver, filter);

    // "Push to talk" can be a serious pain when the screen keeps turning off.
    // Let's prevent that.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    initializeManager();
}
项目:CustomAndroidOneSheeld    文件:ShieldFragmentParent.java   
@Override
    public void onResume() {
        super.onResume();
//        if (getApplication().getAppFirmata().isOpen() == false && !getApplication().getIsDemoMode()) return;
        if (getApplication().getRunningShields().get(getControllerTag()) == null) {
            if (!reInitController())
                return;
        }
        if (activity == null || activity.findViewById(R.id.shieldStatus) == null)
            return;
        MainActivity.currentShieldTag = getControllerTag();
        // restore the staus of shield interaction toggle button
        if (getApplication().getRunningShields().get(getControllerTag()) != null)
            ((ToggleButton) activity.findViewById(R.id.shieldStatus))
                    .setChecked(getApplication().getRunningShields().get(
                            getControllerTag()).isInteractive);
        // Google analytics tracking
        getApplication().getTracker().setScreenName(getControllerTag());
        getApplication().getTracker().send(
                new HitBuilders.ScreenViewBuilder().build());
        // Logging current view for crashlytics
        CrashlyticsUtils.setString("Current View", getTag());
        ((T) this).doOnResume();
    }
项目:mao-android    文件:Camera2Fragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    log.i("onCreateView");
    View rootView = inflater.inflate(R.layout.fragment_camera, container, false);

    mCameraManager = (CameraManager) getContext().getSystemService(Context.CAMERA_SERVICE);

    mHandlerThread = new HandlerThread("CameraFragment_HandlerThread");
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());

    ttv_camera = (AutoFitTextureView) rootView.findViewById(R.id.ttv_camera);
    ttv_camera.setSurfaceTextureListener(this);

    tbtn_camera = (ToggleButton) rootView.findViewById(R.id.tbtn_camera);
    tbtn_camera.setOnCheckedChangeListener(this);

    return rootView;
}
项目:boohee_v5.6    文件:AddCameraRecordActivity$$ViewInjector.java   
public void inject(Finder finder, final T target, Object source) {
    target.toggle_bingo = (ToggleButton) finder.castView((View) finder.findRequiredView
            (source, R.id.toggle_bingo, "field 'toggle_bingo'"), R.id.toggle_bingo, "field " +
            "'toggle_bingo'");
    target.et_calory = (EditText) finder.castView((View) finder.findRequiredView(source, R.id
            .et_calory, "field 'et_calory'"), R.id.et_calory, "field 'et_calory'");
    target.et_name = (EditText) finder.castView((View) finder.findRequiredView(source, R.id
            .et_name, "field 'et_name'"), R.id.et_name, "field 'et_name'");
    target.iv_photo = (PhotoView) finder.castView((View) finder.findRequiredView(source, R.id
            .iv_photo, "field 'iv_photo'"), R.id.iv_photo, "field 'iv_photo'");
    ((View) finder.findRequiredView(source, R.id.ll_invite_bingo, "method 'onClick'"))
            .setOnClickListener(new DebouncingOnClickListener() {
        public void doClick(View p0) {
            target.onClick(p0);
        }
    });
}
项目:boohee_v5.6    文件:CopyRecordActivity.java   
@OnClick({2131427582, 2131427584})
public void onClick(View v) {
    boolean z = false;
    switch (v.getId()) {
        case R.id.ll_check_all:
            ToggleButton toggleButton = this.tb_check_all;
            if (!this.tb_check_all.isChecked()) {
                z = true;
            }
            toggleButton.setChecked(z);
            checkAll(this.tb_check_all.isChecked());
            return;
        case R.id.rl_copy:
            if (this.copyCount == 0) {
                Helper.showToast((CharSequence) "请选择复制内容");
                return;
            }
            this.copyFlag = 0;
            copyEating();
            copyActivity();
            return;
        default:
            return;
    }
}
项目:boohee_v5.6    文件:BooheeNoticeActivity.java   
void initNotice(int type, ToggleButton toggleButton, TextView textView) {
    ArrayList<Alarm> alarms = this.alarm_dao.getAlarmsByNoticeType(type);
    if (alarms != null && alarms.size() != 0) {
        String timeString = "";
        for (int i = 0; i < alarms.size(); i++) {
            Alarm alarm = (Alarm) alarms.get(i);
            if (alarm.is_open()) {
                timeString = timeString + " " + ((Alarm) alarms.get(i)).formatTime();
                this.alarm_dao.update(alarm);
                RemindService.start(alarm, this.ctx);
            }
        }
        if (TextUtils.isEmpty(timeString)) {
            toggleButton.setChecked(false);
            textView.setText(R.string.ft);
            return;
        }
        toggleButton.setChecked(true);
        textView.setText("每天 " + timeString);
    }
}
项目:boohee_v5.6    文件:BooheeNoticeActivity.java   
private void findView() {
    this.txt_notice_good_morning_sub_title = (TextView) findViewById(R.id
            .txt_notice_good_morning_sub_title);
    this.txt_notice_diet_sub_title = (TextView) findViewById(R.id.txt_notice_diet_sub_title);
    this.txt_notice_sport_sub_title = (TextView) findViewById(R.id.txt_notice_sport_sub_title);
    this.txt_notice_water_sub_title = (TextView) findViewById(R.id.txt_notice_water_sub_title);
    this.txt_notice_box_count = (TextView) findViewById(R.id.txt_notice_box_count);
    this.txt_notice_good_morning_sub_title.setEllipsize(TruncateAt.END);
    this.txt_notice_diet_sub_title.setEllipsize(TruncateAt.END);
    this.txt_notice_sport_sub_title.setEllipsize(TruncateAt.END);
    this.txt_notice_water_sub_title.setEllipsize(TruncateAt.END);
    this.tb_notice_good_morning = (ToggleButton) findViewById(R.id.tb_notice_good_morning);
    this.tb_notice_diet = (ToggleButton) findViewById(R.id.tb_notice_diet);
    this.tb_notice_sport = (ToggleButton) findViewById(R.id.tb_notice_sport);
    this.tb_notice_water = (ToggleButton) findViewById(R.id.tb_notice_water);
}
项目:boohee_v5.6    文件:WaterNoticeActivity.java   
private void findView() {
    this.txt_notice_water_time_one = (TextView) findViewById(R.id.txt_notice_water_time_one);
    this.txt_notice_water_time_two = (TextView) findViewById(R.id.txt_notice_water_time_two);
    this.txt_notice_water_time_three = (TextView) findViewById(R.id
            .txt_notice_water_time_three);
    this.txt_notice_water_time_four = (TextView) findViewById(R.id.txt_notice_water_time_four);
    this.txt_notice_water_time_five = (TextView) findViewById(R.id.txt_notice_water_time_five);
    this.txt_notice_water_time_six = (TextView) findViewById(R.id.txt_notice_water_time_six);
    this.txt_notice_water_time_seven = (TextView) findViewById(R.id
            .txt_notice_water_time_seven);
    this.txt_notice_water_time_eight = (TextView) findViewById(R.id
            .txt_notice_water_time_eight);
    this.tb_notice_water_one = (ToggleButton) findViewById(R.id.tb_notice_water_one);
    this.tb_notice_water_two = (ToggleButton) findViewById(R.id.tb_notice_water_two);
    this.tb_notice_water_three = (ToggleButton) findViewById(R.id.tb_notice_water_three);
    this.tb_notice_water_four = (ToggleButton) findViewById(R.id.tb_notice_water_four);
    this.tb_notice_water_five = (ToggleButton) findViewById(R.id.tb_notice_water_five);
    this.tb_notice_water_six = (ToggleButton) findViewById(R.id.tb_notice_water_six);
    this.tb_notice_water_seven = (ToggleButton) findViewById(R.id.tb_notice_water_seven);
    this.tb_notice_water_eight = (ToggleButton) findViewById(R.id.tb_notice_water_eight);
}
项目:MobiRNN-EMDL17    文件:PhoneActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    controlToggle = (ToggleButton) findViewById(R.id.toggle_control);

    mStatusTextView = (TextView) findViewById(R.id.tv_status);
    mStatusTextView.setMovementMethod(new ScrollingMovementMethod());
    mResultProgress = (ProgressBar) findViewById(R.id.progress);
    mResultProgress.setMax(100);

    NumberPicker picker = (NumberPicker) findViewById(R.id.number_picker);
    picker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
    picker.setOnValueChangedListener(this);
    picker.setDisplayedValues(mSampleSizes);
    picker.setMinValue(0);
    picker.setMaxValue(mSampleSizes.length - 1);
    picker.setWrapSelectorWheel(true);
    picker.setValue(0);
    mSampleSize = 1;
    Logger.i("Sample size initial value: %s", mSampleSize);

    checkPermissions();

}
项目:BarcodeReaderView    文件:ScannerActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scanner);

    ((ToggleButton) findViewById(R.id.tb_torch)).setOnCheckedChangeListener(this);
    ((ToggleButton) findViewById(R.id.tb_sound)).setOnCheckedChangeListener(this);
    ((ToggleButton) findViewById(R.id.tb_vibrate)).setOnCheckedChangeListener(this);


    //Step 1 : xml布局,监听器
    brvScanner = (BarcodeReaderView) findViewById(R.id.brv_scanner);
    brvScanner.setOnBarcodeReadListener(this);

    //Step 2 : 设置参数(可选)
    List<BarcodeFormat> barcodeFormats = new ArrayList<>();
    barcodeFormats.add(BarcodeFormat.QR_CODE);
    barcodeFormats.add(BarcodeFormat.CODE_128);
    brvScanner.setDecodeFormats(barcodeFormats);
}
项目:oneM2M-Application-AndroidSample    文件:MainActivity.java   
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btnRetrieve = (Button) findViewById(R.id.btnRetrieve);
    Switch_MQTT = (Switch) findViewById(R.id.switch_mqtt);
    btnControl_Green = (ToggleButton) findViewById(R.id.btnControl_Green);
    btnControl_Blue = (ToggleButton) findViewById(R.id.btnControl_Blue);
    textViewData = (TextView) findViewById(R.id.textViewData);

    btnRetrieve.setOnClickListener(this);
    Switch_MQTT.setOnCheckedChangeListener(this);
    btnControl_Green.setOnClickListener(this);
    btnControl_Blue.setOnClickListener(this);
    // Create AE and Get AEID

    GetAEInfo();
}
项目:smartswitch    文件:SwitchesAdapter.java   
public SwitchViewHolder(View itemView) {
    super(itemView);

    mSwitchTextView = (AppCompatTextView) itemView.findViewById(R.id.switch_name_tv);
    mSwitchToggel = (ToggleButton) itemView.findViewById(R.id.switch_status_toggel);

    ViewGroup.LayoutParams params = mSwitchToggel.getLayoutParams();
    int square = Resources.getSystem().getDisplayMetrics().widthPixels / 2;
    params.width = square;
    params.height = square - 50;
    mSwitchToggel.setLayoutParams(params);

}
项目:GitHub    文件:BitmapAnimationDebugFragment.java   
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {

  // Get the animation container
  final ImageView imageView = (ImageView) view.findViewById(R.id.animation_container);

  mFrameInformationContainer = (LinearLayout) view.findViewById(R.id.frame_information);

  mAnimatedDrawable = new AnimatedDrawable2();
  mAnimatedDrawable.setDrawListener(new AnimatedDrawable2DebugDrawListener());

  view.findViewById(R.id.invalidate_button).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      imageView.invalidate();
    }
  });

  mAnimationControlsManager = new AnimationControlsManager(
      mAnimatedDrawable,
      (SeekBar) getView().findViewById(R.id.seekbar),
      (ToggleButton) getView().findViewById(R.id.playpause),
      getView().findViewById(R.id.reset));

  new BitmapAnimationCacheSelectorConfigurator(
      (Spinner) view.findViewById(R.id.spinner),
      mBitmapFrameCacheChangedListener,
      mFrameCacheListener);

  imageView.setImageDrawable(mAnimatedDrawable);
}
项目:Ships    文件:ShowMapFragment.java   
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final View rootView = inflater.inflate(R.layout.fragment_map, container, false);

    logTextView = (TextView) rootView.findViewById(R.id.textView1);

    final File filesDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
    fileMap = new File(filesDirectory, FILE_MAP);

    Utils.loadAd(rootView);
    setHasOptionsMenu(true);
    setupWebView(rootView);
    setupNmeaClientService();

    startStopButton = (ToggleButton) rootView.findViewById(R.id.startStopAisButton);
    startStopButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                startReceivingAisFromAntenna();
            } else {
                stopReceivingAisFromAntenna();
            }
        }
    });

    // TODO: Not possible to stop. Will start automatically when valid PPM exists and hide (stop) button for now
    startStopButton.setVisibility(View.GONE);
    return rootView;
}
项目:quickblox-android    文件:BaseConversationFragment.java   
protected void initViews(View view) {
    micToggleVideoCall = (ToggleButton) view.findViewById(R.id.toggle_mic);
    handUpVideoCall = (ImageButton) view.findViewById(R.id.button_hangup_call);
    outgoingOpponentsRelativeLayout = view.findViewById(R.id.layout_background_outgoing_screen);
    allOpponentsTextView = (TextView) view.findViewById(R.id.text_outgoing_opponents_names);
    ringingTextView = (TextView) view.findViewById(R.id.text_ringing);

    if (isIncomingCall) {
        hideOutgoingScreen();
    }
}