當前位置: 首頁>>代碼示例>>Java>>正文


Java LinearLayoutManager.setStackFromEnd方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Team-Sprout,項目名稱:Clipcon-AndroidClient,代碼行數:20,代碼來源:HistoryFragment.java

示例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);
}
 
開發者ID:lisnstatic,項目名稱:live_master,代碼行數:17,代碼來源:PushLiveActivity.java

示例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);
}
 
開發者ID:tranleduy2000,項目名稱:floating_calc,代碼行數:20,代碼來源:FloatingPageAdapter.java

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

}
 
開發者ID:DecentralizedAmateurPagingNetwork,項目名稱:DAPNETApp,代碼行數:19,代碼來源:CallFragment.java

示例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;
}
 
開發者ID:tortuvshin,項目名稱:health,代碼行數:22,代碼來源:FileViewerFragment.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: 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);

    }
 
開發者ID:sciage,項目名稱:FinalProject,代碼行數:25,代碼來源:PostsDetailsActivity.java

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

}
 
開發者ID:adib2149,項目名稱:FormMaster,代碼行數:22,代碼來源:FormBuilder.java

示例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;
}
 
開發者ID:adarshgumashta,項目名稱:Facebook-Video-Downloader,代碼行數:22,代碼來源:FileViewerFragment.java

示例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);
      }
    }
  });
}
 
開發者ID:softonic,項目名稱:instamaterial,代碼行數:18,代碼來源:CommentsActivity.java

示例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));
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:15,代碼來源:DataDisplayFragment.java

示例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);
    }
}
 
開發者ID:tranleduy2000,項目名稱:sortalgorithm,代碼行數:10,代碼來源:LogView.java

示例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();
}
 
開發者ID:picopalette,項目名稱:event-me,代碼行數:31,代碼來源:MessagingActivity.java

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

}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:17,代碼來源:ChatActivity.java

示例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);
}
 
開發者ID:VidyaSastry,項目名稱:Opal-Chat-AnalyticsDashboard,代碼行數:15,代碼來源:ChatFragment.java


注:本文中的android.support.v7.widget.LinearLayoutManager.setStackFromEnd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。