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


Java FloatingActionButton类代码示例

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


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

示例1: setFabTitle

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
/**
 * Replaces the %s placeholder in the Floating Action Buttons with the current gateway
 *
 * @param fab floating action button that we are setting the text for
 */
private void setFabTitle(final FloatingActionButton fab) {
    fab.setTitle(fab.getTitle().replace("%s", getGatewayName()));

    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            collapseFab();

            if (fab == addZone){
                addZone();
            } else if (fab == addButton) {
                addButton();
            } else if (fab == addCommand) {
                addCommand();
            }
        }
    });
}
 
开发者ID:sourceallies,项目名称:zonebeacon,代码行数:24,代码来源:MainActivity.java

示例2: initDrawer

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
public void initDrawer() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    fabMenu = (FloatingActionsMenu) findViewById(R.id.multiple_actions_down);
    fabPrimary = (FloatingActionButton) findViewById(R.id.bt_rings_from_contacts);
    fabSecondary = (FloatingActionButton) findViewById(R.id.bt_rings_from_qrcode);
    fabPrimary.setIconDrawable(getResources().getDrawable(R.drawable.ic_contact_mail_white_36dp));
    fabSecondary.setIconDrawable(getResources().getDrawable(R.drawable.ic_qrcode_scan_white_36dp));


    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);

}
 
开发者ID:HancelParallelZero,项目名称:hancel_android,代码行数:21,代码来源:BaseActivity.java

示例3: onPostExecute

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
    protected void onPostExecute(Integer myResultObject) {
        int mResult = myResultObject.intValue();

        mMultipleActions = (FloatingActionsMenu) getView().findViewById(R.id.multipleActions);
        mActionLock = (FloatingActionButton) getView().findViewById(R.id.actionLock);
        mActionUnlock = (FloatingActionButton) getView().findViewById(R.id.actionUnlock);

        if (mResult == BootLoader.BL_UNLOCKED) {
            prepareUnlockSet();
            mActionLock.setVisibility(View.VISIBLE);
            mActionUnlock.setVisibility(View.GONE);
        } else if (mResult == BootLoader.BL_LOCKED) {
            prepareLockSet();
            mMultipleActions.setAlpha(1);
            mActionLock.setVisibility(View.GONE);
            mActionUnlock.setVisibility(View.VISIBLE);
        } else if (mResult == BootLoader.BL_UNSUPPORTED_DEVICE) {
            prepareUnsupportedSet();
mActionLock.setVisibility(View.GONE);
mActionUnlock.setVisibility(View.GONE);
        } else {
            prepareErrorSet();
mMultipleActions.setVisibility(View.GONE);
        }
    }
 
开发者ID:MrDoomy,项目名称:PadLock,代码行数:27,代码来源:MainFragment.java

示例4: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_launcher);
	
	
	mWallpaperManager = WallpaperManager.getInstance(this);
	mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());

	mLauncherMain = (RelativeLayout) findViewById(R.id.launcher_main);
	mViewPager = (ViewPager) findViewById(R.id.pager);
	mLauncherFab = (FloatingActionButton) findViewById(R.id.launcher_fab);
	
	mViewPager.setAdapter(mSectionsPagerAdapter);
	mLauncherMain.setBackground(mWallpaperManager.getDrawable());
	
	mLauncherFab.setOnClickListener(new OnFabBtnClickListener());
}
 
开发者ID:petalyaa,项目名称:Launchpet2,代码行数:19,代码来源:LauncherActivity.java

示例5: setPlaySongFloatingMenuButton

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
private void setPlaySongFloatingMenuButton(View view, final String urrlKey)
{
    FloatingActionButton playSongFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.play_song_floating_menu_button);
    if (isPlayVideo(urrlKey)) {
        playSongFloatingActionButton.setVisibility(View.VISIBLE);
        playSongFloatingActionButton.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                showYouTube(urrlKey);
                if (floatingActionMenu.isExpanded()) {
                    floatingActionMenu.collapse();
                }
            }
        });
    }
}
 
开发者ID:mcruncher,项目名称:worshipsongs-android,代码行数:19,代码来源:SongContentPortraitViewFragment.java

示例6: setPresentSongFloatingButton

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
private void setPresentSongFloatingButton(View view)
{
    presentSongFloatingButton = (FloatingActionButton) view.findViewById(R.id.present_song_floating_button);
    presentSongFloatingButton.setVisibility(View.VISIBLE);
    presentSongFloatingButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            if (presentationScreenService.getPresentation() != null) {
                presentSelectedVerse(0);
                presentSongFloatingButton.setVisibility(View.GONE);
                getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
            } else {
                Toast.makeText(getActivity(), "Your device is not connected to any remote display", Toast.LENGTH_SHORT).show();
            }
        }
    });
}
 
开发者ID:mcruncher,项目名称:worshipsongs-android,代码行数:20,代码来源:SongContentPortraitViewFragment.java

示例7: onCreateView

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_disturbances, container, false);
    list = (RecyclerView) view.findViewById(R.id.disturbance_list);
    reportButton = (FloatingActionButton) view.findViewById(R.id.disturbance_button);
    reportButton.setOnClickListener(listener);

    LinearLayoutManager layoutManager = new LinearLayoutManager(context);
    list.setLayoutManager(layoutManager);
    list.setItemAnimator(new DefaultItemAnimator());
    Object[] arr = getDisturbances(context).toArray();

    adapter = new DisturbanceAdapter(Arrays.copyOf(arr, arr.length, String[].class));
    list.setAdapter(adapter);
    setHasOptionsMenu(true);
    return view;
}
 
开发者ID:jakkra,项目名称:Transit,代码行数:18,代码来源:DisturbancesFragment.java

示例8: onCreateView

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (rootView == null) {
        super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.detailed_journey_fragment, container, false);
        swipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_container);
        swipeRefreshLayout.setColorSchemeResources(R.color.colorDividerBackground);
        progressWheel = (ProgressWheel) view.findViewById(R.id.progress_detail);
        recycleView = (RecyclerView) view.findViewById(R.id.detailed_recycle_view);
        LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
        recycleView.setLayoutManager(mLayoutManager);
        recycleView.setHasFixedSize(true);
        recycleView.setItemAnimator(new DefaultItemAnimator());
        swipeRefreshLayout.setRefreshing(true);
        swipeRefreshLayout.setOnRefreshListener(this);
        uiFiller = new FillDetailedHeaderHelper(view);
        mapButton = (FloatingActionButton) view.findViewById(R.id.map_button);
        rootView = view;
    } else {
        //((ViewGroup) rootView.getParent()).removeView(rootView);

    }
    return rootView;
}
 
开发者ID:jakkra,项目名称:Transit,代码行数:25,代码来源:DetailedJourneyFragment.java

示例9: selectFab1

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
public void selectFab1(View v) {
    mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
    mFAB1.setVisibility(View.GONE);
    mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
    mFAB2.setVisibility(View.VISIBLE);
    mActive = "true";
}
 
开发者ID:attiqrehman1991,项目名称:Task-Reminder,代码行数:8,代码来源:ReminderEditActivity.java

示例10: selectFab2

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
public void selectFab2(View v) {
    mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
    mFAB2.setVisibility(View.GONE);
    mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
    mFAB1.setVisibility(View.VISIBLE);
    mActive = "false";
}
 
开发者ID:attiqrehman1991,项目名称:Task-Reminder,代码行数:8,代码来源:ReminderEditActivity.java

示例11: initView

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
void initView() {
    mMapView = (MapView) findViewById(R.id.map);
    mLocbtn = (AppCompatImageButton) findViewById(R.id.locbtn);
    mActionLocate = (FloatingActionButton) findViewById(R.id.action_locate);
    mActionSettings = (FloatingActionButton) findViewById(R.id.action_settings);
    mActionReminder = (FloatingActionButton) findViewById(R.id.action_reminder);
    mFloatingActionsMenu = (FloatingActionsMenu) findViewById(R.id.floating_actions_menu);
    mInfoTextView = (TextView) findViewById(R.id.info_text_view);

    mActionLocate.setOnClickListener(this);
    mActionSettings.setOnClickListener(this);
    mActionReminder.setOnClickListener(this);
    mLocbtn.setOnClickListener(this);
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:15,代码来源:MapActivity.java

示例12: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Find the layout information
    rootLayout = (CoordinatorLayout) findViewById(R.id.root_layout);
    recycler = (RecyclerView) findViewById(R.id.recycler_view);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    spinner = (Spinner) findViewById(R.id.toolbar_spinner);
    dim = findViewById(R.id.dim);
    fabMenu = (FloatingActionsMenu) findViewById(R.id.fab_menu);

    getHelp = (FloatingActionButton) findViewById(R.id.get_help);
    addZone = (FloatingActionButton) findViewById(R.id.add_zone);
    addButton = (FloatingActionButton) findViewById(R.id.add_button);
    addCommand = (FloatingActionButton) findViewById(R.id.add_command);

    // set up the app bar with a spinner, toolbar, and no title
    setSpinnerAdapter();
    setSupportActionBar(toolbar);
    setTitle("");

    // put the labels on the floating action buttons.
    setFabButtons();

    swipeRefreshLayout.setOnRefreshListener(getRefreshListener(this));
    swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimary);
}
 
开发者ID:sourceallies,项目名称:zonebeacon,代码行数:30,代码来源:MainActivity.java

示例13: onCreate

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

    mPreview = (CameraSourcePreview) findViewById(R.id.preview);
    mGraphicOverlay = (GraphicOverlay) findViewById(R.id.faceOverlay);

    model = new Model(getApplicationContext());
    presenter = new Presenter(getApplicationContext(),mGraphicOverlay,mPreview,model,this);


    hatIcon = (com.getbase.floatingactionbutton.FloatingActionButton) findViewById(R.id.hatIcon);
    eyesIcon = (com.getbase.floatingactionbutton.FloatingActionButton) findViewById(R.id.eyesIcon);
    moustacheIcon = (com.getbase.floatingactionbutton.FloatingActionButton) findViewById(R.id.moustacheIcon);
    recordIcon = (android.support.design.widget.FloatingActionButton) findViewById(R.id.recordIcon);
    changeCameraIcon = (com.getbase.floatingactionbutton.FloatingActionButton) findViewById(R.id.changeCameraIcon);

    hatIcon.setOnClickListener(this);
    eyesIcon.setOnClickListener(this);
    moustacheIcon.setOnClickListener(this);
    recordIcon.setOnClickListener(this);
    changeCameraIcon.setOnClickListener(this);
    mGraphicOverlay.setOnClickListener(this);


    presenter.checkWriteExternalStoragePermissions();
    presenter.checkCameraPermissions(mGraphicOverlay);
    presenter.checkAudioPermissions();

    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

}
 
开发者ID:VideonaTalentum,项目名称:ProyectoAndroid,代码行数:34,代码来源:View.java

示例14: initViews

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
/********************************************************************************************
 * Initialization Methods
 ********************************************************************************************/

private void initViews() {
    mResources = getResources();
    mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.coordinatorLayout);
    mFloatingActionMenu = (FloatingActionsMenu) findViewById(R.id.todoFAB);
    mCreateFabFAB = (FloatingActionButton) findViewById(R.id.newTodoFAB);
    mCaturdayFAB = (FloatingActionButton) findViewById(R.id.partyFAB);
}
 
开发者ID:ZkHaider,项目名称:CodePath-TodoApp,代码行数:12,代码来源:MainActivity.java

示例15: assembleFabByDefault

import com.getbase.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
/**
   * Based on provided title and icon, it will create a fab and add it into the menu.
   * @param title the label which will display close to this fab
   * @param iconDrawable the icon which will display into this fab
   * @return the new fab object
   */
  protected FloatingActionButton assembleFabByDefault(String title, Drawable iconDrawable) {
    FloatingActionButton fab = new FloatingActionButton(context);
    fab.setColorNormal(childFabNormalColor);
    fab.setColorPressed(childFabPressedColor);
    fab.setSize(FloatingActionButton.SIZE_MINI);
    fab.setTitle(title);

    Preconditions.checkNotNull(iconDrawable);
//    iconDrawable.setColorFilter(getResources().getColor(R.color.purple), PorterDuff.Mode.SRC_IN);
    fab.setIconDrawable(iconDrawable);

    addButton(fab);
    return fab;
  }
 
开发者ID:wingjay,项目名称:jayAndroid,代码行数:21,代码来源:AbsFloatingActionsMenu.java


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