本文整理汇总了Java中com.tonicartos.superslim.LayoutManager类的典型用法代码示例。如果您正苦于以下问题:Java LayoutManager类的具体用法?Java LayoutManager怎么用?Java LayoutManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutManager类属于com.tonicartos.superslim包,在下文中一共展示了LayoutManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: maybeFireLoadMore
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
private void maybeFireLoadMore() {
if (hasLoadMoreFired) {
return;
}
if (!showShowLoadMore) {
return;
}
final RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
int visibleItemCount = layoutManager.getChildCount();
int totalItemCount = layoutManager.getItemCount();
int firstVisibleItemPosition = findFirstVisibleItemPosition();
if (totalItemCount == 0) {
return;
}
if (firstVisibleItemPosition + visibleItemCount + bufferItems > totalItemCount) {
if (onLoadMoreListener != null) {
hasLoadMoreFired = true;
onLoadMoreListener.onLoadMore(adapter.getLastItem());
}
}
}
开发者ID:jonashao,项目名称:Samantha,代码行数:25,代码来源:RealmRecyclerView.java
示例2: findFirstVisibleItemPosition
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
public int findFirstVisibleItemPosition() {
switch (type) {
case LinearLayout:
return ((LinearLayoutManager) recyclerView.getLayoutManager())
.findFirstVisibleItemPosition();
case Grid:
return ((GridLayoutManager) recyclerView.getLayoutManager())
.findFirstVisibleItemPosition();
case LinearLayoutWithHeaders:
return ((LayoutManager) recyclerView.getLayoutManager())
.findFirstVisibleItemPosition();
case StaggeredGridLayout:
return ((StaggeredGridLayoutManager) recyclerView.getLayoutManager())
.findFirstVisibleItemPositions(null)[0];
default:
throw new IllegalStateException("Type of layoutManager unknown." +
"In this case this method needs to be overridden");
}
}
开发者ID:jonashao,项目名称:Samantha,代码行数:20,代码来源:RealmRecyclerView.java
示例3: onCreateView
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sendungen_abisz, container, false);
Context context = view.getContext();
if ((getActivity()) != null)
((BaseActivity) getActivity()).setActionBarTitle(mHeaderTitle);
final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
mWindowHeight = LayoutTasks.getWindowHeight(context);
mLayoutManager = new LayoutManager(getActivity());
recyclerView.setLayoutManager(mLayoutManager);
mVideoAdapter = new VideoAdapter(new ArrayList<Episode>(), mListener);
recyclerView.setAdapter(mVideoAdapter);
recyclerView.addOnScrollListener(onScrollListener);
downloadVideos();
return view;
}
开发者ID:PJakcson,项目名称:Mediathek,代码行数:24,代码来源:ZdfVideoFragment.java
示例4: onCreate
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
mRecyclerView.setLayoutManager(new LayoutManager(this));
Data data = new Data();
timelineAdapter = new TimelineAdapter(data.getData());
mRecyclerView.setAdapter(timelineAdapter);
}
开发者ID:andersonkxiass,项目名称:SuperSlimDemo,代码行数:18,代码来源:MainActivity.java
示例5: onBindViewHolder
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onBindViewHolder(ViewHolder holder, int i) {
Item item = getItem(i);
if (item == null) {
return;
}
LayoutManager.LayoutParams lp = LayoutManager.LayoutParams.from(holder.itemView.getLayoutParams());
lp.setSlm(LinearSLM.ID);
if (item.getType() == ViewTypes.HEADER) {
HeaderItem hi = (HeaderItem) item;
HeaderViewHolder headerHolder = (HeaderViewHolder) holder;
hi.setViewholder(headerHolder);
headerHolder.update(hi.getGroup());
lp.setFirstPosition(i);
} else {
DeviceItem di = (DeviceItem) item;
DeviceViewHolder deviceHolder = (DeviceViewHolder) holder;
di.setViewholder(deviceHolder);
deviceHolder.bind(di.getDevice());
lp.setFirstPosition(di.getHeaderPos());
}
holder.itemView.setLayoutParams(lp);
}
开发者ID:pimatic,项目名称:pimatic-android,代码行数:25,代码来源:DeviceAdapter.java
示例6: onActivityCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final RecyclerView recyclerView = (RecyclerView) mRootView.findViewById(R.id.recycler_view);
LayoutManager layoutManager = new LayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(null);
mAdapter = new HistoryAdapter(getActivity(),
R.layout.list_item_content,
null);
recyclerView.setAdapter(mAdapter);
getLoaderManager().initLoader(Queries.HistorySummaryQuery._TOKEN, null, this);
}
开发者ID:mudar,项目名称:SnooZy,代码行数:18,代码来源:HistoryFragment.java
示例7: onBindViewHolder
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (getItemViewType(position) == VIEW_TYPE_HEADER) {
HeaderViewHolder headerHolder = (HeaderViewHolder) holder;
headerHolder.bindRow(position);
ViewCompat.setElevation(holder.itemView, headerElevation);
setAnimation(holder.itemView, position);
} else {
if (mCursor != null && mCursor.moveToPosition(mSections.getRawPosition(position))) {
HistoryViewHolder historyHolder = (HistoryViewHolder) holder;
historyHolder.bindRow();
}
}
final LayoutManager.LayoutParams params = LayoutManager.LayoutParams.from(holder.itemView.getLayoutParams());
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.setSlm(LinearSLM.ID);
params.setFirstPosition(mSections.getHeaderPosition(position));
holder.itemView.setLayoutParams(params);
}
开发者ID:mudar,项目名称:SnooZy,代码行数:25,代码来源:HistoryAdapter.java
示例8: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_important)));
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
LinearLayout noSets = (LinearLayout)view.findViewById(R.id.no_sets);
if (Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_important)).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:33,代码来源:ImportantFragment.java
示例9: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_todo)));
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
LinearLayout noSets = (LinearLayout)view.findViewById(R.id.no_sets);
if (Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_todo)).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:33,代码来源:TodoFragment.java
示例10: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay,
Utils.getMostUsedFlashcards(flashcards)
);
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
LinearLayout noSets = (LinearLayout)view.findViewById(R.id.no_sets);
if (Utils.getMostUsedFlashcards(flashcards).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:35,代码来源:MostUsedFragment.java
示例11: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_dictionary)));
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
LinearLayout noSets = (LinearLayout)view.findViewById(R.id.no_sets);
if (Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_dictionary)).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:33,代码来源:DictionaryFragment.java
示例12: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsInAlphabeticalOrder(flashcards));
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
LinearLayout noSets = (LinearLayout) view.findViewById(R.id.no_sets);
if (Utils.getFlashcardsInAlphabeticalOrder(flashcards).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:34,代码来源:AllSetsFragment.java
示例13: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
db = FlashcardDb.getInstance(getActivity().getApplicationContext());
flashcards = db.getAllFlashcards();
Log.d(TAG, "onViewCreated: flashcards.size() = " + flashcards.size());
rv.setLayoutManager(new LayoutManager(getActivity()));
//OverScrollDecoratorHelper.setUpOverScroll(rv, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
adapter = new RVMainAdapter(getActivity(), mHeaderDisplay, Utils.getFlashcardsByLabel(flashcards, getString(R.string.menu_todo)));
adapter.setMarginsFixed(mAreMarginsFixed);
adapter.setHeaderDisplay(mHeaderDisplay);
rv.setAdapter(new ScaleInAnimationAdapter(new AlphaInAnimationAdapter(adapter)));
String label = getArguments().getString("title", "aksjdhiqwhe27813487132647813");
LinearLayout noSets = (LinearLayout) view.findViewById(R.id.no_sets);
if (Utils.getFlashcardsByLabel(flashcards, label).isEmpty())
noSets.setVisibility(View.VISIBLE);
else
noSets.setVisibility(View.GONE);
}
开发者ID:AbduazizKayumov,项目名称:Flashcard-Maker-Android,代码行数:35,代码来源:LabelFragment.java
示例14: onCreateView
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sendungen_abisz, container, false);
Context context = view.getContext();
if ((getActivity()) != null)
((BaseActivity) getActivity()).setActionBarResource(R.string.action_title_sendung_verpasst);
final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
View scrollArea = view.findViewById(R.id.fastScrollArea);
mWindowHeight = LayoutTasks.getWindowHeight(context);
mIndicator = (TextView) view.findViewById(R.id.indicator);
mScrollLayoutParams = (RelativeLayout.LayoutParams) mIndicator.getLayoutParams();
mLayoutManager = new LayoutManager(getActivity());
recyclerView.setLayoutManager(mLayoutManager);
mVideoAdapter = new VideoAdapter(new ArrayList<Episode>(), mListener);
recyclerView.setAdapter(mVideoAdapter);
mVideoAdapter.updateValues(Episode.createHeader(FormatTime.getMissedHeader(mDay)));
recyclerView.addOnScrollListener(onScrollListener);
scrollArea.setOnTouchListener(this);
// downloadMissedVideos(mLoadedItems, INT_UPDATE_COUNT);
downloadMissedVideos2();
return view;
}
开发者ID:PJakcson,项目名称:Mediathek,代码行数:30,代码来源:ZdfMissedVideoFragment.java
示例15: onCreate
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_icon);
RecyclerView recyclerView =
(RecyclerView) findViewById(R.id.recycler_select_icon);
recyclerView.setLayoutManager(new LayoutManager(this));
recyclerView.setAdapter(new IconListAdapter(this));
}
开发者ID:1641835946,项目名称:MyTimeLogger,代码行数:12,代码来源:SelectIconActivity.java
示例16: onCreateOptionsMenu
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
MenuItem item = null;
CountriesFragment countriesFragment = getCountriesFragment();
final int headerMode = countriesFragment.getHeaderMode();
if (headerMode == LayoutManager.LayoutParams.HEADER_INLINE) {
item = menu.findItem(R.id.action_header_inline);
} else if ((headerMode & LayoutManager.LayoutParams.HEADER_ALIGN_START)
== LayoutManager.LayoutParams.HEADER_ALIGN_START) {
item = menu.findItem(R.id.action_header_start);
} else if ((headerMode & LayoutManager.LayoutParams.HEADER_ALIGN_END)
== LayoutManager.LayoutParams.HEADER_ALIGN_END) {
item = menu.findItem(R.id.action_header_end);
}
if (item != null) {
item.setChecked(true);
}
menu.findItem(R.id.action_overlay).setChecked(countriesFragment.areHeadersOverlaid());
menu.findItem(R.id.action_sticky).setChecked(countriesFragment.areHeadersSticky());
menu.findItem(R.id.action_fixed_margins).setChecked(countriesFragment.areMarginsFixed());
return true;
}
开发者ID:dingdingyr,项目名称:SuperSLiM-,代码行数:31,代码来源:MainActivity.java
示例17: onViewCreated
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState != null) {
mHeaderDisplay = savedInstanceState
.getInt(KEY_HEADER_POSITIONING,
getResources().getInteger(R.integer.default_header_display));
mAreMarginsFixed = savedInstanceState
.getBoolean(KEY_MARGINS_FIXED,
getResources().getBoolean(R.bool.default_margins_fixed));
} else {
mHeaderDisplay = getResources().getInteger(R.integer.default_header_display);
mAreMarginsFixed = getResources().getBoolean(R.bool.default_margins_fixed);
}
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
ItemDecorator decor = new ItemDecorator.Builder(getActivity())
.setDrawableBelow(R.drawable.divider_horizontal, ItemDecorator.INTERNAL)
.decorateSlm(LinearSLM.ID)
.decorateSlm(GridSLM.ID)
.build();
mRecyclerView.addItemDecoration(decor);
mAdapter = new CountryNamesAdapter(getActivity(), mHeaderDisplay);
LayoutManager layoutManager = new LayoutManager.Builder(getActivity())
.addAdapter(mAdapter)
.build();
mRecyclerView.setLayoutManager(layoutManager);
mAdapter.setMarginsFixed(mAreMarginsFixed);
mAdapter.setHeaderDisplay(mHeaderDisplay);
mRecyclerView.setAdapter(mAdapter);
}
开发者ID:dingdingyr,项目名称:SuperSLiM-,代码行数:37,代码来源:CountriesFragment.java
示例18: onBindViewHolder
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public void onBindViewHolder(CountryViewHolder holder, int position) {
final LineItem item = mSectionGraph.getItem(position);
final View itemView = holder.itemView;
holder.bindItem(item.text);
final GridSLM.LayoutParams lp = new GridSLM.LayoutParams(
itemView.getLayoutParams());
// Overrides xml attrs, could use different layouts too.
if (item.isHeader) {
lp.headerDisplay = mHeaderDisplay;
if (lp.isHeaderInline() || (mMarginsFixed && !lp.isHeaderOverlay())) {
lp.width = ViewGroup.LayoutParams.MATCH_PARENT;
} else {
lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
}
}
if (position == item.sectionFirstPosition) {
lp.setSlm(item.sectionManager == LINEAR ? LinearSLM.ID : GridSLM.ID);
lp.marginEnd = mMarginsFixed ? mContext.getResources()
.getDimensionPixelSize(R.dimen.default_section_marginEnd)
: LayoutManager.LayoutParams.MARGIN_AUTO;
lp.marginStart = mMarginsFixed ? mContext.getResources()
.getDimensionPixelSize(R.dimen.default_section_marginStart)
: LayoutManager.LayoutParams.MARGIN_AUTO;
lp.setColumnWidth(mContext.getResources().getDimensionPixelSize(R.dimen.grid_column_width));
}
itemView.setLayoutParams(lp);
}
开发者ID:dingdingyr,项目名称:SuperSLiM-,代码行数:33,代码来源:CountryNamesAdapter.java
示例19: onCreateView
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
// The last two arguments ensure LayoutParams are inflated
// properly.
View rootView = inflater.inflate(
R.layout.device_page_layout, container, false);
Bundle args = getArguments();
final int index = args.getInt(ARG_OBJECT);
final RecyclerView listview = (RecyclerView) rootView.findViewById(R.id.devciesListView);
LayoutManager mLayoutManager = new LayoutManager(getActivity());
listview.setLayoutManager(mLayoutManager);
//Needed because the DeviceAdapter adds a listener to the DevicePageManager,
//but this method if caled in the loop of DevicePageManager.didChange and and
//DevicePageManager.onChange modifies the listener array, what leads to a violation
//exception
new Handler().post(new Runnable() {
@Override
public void run() {
final DeviceAdapter adapter = new DeviceAdapter(getActivity(), index);
listview.setAdapter(adapter);
}
});
// ((TextView) rootView.findViewById(android.R.id.text1)).setText(
// Integer.toString());
return rootView;
}
开发者ID:pimatic,项目名称:pimatic-android,代码行数:36,代码来源:DevicePagePagerAdapter.java
示例20: onCreateView
import com.tonicartos.superslim.LayoutManager; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_playa_list_view, container, false);
mEmptyText = v.findViewById(android.R.id.empty);
mRecyclerView = v.findViewById(android.R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setLayoutManager(new LayoutManager(getActivity()));
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
return v;
}
开发者ID:Burning-Man-Earth,项目名称:iBurn-Android,代码行数:11,代码来源:FavoritesListViewFragment.java
注:本文中的com.tonicartos.superslim.LayoutManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论