android.support.v4.app.FragmentActivity.obtainStyledAttributes()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(118)

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

FragmentActivity.obtainStyledAttributes介绍

暂无

代码示例

代码示例来源:origin: sjwall/MaterialTapTargetPrompt

@NonNull
@Override
public TypedArray obtainStyledAttributes(int resId, int[] attrs)
{
  return this.fragment.requireActivity().obtainStyledAttributes(resId, attrs);
}

代码示例来源:origin: spacecowboy/NoNonsense-FilePicker

/**
 * Checks if a divider drawable has been defined in the current theme. If it has, will apply
 * an item decoration with the divider. If no divider has been specified, then does nothing.
 */
protected void configureItemDecoration(@NonNull LayoutInflater inflater,
                    @NonNull RecyclerView recyclerView) {
  final TypedArray attributes =
      getActivity().obtainStyledAttributes(new int[]{R.attr.nnf_list_item_divider});
  Drawable divider = attributes.getDrawable(0);
  attributes.recycle();
  if (divider != null) {
    recyclerView.addItemDecoration(new DividerItemDecoration(divider));
  }
}

代码示例来源:origin: leftcoding/GankLy

public void setItemSelectBackground(@NonNull List<View> list) {
  if (!ListUtils.isListEmpty(list)) {
    int[] attrs = new int[]{R.attr.selectableItemBackground};
    TypedArray typedArray = getActivity().obtainStyledAttributes(attrs);
    final int backgroundResource = typedArray.getResourceId(0, 0);
    ButterKnife.apply(list, new ButterKnife.Action<View>() {
      @Override
      public void apply(@NonNull View view, int index) {
        view.setBackgroundResource(backgroundResource);
      }
    });
    typedArray.recycle();
  }
}

代码示例来源:origin: leftcoding/GankLy

public void setItemSelectBackground(@NonNull List<View> list) {
  if (!ListUtils.isListEmpty(list)) {
    int[] attrs = new int[]{R.attr.selectableItemBackground};
    TypedArray typedArray = getActivity().obtainStyledAttributes(attrs);
    final int backgroundResource = typedArray.getResourceId(0, 0);
    ButterKnife.apply(list, new ButterKnife.Action<View>() {
      @Override
      public void apply(@NonNull View view, int index) {
        view.setBackgroundResource(backgroundResource);
      }
    });
  }
}

代码示例来源:origin: henrichg/PhoneProfilesPlus

TypedArray themeColors = getActivity().obtainStyledAttributes(mStyleResId, R.styleable.BetterPickersDialogs);
mDayPickerDescription = res.getString(R.string.day_picker_description);
mSelectDay = res.getString(R.string.select_day);

代码示例来源:origin: henrichg/PhoneProfilesPlus

TypedArray themeColors = getActivity().obtainStyledAttributes(mStyleResId, R.styleable.BetterPickersDialogs);

相关文章

微信公众号

最新文章

更多

FragmentActivity类方法