@Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.frag_opus_setting_page, container, false);

    mOpusConfig = OpusConfig.GetInstance();
    mOpusApplication = mOpusConfig.getOAValue();
    mOpusSignal = mOpusConfig.getOSTValue();
    mOpusBandwidth = mOpusConfig.getOBValue();

    initView(rootView);

    return rootView;
  }
 private void setOpusSignal(int checkedId) {
   switch (checkedId) {
     case R.id.rbSignalAuto:
       mOpusSignal = OpusWrapper.OPUS_SIGNAL_TYPE_AUTO;
       break;
     case R.id.rbSignalVoice:
       mOpusSignal = OpusWrapper.OPUS_SIGNAL_TYPE_VOICE;
       break;
     case R.id.rbSignalMusic:
       mOpusSignal = OpusWrapper.OPUS_SIGNAL_TYPE_MUSIC;
       break;
   }
   mOpusConfig.setOSTValue(mOpusSignal);
 }
 private void setOpusApplication(int checkedId) {
   switch (checkedId) {
     case R.id.rbAppAudio:
       mOpusApplication = OpusWrapper.OPUS_APPLICATION_AUDIO;
       break;
     case R.id.rbAppVoIP:
       mOpusApplication = OpusWrapper.OPUS_APPLICATION_VOIP;
       break;
     case R.id.rbAppRistrictLowDelay:
       mOpusApplication = OpusWrapper.OPUS_APPLICATION_RESTRICTED_LOWDELAY;
       break;
   }
   mOpusConfig.setOAValue(mOpusApplication);
 }
 private void initSignalUIValue() {
   int opusSignal = mOpusConfig.getOSTValue();
   switch (opusSignal) {
     case OpusWrapper.OPUS_SIGNAL_TYPE_AUTO:
       rbSignalAuto.setChecked(true);
       break;
     case OpusWrapper.OPUS_SIGNAL_TYPE_MUSIC:
       rbSignalMusic.setChecked(true);
       break;
     case OpusWrapper.OPUS_SIGNAL_TYPE_VOICE:
       rbSignalVoice.setChecked(true);
       break;
   }
 }
  private void initBitrateUIValue() {
    int bitrate = mOpusConfig.getBitrate();
    String strBitrate = String.valueOf(bitrate);
    int index = 0;
    for (index = 0; index < listOpusBitrate.length; index++) {
      if (strBitrate.equalsIgnoreCase(listOpusBitrate[index])) {
        break;
      }
    }

    if (index < listOpusBitrate.length) {
      spnOpusBitrate.setSelection(index);
    }
  }
  private void initApplicationUIValue() {
    int opusApplication = mOpusConfig.getOAValue();

    switch (opusApplication) {
      case OpusWrapper.OPUS_APPLICATION_AUDIO:
        rbAppAudio.setChecked(true);
        break;
      case OpusWrapper.OPUS_APPLICATION_VOIP:
        rbAppVoIP.setChecked(true);
        break;
      case OpusWrapper.OPUS_APPLICATION_RESTRICTED_LOWDELAY:
        rbAppRistrictLowDelay.setChecked(true);
        break;
    }
  }
 private void setOpusBandwidth(int checkedId) {
   switch (checkedId) {
     case R.id.rbBandWidthNarrow:
       mOpusBandwidth = OpusWrapper.OPUS_BANDWIDTH_NARROWBAND;
       break;
     case R.id.rbBandWidthMedium:
       mOpusBandwidth = OpusWrapper.OPUS_BANDWIDTH_MEDIUMBAND;
       break;
     case R.id.rbBandWidthWide:
       mOpusBandwidth = OpusWrapper.OPUS_BANDWIDTH_WIDEBAND;
       break;
     case R.id.rbBandWidthSuperWide:
       mOpusBandwidth = OpusWrapper.OPUS_BANDWIDTH_SUPERWIDEBAND;
       break;
     case R.id.rbBandWidthFull:
       mOpusBandwidth = OpusWrapper.OPUS_BANDWIDTH_FULLBAND;
       break;
   }
   mOpusConfig.setOBValue(mOpusBandwidth);
 }
 private void initBandwidthValue() {
   int opusBandwidth = mOpusConfig.getOBValue();
   switch (opusBandwidth) {
     case OpusWrapper.OPUS_BANDWIDTH_FULLBAND:
       rbBandwidthFull.setChecked(true);
       break;
     case OpusWrapper.OPUS_BANDWIDTH_MEDIUMBAND:
       rbBandwidthMedium.setChecked(true);
       break;
     case OpusWrapper.OPUS_BANDWIDTH_NARROWBAND:
       rbBandwidthNarrow.setChecked(true);
       break;
     case OpusWrapper.OPUS_BANDWIDTH_SUPERWIDEBAND:
       rbBandwidthSuper.setChecked(true);
       break;
     case OpusWrapper.OPUS_BANDWIDTH_WIDEBAND:
       rbBandwidthWide.setChecked(true);
       break;
   }
 }
 public FragOpusSettingPage() {
   mOpusConfig = OpusConfig.GetInstance();
 }