当前位置: 首页>>代码示例>>Java>>正文


Java Toolbar.setVisibility方法代码示例

本文整理汇总了Java中android.support.v7.widget.Toolbar.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java Toolbar.setVisibility方法的具体用法?Java Toolbar.setVisibility怎么用?Java Toolbar.setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.Toolbar的用法示例。


在下文中一共展示了Toolbar.setVisibility方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onShowTab

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public void onShowTab(@NonNull final Context context,
                      @NonNull final TabSwitcher tabSwitcher, @NonNull final View view,
                      @NonNull final Tab tab, final int index, final int viewType,
                      @Nullable final Bundle savedInstanceState) {
    TextView textView = findViewById(android.R.id.title);
    textView.setText(tab.getTitle());
    Toolbar toolbar = findViewById(R.id.toolbar);
    toolbar.setVisibility(tabSwitcher.isSwitcherShown() ? View.GONE : View.VISIBLE);

    if (viewType != 0) {
        EditText editText = findViewById(android.R.id.edit);

        if (savedInstanceState == null) {
            editText.setText(null);
        }

        editText.requestFocus();
    }
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:21,代码来源:MainActivity.java

示例2: onShowCustomView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {

    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    mCustomView = view;
    customViewContainer.setVisibility(View.VISIBLE);
    Toolbar toolbar = (Toolbar) findViewById(R.id.browser_toolbar);
    toolbar.setVisibility(View.GONE);
    customViewContainer.addView(view);
    mCustomViewCallback = callback;
}
 
开发者ID:sfilmak,项目名称:MakiLite,代码行数:15,代码来源:MakiBrowser.java

示例3: onHideCustomView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public void onHideCustomView() {
    super.onHideCustomView();
    if (mCustomView == null)
        return;
    mCustomView.setVisibility(View.GONE);
    customViewContainer.setVisibility(View.GONE);
    Toolbar toolbar = (Toolbar) findViewById(R.id.browser_toolbar);
    toolbar.setVisibility(View.VISIBLE);
    customViewContainer.removeView(mCustomView);
    mCustomViewCallback.onCustomViewHidden();
    mCustomView = null;
}
 
开发者ID:sfilmak,项目名称:MakiLite,代码行数:14,代码来源:MakiBrowser.java

示例4: onCreateView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_videos, container, false);

    RecyclerView recyclerView = root.findViewById(R.id.recycler_view);

    Toolbar toolbar = root.findViewById(R.id.toolbar);

    if (!inTabsContainer) {
        toolbar.setVisibility(View.VISIBLE);
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    } else {
        toolbar.setVisibility(View.GONE);
    }

    mSwipeRefreshLayout = root.findViewById(R.id.refresh);
    mSwipeRefreshLayout.setOnRefreshListener(() -> getPresenter().fireRefresh());

    ViewUtils.setupSwipeRefreshLayoutWithCurrentTheme(getActivity(), mSwipeRefreshLayout);

    mEmpty = root.findViewById(R.id.empty);

    int columns = getContext().getResources().getInteger(R.integer.videos_column_count);
    StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(columns, StaggeredGridLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(manager);
    recyclerView.addOnScrollListener(new PicassoPauseOnScrollListener(Constants.PICASSO_TAG));
    recyclerView.addOnScrollListener(new EndlessRecyclerOnScrollListener() {
        @Override
        public void onScrollToLastElement() {
            getPresenter().fireScrollToEnd();
        }
    });

    mAdapter = new VideosAdapter(getActivity(), Collections.emptyList());
    mAdapter.setVideoOnClickListener(this);
    recyclerView.setAdapter(mAdapter);

    resolveEmptyTextVisibility();
    return root;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:41,代码来源:VideosFragment.java

示例5: onCreateView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_albums_gallery, container, false);

    Toolbar toolbar = view.findViewById(R.id.toolbar);
    if(!hasHideToolbarExtra()){
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    } else {
        toolbar.setVisibility(View.GONE);
    }

    mSwipeRefreshLayout = view.findViewById(R.id.refresh);
    mSwipeRefreshLayout.setOnRefreshListener(this);
    ViewUtils.setupSwipeRefreshLayoutWithCurrentTheme(getActivity(), mSwipeRefreshLayout);

    RecyclerView recyclerView = view.findViewById(R.id.list);

    mEmptyText = view.findViewById(R.id.empty);

    int columnCount = getResources().getInteger(R.integer.photos_albums_column_count);
    recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), columnCount));
    recyclerView.addOnScrollListener(new PicassoPauseOnScrollListener(Constants.PICASSO_TAG));

    mAdapter = new VkPhotoAlbumsAdapter(getActivity(), Collections.emptyList());
    mAdapter.setClickListener(this);

    recyclerView.setAdapter(mAdapter);

    mFab = view.findViewById(R.id.fab);
    mFab.setOnClickListener(v -> getPresenter().fireCreateAlbumClick());
    return view;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:33,代码来源:VKPhotoAlbumsFragment.java

示例6: onCreateView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_local_albums_gallery, container, false);

    Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    if(!hasHideToolbarExtra()){
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    } else {
        toolbar.setVisibility(View.GONE);
    }

    mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh);
    mSwipeRefreshLayout.setOnRefreshListener(this);
    ViewUtils.setupSwipeRefreshLayoutWithCurrentTheme(getActivity(), mSwipeRefreshLayout);

    int columnCount = getResources().getInteger(R.integer.photos_albums_column_count);
    RecyclerView.LayoutManager manager = new StaggeredGridLayoutManager(columnCount, StaggeredGridLayoutManager.VERTICAL);

    mRecyclerView = (RecyclerView) view.findViewById(R.id.list);
    mRecyclerView.setLayoutManager(manager);
    mRecyclerView.addOnScrollListener(new PicassoPauseOnScrollListener(LocalPhotoAlbumsAdapter.PICASSO_TAG));

    mAlbumsAdapter = new LocalPhotoAlbumsAdapter(Collections.emptyList());
    mAlbumsAdapter.setClickListener(this);

    mRecyclerView.setAdapter(mAlbumsAdapter);

    mEmptyTextView = (TextView)view.findViewById(R.id.empty);
    return view;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:31,代码来源:LocalImageAlbumsFragment.java

示例7: initBaseViews

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
private void initBaseViews() {
    mToolbar = (Toolbar) findViewById(R.id.toolbar_media_gallery);
    if (getSupportActionBar() != null) {
        mToolbar.setVisibility(View.GONE);
        getSupportActionBar().setTitle(String.valueOf(title));
    } else {
        setSupportActionBar(mToolbar);
        mToolbar.setTitle(String.valueOf(title));
    }
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
}
 
开发者ID:alhazmy13,项目名称:MediaGallery,代码行数:13,代码来源:BaseActivity.java

示例8: setNoTitle

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
 * Hide the toolbar
 * @param toolbar
 * @param needTitle
 */
private static void setNoTitle(Toolbar toolbar, boolean needTitle) {
    if(needTitle)  {
        toolbar.setVisibility(View.VISIBLE);
    } else {
        toolbar.setVisibility(View.INVISIBLE);
    }
}
 
开发者ID:YuntaoWei,项目名称:PictureShow,代码行数:13,代码来源:PicShowUtils.java

示例9: adaptToolbarVisibility

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
 * Adapts the visibility of the toolbars, which are shown, when the tab switcher is shown.
 */
private void adaptToolbarVisibility() {
    Toolbar[] toolbars = getToolbars();

    if (toolbars != null) {
        for (Toolbar toolbar : toolbars) {
            toolbar.setVisibility(
                    getTabSwitcher().isSwitcherShown() && getModel().areToolbarsShown() ?
                            View.VISIBLE : View.INVISIBLE);
        }
    }

    // TODO: Detach and re-inflate layout
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:17,代码来源:AbstractTabSwitcherLayout.java

示例10: paintStatusbar

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
public void paintStatusbar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar3);
    toolbar.setVisibility(GONE);
    setTitle(getString(R.string.title_enter_details));
    //------------------ try to paint the statusbar -------------------------------
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.setStatusBarColor(getResources().getColor(PIBLUE));
    }

}
 
开发者ID:privacyidea,项目名称:privacyidea-authenticator,代码行数:14,代码来源:EnterDetailsActivity.java

示例11: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_capture_view);
    mActivity = this;

    mCaptureFragment = new CaptureFragment();
    mCaptureFragment.setAnalyzeCallback(analyzeCallback);
    getSupportFragmentManager().beginTransaction().replace(R.id.fl_zxing_container, mCaptureFragment).commit();
    mCaptureFragment.setCameraInitCallBack(new CaptureFragment.CameraInitCallBack() {
        @Override
        public void callBack(Exception e) {
            if (e != null) {
                e.printStackTrace();
            }
        }
    });

    boolean isShow = getIntent().getBooleanExtra(CodeUtils.EXTRA_SHOW_SCAN_TITLE, false);
    if (isShow) {
        Toolbar about_toolbar = (Toolbar) findViewById(R.id.about_toolbar);
        about_toolbar.setVisibility(View.VISIBLE);
        setSupportActionBar(about_toolbar);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayShowTitleEnabled(false);
        }
        findViewById(R.id.tv_album).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CodeUtils.openAlbum(mActivity, REQUEST_IMAGE);
            }
        });
    }
}
 
开发者ID:Jusenr,项目名称:zxing_qrcode_demo,代码行数:37,代码来源:CaptureActivity.java

示例12: adaptToolbarVisibility

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
 * Adapts the visibility of the toolbars, which are shown, when the tab switcher is shown.
 */
private void adaptToolbarVisibility() {
    Toolbar[] toolbars = getToolbars();

    if (toolbars != null) {
        for (Toolbar toolbar : toolbars) {
            toolbar.setVisibility(
                    getModel().areToolbarsShown() ? View.VISIBLE : View.INVISIBLE);
        }
    }
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:14,代码来源:AbstractTabSwitcherLayout.java

示例13: hideToolBar

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
public void hideToolBar() {
    Toolbar toolbar = (Toolbar) getActivity().findViewById(R.id.toolbar_call);
    toolbar.setVisibility(View.GONE);
}
 
开发者ID:mobilemaster128,项目名称:quickblox-android,代码行数:5,代码来源:IncomeCallFragment.java

示例14: doOldToolbar

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
public void doOldToolbar() {
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mToolbar.setVisibility(View.VISIBLE);
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:5,代码来源:ReorderFeeds.java


注:本文中的android.support.v7.widget.Toolbar.setVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。