Search in sources :

Example 56 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 57 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 58 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 59 with ActionBar

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));
        }
    });
}
Also used : NestedScrollView(android.support.v4.widget.NestedScrollView) ActionBar(android.support.v7.app.ActionBar) SuppressLint(android.annotation.SuppressLint)

Example 60 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Aggregations

ActionBar (android.support.v7.app.ActionBar)784 View (android.view.View)248 Toolbar (android.support.v7.widget.Toolbar)214 TextView (android.widget.TextView)160 Intent (android.content.Intent)118 ImageView (android.widget.ImageView)76 AppCompatActivity (android.support.v7.app.AppCompatActivity)66 RecyclerView (android.support.v7.widget.RecyclerView)57 AdapterView (android.widget.AdapterView)52 Bundle (android.os.Bundle)49 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)49 ListView (android.widget.ListView)44 ColorDrawable (android.graphics.drawable.ColorDrawable)33 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)32 ViewPager (android.support.v4.view.ViewPager)29 ArrayList (java.util.ArrayList)29 SharedPreferences (android.content.SharedPreferences)28 Fragment (android.support.v4.app.Fragment)28 MenuItem (android.view.MenuItem)28 BindView (butterknife.BindView)28