当前位置: 首页>>代码示例>>Java>>正文


Java LayoutRes类代码示例

本文整理汇总了Java中android.support.annotation.LayoutRes的典型用法代码示例。如果您正苦于以下问题:Java LayoutRes类的具体用法?Java LayoutRes怎么用?Java LayoutRes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LayoutRes类属于android.support.annotation包,在下文中一共展示了LayoutRes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VariableViewAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * @param variableNameManager The name manager containing the variables.
 * @param context A context for inflating layouts.
 * @param resource The {@link TextView} layout to use when inflating items.
 */
public VariableViewAdapter(Context context, NameManager variableNameManager,
                           @LayoutRes int resource) {
    super(context, resource);

    mVariableNameManager = variableNameManager;
    mVars = mVariableNameManager.getUsedNames();

    mRenameString = context.getString(R.string.rename_variable);
    mDeleteString = context.getString(R.string.delete_variable);
    refreshVariables();
    variableNameManager.registerObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            refreshVariables();
        }
    });
}
 
开发者ID:Axe-Ishmael,项目名称:Blockly,代码行数:23,代码来源:BasicFieldVariableView.java

示例2: FirebaseRecyclerAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
FirebaseRecyclerAdapter(Class<T> modelClass,
                        @LayoutRes int modelLayout,
                        Class<VH> viewHolderClass,
                        FirebaseArray snapshots) {
    mModelClass = modelClass;
    mModelLayout = modelLayout;
    mViewHolderClass = viewHolderClass;
    mSnapshots = snapshots;

    mSnapshots.setOnChangedListener(new ChangeEventListener() {
        @Override
        public void onChildChanged(EventType type, int index, int oldIndex) {
            FirebaseRecyclerAdapter.this.onChildChanged(type, index, oldIndex);
        }

        @Override
        public void onDataChanged() {
            FirebaseRecyclerAdapter.this.onDataChanged();
        }

        @Override
        public void onCancelled(DatabaseError error) {
            FirebaseRecyclerAdapter.this.onCancelled(error);
        }
    });
}
 
开发者ID:rumaan,项目名称:AcademApp,代码行数:27,代码来源:FirebaseRecyclerAdapter.java

示例3: CommonAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
public CommonAdapter(Context context, Class<? extends T> clazz, @LayoutRes final int layoutId,final int maxRecyclerCount) {
    super();
    mContext = context;
    this.layoutId = layoutId;
    register(clazz, new MultiItemView<T>() {

        @NonNull
        @Override
        public int getLayoutId() {
            return layoutId;
        }

        @Override
        public void onBindViewHolder(@NonNull ViewHolder holder, @NonNull T item, int position) {
            convert(holder, item, position);
        }

        @Override
        public int getMaxRecycleCount() {
            return maxRecyclerCount;
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:CommonAdapter.java

示例4: showCustomLongSafe

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * 安全地显示长时自定义吐司
 */
public static void showCustomLongSafe(@LayoutRes final int layoutId) {
    sHandler.post(new Runnable() {
        @Override
        public void run() {
            setView(layoutId);
            show("", Toast.LENGTH_LONG);
        }
    });
}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:13,代码来源:ToastUtils.java

示例5: SectionedFirebaseRecyclerAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 *
 * @param modelClass  the class of the list items
 * @param itemLayout  XML layout of each list item
 * @param itemHolderClass  ViewHolder subclass of the list item
 * @param headerLayout  XML layout of the section headers
 * @param headerHolderClass  ViewHolder subclass of the section headers
 * @param q reference to the Firebase datasource
 */
SectionedFirebaseRecyclerAdapter(Class<T> modelClass,
                                 @LayoutRes int itemLayout,
                                 Class<VH> itemHolderClass,
                                 @LayoutRes int headerLayout,
                                 Class<HVH> headerHolderClass,
                                 Query q) {
    super(modelClass, itemLayout,
            (Class<RecyclerView.ViewHolder>) itemHolderClass, q);
    this.itemLayout = itemLayout;
    this.headerLayout = headerLayout;
    this.itemClass = itemHolderClass;
    this.headerClass = headerHolderClass;
}
 
开发者ID:gvsucis,项目名称:mobile-app-dev-book,代码行数:23,代码来源:SectionedFirebaseRecyclerAdapter.java

示例6: QariAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
QariAdapter(@NonNull Context context,
            @NonNull List<QariItem> items,
            @LayoutRes int layoutViewId,
            @LayoutRes int dropDownViewId) {
  mItems = items;
  mLayoutViewId = layoutViewId;
  mDropDownViewId = dropDownViewId;
  mInflater = LayoutInflater.from(context);
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:10,代码来源:AudioStatusBar.java

示例7: inflateCustomView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * Inflates custom view
 *
 * @param layout              layout for custom view
 * @param viewInflateListener inflate listener for custom view
 */
private void inflateCustomView(@LayoutRes int layout, OnViewInflateListener viewInflateListener) {
    View view = mActivity.getLayoutInflater().inflate(layout, this, false);
    this.addView(view);
    if (viewInflateListener != null) {
        viewInflateListener.onViewInflated(view);
    }
}
 
开发者ID:faruktoptas,项目名称:FancyShowCaseView,代码行数:14,代码来源:FancyShowCaseView.java

示例8: getLayout

import android.support.annotation.LayoutRes; //导入依赖的package包/类
@Override
public XmlResourceParser getLayout(@LayoutRes int id) throws NotFoundException {
    int realId = getCorrespondResIdStrictly(id);
    if (realId > 0) {
        return mSkinResources.getLayout(realId);
    }
    return super.getLayout(id);
}
 
开发者ID:Zeal27,项目名称:SkinFramework,代码行数:9,代码来源:ComposedResources.java

示例9: setContentView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {
    super.setContentView(layoutResID);
    ButterKnife.bind(this);
    mediumAnimationDuration = getResources().getInteger(
            android.R.integer.config_mediumAnimTime);
    shortAnimationDuration = getResources().getInteger(
            android.R.integer.config_shortAnimTime);
    initViews();
}
 
开发者ID:ehsunshine,项目名称:memory-game,代码行数:11,代码来源:BaseActivity.java

示例10: setContentView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setContentView(@LayoutRes final int layoutResID) {
    super.setContentView(layoutResID);
    if (mFoundViews != null) {
        mFoundViews.clear();
    }
    mFoundViews = AnnotationParser.parseFields(getContext(), this, this);
}
 
开发者ID:milosmns,项目名称:silly-android,代码行数:12,代码来源:ParsableDialog.java

示例11: setRefreshHeaderView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * 添加刷新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);
    }
}
 
开发者ID:ynztlxdeai,项目名称:MVPtemplate,代码行数:12,代码来源:IRecyclerView.java

示例12: setEmptyView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
private void setEmptyView(@LayoutRes final int emptyResourceId) {
    if (mEmptyView == null && emptyResourceId > 0) {
        mEmptyId = emptyResourceId;
        mEmpty.setLayoutResource(emptyResourceId);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            mEmpty.setLayoutInflater(inflater);
        }
        mEmptyView = mEmpty.inflate();
    } else {
        Log.d(VIEW_LOG_TAG, "unabled to set empty view because the empty has been set");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:UltimateRecyclerView.java

示例13: PlaylistAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
public PlaylistAdapter(AppCompatActivity activity, ArrayList<Playlist> dataSet, @LayoutRes int itemLayoutRes, @Nullable CabHolder cabHolder) {
    super(activity, cabHolder, R.menu.menu_playlists_selection);
    this.activity = activity;
    this.dataSet = dataSet;
    this.itemLayoutRes = itemLayoutRes;
    setHasStableIds(true);
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:8,代码来源:PlaylistAdapter.java

示例14: RecyclerViewAdapter

import android.support.annotation.LayoutRes; //导入依赖的package包/类
public RecyclerViewAdapter(Context context, List<T> dataList
        , @LayoutRes int layoutId, RecyclerViewSingleTypeProcessor singleTypeProcessor) {
    mContext = context;
    mDataList = dataList;
    mTypeLayoutIds = new ArrayMap<>();
    mTypeLayoutIds.put(0, layoutId);
    mSingleTypeProcessor = singleTypeProcessor;
}
 
开发者ID:arjinmc,项目名称:ExpandRecyclerView,代码行数:9,代码来源:RecyclerViewAdapter.java

示例15: addView

import android.support.annotation.LayoutRes; //导入依赖的package包/类
/**
 * 为snackbar添加布局
 * <p>在show...Snackbar之后调用</p>
 *
 * @param layoutId 布局文件
 * @param index    位置(the position at which to add the child or -1 to add last)
 */
public static void addView(@LayoutRes int layoutId, int index) {
    Snackbar snackbar = snackbarWeakReference.get();
    if (snackbar != null) {
        View view = snackbar.getView();
        Snackbar.SnackbarLayout layout = (Snackbar.SnackbarLayout) view;
        View child = LayoutInflater.from(view.getContext()).inflate(layoutId, null);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT);
        params.gravity = Gravity.CENTER_VERTICAL;
        layout.addView(child, index, params);
    }
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:21,代码来源:SnackbarUtils.java


注:本文中的android.support.annotation.LayoutRes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。