本文整理汇总了Java中android.support.v7.widget.LinearLayoutManager.setReverseLayout方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutManager.setReverseLayout方法的具体用法?Java LinearLayoutManager.setReverseLayout怎么用?Java LinearLayoutManager.setReverseLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.LinearLayoutManager
的用法示例。
在下文中一共展示了LinearLayoutManager.setReverseLayout方法的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: initSelectionRecycler
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
/**
* 初始化选集recyclerView
*/
private void initSelectionRecycler()
{
List<BangumiDetailsInfo.ResultBean.EpisodesBean> episodes = result.getEpisodes();
mBangumiSelectionRecycler.setHasFixedSize(false);
mBangumiSelectionRecycler.setNestedScrollingEnabled(false);
LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mLinearLayoutManager.setReverseLayout(true);
mBangumiSelectionRecycler.setLayoutManager(mLinearLayoutManager);
BangumiDetailsSelectionAdapter mBangumiDetailsSelectionAdapter = new BangumiDetailsSelectionAdapter(mBangumiSelectionRecycler, episodes);
mBangumiSelectionRecycler.setAdapter(mBangumiDetailsSelectionAdapter);
mBangumiDetailsSelectionAdapter.notifyItemForeground(episodes.size() - 1);
mBangumiSelectionRecycler.scrollToPosition(episodes.size() - 1);
mBangumiDetailsSelectionAdapter.setOnItemClickListener((position, holder) -> {
mBangumiDetailsSelectionAdapter.notifyItemForeground(holder.getLayoutPosition());
VideoDetailsActivity.launch(BangumiDetailsActivity.this,
episodes.get(position).getAv_id(), episodes.get(position).getCover());
LogUtil.test(" getAv_id = "+ episodes.get(position).getAv_id());
});
}
示例3: initSelectionRecycler
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
/**
* 初始化选集recyclerView
*/
private void initSelectionRecycler() {
List<BangumiDetailsInfo.ResultBean.EpisodesBean> episodes = result.getEpisodes();
mBangumiSelectionRecycler.setHasFixedSize(false);
mBangumiSelectionRecycler.setNestedScrollingEnabled(false);
LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(this,
LinearLayoutManager.HORIZONTAL, false);
mLinearLayoutManager.setReverseLayout(true);
mBangumiSelectionRecycler.setLayoutManager(mLinearLayoutManager);
BangumiDetailsSelectionAdapter mBangumiDetailsSelectionAdapter
= new BangumiDetailsSelectionAdapter(mBangumiSelectionRecycler, episodes);
mBangumiSelectionRecycler.setAdapter(mBangumiDetailsSelectionAdapter);
mBangumiDetailsSelectionAdapter.notifyItemForeground(episodes.size() - 1);
mBangumiSelectionRecycler.scrollToPosition(episodes.size() - 1);
mBangumiDetailsSelectionAdapter.setOnItemClickListener((position, holder) -> {
mBangumiDetailsSelectionAdapter.notifyItemForeground(holder.getLayoutPosition());
VideoDetailsActivity.launch(BangumiDetailsActivity.this,
Integer.valueOf(episodes.get(position).getAv_id()), episodes.get(position).getCover());
});
}
示例4: 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);
}
示例5: 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);
}
示例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: 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;
}
示例8: 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;
}
示例9: onCreate
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_timeline);
ButterKnife.bind(this);
// recover our username and set the maximum tweet size
username = getIntent().getStringExtra(INTENT_USERNAME);
txtMessage.setFilters(new InputFilter[] { new InputFilter.LengthFilter(138 - username.length()) });
// Configure the Toolbar
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
gatewaySwitch.setChecked(true);
// configure the recyclerview
RecyclerView tweetsRecyclerView = findViewById(R.id.tweet_list);
LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(this);
mLinearLayoutManager.setReverseLayout(true);
tweetsRecyclerView.setLayoutManager(mLinearLayoutManager);
tweetsRecyclerView.setAdapter(tweetsAdapter);
// Set the Bridgefy MessageListener
Log.d(TAG, "Setting new State and Message Listeners");
Bridgefy.setMessageListener(tweetManager = new TweetManager(username, this));
// register the connected receiver
// LocalBroadcastManager.getInstance(this).registerReceiver(wifiReceiver, wifiReceiver.getIntentFilter());
getApplicationContext().registerReceiver(wifiReceiver,
new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}
示例10: onCreate
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
ButterKnife.bind(this);
// recover our Peer object
conversationName = getIntent().getStringExtra(INTENT_EXTRA_NAME);
conversationId = getIntent().getStringExtra(INTENT_EXTRA_UUID);
// Configure the Toolbar
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Enable the Up button
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setTitle(conversationName);
ab.setDisplayHomeAsUpEnabled(true);
}
// register the receiver to listen for incoming messages
LocalBroadcastManager.getInstance(getBaseContext())
.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Message message = new Message(intent.getStringExtra(MainActivity.INTENT_EXTRA_MSG));
message.setDeviceName(intent.getStringExtra(MainActivity.INTENT_EXTRA_NAME));
message.setDirection(Message.INCOMING_MESSAGE);
messagesAdapter.addMessage(message);
}
}, new IntentFilter(conversationId));
// configure the recyclerview
RecyclerView messagesRecyclerView = findViewById(R.id.message_list);
LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(this);
mLinearLayoutManager.setReverseLayout(true);
messagesRecyclerView.setLayoutManager(mLinearLayoutManager);
messagesRecyclerView.setAdapter(messagesAdapter);
}
示例11: setRecyclerView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
public void setRecyclerView(Context context) {
// 用于存储recyclerView的日期
GlobalVariables.setmDate("");
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setStackFromEnd(true); // 列表从底部开始展示,反转后从上方开始展示
layoutManager.setReverseLayout(true); // 列表反转
ioItemRecyclerView.setLayoutManager(layoutManager);
adapter = new IOItemAdapter(ioItemList);
ioItemRecyclerView.setAdapter(adapter);
itemTouchHelper.attachToRecyclerView(ioItemRecyclerView);
}
示例12: setUpRecyclerView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void setUpRecyclerView() {
mLayoutManager = new LinearLayoutManager(getActivity());
mLayoutManager.setReverseLayout(true);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mChatAdapter);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (mLayoutManager.findLastVisibleItemPosition() == mChatAdapter.getItemCount() - 1) {
mChatAdapter.loadPreviousMessages(30, null);
}
}
});
}
示例13: 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));
}
示例14: onViewCreated
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mChart = (LineChart) view.findViewById(R.id.line_chart);
mBpmRecyclerView = (RecyclerView) view.findViewById(R.id.data_display_recycler_view);
initChart();
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setReverseLayout(true); /*让RecyclerView的元素倒序显示*/
layoutManager.setStackFromEnd(true);/*初始元素不默认从底部开始显示*/
mBpmRecyclerView.setLayoutManager(layoutManager);
mBpmRecyclerView.setAdapter(new MedicallyExamAdapter(getActivity(), data));
}
示例15: onCreateView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mMainView = inflater.inflate(R.layout.fragment_chats, container, false);
mConvList = (RecyclerView) mMainView.findViewById(R.id.conv_list);
mAuth = FirebaseAuth.getInstance();
mCurrent_user = mAuth.getCurrentUser();
if(mCurrent_user!= null)
{ mCurrent_user_id = mCurrent_user.getUid();}
mConvDatabase = FirebaseDatabase.getInstance().getReference().child("Chat").child(mCurrent_user_id);
mConvDatabase.keepSynced(true);
mUsersDatabase = FirebaseDatabase.getInstance().getReference().child("Users");
mMessageDatabase = FirebaseDatabase.getInstance().getReference().child("messages").child(mCurrent_user_id);
mUsersDatabase.keepSynced(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setReverseLayout(true);
linearLayoutManager.setStackFromEnd(true);
mConvList.setHasFixedSize(true);
mConvList.setLayoutManager(linearLayoutManager);
// Inflate the layout for this fragment
return mMainView;
}