Search in sources :

Example 26 with ActionBar

use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.

the class TraktCommentsActivity method setupActionBar.

@Override
protected void setupActionBar() {
    super.setupActionBar();
    String commentsTitle = getIntent().getStringExtra(InitBundle.TITLE);
    setTitle(getString(R.string.comments) + " " + commentsTitle);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(R.string.comments);
        actionBar.setSubtitle(commentsTitle);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 27 with ActionBar

use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.

the class SeriesGuidePreferences method setupActionBar.

private void setupActionBar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.sgToolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 28 with ActionBar

use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.

the class SearchActivity method setupActionBar.

@Override
protected void setupActionBar() {
    super.setupActionBar();
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 29 with ActionBar

use of android.support.v7.app.ActionBar in project BoomMenu by Nightonke.

the class ActionBarActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_action_bar);
    ActionBar mActionBar = getSupportActionBar();
    assert mActionBar != null;
    mActionBar.setDisplayShowHomeEnabled(false);
    mActionBar.setDisplayShowTitleEnabled(false);
    LayoutInflater mInflater = LayoutInflater.from(this);
    View actionBar = mInflater.inflate(R.layout.custom_actionbar, null);
    TextView mTitleTextView = (TextView) actionBar.findViewById(R.id.title_text);
    mTitleTextView.setText(R.string.app_name);
    mActionBar.setCustomView(actionBar);
    mActionBar.setDisplayShowCustomEnabled(true);
    ((Toolbar) actionBar.getParent()).setContentInsetsAbsolute(0, 0);
    BoomMenuButton leftBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_left_bmb);
    BoomMenuButton rightBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_right_bmb);
    leftBmb.setButtonEnum(ButtonEnum.TextOutsideCircle);
    leftBmb.setPiecePlaceEnum(PiecePlaceEnum.DOT_9_1);
    leftBmb.setButtonPlaceEnum(ButtonPlaceEnum.SC_9_1);
    for (int i = 0; i < leftBmb.getPiecePlaceEnum().pieceNumber(); i++) leftBmb.addBuilder(BuilderManager.getTextOutsideCircleButtonBuilderWithDifferentPieceColor());
    rightBmb.setButtonEnum(ButtonEnum.Ham);
    rightBmb.setPiecePlaceEnum(PiecePlaceEnum.HAM_4);
    rightBmb.setButtonPlaceEnum(ButtonPlaceEnum.HAM_4);
    for (int i = 0; i < rightBmb.getPiecePlaceEnum().pieceNumber(); i++) rightBmb.addBuilder(BuilderManager.getHamButtonBuilderWithDifferentPieceColor());
}
Also used : BoomMenuButton(com.nightonke.boommenu.BoomMenuButton) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 30 with ActionBar

use of android.support.v7.app.ActionBar in project CoCoin by Nightonke.

the class AccountBookTodayViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_book_today_view);
    SuperToast.cancelAllSuperToasts();
    mContext = this;
    mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
    userName = (TextView) findViewById(R.id.user_name);
    userEmail = (TextView) findViewById(R.id.user_email);
    userName.setTypeface(CoCoinUtil.typefaceLatoRegular);
    userEmail.setTypeface(CoCoinUtil.typefaceLatoLight);
    User user = BmobUser.getCurrentUser(CoCoinApplication.getAppContext(), User.class);
    if (user != null) {
        userName.setText(user.getUsername());
        userEmail.setText(user.getEmail());
    }
    setFonts();
    View view = mViewPager.getRootView();
    title = (TextView) view.findViewById(R.id.logo_white);
    title.setTypeface(CoCoinUtil.typefaceLatoLight);
    title.setText(SettingManager.getInstance().getAccountBookName());
    mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
    setTitle("");
    toolbar = mViewPager.getToolbar();
    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    custom = (MaterialRippleLayout) mDrawer.findViewById(R.id.custom_layout);
    tags = (MaterialRippleLayout) mDrawer.findViewById(R.id.tag_layout);
    months = (MaterialRippleLayout) mDrawer.findViewById(R.id.month_layout);
    list = (MaterialRippleLayout) mDrawer.findViewById(R.id.list_layout);
    report = (MaterialRippleLayout) mDrawer.findViewById(R.id.report_layout);
    sync = (MaterialRippleLayout) mDrawer.findViewById(R.id.sync_layout);
    settings = (MaterialRippleLayout) mDrawer.findViewById(R.id.settings_layout);
    help = (MaterialRippleLayout) mDrawer.findViewById(R.id.help_layout);
    feedback = (MaterialRippleLayout) mDrawer.findViewById(R.id.feedback_layout);
    about = (MaterialRippleLayout) mDrawer.findViewById(R.id.about_layout);
    syncIcon = (MaterialIconView) mDrawer.findViewById(R.id.sync_icon);
    setIconEnable(syncIcon, SettingManager.getInstance().getLoggenOn());
    monthExpenseTip = (TextView) mDrawer.findViewById(R.id.month_expense_tip);
    monthExpenseTip.setTypeface(CoCoinUtil.GetTypeface());
    monthExpense = (RiseNumberTextView) mDrawer.findViewById(R.id.month_expense);
    monthExpense.setTypeface(CoCoinUtil.typefaceLatoLight);
    if (SettingManager.getInstance().getIsMonthLimit()) {
        monthExpenseTip.setVisibility(View.VISIBLE);
        monthExpense.setText("0");
    } else {
        monthExpenseTip.setVisibility(View.INVISIBLE);
        monthExpense.setVisibility(View.INVISIBLE);
    }
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        final ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayUseLogoEnabled(false);
            actionBar.setHomeButtonEnabled(true);
        }
    }
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0) {

        public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
            monthExpense.setText("0");
        }

        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            monthExpense.withNumber(RecordManager.getCurrentMonthExpense()).setDuration(500).start();
        }
    };
    mDrawer.setDrawerListener(mDrawerToggle);
    View logo = findViewById(R.id.logo_white);
    if (logo != null) {
        logo.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                mViewPager.notifyHeaderChanged();
            }
        });
    }
    todayModeAdapter = new TodayViewFragmentAdapter(getSupportFragmentManager());
    mViewPager.getViewPager().setOffscreenPageLimit(todayModeAdapter.getCount());
    mViewPager.getViewPager().setAdapter(todayModeAdapter);
    mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
    mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {

        @Override
        public HeaderDesign getHeaderDesign(int page) {
            return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(page - 2), CoCoinUtil.GetTagDrawable(-3));
        }
    });
    setListeners();
    profileImage = (CircleImageView) mDrawer.findViewById(R.id.profile_image);
    profileImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (SettingManager.getInstance().getLoggenOn()) {
                CoCoinUtil.showToast(mContext, R.string.change_logo_tip);
            } else {
                CoCoinUtil.showToast(mContext, R.string.login_tip);
            }
        }
    });
    mDemoSlider = (SliderLayout) findViewById(R.id.slider);
    HashMap<String, Integer> urls = CoCoinUtil.GetDrawerTopUrl();
    for (String name : urls.keySet()) {
        CustomSliderView customSliderView = new CustomSliderView(this);
        // initialize a SliderLayout
        customSliderView.image(urls.get(name)).setScaleType(BaseSliderView.ScaleType.Fit);
        mDemoSlider.addSlider(customSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOut);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
    loadLogo();
}
Also used : MaterialViewPager(com.github.florent37.materialviewpager.MaterialViewPager) BmobUser(cn.bmob.v3.BmobUser) User(com.nightonke.saver.model.User) HeaderDesign(com.github.florent37.materialviewpager.header.HeaderDesign) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) RiseNumberTextView(com.nightonke.saver.ui.RiseNumberTextView) View(android.view.View) TextView(android.widget.TextView) BaseSliderView(com.daimajia.slider.library.SliderTypes.BaseSliderView) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) MaterialIconView(net.steamcrafted.materialiconlib.MaterialIconView) TodayViewFragmentAdapter(com.nightonke.saver.adapter.TodayViewFragmentAdapter) DescriptionAnimation(com.daimajia.slider.library.Animations.DescriptionAnimation) ActionBar(android.support.v7.app.ActionBar)

Aggregations

ActionBar (android.support.v7.app.ActionBar)400 View (android.view.View)117 Toolbar (android.support.v7.widget.Toolbar)98 TextView (android.widget.TextView)63 AppCompatActivity (android.support.v7.app.AppCompatActivity)31 ImageView (android.widget.ImageView)31 Intent (android.content.Intent)29 RecyclerView (android.support.v7.widget.RecyclerView)27 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)23 AdapterView (android.widget.AdapterView)21 ViewPager (android.support.v4.view.ViewPager)15 ArrayList (java.util.ArrayList)15 Bundle (android.os.Bundle)14 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)14 SuppressLint (android.annotation.SuppressLint)13 ListView (android.widget.ListView)13 FragmentManager (android.app.FragmentManager)12 Fragment (android.support.v4.app.Fragment)12 ColorDrawable (android.graphics.drawable.ColorDrawable)10 NavigationView (android.support.design.widget.NavigationView)10