public override object instantiateItem(ViewGroup container, int position) { Context context = container.Context; LayoutInflater inflater = LayoutInflater.from(context); View view = inflater.inflate(R.layout.item_font, container, false); RecyclerView recyclerView = (RecyclerView)view.findViewById(R.id.recyclerView); int nbColumns = AndroidUtils.getScreenSize((Activity)context).width / context.Resources.getDimensionPixelSize(R.dimen.item_width); recyclerView.LayoutManager = new GridLayoutManager(context, nbColumns); recyclerView.Adapter = new IconAdapter(fonts[position].Font.characters()); container.addView(view); return(view); }
protected internal override ImageButton createDeviceButton() { ImageButton button = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.main_app_view, this, false); Drawable drawable = this.mData.mInstanceIcon; if (drawable.IntrinsicHeight > mDeviceIconMaxSize) { drawable.setBounds(0, 0, mDeviceIconMaxSize, mDeviceIconMaxSize); } button.ImageDrawable = drawable; button.Clickable = false; button.LongClickable = true; Resources res = Resources; perpendicular = res.getDimensionPixelSize(R.dimen.default_controlbar_widget); along = res.getDimensionPixelSize(R.dimen.main_app_btn_length); return(button); }
protected internal override ImageButton createDeviceButton() { ImageButton button = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.app_view, this, false); button.ImageDrawable = this.mData.mInstanceIcon; if (mData.mActionList.size() > 0) { button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); } else { button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this); } Resources res = Resources; perpendicular = res.getDimensionPixelSize(R.dimen.max_app_ic_size); along = res.getDimensionPixelSize(R.dimen.max_app_ic_size); return(button); }
public override ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.Context).inflate(R.layout.item_icon, parent, false); return(new ViewHolder(view)); }
/// <summary> /// @brief TODO /// </summary> /// <param name="resId"> </param> /// <param name="parent"> </param> /// <param name="isAdded"> </param> /// @param <T> /// /// @return </param> public virtual T inflate <T>(int resId, ViewGroup parent, bool isAdded) where T : android.view.View { return((T)LayoutInflater.from(mContext.get()).inflate(resId, parent, isAdded)); }
public FileAdapter(FileListDialogFragment outerInstance, Context context) { this.outerInstance = outerInstance; layoutInflater = LayoutInflater.from(context); }