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


Java FloatingActionButton类代码示例

本文整理汇总了Java中com.melnykov.fab.FloatingActionButton的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton类的具体用法?Java FloatingActionButton怎么用?Java FloatingActionButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setUpFAB

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
/**
 * Setup utility for the FAB
 *
 * @param context
 * @param icon         the icon to apply
 * @param button       the FAB button
 * @param mFABlistener the listener to apply
 */
public static void setUpFAB(Activity context, int icon, FloatingActionButton button, View.OnClickListener mFABlistener) {
    button.setVisibility(View.VISIBLE);
    button.setType(FloatingActionButton.TYPE_NORMAL);
    if (ThemeUtils.getAppTheme3(context) < 6) {
        button.setColorNormal(context.getResources().getColor(
                ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context)));
        button.setColorPressed(context.getResources().getColor(
                ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context)));
    } else {
        button.setColorNormal(ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context));
        button.setColorPressed(ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context));
    }
    button.setImageDrawable(context.getResources().getDrawable(icon));
    button.setOnClickListener(mFABlistener);
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:24,代码来源:InterfaceUtils.java

示例2: onResume

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
public void onResume() {
    super.onResume();

    listView = (ListView) findViewById(R.id.list_view);
    bartoursAdapter = new BartoursAdapter(
            this,
            bartout.getBartours()
    );
    listView.setAdapter(bartoursAdapter);

    listView.setOnItemClickListener(this);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.newBartourButton);
    fab.attachToListView(listView);

    if(bartout.getActiveBartour() != null) {
        fab.setColorNormal(Color.GRAY);
        fab.setColorPressed(Color.GRAY);
        fab.setColorRipple(Color.GRAY);
    } else {
        fab.setColorNormal(Color.parseColor("#4CAF50"));
        fab.setColorPressed(Color.parseColor("#2E7D32"));
        fab.setColorRipple(Color.parseColor("#43A047"));
    }
}
 
开发者ID:Bartout-Team,项目名称:Bartout,代码行数:26,代码来源:HomeActivity.java

示例3: onCreateView

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(
            R.layout.fragment_recyclerview, container, false);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
    FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
    fab.hide();
    ImageView backdrop = (ImageView) rootView.findViewById(R.id.white_backdrop);
    backdrop.setVisibility(View.VISIBLE);

    setLayoutManager();

    if (getActivity() != null)
        new loadAlbums().execute("");
    return rootView;
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:19,代码来源:AlbumFragment.java

示例4: onCreateView

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(
            R.layout.fragment_recyclerview, container, false);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
    FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
    fab.hide();
    ImageView backdrop = (ImageView) rootView.findViewById(R.id.white_backdrop);
    backdrop.setVisibility(View.VISIBLE);

    //audioVisualization = (AudioVisualization) rootView.findViewById(R.id.visualizer_view);

    setLayoutManager();

    if (getActivity() != null)
        new loadArtists().execute("");
    return rootView;
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:21,代码来源:ArtistFragment.java

示例5: generateFollowCircles

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
private ArrayList<ImageButton> generateFollowCircles() {

        int diameter = mFAB.getType() == FloatingActionButton.TYPE_NORMAL ?
                Utils.getDimension(mContext, R.dimen.fab_size_normal) :
                Utils.getDimension(mContext, R.dimen.fab_size_mini);

        ArrayList<ImageButton> circles = new ArrayList<>(mMenuItems.size());
        for (MenuItem item : mMenuItems) {
            ImageButton circle = new ImageButton(mContext);
            OvalShape ovalShape = new OvalShape();
            ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
            shapeDrawable.getPaint().setColor(getResources().getColor(item.getBgColor()));
            circle.setBackgroundDrawable(shapeDrawable);
            circle.setImageResource(item.getIcon());
            LayoutParams lp = new LayoutParams(diameter, diameter);
            circle.setLayoutParams(lp);
            circles.add(circle);
        }

        return circles;
    }
 
开发者ID:tiancaiCC,项目名称:SpringFloatingActionMenu,代码行数:22,代码来源:SpringFloatingActionMenu.java

示例6: generateRevealCircle

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
private View generateRevealCircle() {
    int diameter = mFAB.getType() == FloatingActionButton.TYPE_NORMAL ?
            Utils.getDimension(mContext, R.dimen.fab_size_normal) :
            Utils.getDimension(mContext, R.dimen.fab_size_mini);
    View view = new View(mContext);
    OvalShape ovalShape = new OvalShape();
    ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
    shapeDrawable.getPaint().setColor(ContextCompat.getColor(mContext, mRevealColor));
    view.setBackgroundDrawable(shapeDrawable);
    LayoutParams lp = new LayoutParams(diameter, diameter);
    view.setLayoutParams(lp);

    // Make view clickable to avoid clicks on any view located behind the menu
    view.setClickable(true);

    // note it is invisible, but will be visible while  animating
    view.setVisibility(View.INVISIBLE);
    return view;
}
 
开发者ID:tiancaiCC,项目名称:SpringFloatingActionMenu,代码行数:20,代码来源:SpringFloatingActionMenu.java

示例7: onViewCreated

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ButterKnife.inject(this, view);

    mSwipeRefresh.setOnRefreshListener(this);
    mSwipeRefresh.setColorSchemeResources(getFragmentActivity().isEasyRedmine() ? R.color.er_primary : R.color.r_primary);

    if (!mLastFilter.equals(Storage.getFilter()) || mAdapter == null) {
        setFilteredAdapter(!mLastFilter.equals(Storage.getFilter()));
    }

    FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
    fab.attachToListView(getListView());
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            NewTaskActivity.start(getFragmentActivity());
        }
    });
}
 
开发者ID:easyredmine,项目名称:mobile_app_android,代码行数:22,代码来源:TasksFragment.java

示例8: addHelperFab

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
public void addHelperFab(Context context ,HelperFab.Location location,final HelperFab fab) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
    final FloatingActionButton newFab = (FloatingActionButton)inflater.inflate(R.layout.fab_layout_normal,null);
    newFab.setBackgroundColor(fab.getBackgroundColor());
    newFab.setColorNormal(fab.getBackgroundColor());
    newFab.setColorPressed(fab.getFabSelectedColor());
    newFab.setColorRipple(fab.getFabRippleColor());
    newFab.setImageDrawable(fab.getDrawable());
    newFab.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            fab.onClick();
        }
    });

    if(location == HelperFab.Location.RIGHT) {
        helperFabRight = newFab;
    }
    else if(location == HelperFab.Location.LEFT) {
        helperFabLeft = newFab;
    }
}
 
开发者ID:oznakn,项目名称:HorizontalFabMenu,代码行数:24,代码来源:HorizontalFabMenu.java

示例9: onCreateView

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment and hold the reference
    //in mRootView
    mRootView = inflater.inflate(R.layout.fragment_note_list, container, false);

    //Get a programmatic reference to the Floating Action Button
    mFab = (FloatingActionButton)mRootView.findViewById(R.id.fab);

    //attach an onClick listener to the Floating Action Button
    mFab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(new Intent(getActivity(), NoteEditorActivity.class));
        }
    });

    setupList();
    return mRootView;
}
 
开发者ID:Okason,项目名称:SimpleNoteApp,代码行数:22,代码来源:NoteListFragment.java

示例10: onCreate

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTheme(R.style.down_up_theme);
    setContentView(R.layout.activity_wishlist);
    myTitle = getString(R.string.app_name);
    if (toolbar == null) {
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        if (toolbar != null) {
            setSupportActionBar(toolbar);
            toolbar.setTitle(myTitle);
            toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
            getSupportActionBar().setDisplayShowTitleEnabled(true);
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }

    RecyclerView recyclerView = (RecyclerView) findViewById(
            R.id.wishlist_recyclerview);
    recyclerView.setHasFixedSize(true);
    recyclerView.setAdapter(new NumberedAdapter(30));

    FloatingActionButton wishlistFab = (FloatingActionButton) findViewById(R.id.wishlist_fab);
    wishlistFab.attachToRecyclerView(recyclerView);

}
 
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:27,代码来源:WishlistActivity.java

示例11: onCreate

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_book_library);

    addBookContainer = (ObservableScrollView) findViewById(R.id.add_book_container);

    imageBook = (SimpleDraweeView) findViewById(R.id.image_book);
    tvBookTitle = (TextView) findViewById(R.id.tv_book_title);
    tvBookAuthor = (TextView) findViewById(R.id.tv_book_author);
    tvBookPublisher = (TextView) findViewById(R.id.tv_book_publisher);
    tvBookSummary = (TextView) findViewById(R.id.tv_book_summary);
    addLibraryButton = (FloatingActionButton) findViewById(R.id.btn_addlibrary);

    addLibraryButton.attachToScrollView(addBookContainer);

    Intent scan = new Intent(this, ScannerActivity.class);
    startActivityForResult(scan, ADD_BOOK_LIBRARY_RESULT);
}
 
开发者ID:championswimmer,项目名称:Bookd_Android_App,代码行数:20,代码来源:AddBookLibraryActivity.java

示例12: onCreate

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    DetectWear.setNodesListener(this);

    sharedPreferences = this.getSharedPreferences("pl.tajchert.spritzerwear", Context.MODE_PRIVATE);

    commentsRecList = (RecyclerView) findViewById(R.id.storyList);
    fab = (FloatingActionButton) findViewById(R.id.normal_plus);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            showAddDialog();
        }
    });

    commentsRecList.setHasFixedSize(false);
    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    commentsRecList.setLayoutManager(llm);
    arrayListStories = new ArrayList<>();
    adapter = new AdapterComment(arrayListStories);
    commentsRecList.setAdapter(adapter);

}
 
开发者ID:tajchert,项目名称:SpritzerWear,代码行数:27,代码来源:MainActivity.java

示例13: hideShowViewByScale

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
public static void hideShowViewByScale(final View view, final int icon) {

        ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR)
                .scaleX(0).scaleY(0);

        propertyAnimator.setDuration(300);
        propertyAnimator.start();

        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            public void run() {
                ((FloatingActionButton) view).setImageResource(icon);
                showViewByScale(view);
            }
        }, 300);

    }
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:18,代码来源:Utils.java

示例14: onCreate

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.main_title);
    setContentView(R.layout.activity_conversations_list);

    ArrayList<Conversation> conversations = Utils.loadConversationsFromCache(getBaseContext());
    if(conversations == null) conversations = new ArrayList<>();

    listAdapter = new ConversationsListAdapter(getBaseContext(),
            R.layout.conversation_item, conversations);

    mListView = (ListView) findViewById(R.id.conversations_list_view);
    mListView.setAdapter(listAdapter);
    // Listen to clicks
    mListView.setOnItemClickListener(this);
    // listen for conversation updates
    initMultiChoiceListView();

    fab = (FloatingActionButton) findViewById(R.id.fab);
    getLoaderManager().initLoader(0, null, this);
}
 
开发者ID:Ioane5,项目名称:GeoSMS-Release,代码行数:23,代码来源:ConversationsListActivity.java

示例15: onCreate

import com.melnykov.fab.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mToolbar = (Toolbar) findViewById(R.id.activity_main_toolbar);
    mToolbar.setTitle(R.string.app_name);
    setSupportActionBar(mToolbar);

    mCurrentPageId = PAGE_ID_COLOR_ITEM_LIST;
    mColorItemListPage = new ColorItemListPage(this);
    mColorItemListPage.setListener(this);
    mPaletteListPage = new PaletteListPage(this);
    mPaletteListPage.setListener(this);

    mFab = (FloatingActionButton) findViewById(R.id.activity_main_fab);
    mFab.setOnClickListener(this);

    final MyPagerAdapter adapter = new MyPagerAdapter();
    mTabs = (PagerSlidingTabStrip) findViewById(R.id.activity_main_tabs);
    mViewPager = (ViewPager) findViewById(R.id.activity_main_view_pager);
    mViewPager.setAdapter(adapter);
    mTabs.setViewPager(mViewPager);
    mTabs.setOnPageChangeListener(this);

    mMainActivityFlavor = new MainActivityFlavor(this);
}
 
开发者ID:tvbarthel,项目名称:CameraColorPicker,代码行数:27,代码来源:MainActivity.java


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