當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。