本文整理汇总了Java中android.support.v7.widget.LinearLayoutManager.setStackFromEnd方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutManager.setStackFromEnd方法的具体用法?Java LinearLayoutManager.setStackFromEnd怎么用?Java LinearLayoutManager.setStackFromEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.LinearLayoutManager
的用法示例。
在下文中一共展示了LinearLayoutManager.setStackFromEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_history, container, false);
setContentsCallback();
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setReverseLayout(true);
layoutManager.setStackFromEnd(true);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView_history);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(layoutManager);
historyAdapter = new HistoryAdapter(getContext(), contentsArrayList);
recyclerView.setAdapter(historyAdapter);
return view;
}
示例2: initViews
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initViews() {
btnPublish = (ImageButton) findViewById(R.id.publish);
btnSwitch = (ImageButton) findViewById(R.id.swCam);
btnBack = (ImageButton) findViewById(R.id.back);
txtState = (TextView) findViewById(R.id.state);
mCameraView = (SurfaceView) findViewById(R.id.preview);
mMessagesView = (RecyclerView) findViewById(R.id.push_messages_receive_layout);
linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setStackFromEnd(true);
mMessagesView.setLayoutManager(linearLayoutManager);
mMessagesView.setAdapter(mAdapter);
mCameraView.getHolder().addCallback(this);
btnPublish.setOnClickListener(this);
btnSwitch.setOnClickListener(this);
btnBack.setOnClickListener(this);
}
示例3: setUpHistory
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void setUpHistory(RecyclerView historyView) {
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
layoutManager.setReverseLayout(true);
layoutManager.setStackFromEnd(true);
historyView.setLayoutManager(layoutManager);
historyView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
final FloatingHistoryAdapter historyAdapter = new FloatingHistoryAdapter(mContext, mSolver, mHistory, mHistoryCallback);
mHistory.setObserver(new History.Observer() {
@Override
public void notifyDataSetChanged() {
historyAdapter.notifyDataSetChanged();
}
});
historyView.setAdapter(historyAdapter);
layoutManager.scrollToPosition(historyAdapter.getItemCount() - 1);
}
示例4: initViews
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initViews(View v) {
adapter=new CallAdapter(new ArrayList<HamnetCall>());
recyclerView = (RecyclerView) v.findViewById(R.id.item_recycler_view);
recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
mLayoutManager.setReverseLayout(true);
mLayoutManager.setStackFromEnd(true);
recyclerView.setLayoutManager(mLayoutManager);
SharedPreferences sharedPref = this.getActivity().getSharedPreferences("sharedPref", Context.MODE_PRIVATE);
server = sharedPref.getString("server", "http://www.hampager.de:8080");
user = sharedPref.getString("user", "invalid");
password = sharedPref.getString("pass", "invalid");
admin = sharedPref.getBoolean("admin", true);
fetchJSON(server, user, password, admin);
}
示例5: onCreateView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_file_viewer, container, false);
RecyclerView mRecyclerView = (RecyclerView) v.findViewById(R.id.recyclerView);
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
llm.setOrientation(LinearLayoutManager.VERTICAL);
//newest to oldest order (database stores from oldest to newest)
llm.setReverseLayout(true);
llm.setStackFromEnd(true);
mRecyclerView.setLayoutManager(llm);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mFileViewerAdapter = new FileViewerAdapter(getActivity(), llm);
mRecyclerView.setAdapter(mFileViewerAdapter);
return v;
}
示例6: initViews
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initViews(View v) {
emptyListLabel = v.findViewById(R.id.empty_list_label);
mRecordingsListView = v.findViewById(R.id.recyclerView);
mRecordingsListView.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
llm.setOrientation(LinearLayoutManager.VERTICAL);
//newest to oldest order (database stores from oldest to newest)
llm.setReverseLayout(true);
llm.setStackFromEnd(true);
mRecordingsListView.setLayoutManager(llm);
//mRecordingsListView.setItemAnimator(new DefaultItemAnimator());
mRecordingsListView.setAdapter(mPlayListAdapter);
playListPresenter.onViewInitialised();
}
示例7: initRecyclerView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initRecyclerView() {
/**code edited by nirmal
* Replacing the linearlayout manager
*/
// mLinearLayoutManager = new LinearLayoutManager(PostsDetailsActivity.this,LinearLayoutManager.VERTICAL,true);
mMessageAdapter = new MessageAdapter(PostsDetailsActivity.this, myCommentList, mInsertMessageListener);
mLinearLayoutManager = new LinearLayoutManager(PostsDetailsActivity.this) {
@Override
public boolean canScrollVertically() {
return false;
}
};
mLinearLayoutManager.setStackFromEnd(true);
// mLinearLayoutManager.setReverseLayout(true);
mMessageRecyclerView.setLayoutManager(mLinearLayoutManager);
mMessageRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(this));
mMessageRecyclerView.setAdapter(mMessageAdapter);
}
示例8: initializeFormBuildHelper
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
/**
* private method for initializing form build helper
* @param context
* @param recyclerView
* @param listener
*/
private void initializeFormBuildHelper(Context context, RecyclerView recyclerView, OnFormElementValueChangedListener listener) {
// initialize form adapter
this.mFormAdapter = new FormAdapter(context, listener);
// set up the recyclerview with adapter
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
linearLayoutManager.setStackFromEnd(false);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(mFormAdapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
}
示例9: onCreateView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.view_files, container, false);
final RecyclerView mRecyclerView = (RecyclerView) v.findViewById(R.id.recyclerView);
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
llm.setOrientation(LinearLayoutManager.VERTICAL);
//newest to oldest order (database stores from oldest to newest)
llm.setReverseLayout(true);
llm.setStackFromEnd(true);
mRecyclerView.setLayoutManager(llm);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mFileViewerAdapter = new FileViewerAdapter(getActivity(), llm);
mRecyclerView.setAdapter(mFileViewerAdapter);
return v;
}
示例10: setupComments
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override public void setupComments() {
linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setStackFromEnd(true);
rvComments.setLayoutManager(linearLayoutManager);
commentsAdapter = new CommentsAdapter(this);
rvComments.setAdapter(commentsAdapter);
rvComments.setOverScrollMode(View.OVER_SCROLL_NEVER);
rvComments.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
commentsAdapter.setAnimationsLocked(true);
}
}
});
}
示例11: onViewCreated
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mBpsTextView = (TextView) view.findViewById(R.id.bpm_text_view);
mChart = (LineChart) view.findViewById(R.id.line_chart);
mDataDisplayRecyclerView = (RecyclerView) view.findViewById(R.id.data_display_recycler_view);
initChart();
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setReverseLayout(true); /*让RecyclerView的元素倒序显示*/
layoutManager.setStackFromEnd(true);/*初始元素不默认从底部开始显示*/
mDataDisplayRecyclerView.setLayoutManager(layoutManager);
mDataDisplayRecyclerView.setAdapter(new DataDisplayAdapter(getActivity(), data));
}
示例12: setup
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void setup(Context context) {
if (!isInEditMode()) {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setStackFromEnd(true);
setLayoutManager(linearLayoutManager);
mLogAdapter = new LogView.LogAdapter(context);
setAdapter(mLogAdapter);
}
}
示例13: onCreate
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
evekey = (String) getIntent().getExtras().get("id");
setContentView(R.layout.activity_messaging);
contentRoot = findViewById(R.id.contentRoot);
edMessage = (EmojiconEditText)findViewById(R.id.editTextMessage);
btSendMessage = (ImageView)findViewById(R.id.buttonMessage);
btSendMessage.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
String nullcheck = edMessage.getText().toString();
Log.d("Strings",nullcheck);
if(nullcheck != null){
Log.d("testings",nullcheck);
sendMessageFirebase();
}
}
} );
btEmoji = (ImageView)findViewById(R.id.buttonEmoji);
emojIcon = new EmojIconActions(this,contentRoot,edMessage,btEmoji);
emojIcon.ShowEmojIcon();
rvListMessage = (RecyclerView)findViewById(R.id.messageRecyclerView);
mLinearLayoutManager = new LinearLayoutManager(this);
mLinearLayoutManager.setStackFromEnd(true);
setUserModel();
}
示例14: bindViews
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
/**
* Vincular views com Java API
*/
private void bindViews() {
View contentRoot = findViewById(R.id.contentRoot);
edMessage = (EmojiconEditText) findViewById(R.id.editTextMessage);
ImageView btSendMessage = (ImageView) findViewById(R.id.buttonMessage);
btSendMessage.setOnClickListener(this);
ImageView btEmoji = (ImageView) findViewById(R.id.buttonEmoji);
EmojIconActions emojIcon = new EmojIconActions(this, contentRoot, edMessage, btEmoji);
emojIcon.ShowEmojIcon();
rvListMessage = (RecyclerView) findViewById(R.id.messageRecyclerView);
mLinearLayoutManager = new LinearLayoutManager(this);
mLinearLayoutManager.setStackFromEnd(true);
}
示例15: onActivityCreated
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (presenter == null) {
presenter = new ChatPresenter(this);
}
setupUI(this.getView());
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.setStackFromEnd(true);
messageListView.setLayoutManager(linearLayoutManager);
}