界面优化 增加历史礼包(有未解决BUG)和关于页面
This commit is contained in:
@ -8,6 +8,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -34,6 +35,7 @@ public class KcSelectGameActivity extends BaseActivity {
|
||||
@BindView(R.id.select_game_all) CheckBox selectAll;
|
||||
@BindView(R.id.install_count) TextView installCount;
|
||||
@BindView(R.id.select_game_installed_ll) RelativeLayout installRl;
|
||||
@BindView(R.id.select_game_pb) ProgressBar mSelectPb;
|
||||
|
||||
private KcSelectGameAdapter mAdapter;
|
||||
|
||||
@ -63,7 +65,7 @@ public class KcSelectGameActivity extends BaseActivity {
|
||||
|
||||
selectAll.setVisibility(View.GONE);
|
||||
|
||||
mAdapter = new KcSelectGameAdapter(this, mSelectSend, installCount);
|
||||
mAdapter = new KcSelectGameAdapter(this, mSelectSend, installCount, installRl, mSelectPb);
|
||||
layoutManager = new LinearLayoutManager(this);
|
||||
mSelectRv.setLayoutManager(layoutManager);
|
||||
mSelectRv.setAdapter(mAdapter);
|
||||
@ -121,26 +123,46 @@ public class KcSelectGameActivity extends BaseActivity {
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||
super.onScrolled(recyclerView, dx, dy);
|
||||
int position = layoutManager.findFirstVisibleItemPosition();
|
||||
int gameSize = mAdapter.getGameSize();
|
||||
|
||||
if (position >= mAdapter.getGameSize()) {
|
||||
installCount.setText("已安装的应用(" + mAdapter.getAppSize() +")");
|
||||
} else {
|
||||
installCount.setText("已安装的游戏(" + mAdapter.getGameSize() +")");
|
||||
}
|
||||
|
||||
|
||||
if (position == mAdapter.getGameSize() - 1) {
|
||||
int buttom = layoutManager.findViewByPosition(position).getBottom();
|
||||
if (buttom <= installRl.getHeight()) {
|
||||
rparams.topMargin = buttom - installRl.getHeight();
|
||||
installRl.setLayoutParams(rparams);
|
||||
if (gameSize == 0) { // 游戏列表为空
|
||||
if (position == gameSize) {
|
||||
int buttom = layoutManager.findViewByPosition(position).getBottom();
|
||||
int i = installRl.getHeight() + DisplayUtils.dip2px(KcSelectGameActivity.this, 40);
|
||||
if (buttom <= i && i/2 < buttom) {
|
||||
rparams.topMargin = buttom - installRl.getHeight() - DisplayUtils.dip2px(KcSelectGameActivity.this, 40);
|
||||
installRl.setLayoutParams(rparams);
|
||||
installCount.setText("已安装的游戏(" + gameSize +")");
|
||||
} else {
|
||||
installCount.setText("已安装的应用(" + mAdapter.getAppSize() +")");
|
||||
rparams.topMargin = 0;
|
||||
installRl.setLayoutParams(rparams);
|
||||
}
|
||||
} else {
|
||||
installCount.setText("已安装的应用(" + mAdapter.getAppSize() +")");
|
||||
rparams.topMargin = 0;
|
||||
installRl.setLayoutParams(rparams);
|
||||
}
|
||||
} else {
|
||||
rparams.topMargin = 0;
|
||||
installRl.setLayoutParams(rparams);
|
||||
if (position >= gameSize) {
|
||||
installCount.setText("已安装的应用(" + mAdapter.getAppSize() +")");
|
||||
} else {
|
||||
installCount.setText("已安装的游戏(" + mAdapter.getGameSize() +")");
|
||||
}
|
||||
|
||||
if (position == gameSize - 1) {
|
||||
int buttom = layoutManager.findViewByPosition(position).getBottom();
|
||||
if (buttom <= installRl.getHeight()) {
|
||||
rparams.topMargin = buttom - installRl.getHeight();
|
||||
installRl.setLayoutParams(rparams);
|
||||
} else {
|
||||
rparams.topMargin = 0;
|
||||
installRl.setLayoutParams(rparams);
|
||||
}
|
||||
} else {
|
||||
rparams.topMargin = 0;
|
||||
installRl.setLayoutParams(rparams);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user