android.widget.TextView.onRestoreInstanceState()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中android.widget.TextView.onRestoreInstanceState()方法的一些代码示例,展示了TextView.onRestoreInstanceState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.onRestoreInstanceState()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:onRestoreInstanceState

TextView.onRestoreInstanceState介绍

暂无

代码示例

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    Serializable text = bundle.getSerializable(BootstrapTextView.KEY);
    Serializable brand = bundle.getSerializable(BootstrapBrand.KEY);
    if (brand instanceof BootstrapBrand) {
      bootstrapBrand = (BootstrapBrand) brand;
    }
    if (text instanceof BootstrapText) {
      bootstrapText = (BootstrapText) text;
    }
    state = bundle.getParcelable(TAG);
  }
  super.onRestoreInstanceState(state);
  updateBootstrapState();
}

代码示例来源:origin: koral--/android-gif-drawable

@Override
public void onRestoreInstanceState(Parcelable state) {
  if (!(state instanceof GifViewSavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  GifViewSavedState ss = (GifViewSavedState) state;
  super.onRestoreInstanceState(ss.getSuperState());
  Drawable[] compoundDrawables = getCompoundDrawables();
  ss.restoreState(compoundDrawables[0], 0);
  ss.restoreState(compoundDrawables[1], 1);
  ss.restoreState(compoundDrawables[2], 2);
  ss.restoreState(compoundDrawables[3], 3);
  Drawable[] compoundDrawablesRelative = getCompoundDrawablesRelative();
  ss.restoreState(compoundDrawablesRelative[0], 4);
  ss.restoreState(compoundDrawablesRelative[2], 5);
  ss.restoreState(getBackground(), 6);
}

代码示例来源:origin: curioustechizen/android-ago

@Override
public void onRestoreInstanceState(Parcelable state) {
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss = (SavedState)state;
  mReferenceTime = ss.referenceTime;
  super.onRestoreInstanceState(ss.getSuperState());
}

代码示例来源:origin: hiwhitley/DownloadProgressButton

@Override
public void onRestoreInstanceState(Parcelable state) {
  DownloadProgressButton.SavedState ss = (DownloadProgressButton.SavedState) state;
  super.onRestoreInstanceState(ss.getSuperState());
  mState = ss.state;
  mProgress = ss.progress;
  mCurrentText = ss.currentText;
}

代码示例来源:origin: Blankeer/DownloadProgressButton

@Override
public void onRestoreInstanceState(Parcelable state) {
  SavedState ss = (SavedState) state;
  super.onRestoreInstanceState(ss.getSuperState());
  mState = ss.state;
  mProgress = ss.progress;
  mCurrentText = ss.currentText;
}

代码示例来源:origin: andforce/iBeebo

@Override
public void onRestoreInstanceState(Parcelable state) {
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss = (SavedState) state;
  super.onRestoreInstanceState(ss.getSuperState());
  this.ids = ss.ids;
  this.disappear = ss.disappear;
  this.type = ss.type;
  if (ss.visible) {
    setVisibility(View.VISIBLE);
  }
}

代码示例来源:origin: yaozs/YzsLib

@Override
public void onRestoreInstanceState(Parcelable savedState) {
  if (savedState instanceof Bundle) {
    Bundle bundle = (Bundle) savedState;
    selectedIndex = bundle.getInt(SELECTED_INDEX);
    if (adapter != null) {
      setText(adapter.getItemInDataset(selectedIndex).toString());
      adapter.notifyItemSelected(selectedIndex);
    }
    if (bundle.getBoolean(IS_POPUP_SHOWING)) {
      if (popupWindow != null) {
        // Post the show request into the looper to avoid bad token exception
        post(new Runnable() {
          @Override
          public void run() {
            showDropDown();
          }
        });
      }
    }
    savedState = bundle.getParcelable(INSTANCE_STATE);
  }
  super.onRestoreInstanceState(savedState);
}

代码示例来源:origin: jaredrummler/MaterialSpinner

@Override public void onRestoreInstanceState(Parcelable savedState) {
 if (savedState instanceof Bundle) {
  Bundle bundle = (Bundle) savedState;
  selectedIndex = bundle.getInt("selected_index");
  nothingSelected = bundle.getBoolean("nothing_selected");
  if (adapter != null) {
   if (nothingSelected && !TextUtils.isEmpty(hintText)) {
    setHintColor(hintColor);
    setText(hintText);
   } else {
    setTextColor(textColor);
    setText(adapter.get(selectedIndex).toString());
   }
   adapter.notifyItemSelected(selectedIndex);
  }
  if (bundle.getBoolean("is_popup_showing")) {
   if (popupWindow != null) {
    // Post the show request into the looper to avoid bad token exception
    post(new Runnable() {
     @Override public void run() {
      expand();
     }
    });
   }
  }
  savedState = bundle.getParcelable("state");
 }
 super.onRestoreInstanceState(savedState);
}

相关文章

微信公众号

最新文章

更多

TextView类方法