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


Java FloatingActionButton.setVisibility方法代码示例

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


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

示例1: showFab

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public static void showFab(@Nullable FloatingActionButton fab) 
{
       if (fab == null)
		return;

       if (ViewCompat.isLaidOut(fab)) 
	{
           fab.show();
           return;
       }
       fab.animate().cancel();
       fab.setScaleX(0f);
       fab.setScaleY(0f);
       fab.setAlpha(0f);
       fab.setVisibility(View.VISIBLE);
       fab.animate().setDuration(200).scaleX(1).scaleY(1).alpha(1).setInterpolator(new LinearOutSlowInInterpolator());
   }
 
开发者ID:MSay2,项目名称:Mire,代码行数:18,代码来源:AnimUtils.java

示例2: animateIn

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void animateIn(FloatingActionButton button) {
    button.setVisibility(View.VISIBLE);
    if (Build.VERSION.SDK_INT >= 14) {
        ViewCompat.animate(button)
            .scaleX(1.0F)
            .scaleY(1.0F)
            .alpha(1.0F)
            .setInterpolator(INTERPOLATOR)
            .withLayer()
            .setListener(null)
            .start();
    } else {
        Animation anim = AnimationUtils.loadAnimation(button.getContext(),
            android.support.design.R.anim.design_fab_in);
        anim.setDuration(200L);
        anim.setInterpolator(INTERPOLATOR);
        button.startAnimation(anim);
    }
}
 
开发者ID:drakeet,项目名称:rebase-android,代码行数:20,代码来源:ScrollAwareFABBehavior.java

示例3: onCreate

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_photo_detail);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setVisibility(View.GONE);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            int itemPosition = mPhotoPagerAdapter.getItemPosition(pvpDetail);
            if (itemPosition < 0 || itemPosition >imgUrls.length){
                itemPosition = 0;
            }

        }
    });
    parseIntent();
    initLoad();
    initBar();
    initPager();
}
 
开发者ID:lueans,项目名称:LueansRead,代码行数:24,代码来源:PhotoDetailActivity.java

示例4: initView

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {
    mTabHeader = (TableLayout) findViewById(R.id.sql_tabview_header_tab);
    mRecycleView = (FastScrollRecyclerView) findViewById(R.id.sql_tabview_recycleview);
    mLinearLayoutManager = new LinearLayoutManager(SqlTabDatasActivity.this);
    mLinearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mRecycleView.setLayoutManager(mLinearLayoutManager);
    mContent = (MyHorizontalScrollView) findViewById(R.id.content);
    mRecycleView.setMinimumWidth(FeViewUtils.getScreenWidth(this));
    mToolBar = (Toolbar) findViewById(R.id.toolbar);
    mAdmobLayout = (RelativeLayout) findViewById(R.id.admob_layout);
    mRootLayout = (RelativeLayout) findViewById(R.id.rootLayout);
    mAdView = (AdView) findViewById(R.id.adView);
    mAdMobBgBtn = (Button) findViewById(R.id.admob_bg_btn);
    mAdClose = (ImageView) findViewById(R.id.admob_close);
    btn = (FloatingActionButton) findViewById(R.id.fab);
    mTabHeader.setBackground(getResources().getDrawable(R.color.table_head_bg));

    if (dataSource != SqlConstant.TABLE_DATAS_NORMAL) {
        btn.setVisibility(View.GONE);
    } else {
        btn.setVisibility(View.VISIBLE);
    }

    resultHandler = new SqlActivityResultHandler(this);
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:26,代码来源:SqlTabDatasActivity.java

示例5: hideFab

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public static void hideFab(@Nullable FloatingActionButton fab)
{
       if (fab == null)
		return;

       if (ViewCompat.isLaidOut(fab))
	{
           fab.hide();
           return;
       }
       fab.animate().cancel();
       fab.setScaleX(1f);
       fab.setScaleY(1f);
       fab.setAlpha(1f);
       fab.setVisibility(View.GONE);
       fab.animate().setDuration(200).scaleX(0).scaleY(0).alpha(0).setInterpolator(new LinearOutSlowInInterpolator());
   }
 
开发者ID:MSay2,项目名称:Mire,代码行数:18,代码来源:AnimUtils.java

示例6: bind

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
/**
 * sets text of article
 *
 * @param appcontent Appcontent object that contains information of article
 */
private void bind(final Appcontent appcontent) {
    TextView titleTV = (TextView) findViewById(R.id.tv_appcontent_article_title);
    TextView writerTV = (TextView) findViewById(R.id.tv_appcontent_article_writer);
    TextView dateTV = (TextView) findViewById(R.id.tv_appcontent_article_date);
    WebView contentWV = (WebView) findViewById(R.id.wv_appcontent_article_content);

    titleTV.setText(appcontent.getTitle());
    writerTV.setText(appcontent.getWriter());
    dateTV.setText(appcontent.getDate());
    contentWV.loadData(appcontent.getContent(), "text/html; charset=UTF-8", null);

    mFAB = (FloatingActionButton) findViewById(R.id.fab_appcontent_article);
    final List<Attachment> attachmentList = appcontent.getAttachmentList();
    if (attachmentList != null && attachmentList.size() != 0) {
        mFAB.setImageResource(R.drawable.ic_file_download_white_24dp);
        mFAB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DownloadAttachmentDialogFragment
                        .newInstance(AppcontentArticleActivity.this, attachmentList)
                        .show(getSupportFragmentManager(), null);
            }
        });
        mFAB.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:DSM-DMS,项目名称:DMS,代码行数:32,代码来源:AppcontentArticleActivity.java

示例7: handleFloatingActionButton

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void handleFloatingActionButton(FloatingActionButton floatingActionButton) {
    floatingActionButton.setVisibility(View.VISIBLE);
    floatingActionButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(new Intent(getActivity(), ConfigItemActivity.class).putExtra("isNew", true));
        }
    });
}
 
开发者ID:whirlwind-studios,项目名称:School1-Android,代码行数:11,代码来源:DashboardFragment.java

示例8: onCreate

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    String userLogin = getIntent().getStringExtra("userSessionData");

    setContentView(R.layout.activity_personal);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle(userLogin);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    recyclerView = (RecyclerView) findViewById(R.id.repo_details);
    recyclerView.setNestedScrollingEnabled(false);
    profilePoster = (ImageView) findViewById(R.id.profile_poster);
    repositories = (TextView) findViewById(R.id.repositories);
    following = (TextView) findViewById(R.id.following);
    followers = (TextView) findViewById(R.id.followers);

    Parser<GitHubUserProfileDataEntry> parser = new GitHubUserProfileDataParser();
    new UserProfileAsyncTask<GitHubUserProfileDataEntry>(this, this, parser).execute();

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setVisibility(View.GONE); //TODO: delete this line when edit functionality will be done
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //TODO: implement an edit activity
        }
    });
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:31,代码来源:PersonalActivity.java

示例9: onPreExecute

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setVisibility(View.INVISIBLE);
    ProgressBar prg = (ProgressBar) findViewById(R.id.progressBar1);
    prg.setVisibility(View.VISIBLE);
    PieChart rtv = (PieChart) findViewById(R.id.result_text);
    rtv.setVisibility(View.INVISIBLE);
    Snackbar.make(findViewById(android.R.id.content), "Starting detection... ", Snackbar.LENGTH_LONG)
            .setAction("Action", null).show();
}
 
开发者ID:linzuzeng,项目名称:Microsphere,代码行数:12,代码来源:MainActivity.java

示例10: hideSnitchesSecondOvertime

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public void hideSnitchesSecondOvertime()
{
    FloatingActionButton fab_catch = (FloatingActionButton) findViewById(R.id.snitchcatchteam0_second_overtime);
    FloatingActionButton fab_otherteam = (FloatingActionButton) findViewById(R.id.snitchcatchteam1_second_overtime);
    fab_catch.setVisibility(View.INVISIBLE);
    fab_otherteam.setVisibility(View.INVISIBLE);
}
 
开发者ID:kingblaubart,项目名称:quidditchtimekeeper,代码行数:8,代码来源:GameActivity.java

示例11: showSnitchesSecondOvertime

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public void showSnitchesSecondOvertime()
{
    FloatingActionButton fab_catch = (FloatingActionButton) findViewById(R.id.snitchcatchteam0_second_overtime);
    FloatingActionButton fab_otherteam = (FloatingActionButton) findViewById(R.id.snitchcatchteam1_second_overtime);
    fab_catch.setVisibility(View.VISIBLE);
    fab_otherteam.setVisibility(View.VISIBLE);
}
 
开发者ID:kingblaubart,项目名称:quidditchtimekeeper,代码行数:8,代码来源:GameActivity.java

示例12: initSelfView

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void initSelfView() {
    toolbar = (Toolbar) findViewById(R.id.sheet_detail_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    toTop = (FloatingActionButton) findViewById(R.id.sheet_detail_top);
    initToTopPos();

    songList = (RecyclerView) findViewById(R.id.sheet_detail_songs_list);
    appBarLayout = (AppBarLayout) findViewById(R.id.sheet_detail_app_bar);
    collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.sheet_detail_toolbar_layout);
    barStateChangeListener = new AppBarStateChangeListener() {
        @Override
        public void onStateChanged(AppBarLayout appBarLayout, State state) {
            switch (state) {
                case EXPANDED:
                    collapsingToolbarLayout.setTitle(" ");
                    songList.setNestedScrollingEnabled(false);
                    transToTopBt(true);
                    break;
                case COLLAPSED:
                    collapsingToolbarLayout.setTitle(infoController.getTitle());
                    songList.setNestedScrollingEnabled(true);
                    toTop.setVisibility(View.VISIBLE);
                    transToTopBt(false);
                    break;
                case IDLE:
                    collapsingToolbarLayout.setTitle(" ");
                    break;
            }
        }
    };
    appBarLayout.addOnOffsetChangedListener(barStateChangeListener);

}
 
开发者ID:DuanJiaNing,项目名称:Musicoco,代码行数:36,代码来源:SheetDetailActivity.java

示例13: showFavoriteButtons

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
/**
 * Defines if add or remove from Favorites should be initially visible for this movieId.
 */
private void showFavoriteButtons() {
    fabAdd = (FloatingActionButton) findViewById(R.id.fab_add);
    fabDel = (FloatingActionButton) findViewById(R.id.fab_minus);

    Cursor cursor = getContentResolver().query(ContentUris.withAppendedId(URI, tvShowId),
            new String[]{COLUMN_TV_SHOW_ID}, null, null, null);
    if (cursor != null && cursor.getCount() != 0) {
        fabDel.setVisibility(View.VISIBLE);
    } else {
        fabAdd.setVisibility(View.VISIBLE);
    }
    if (cursor != null)
        cursor.close();
}
 
开发者ID:an-garcia,项目名称:MovieGuide,代码行数:18,代码来源:TVShowActivity.java

示例14: showFavoriteButtons

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
/**
 * Defines if add or remove from Favorites should be initially visible for this movieId.
 */
private void showFavoriteButtons() {
    fabAdd = (FloatingActionButton) findViewById(R.id.fab_add);
    fabDel = (FloatingActionButton) findViewById(R.id.fab_minus);

    Cursor cursor = getContentResolver().query(ContentUris.withAppendedId(URI, personId),
            new String[]{COLUMN_PERSON_ID}, null, null, null);
    if (cursor != null && cursor.getCount() != 0) {
        fabDel.setVisibility(View.VISIBLE);
    } else {
        fabAdd.setVisibility(View.VISIBLE);
    }
    if (cursor != null)
        cursor.close();
}
 
开发者ID:an-garcia,项目名称:MovieGuide,代码行数:18,代码来源:PersonActivity.java

示例15: showFavoriteButtons

import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
/**
 * Defines if add or remove from Favorites should be initially visible for this movieId.
 */
private void showFavoriteButtons() {
    fabAdd = (FloatingActionButton) findViewById(R.id.fab_add);
    fabDel = (FloatingActionButton) findViewById(R.id.fab_minus);

    Cursor cursor = getContentResolver().query(ContentUris.withAppendedId(URI, movieID),
            new String[]{COLUMN_MOVIE_ID}, null, null, null);
    if (cursor != null && cursor.getCount() != 0) {
        fabDel.setVisibility(View.VISIBLE);
    } else {
        fabAdd.setVisibility(View.VISIBLE);
    }
    if (cursor != null)
        cursor.close();
}
 
开发者ID:an-garcia,项目名称:MovieGuide,代码行数:18,代码来源:MovieActivity.java


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