Java Code Examples for com.kabouzeid.appthemehelper.ThemeStore#primaryColor()

The following examples show how to use com.kabouzeid.appthemehelper.ThemeStore#primaryColor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LibraryFragment.java    From Music-Player with GNU General Public License v3.0 6 votes vote down vote up
private void setUpViewPager() {
    pagerAdapter = new MusicLibraryPagerAdapter(getActivity(), getChildFragmentManager());
    pager.setAdapter(pagerAdapter);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);

    tabs.setupWithViewPager(pager);

    int primaryColor = ThemeStore.primaryColor(getActivity());
    int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor);
    int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor);
    TabLayoutUtil.setTabIconColors(tabs, normalColor, selectedColor);
    tabs.setTabTextColors(normalColor, selectedColor);
    tabs.setSelectedTabIndicatorColor(ThemeStore.accentColor(getActivity()));

    updateTabVisibility();

    if (PreferenceUtil.getInstance(getContext()).rememberLastTab()) {
        pager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getLastPage());
    }
    pager.addOnPageChangeListener(this);
}
 
Example 2
Source File: LibraryFragment.java    From Orin with GNU General Public License v3.0 6 votes vote down vote up
private void setUpViewPager() {
    pagerAdapter = new MusicLibraryPagerAdapter(getActivity(), getChildFragmentManager());
    pager.setAdapter(pagerAdapter);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);

    tabs.setupWithViewPager(pager);

    int primaryColor = ThemeStore.primaryColor(getActivity());
    int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor);
    int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor);
    TabLayoutUtil.setTabIconColors(tabs, normalColor, selectedColor);
    tabs.setTabTextColors(normalColor, selectedColor);
    tabs.setSelectedTabIndicatorColor(selectedColor); //ThemeStore.accentColor(getActivity()) ... former value, me no like



    int startPosition = PreferenceUtil.getInstance(getActivity()).getDefaultStartPage();
    startPosition = startPosition == -1 ? PreferenceUtil.getInstance(getActivity()).getLastPage() : startPosition;
    pager.setCurrentItem(startPosition);
    PreferenceUtil.getInstance(getActivity()).setLastPage(startPosition); // just in case
    pager.addOnPageChangeListener(this);
}
 
Example 3
Source File: SettingsActivity.java    From RetroMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle bundle) {
    super.onCreate(bundle);
    setContentView(R.layout.activity_settings);
    ButterKnife.bind(this);

    setStatusbarColorAuto();
    setNavigationbarColorAuto();
    setTaskDescriptionColorAuto();

    setupToolbar();

    SettingsPagerAdapter settingsPagerAdapter = new SettingsPagerAdapter(getSupportFragmentManager());
    mViewPager.setAdapter(settingsPagerAdapter);
    mTabLayout.setupWithViewPager(mViewPager);

    int primaryColor = ThemeStore.primaryColor(this);
    int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(this, primaryColor);
    int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(this, primaryColor);
    TabLayoutUtil.setTabIconColors(mTabLayout, normalColor, selectedColor);
    mTabLayout.setTabTextColors(normalColor, selectedColor);
    mTabLayout.setSelectedTabIndicatorColor(ThemeStore.accentColor(this));
}
 
Example 4
Source File: LibraryFragment.java    From VinylMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
private void setUpViewPager() {
    pagerAdapter = new MusicLibraryPagerAdapter(getActivity(), getChildFragmentManager());
    pager.setAdapter(pagerAdapter);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);

    tabs.setupWithViewPager(pager);

    int primaryColor = ThemeStore.primaryColor(getActivity());
    int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor);
    int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor);
    TabLayoutUtil.setTabIconColors(tabs, normalColor, selectedColor);
    tabs.setTabTextColors(normalColor, selectedColor);
    tabs.setSelectedTabIndicatorColor(ThemeStore.accentColor(getActivity()));

    updateTabVisibility();

    if (PreferenceUtil.getInstance().rememberLastTab()) {
        pager.setCurrentItem(PreferenceUtil.getInstance().getLastPage());
    }
    pager.addOnPageChangeListener(this);
}
 
Example 5
Source File: LibraryFragment.java    From Phonograph with GNU General Public License v3.0 6 votes vote down vote up
private void setUpViewPager() {
    pagerAdapter = new MusicLibraryPagerAdapter(getActivity(), getChildFragmentManager());
    pager.setAdapter(pagerAdapter);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);

    tabs.setupWithViewPager(pager);

    int primaryColor = ThemeStore.primaryColor(getActivity());
    int normalColor = ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor);
    int selectedColor = ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor);
    TabLayoutUtil.setTabIconColors(tabs, normalColor, selectedColor);
    tabs.setTabTextColors(normalColor, selectedColor);
    tabs.setSelectedTabIndicatorColor(ThemeStore.accentColor(getActivity()));

    updateTabVisibility();

    if (PreferenceUtil.getInstance(getContext()).rememberLastTab()) {
        pager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getLastPage());
    }
    pager.addOnPageChangeListener(this);
}
 
Example 6
Source File: FoldersFragment.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
private void setUpAppbarColor() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    breadCrumbs.setBackgroundColor(primaryColor);
    breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor));
    breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor));
}
 
Example 7
Source File: LibraryFragment.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
private void setUpToolbar() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
    toolbar.setTitleTextAppearance(getActivity().getApplicationContext(), R.style.ProductSansTextAppearace);
    getActivity().setTitle(R.string.main_activity_name);
    getMainActivity().setSupportActionBar(toolbar);
}
 
Example 8
Source File: FoldersFragment.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
private void setUpAppbarColor() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    breadCrumbs.setBackgroundColor(primaryColor);
    breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor));
    breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor));
}
 
Example 9
Source File: LibraryFragment.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
private void setUpToolbar() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
    getActivity().setTitle(R.string.app_name);
    getMainActivity().setSupportActionBar(toolbar);
}
 
Example 10
Source File: FoldersFragment.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void setUpAppbarColor() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    breadCrumbs.setBackgroundColor(primaryColor);
    breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor));
    breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor));
}
 
Example 11
Source File: LibraryFragment.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void setupToolbar() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    mAppbar.setBackgroundColor(primaryColor);
    mToolbar.setBackgroundColor(primaryColor);
    mToolbar.setTitle(R.string.library);
    mToolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
    getActivity().setTitle(R.string.app_name);
    getMainActivity().setSupportActionBar(mToolbar);
}
 
Example 12
Source File: FoldersFragment.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void setUpAppbarColor() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    breadCrumbs.setBackgroundColor(primaryColor);
    breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor));
    breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor));
}
 
Example 13
Source File: LibraryFragment.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void setUpToolbar() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
    getActivity().setTitle(R.string.app_name);
    getMainActivity().setSupportActionBar(toolbar);
}
 
Example 14
Source File: FoldersFragment.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
private void setUpAppbarColor() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    breadCrumbs.setBackgroundColor(primaryColor);
    breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), primaryColor));
    breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), primaryColor));
}
 
Example 15
Source File: LibraryFragment.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
private void setUpToolbar() {
    int primaryColor = ThemeStore.primaryColor(getActivity());
    appbar.setBackgroundColor(primaryColor);
    toolbar.setBackgroundColor(primaryColor);
    toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
    getActivity().setTitle(R.string.app_name);
    getMainActivity().setSupportActionBar(toolbar);
}