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());
}
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);
}
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));
}
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));
}
});
}
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();
}
Aggregations