use of com.scwang.smart.refresh.footer.ClassicsFooter in project ManPinAPP by AnyMarvel.
the class BookRRecommendFImpl method bindView.
@Override
protected void bindView() {
super.bindView();
recommendRecyclerView = view.findViewById(R.id.mp_bookr_recommend_recyclerview);
bookRrefreshLayout = view.findViewById(R.id.bookr_recommend_refreshLayout);
bookRrefreshLayout.setRefreshFooter(new ClassicsFooter(requireContext()));
bookRrefreshLayout.setRefreshHeader(new ClassicsHeader(requireContext()));
}
use of com.scwang.smart.refresh.footer.ClassicsFooter in project ManPinAPP by AnyMarvel.
the class BookRankListActivity method bindView.
@Override
protected void bindView() {
super.bindView();
recommendRecyclerView = findViewById(R.id.mp_bookr_recommend_recyclerview);
bookRrefreshLayout = findViewById(R.id.bookr_recommend_refreshLayout);
bookRrefreshLayout.setRefreshFooter(new ClassicsFooter(Objects.requireNonNull(getContext())));
bookRrefreshLayout.setRefreshHeader(new ClassicsHeader(Objects.requireNonNull(getContext())));
title = findViewById(R.id.mp_book_rank_list_title);
searchView = findViewById(R.id.bookr_fragment_search);
searchView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent searchIntent = new Intent(BookRankListActivity.this, SearchActivity.class);
startActivity(searchIntent);
}
});
bookRankLoading = findViewById(R.id.book_rank_loading);
errorButton = findViewById(R.id.mp_error_button);
errorButton.setVisibility(View.GONE);
errorButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
errorButton.setVisibility(View.GONE);
mPresenter.initBookRankListData(bookRankUrl);
}
});
}
use of com.scwang.smart.refresh.footer.ClassicsFooter in project box by lany192.
the class BoxApplication method initRefreshView.
private void initRefreshView() {
// 设置全局的Header构建器
SmartRefreshLayout.setDefaultRefreshHeaderCreator((context, layout) -> {
// 全局设置主题颜色
layout.setPrimaryColorsId(R.color.refresh_head_background, R.color.refresh_head_text_color);
return new ClassicsHeader(context).setArrowResource(// .setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
R.drawable.vector_arrow_gray);
});
// 设置全局的Footer构建器
SmartRefreshLayout.setDefaultRefreshFooterCreator((context, layout) -> {
// 指定为经典Footer,默认是 BallPulseFooter
return new ClassicsFooter(context).setDrawableSize(20);
});
}
use of com.scwang.smart.refresh.footer.ClassicsFooter in project iot-device-java by tencentyun.
the class TmeMainActivity method initView.
private void initView() {
mGetSongBtn = findViewById(R.id.request_song);
mSearchIv = findViewById(R.id.search);
mPreIv = findViewById(R.id.iv_pre);
mNextIv = findViewById(R.id.iv_next);
mPlayIv = findViewById(R.id.iv_play);
mPlayModeIv = findViewById(R.id.iv_play_mode);
mInputEt = findViewById(R.id.input);
mCurrentSongTv = findViewById(R.id.tv_current_song);
mPlayList = findViewById(R.id.play_list);
mSmartRefreshLayout = findViewById(R.id.smart_refreshLayout);
mTimeTv = findViewById(R.id.tv_time);
mSeekBar = findViewById(R.id.sb_seek_bar);
mVolumeSeekBar = findViewById(R.id.sb_volume);
mSwitch = findViewById(R.id.tb_switch);
mSpinner = findViewById(R.id.sp_quality);
mSmartRefreshLayout.setEnableLoadMore(true);
mSmartRefreshLayout.setRefreshFooter(new ClassicsFooter(this));
mGetSongBtn.setOnClickListener(this);
mSearchIv.setOnClickListener(this);
mPreIv.setOnClickListener(this);
mNextIv.setOnClickListener(this);
mPlayIv.setOnClickListener(this);
mPlayModeIv.setOnClickListener(this);
mPlayList.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mPlayList.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
mAdapter = new SongListAdapter(this, mSongList);
mAdapter.setOnItemClickListener(new SongListAdapter.ItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Song song = mSongList.get(position);
mCurrentSongTv.setText(song.songName + "-" + song.singerName);
playSong(position);
}
});
mPlayList.setAdapter(mAdapter);
mSmartRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore(RefreshLayout refreshLayout) {
refreshLayout.finishLoadMore();
page++;
if (operationType == TYPE_SEARCH) {
doSearch(keyword);
} else if (operationType == TYPE_SONG_LIST) {
getSongListById(songListId, songListType);
}
}
});
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) {
TXLog.d(TAG, "seek =" + seekValue);
seekValue = progress;
UltimateSongPlayer.getInstance().seekTo(seekValue * 1000);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
mIsSeekBarTouching = true;
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
if (seekValue >= 60) {
SongInfo songInfo = UltimateSongPlayer.getInstance().getSongInfo();
if (songInfo != null && songInfo.isTryListen()) {
TmeMainActivity.this.runOnUiThread(() -> ToastUtil.showS("当前歌曲只支持试听60秒~"));
}
}
UltimateSongPlayer.getInstance().seekTo(seekValue * 1000);
mIsSeekBarTouching = false;
reportProperty(Common.PROPERTY_PLAY_POSITION, seekValue);
}
});
mVolumeSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) {
TXLog.d(TAG, "seek =" + volumeSeekValue);
volumeSeekValue = progress;
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, AudioManager.FLAG_PLAY_SOUND);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
int volume = (int) ((volumeSeekValue / (maxVolume * 1.00)) * Common.TOTOAL_VOLUME_DURATION);
reportProperty(Common.PROPERTY_VOLUME, volume);
}
});
mSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
if (mDataTemplateSample != null)
return;
mDataTemplateSample = new TmeDataTemplateSample(TmeMainActivity.this, mBrokerURL, mProductID, mDevName, mDevPSK, new SelfMqttActionCallBack(mProductID, mDevName), JSON_FILE_NAME, new SelfDownStreamCallBack(), mAuthCallback);
mDataTemplateSample.connect();
} else {
if (mDataTemplateSample == null)
return;
mDataTemplateSample.disconnect();
mDataTemplateSample = null;
}
}
});
mSpinner.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, qualityStrArray));
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (isGetStatusReply) {
UltimateSongPlayer.getInstance().changeQuality(qualities[position]);
isGetStatusReply = false;
} else {
if (UltimateSongPlayer.getInstance().getCurrentPlayQuality() == qualities[position]) {
return;
}
// 当前歌曲详情
SongInfo songInfo = UltimateSongPlayer.getInstance().getSongInfo();
if (songInfo == null) {
ToastUtil.showS("无法切换音质");
parent.setSelection(0);
return;
}
if (songInfo.isTryListen()) {
ToastUtil.showS("试听中,无法切换音质");
parent.setSelection(0);
return;
}
if (songInfo.getSupportQualities().contains(qualities[position])) {
UltimateSongPlayer.getInstance().changeQuality(qualities[position]);
reportProperty(Common.PROPERTY_RECOMMEND_QUALITY, position);
} else {
parent.setSelection(0);
ToastUtil.showS(String.format("当前歌曲不支持%s音质", qualityStrArray[position]));
}
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
Aggregations