类android.support.annotation.LayoutRes源码实例Demo

下面列出了怎么用android.support.annotation.LayoutRes的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Common   文件: AbstractPopup.java
/**
 * Create a new popup window
 *
 * @param context        Context
 * @param resource       The popup's layout resource
 * @param width          The popup's width
 * @param height         The popup's height
 * @param focusable      True if the popup can be focused, false otherwise
 * @param animationStyle Animation style to use when the popup appears
 *                       and disappears.  Set to -1 for the default animation, 0 for no
 *                       animation, or a resource identifier for an explicit animation.
 */
public AbstractPopup(Context context, @LayoutRes int resource, int width, int height, boolean focusable, int animationStyle) {
    /*
     * LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     */
    super(LayoutInflater.from(context).inflate(resource, null), width, height, focusable);
    this.mContext = context;
    this.mRootView = getContentView();
    if (animationStyle != -1) {
        setAnimationStyle(animationStyle);
    }
    setOutsideTouchable(true);
    setFocusable(true);
    setClippingEnabled(true);
    setBackgroundDrawable(new BitmapDrawable());
    init();
}
 
源代码2 项目: youqu_master   文件: IRecyclerView.java
/**
 * 添加加载更多footer layout
 *
 * @param loadMoreFooterLayoutRes
 */
public void setLoadMoreFooterView(@LayoutRes int loadMoreFooterLayoutRes) {
    ensureLoadMoreFooterContainer();
    final View loadMoreFooter = LayoutInflater.from(getContext()).inflate(loadMoreFooterLayoutRes, mLoadMoreFooterContainer, false);
    if (loadMoreFooter != null) {
        setLoadMoreFooterView(loadMoreFooter);
    }
}
 
源代码3 项目: MvpRoute   文件: BaseAdapter.java
public BaseAdapter(Collection<T> data, @LayoutRes int layout, OnItemClickListener<V> listener) {
	this.data = new ArrayList<>();
	if (data != null) {
		this.data.addAll(data);
	}
	this.layouts = layout;
	this.listener = listener;
	spLayout = new SparseIntArray();
	spLayout.put(TYPE_NOMAL, this.layouts);
	headerList.addChangeListener(this);
}
 
源代码4 项目: Upchain-wallet   文件: AddWalletView.java
private void init(@LayoutRes int layoutId) {
	LayoutInflater.from(getContext()).inflate(layoutId, this, true);
	findViewById(R.id.new_account_action).setOnClickListener(this);
	findViewById(R.id.import_account_action).setOnClickListener(this);

       ViewPager viewPager = (ViewPager)findViewById(R.id.intro);
       if (viewPager != null) {
           viewPager.setPageTransformer(false, new DepthPageTransformer());
           viewPager.setAdapter(new IntroPagerAdapter());
       }
}
 
源代码5 项目: Phantom   文件: PluginInterceptActivity.java
@Override
public void setContentView(@LayoutRes int layoutResID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    if (null == inflater) {
        return;
    }
    setContentView(inflater.inflate(layoutResID, null));
}
 
源代码6 项目: PowerFileExplorer   文件: HiddenAdapter.java
public HiddenAdapter(Context context, ContentFragment mainFrag, Futils utils, @LayoutRes int layoutId,
                     ArrayList<HFile> items, MaterialDialog materialDialog, boolean hide) {
    addAll(items);
    this.utils = utils;
    this.c = context;
    this.context = mainFrag;
    this.items = items;
    this.hide = hide;
    this.materialDialog = materialDialog;
}
 
源代码7 项目: V2EX   文件: BaseActivity.java
@Override
public void setContentView(@LayoutRes int layoutResID) {
    super.setContentView(layoutResID);
    super.setContentView(R.layout.w_layout_act_root);
    setRootView();
    LayoutInflater.from(this).inflate(layoutResID, mFlContainer,true);
}
 
源代码8 项目: MeiBaseModule   文件: StatusHelper.java
public View setTitleLayout(@LayoutRes int layoutResId) {
    TypedValue tv = new TypedValue();
    int actionBarHeight = mContext.getResources().getDimensionPixelSize(R.dimen.mei_48_dp);
    if (mContext.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
        actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, mContext
                .getResources().getDisplayMetrics());
    }
    return setTitleLayout(layoutResId, actionBarHeight);
}
 
源代码9 项目: MeiBaseModule   文件: StatusHelper.java
/**
 * set empty layout
 *
 * @param layoutResId
 * @return
 */
public View setEmptyLayout(@LayoutRes int layoutResId) {
    if (mEmptyView != null) return mEmptyView;
    setViewStubLayoutRes(R.id.base_empty_stub, layoutResId);
    mEmptyView = inflateViewStub(R.id.base_empty_stub);
    return mEmptyView;
}
 
源代码10 项目: MeiBaseModule   文件: StatusHelper.java
/**
 * set loading layout
 *
 * @param layoutResId
 * @return
 */
public View setLoadingLayout(@LayoutRes int layoutResId) {
    if (mLoadingView != null) return mLoadingView;
    setViewStubLayoutRes(R.id.base_loading_stub, layoutResId);
    mLoadingView = inflateViewStub(R.id.base_loading_stub);
    return mLoadingView;
}
 
源代码11 项目: MeiBaseModule   文件: StatusHelper.java
/**
 * set error layout
 *
 * @param layoutResId
 * @return
 */
public View setErrorLayout(@LayoutRes int layoutResId) {
    if (mErrorView != null) return mErrorView;
    setViewStubLayoutRes(R.id.base_error_stub, layoutResId);
    mErrorView = inflateViewStub(R.id.base_error_stub);
    return mErrorView;
}
 
源代码12 项目: youqu_master   文件: IRecyclerView.java
/**
 * 添加刷新header layout
 *
 * @param refreshHeaderLayoutRes
 */
public void setRefreshHeaderView(@LayoutRes int refreshHeaderLayoutRes) {
    ensureRefreshHeaderContainer();
    final View refreshHeader = LayoutInflater.from(getContext()).inflate(refreshHeaderLayoutRes, mRefreshHeaderContainer, false);
    if (refreshHeader != null) {
        setRefreshHeaderView(refreshHeader);
    }
}
 
源代码13 项目: MvpRoute   文件: BaseFragment.java
/**
 * 返回布局id
 *
 * @return 返回布局id
 * @throws @exception NullPointerException 当没有申明此注解是抛出此异常
 * @see Layout
 */
private @LayoutRes
int getLayout() {
	if (getClass().isAnnotationPresent(Layout.class)) {
		return getClass().getAnnotation(Layout.class).value();
	} else {
		throw new NullPointerException("You must declare that layout is annotated on the class");
	}
}
 
@SuppressWarnings("unchecked")
public CodeSuggestAdapter(@NonNull Context context, @LayoutRes int resource, @NonNull ArrayList<Description> objects) {
    super(context, resource, objects);
    this.inflater = LayoutInflater.from(context);
    this.context = context;
    this.clone = (ArrayList<Description>) objects.clone();
    this.suggestion = new ArrayList<>();
    this.resourceID = resource;

    AppSetting appSetting = new AppSetting(context);
    editorTextSize = appSetting.getEditorTextSize();
}
 
源代码15 项目: EasySettings   文件: CustomDialogSettingsObject.java
public Builder(String key,
                 String title,
  @LayoutRes int customDialogViewId)
  {
      //todo don't forget to pass your own id's here!
      super(key,
title,
null,
R.id.textView_basicSettingsObject_title,
R.id.textView_basicSettingsObject_summary,
ESettingsTypes.VOID,
R.id.imageView_basicSettingsObject_icon);

      this.customViewId = customDialogViewId;
  }
 
源代码16 项目: ETHWallet   文件: AddWalletView.java
private void init(@LayoutRes int layoutId) {
	LayoutInflater.from(getContext()).inflate(layoutId, this, true);
	findViewById(R.id.new_account_action).setOnClickListener(this);
	findViewById(R.id.import_account_action).setOnClickListener(this);

       ViewPager viewPager = findViewById(R.id.intro);
       if (viewPager != null) {
           viewPager.setPageTransformer(false, new DepthPageTransformer());
           viewPager.setAdapter(new IntroPagerAdapter());
       }
}
 
源代码17 项目: StatusView   文件: StatusView.java
/**
 * 根据布局文件 Id 得到对应的 View,并设置控件属性、绑定接口
 */
private View generateStatusView(@LayoutRes int layoutId) {
    View statusView = viewArray.get(layoutId);
    if (statusView == null) {
        statusView = inflate(layoutId);
        viewArray.put(layoutId, statusView);
        configStatusView(layoutId, statusView);
    }
    return statusView;
}
 
源代码18 项目: ETHWallet   文件: DepositView.java
private void init(@LayoutRes int layoutId, @NonNull Wallet wallet) {
    this.wallet = wallet;
    LayoutInflater.from(getContext()).inflate(layoutId, this, true);
    findViewById(R.id.action_coinbase).setOnClickListener(this);
    findViewById(R.id.action_shapeshift).setOnClickListener(this);
    findViewById(R.id.action_changelly).setOnClickListener(this);
}
 
源代码19 项目: star-zone-android   文件: BaseFragment.java
@LayoutRes
public abstract int getLayoutResId();
 
源代码20 项目: timecat   文件: BaseLazyLoadFragment.java
@LayoutRes
public abstract int getLayout();
 
源代码21 项目: MvpRoute   文件: BaseAdapter.java
public final void addHeaderView(@LayoutRes int layout) {
	headerList.add(new DataBean(layout));
}
 
public void setHeaderLayoutId(@LayoutRes int headerLayoutId) {
    this.headerLayoutId = headerLayoutId;
}
 
@Override
public void setContentView(@LayoutRes int layoutResID) {
    getDelegate().setContentView(layoutResID);
}
 
源代码24 项目: imsdk-android   文件: BaseMultiItemQuickAdapter.java
protected void setDefaultViewTypeLayout(@LayoutRes int layoutResId) {
    addItemType(DEFAULT_VIEW_TYPE, layoutResId);
}
 
源代码25 项目: TikTok   文件: IActivity.java
@LayoutRes
int layoutResID();
 
源代码26 项目: sealrtc-android   文件: BaseRecyclerAdapter.java
public BaseRecyclerAdapter(@NonNull List<T> data, @LayoutRes int layoutResId) {
    mData = data;
    mLayoutResId = layoutResId;
    mSelectedItems = new SparseArray<>();
}
 
源代码27 项目: SimpleAdapterDemo   文件: BaseItemAdapter.java
public BaseItemAdapter(@LayoutRes int itemLayoutId) {
    setItemLayoutId(itemLayoutId);
}
 
源代码28 项目: SimpleAdapterDemo   文件: BaseItemAdapter.java
public @LayoutRes
int getItemLayoutId() {
    return itemLayoutId;
}
 
@Override
public void setContentView(@LayoutRes int layoutResID) {
    getDelegate().setContentView(layoutResID);
}
 
源代码30 项目: Finder   文件: AppCompatPreferenceActivity.java
@Override
public void setContentView(@LayoutRes int layoutResID) {
    getDelegate().setContentView(layoutResID);
}
 
 同包方法