use of android.support.v7.app.ActionBar in project bilibili-android-client by HotBitmapGG.
the class SpecialDetailsActivity method initToolBar.
@Override
public void initToolBar() {
mToolbar.setTitle("专题详情");
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project bilibili-android-client by HotBitmapGG.
the class ActivityCenterActivity method initToolBar.
@Override
public void initToolBar() {
mToolbar.setTitle("活动中心");
setSupportActionBar(mToolbar);
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project bilibili-android-client by HotBitmapGG.
the class TopicCenterActivity method initToolBar.
@Override
public void initToolBar() {
mToolbar.setTitle("话题中心");
setSupportActionBar(mToolbar);
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project bilibili-android-client by HotBitmapGG.
the class BangumiDetailsActivity method initToolBar.
@Override
public void initToolBar() {
mToolbar.setTitle("番剧详情");
setSupportActionBar(mToolbar);
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
//设置Toolbar的透明度
mToolbar.setBackgroundColor(Color.argb(0, 251, 114, 153));
//设置StatusBar透明
SystemBarHelper.immersiveStatusBar(this);
SystemBarHelper.setPadding(this, mToolbar);
//获取顶部image高度和toolbar高度
float imageHeight = getResources().getDimension(R.dimen.bangumi_details_top_layout_height);
float toolBarHeight = getResources().getDimension(R.dimen.action_bar_default_height);
mNestedScrollView.setNestedScrollingEnabled(true);
mNestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
@Override
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
//根据NestedScrollView滑动改变Toolbar的透明度
float offsetY = toolBarHeight - imageHeight;
//计算滑动距离的偏移量
float offset = 1 - Math.max((offsetY - scrollY) / offsetY, 0f);
float absOffset = Math.abs(offset);
//如果滑动距离大于1就设置完全不透明度
if (absOffset >= 1) {
absOffset = 1;
}
mToolbar.setBackgroundColor(Color.argb((int) (absOffset * 255), 251, 114, 153));
}
});
}
use of android.support.v7.app.ActionBar in project bilibili-android-client by HotBitmapGG.
the class GameCentreActivity method initToolBar.
@Override
public void initToolBar() {
mToolbar.setTitle("游戏中心");
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
Aggregations