Here are the examples of the java api android.view.ViewGroup taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
25179 Examples
19
Source : VideoListAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@NonNull
@Override
public VideoHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new VideoHolder(LayoutInflater.from(mContext).inflate(R.layout.adapter_video_list, parent, false));
}
19
Source : NewsAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(viewType, parent, false);
if (viewType == R.layout.adapter_normal) {
return new NormalHolder(view);
} else {
return new VideoHolder(view);
}
}
19
Source : CommentAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@NonNull
@Override
public CommentHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new CommentHolder(LayoutInflater.from(context).inflate(R.layout.adapter_comment, parent, false));
}
19
Source : VideoListAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (R.layout.adapter_video == viewType || viewType == R.layout.adapter_news_video) {
return new VideoHolder(LayoutInflater.from(mContext).inflate(R.layout.adapter_video, parent, false));
} else {
return new NoMoreHolder(LayoutInflater.from(mContext).inflate(viewType, parent, false));
}
}
19
Source : NewsAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(viewType, parent, false);
if (viewType == R.layout.adapter_news_normal) {
return new NormalHolder(view);
} else {
return new VideoHolder(view);
}
}
19
Source : CommentAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@NonNull
@Override
public CommentHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new CommentHolder(LayoutInflater.from(mContext).inflate(R.layout.adapter_comment, parent, false));
}
19
Source : ChannelAdapter.java
with MIT License
from zzh12138
with MIT License
from zzh12138
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(viewType, parent, false);
if (viewType == R.layout.adapter_channel) {
return new ChannelHolder(view);
} else if (viewType == R.layout.adapter_more_channel) {
return new MoreChannelHolder(view);
} else if (viewType == R.layout.adapter_tab) {
return new TabHolder(view);
} else {
return new replacedleHolder(view);
}
}
19
Source : HotWaresAdapter.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
mInflater = LayoutInflater.from(parent.getContext());
View view = mInflater.inflate(R.layout.template_hot_wares, null);
return new ViewHolder(view);
}
19
Source : HomeCategoryAdapter.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
mInflater = LayoutInflater.from(parent.getContext());
if (viewType == VIEW_TYPE_R) {
return new ViewHolder(mInflater.inflate(R.layout.template_home_cardview2, parent, false));
}
return new ViewHolder(mInflater.inflate(R.layout.template_home_cardview, parent, false));
}
19
Source : AbsWeexActivity.java
with MIT License
from zwwill
with MIT License
from zwwill
protected final void setContainer(ViewGroup container) {
mContainer = container;
}
19
Source : SampleVideo.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 推出全屏时将对应处理参数逻辑返回给非播放器
*
* @param oldF
* @param vp
* @param gsyVideoPlayer
*/
@Override
protected void resolveNormalVideoShow(View oldF, ViewGroup vp, GSYVideoPlayer gsyVideoPlayer) {
super.resolveNormalVideoShow(oldF, vp, gsyVideoPlayer);
if (gsyVideoPlayer != null) {
SampleVideo sampleVideo = (SampleVideo) gsyVideoPlayer;
mSourcePosition = sampleVideo.mSourcePosition;
mType = sampleVideo.mType;
mTransformSize = sampleVideo.mTransformSize;
setUp(mUrlList, mCache, mCachePath, mreplacedle);
resolveTypeUI();
}
}
19
Source : ImagePreviewAdapter.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
super.setPrimaryItem(container, position, object);
currentView = (View) object;
}
19
Source : AutoTextArrayAdapter.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
/**
* {@inheritDoc}
*/
public View getView(int position, View convertView, ViewGroup parent) {
return createViewFromResource(position, convertView, parent, mResource);
}
19
Source : AutoTextArrayAdapter.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
/**
* {@inheritDoc}
*/
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return createViewFromResource(position, convertView, parent, mDropDownResource);
}
19
Source : AutoTextArrayAdapter.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
private View createViewFromResource(int position, View convertView, ViewGroup parent, int resource) {
View view;
TextView text;
if (convertView == null) {
view = mInflater.inflate(resource, parent, false);
} else {
view = convertView;
}
try {
if (mFieldId == 0) {
// If no custom field is replacedigned, replacedume the whole resource is a TextView
text = (TextView) view;
} else {
// Otherwise, find the TextView field within the layout
text = (TextView) view.findViewById(mFieldId);
}
} catch (ClreplacedCastException e) {
Log.e("ArrayAdapter", "You must supply a resource ID for a TextView");
throw new IllegalStateException("ArrayAdapter requires the resource ID to be a TextView", e);
}
T item = gereplacedem(position);
if (item instanceof CharSequence) {
if (indexStr != null) {
String strAll = item.toString();
String strBefore = strAll.substring(0, strAll.indexOf(indexStr));
String strAfter = strAll.substring(strAll.indexOf(indexStr) + indexStr.length());
text.setText(Html.fromHtml(strBefore + "<u><font color= 'black' type='bold'>" + indexStr + "</font></u>" + strAfter));
} else {
text.setText((CharSequence) item);
}
} else {
if (indexStr != null) {
String strAll = item.toString();
String strBefore = strAll.substring(0, strAll.indexOf(indexStr));
String strAfter = strAll.substring(strAll.indexOf(indexStr) + indexStr.length());
text.setText(Html.fromHtml(strBefore + "<u><font color= 'black' type='bold'>" + indexStr + "</font></u>" + strAfter));
} else {
text.setText(item.toString());
}
}
return view;
}
19
Source : ViewPagerCardAdapter.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
currentView = (View) object;
super.setPrimaryItem(container, position, object);
}
19
Source : FavoriteWanRecyclerAdapter.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
public Viewholder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_favorite, parent, false);
Viewholder viewholder = new Viewholder(view);
return viewholder;
}
19
Source : CodeProjectRecyclerAdapter.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
public Viewholder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_wanproject, parent, false);
Viewholder viewholder = new Viewholder(view);
return viewholder;
}
19
Source : CodeArticleRecyclerAdapter.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
public Viewholder onCreateViewHolder(ViewGroup parent, int viewType) {
View viewitem = LayoutInflater.from(context).inflate(R.layout.item_wanarticle, parent, false);
Viewholder viewholder = new Viewholder(viewitem);
return viewholder;
}
19
Source : MultiSelectionGalleryAdapter.java
with Apache License 2.0
from zom
with Apache License 2.0
from zom
@NonNull
@Override
public MultiSelectGalleryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_multiple_list, parent, false);
return new MultiSelectGalleryViewHolder(view);
}
19
Source : GalleryAdapter.java
with Apache License 2.0
from zom
with Apache License 2.0
from zom
@Override
public GalleryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.story_gallery_item, parent, false);
return new GalleryViewHolder(view);
}
19
Source : FTouchHelper.java
with MIT License
from zj565061763
with MIT License
from zj565061763
/**
* 找到parent中处于指定坐标下的child
*
* @param parent
* @param x
* @param y
* @return
*/
public static List<View> findChildrenUnder(ViewGroup parent, int x, int y) {
final List<View> list = new LinkedList<>();
final int count = parent.getChildCount();
for (int i = count - 1; i >= 0; i--) {
final View child = parent.getChildAt(i);
if (isViewUnder(child, x, y))
list.add(child);
}
return list;
}
19
Source : ListDemoAdapter.java
with MIT License
from zj565061763
with MIT License
from zj565061763
@Override
public int getLayoutId(int position, View convertView, ViewGroup parent) {
/**
* 返回item的布局
*/
return R.layout.item_listview;
}
19
Source : WallpapersAdapter.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@NotNull
@Override
public ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
View view;
if (mIsShowName) {
view = LayoutInflater.from(mContext).inflate(R.layout.fragment_wallpapers_item_grid, parent, false);
} else {
view = LayoutInflater.from(mContext).inflate(R.layout.fragment_wallpapers_item_grid_alt, parent, false);
}
return new ViewHolder(view);
}
19
Source : SettingsAdapter.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
if (viewType == TYPE_CONTENT) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_settings_item_list, parent, false);
return new ContentViewHolder(view);
}
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_settings_item_footer, parent, false);
return new FooterViewHolder(view);
}
19
Source : IconsAdapter.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@NotNull
@Override
public ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_icons_item_grid, parent, false);
return new ViewHolder(view);
}
19
Source : FAQsAdapter.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@NotNull
@Override
public ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
View view = null;
if (viewType == TYPE_CONTENT) {
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_faqs_item_list, parent, false);
} else if (viewType == TYPE_FOOTER) {
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_settings_item_footer, parent, false);
}
return new ViewHolder(view, viewType);
}
19
Source : AboutAdapter.java
with Apache License 2.0
from zixpo
with Apache License 2.0
from zixpo
@NotNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
if (viewType == TYPE_HEADER) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_about_item_header, parent, false);
return new HeaderViewHolder(view);
} else if (viewType == TYPE_EXTRA_INFO) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_about_item_sub, parent, false);
return new ExtraInfoViewHolder(view);
}
if (viewType == TYPE_FOOTER) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_about_item_footer, parent, false);
if (CandyBarApplication.getConfiguration().getSocialIconColor() == CandyBarApplication.IconColor.ACCENT) {
view = LayoutInflater.from(mContext).inflate(R.layout.fragment_about_item_footer_accent, parent, false);
}
return new FooterViewHolder(view);
}
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_settings_item_footer, parent, false);
return new ShadowViewHolder(view);
}
19
Source : VideoAdContext.java
with Apache License 2.0
from zion223
with Apache License 2.0
from zion223
public clreplaced VideoAdContext implements VideoAdSlot.SDKSlotListener {
// the ad container
private ViewGroup mParentView;
private VideoAdSlot mAdSlot;
private String mInstance;
// the listener to the app layer
private VideoContextInterface mListener;
public VideoAdContext(ViewGroup parentView, String instance) {
this.mParentView = parentView;
this.mInstance = instance;
load();
}
/**
* init the ad,不调用则不会创建videoview
*/
private void load() {
if (mInstance != null) {
mAdSlot = new VideoAdSlot(mInstance, this);
} else {
// 创建空的slot,不响应任何事件
mAdSlot = new VideoAdSlot(null, this);
if (mListener != null) {
mListener.onVideoFailed();
}
}
}
/**
* release the ad
*/
public void destroy() {
mAdSlot.destroy();
}
public void setAdResultListener(VideoContextInterface listener) {
this.mListener = listener;
}
@Override
public ViewGroup getAdParent() {
return mParentView;
}
@Override
public void onVideoLoadSuccess() {
if (mListener != null) {
mListener.onVideoSuccess();
}
}
@Override
public void onVideoFailed() {
if (mListener != null) {
mListener.onVideoFailed();
}
}
@Override
public void onVideoComplete() {
if (mListener != null) {
mListener.onVideoComplete();
}
}
}
19
Source : AnimatorViewChangeHandler.java
with Apache License 2.0
from Zhuinden
with Apache License 2.0
from Zhuinden
@Override
public void performViewChange(@Nonnull final ViewGroup container, @Nonnull final View previousView, @Nonnull final View newView, final int direction, @Nonnull final ViewChangeCallback viewChangeCallback) {
container.addView(newView);
ViewUtils.waitForMeasure(newView, new ViewUtils.OnMeasuredCallback() {
@Override
public void onMeasured(View view, int width, int height) {
runAnimation(previousView, newView, direction, new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
container.removeView(previousView);
resetPreviousViewValues(previousView);
viewChangeCallback.onCompleted();
}
});
}
});
}
19
Source : MainActivity.java
with Apache License 2.0
from Zhuinden
with Apache License 2.0
from Zhuinden
public clreplaced MainActivity extends AppCompatActivity {
ViewGroup container;
RealmPaginationManager realmPaginationManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
container = findViewById(R.id.container);
realmPaginationManager = Injector.get().realmPaginationManager();
if (savedInstanceState == null) {
// TODO: navigation.
//
getSupportFragmentManager().beginTransaction().add(R.id.container, new TaskFragment(), //
"TASK_FRAGMENT").commit();
}
realmPaginationManager.open();
}
@Override
protected void onDestroy() {
realmPaginationManager.close();
super.onDestroy();
}
}
19
Source : BaseSortRecyclerViewAdapter.java
with Apache License 2.0
from zhouzhuo810
with Apache License 2.0
from zhouzhuo810
@Override
public K onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = null;
switch(viewType) {
case TYPE_HEADER:
itemView = header;
break;
case TYPE_ITEM:
itemView = inflater.inflate(gereplacedemLayoutId(), parent, false);
break;
case TYPE_FOOT:
itemView = footer;
break;
}
return getViewHolder(itemView, viewType);
}
19
Source : SwipeBackLayout.java
with Apache License 2.0
from zhouphenix
with Apache License 2.0
from zhouphenix
/**
* Find out the scrollable child view
* 这里添加了常用的一些可滑动类,特殊类需要添加
*
* @param target targetView
*/
private void findScrollView(ViewGroup target) {
final int count = target.getChildCount();
if (count > 0) {
for (int i = 0; i < count; i++) {
final View child = target.getChildAt(i);
if (child instanceof AbsListView || isInstanceOfClreplaced(child, ScrollView.clreplaced.getName()) || isInstanceOfClreplaced(child, NestedScrollView.clreplaced.getName()) || isInstanceOfClreplaced(child, RecyclerView.clreplaced.getName()) || child instanceof HorizontalScrollView || child instanceof ViewPager || child instanceof WebView) {
mScrollChild = child;
break;
} else if (child instanceof ViewGroup) {
findScrollView((ViewGroup) child);
}
}
}
if (mScrollChild == null)
mScrollChild = target;
}
19
Source : PickerItemAdapter.java
with Apache License 2.0
from zhouhuandev
with Apache License 2.0
from zhouhuandev
@NonNull
@Override
public PickerItemAdapter.ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ItemViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.picker_item_root, parent, false), viewType == ITEM_TYPE_CAMERA, selectConfig, presenter, uiConfig);
}
19
Source : GSYRenderExView.java
with Apache License 2.0
from zhkrb
with Apache License 2.0
from zhkrb
public void reAddView(ViewGroup textureViewContainer, int rotate, GSYTextureExView renderView) {
renderView.setRotation(rotate);
if (renderView.getSurfaceTexture() != renderView.getSaveSurfaceTexture()) {
renderView.setSurfaceTexture(renderView.getSaveSurfaceTexture());
}
renderView.getIGSYSurfaceListener().onSurfaceAvailable(renderView.getSurface());
if (renderView.getParent() != null) {
((ViewGroup) renderView.getParent()).removeView(renderView);
}
GSYRenderView.addToParent(textureViewContainer, renderView);
}
19
Source : VideoPlayerView.java
with Apache License 2.0
from zhkrb
with Apache License 2.0
from zhkrb
public VideoPlayerView setContentView(ViewGroup contentView) {
mContentView = contentView;
return this;
}
19
Source : TouchView.java
with MIT License
from Zhaoss
with MIT License
from Zhaoss
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (minWidth == 0) {
whRatio = getWidth() * 1f / getHeight();
minWidth = getWidth() / 2;
ViewGroup parent = (ViewGroup) getParent();
maxWidth = parent.getWidth();
minHeight = getHeight() / 2;
maxHeight = (int) (maxWidth / whRatio);
}
}
19
Source : RecordView.java
with MIT License
from Zhaoss
with MIT License
from Zhaoss
@Override
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
ViewGroup parent = (ViewGroup) getParent();
parent.requestDisallowInterceptTouchEvent(true);
downX = event.getRawX();
downY = event.getRawY();
mHandler.sendEmptyMessageDelayed(0, 200);
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
ViewGroup parent1 = (ViewGroup) getParent();
parent1.requestDisallowInterceptTouchEvent(false);
float upX = event.getRawX();
float upY = event.getRawY();
if (mHandler.hasMessages(0)) {
mHandler.removeMessages(0);
if (Math.abs(upX - downX) < slideDis && Math.abs(upY - downY) < slideDis) {
if (mOnGestureListener != null) {
mOnGestureListener.onClick();
}
}
} else {
if (mOnGestureListener != null) {
mOnGestureListener.onUp();
}
}
initState();
break;
}
return true;
}
19
Source : StatusBarUtils.java
with MIT License
from zhao-mingjian
with MIT License
from zhao-mingjian
/**
* 添加了一个状态栏(实际上是个view),放在了状态栏的垂直下方
*/
public static void addStatusBarBehind(Activity activity, @ColorInt int color, int statusBarAlpha) {
// 获取windowphone下的decorView
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
int count = decorView.getChildCount();
// 判断是否已经添加了statusBarView
if (count > 0 && decorView.getChildAt(count - 1) instanceof StatusBarView) {
decorView.getChildAt(count - 1).setBackgroundColor(calculateStatusColor(color, statusBarAlpha));
} else {
// 新建一个和状态栏高宽的view
StatusBarView statusView = createStatusBarView(activity, color, statusBarAlpha);
decorView.addView(statusView);
}
setRootView(activity);
}
19
Source : StatusBarUtils.java
with MIT License
from zhao-mingjian
with MIT License
from zhao-mingjian
/**
* 设置根布局参数
*/
private static void setRootView(Activity activity) {
ViewGroup rootView = (ViewGroup) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0);
// rootview不会为状态栏流出状态栏空间
ViewCompat.setFitsSystemWindows(rootView, true);
rootView.setClipToPadding(true);
}
19
Source : SwipeOutLayout.java
with Apache License 2.0
from zhangliangming
with Apache License 2.0
from zhangliangming
/**
* 初始化界面视图并显示菜单界面
*
* @param contentView 主界面
* @param menuView 菜单界面
* @param dragView 拖动view
*/
public void initViewAndShowMenuView(ViewGroup contentView, ViewGroup menuView, View dragView) {
initView(contentView, menuView, dragView, false);
}
19
Source : SwipeOutLayout.java
with Apache License 2.0
from zhangliangming
with Apache License 2.0
from zhangliangming
/**
* 初始化界面视图并显示主界面
*
* @param contentView 主界面
* @param menuView 菜单界面
* @param dragView 拖动view
*/
public void initViewAndShowContentView(ViewGroup contentView, ViewGroup menuView, View dragView) {
initView(contentView, menuView, dragView, true);
}
19
Source : MakeLrcAdapter.java
with Apache License 2.0
from zhangliangming
with Apache License 2.0
from zhangliangming
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_makelrc, null, false);
MakeLrcViewHolder makeLrcViewHolder = new MakeLrcViewHolder(view);
return makeLrcViewHolder;
}
19
Source : LrcPopPlayListAdapter.java
with Apache License 2.0
from zhangliangming
with Apache License 2.0
from zhangliangming
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View view = null;
if (viewType == NODATA) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_pop_nodata, null, false);
NoDataViewHolder holder = new NoDataViewHolder(view);
return holder;
} else if (viewType == NOMOREDATA) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_pop_nomoredata, null, false);
NoDataViewHolder holder = new NoDataViewHolder(view);
return holder;
} else {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_lrc_popsong, null, false);
LrcPopListViewHolder holder = new LrcPopListViewHolder(view);
return holder;
}
}
19
Source : DownloadMusicAdapter.java
with Apache License 2.0
from zhangliangming
with Apache License 2.0
from zhangliangming
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View view = null;
if (viewType == FOOTER) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_local_footer, null, false);
FooterViewHolder holder = new FooterViewHolder(view);
return holder;
} else if (viewType == CATEGORYreplacedLE) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_local_replacedle, null, false);
CategoryreplacedleViewHolder holder = new CategoryreplacedleViewHolder(view);
return holder;
} else if (viewType == ITEMDownloading) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_downloading, null, false);
return new DownloadingMusicViewHolder(view);
} else if (viewType == ITEMDownloaded) {
view = LayoutInflater.from(mContext).inflate(R.layout.layout_lvitem_localsong, null, false);
return new DownloadedMusicViewHolder(view);
}
return null;
}
19
Source : AppListAdapter.java
with Apache License 2.0
from zhanghai
with Apache License 2.0
from zhanghai
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(AppItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}
19
Source : MFBSwitchPreference.java
with GNU General Public License v3.0
from ZeeRooo
with GNU General Public License v3.0
from ZeeRooo
private Switch findSwitchInChildViews(ViewGroup viewGroup) {
for (int i = 0; i < viewGroup.getChildCount(); i++) {
view = viewGroup.getChildAt(i);
if (view instanceof Switch)
return (Switch) view;
else if (view instanceof ViewGroup) {
tempSwitch = findSwitchInChildViews((ViewGroup) view);
if (tempSwitch != null)
return tempSwitch;
}
}
return null;
}
19
Source : CommonMultiItemAdapter.java
with GNU General Public License v3.0
from z-chu
with GNU General Public License v3.0
from z-chu
protected CommonViewHolder createBaseViewHolder(ViewGroup parent, int layoutResId) {
return this.createBaseViewHolder(this.gereplacedemView(layoutResId, parent));
}
19
Source : PreferenceWithRightIcon.java
with Apache License 2.0
from Z-bm
with Apache License 2.0
from Z-bm
@Override
protected View onCreateView(ViewGroup parent) {
super.onCreateView(parent);
return LayoutInflater.from(getContext()).inflate(R.layout.pref_item_layout, parent, false);
}
19
Source : TimeOfDayRecAdapter.java
with GNU General Public License v3.0
from ywwynm
with GNU General Public License v3.0
from ywwynm
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == TEXTVIEW) {
return new TextViewHolder(mInflater.inflate(R.layout.time_of_day_rec_tv, parent, false));
} else {
return new EditTextHolder(mInflater.inflate(R.layout.time_of_day_rec_et, parent, false));
}
}
See More Examples