Search in sources :

Example 56 with DefaultItemAnimator

use of android.support.v7.widget.DefaultItemAnimator in project BeautifulRefreshLayout by android-cjj.

the class SampleListFragment method setupRecyclerView.

private void setupRecyclerView(RecyclerView recyclerView) {
    recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
    recyclerView.setAdapter(new SimpleStringRecyclerViewAdapter(getActivity()));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 57 with DefaultItemAnimator

use of android.support.v7.widget.DefaultItemAnimator in project 2017-01-HUDI-MAC-CHAR by NHNNEXT.

the class GameRoomActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_game_room);
    ButterKnife.bind(this);
    toolbar.setTitle("입장대기중");
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    gson = new Gson();
    mafiaRemoteService = ServiceGenerator.createService(MafiaRemoteService.class, getBaseContext());
    bgm = MediaPlayer.create(getBaseContext(), day);
    bgm.setLooping(true);
    bgm.start();
    gConfigs = new ArrayList<>();
    gConfigs.add(new GameConfig(5, GameConfig.GameState.WAITING, "시작 대기중입니다."));
    gConfigs.add(new GameConfig(60, GameConfig.GameState.DAY, "의심되는 플레이어를 선택하세요"));
    gConfigs.add(new GameConfig(5, GameConfig.GameState.WAITING, "결과 처리중입니다."));
    gConfigs.add(new GameConfig(30, GameConfig.GameState.NIGHT, "역할에 따라 선택하세요."));
    gConfigs.add(new GameConfig(5, GameConfig.GameState.WAITING, "결과 처리중입니다."));
    ArrayList<User> users = new ArrayList<>();
    messages = new ArrayList<>();
    intent = getIntent();
    user = (User) intent.getSerializableExtra("user");
    roomId = intent.getStringExtra("roomId");
    userName = intent.getStringExtra("userName");
    enterRoom(roomId);
    playerAdapter = new PlayerAdapter(getBaseContext(), users, R.layout.item_player, userName, " ", gameHandler);
    GridLayoutManager gridLayoutManager = new GridLayoutManager(getBaseContext(), 4);
    gridLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
    playerListView.setLayoutManager(gridLayoutManager);
    playerListView.setItemAnimator(new DefaultItemAnimator());
    playerListView.setAdapter(playerAdapter);
    messageAdapter = new MessageAdapter(getBaseContext(), messages, R.layout.my_chat, userName);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getBaseContext(), LinearLayoutManager.VERTICAL, false);
    messageContainer.setLayoutManager(linearLayoutManager);
    messageContainer.setItemAnimator(new DefaultItemAnimator());
    messageContainer.setAdapter(messageAdapter);
    slidingLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {

        @Override
        public void onPanelSlide(View panel, float slideOffset) {
            getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        }

        @Override
        public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
        }
    });
    sendButton.setOnClickListener(this);
    slideButton.setOnClickListener(this);
}
Also used : MessageAdapter(com.zimincom.mafiaonline.adapter.MessageAdapter) User(com.zimincom.mafiaonline.item.User) PlayerAdapter(com.zimincom.mafiaonline.adapter.PlayerAdapter) SlidingUpPanelLayout(com.sothree.slidinguppanel.SlidingUpPanelLayout) MafiaRemoteService(com.zimincom.mafiaonline.remote.MafiaRemoteService) ArrayList(java.util.ArrayList) Gson(com.google.gson.Gson) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) GameConfig(com.zimincom.mafiaonline.item.GameConfig) GridLayoutManager(android.support.v7.widget.GridLayoutManager)

Example 58 with DefaultItemAnimator

use of android.support.v7.widget.DefaultItemAnimator in project okhttp-OkGo by jeasonlzy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initToolBar(toolbar, false, "");
    initData();
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(new MainAdapter(this));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 59 with DefaultItemAnimator

use of android.support.v7.widget.DefaultItemAnimator in project okhttp-OkGo by jeasonlzy.

the class DownloadActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_download);
    initToolBar(toolbar, true, "下载管理");
    initData();
    downloadManager = DownloadService.getDownloadManager();
    downloadManager.setTargetFolder(Environment.getExternalStorageDirectory().getAbsolutePath() + "/aaa/");
    targetFolder.setText("下载路径: " + downloadManager.getTargetFolder());
    sbCorePoolSize.setMax(5);
    sbCorePoolSize.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            downloadManager.getThreadPool().setCorePoolSize(progress);
            tvCorePoolSize.setText(String.valueOf(progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    sbCorePoolSize.setProgress(3);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    adapter = new MainAdapter(this);
    recyclerView.setAdapter(adapter);
    openManager.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            startActivity(new Intent(getApplicationContext(), DownloadManagerActivity.class));
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 60 with DefaultItemAnimator

use of android.support.v7.widget.DefaultItemAnimator in project okhttp-OkGo by jeasonlzy.

the class NewsTabFragment method initData.

@Override
protected void initData() {
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    newsAdapter = new NewsAdapter(null);
    newsAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    newsAdapter.isFirstOnly(false);
    recyclerView.setAdapter(newsAdapter);
    refreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
    refreshLayout.setOnRefreshListener(this);
    newsAdapter.setOnLoadMoreListener(this);
    //开启loading,获取数据
    setRefreshing(true);
    onRefresh();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)103 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)72 RecyclerView (android.support.v7.widget.RecyclerView)63 View (android.view.View)55 TextView (android.widget.TextView)30 ImageView (android.widget.ImageView)25 ArrayList (java.util.ArrayList)16 ClickItemTouchListener (com.sdsmdg.harjot.MusicDNA.clickitemtouchlistener.ClickItemTouchListener)14 GridLayoutManager (android.support.v7.widget.GridLayoutManager)13 Toolbar (android.support.v7.widget.Toolbar)13 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)10 FastAdapter (com.mikepenz.fastadapter.FastAdapter)10 UnifiedTrack (com.sdsmdg.harjot.MusicDNA.models.UnifiedTrack)10 MaterializeBuilder (com.mikepenz.materialize.MaterializeBuilder)9 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)8 LocalTrack (com.sdsmdg.harjot.MusicDNA.models.LocalTrack)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 Button (android.widget.Button)7 Random (java.util.Random)6 Intent (android.content.Intent)5