当前位置: 首页>>代码示例>>Java>>正文


Java LinearLayoutManager.setReverseLayout方法代码示例

本文整理汇总了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;
}
 
开发者ID:Team-Sprout,项目名称:Clipcon-AndroidClient,代码行数:20,代码来源:HistoryFragment.java

示例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());
    });
}
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:26,代码来源:BangumiDetailsActivity.java

示例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());
  });
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:26,代码来源:BangumiDetailsActivity.java

示例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);
}
 
开发者ID:tranleduy2000,项目名称:floating_calc,代码行数:20,代码来源:FloatingPageAdapter.java

示例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);

}
 
开发者ID:DecentralizedAmateurPagingNetwork,项目名称:DAPNETApp,代码行数:19,代码来源:CallFragment.java

示例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();
}
 
开发者ID:Arjun-sna,项目名称:Android-AudioRecorder-App,代码行数:17,代码来源:PlayListFragment.java

示例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;
}
 
开发者ID:adarshgumashta,项目名称:Facebook-Video-Downloader,代码行数:22,代码来源:FileViewerFragment.java

示例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;
}
 
开发者ID:tortuvshin,项目名称:health,代码行数:22,代码来源:FileViewerFragment.java

示例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));
    }
 
开发者ID:bridgefy,项目名称:bridgefy-android-samples,代码行数:32,代码来源:TimelineActivity.java

示例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);
}
 
开发者ID:bridgefy,项目名称:bridgefy-android-samples,代码行数:40,代码来源:ChatActivity.java

示例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);
}
 
开发者ID:yuukidach,项目名称:Ucount,代码行数:14,代码来源:MainActivity.java

示例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);
            }
        }
    });
}
 
开发者ID:narenkukreja,项目名称:quire,代码行数:15,代码来源:GroupChatFragment.java

示例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));
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:15,代码来源:DataDisplayFragment.java

示例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));
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:14,代码来源:MedicallyExamReportFragment.java

示例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;
}
 
开发者ID:IOSD,项目名称:YFHR_Android_App,代码行数:31,代码来源:ChatsFragment.java


注:本文中的android.support.v7.widget.LinearLayoutManager.setReverseLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。