當前位置: 首頁>>代碼示例>>Java>>正文


Java FloatingActionButton.setOnClickListener方法代碼示例

本文整理匯總了Java中com.getbase.floatingactionbutton.FloatingActionButton.setOnClickListener方法的典型用法代碼示例。如果您正苦於以下問題:Java FloatingActionButton.setOnClickListener方法的具體用法?Java FloatingActionButton.setOnClickListener怎麽用?Java FloatingActionButton.setOnClickListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.getbase.floatingactionbutton.FloatingActionButton的用法示例。


在下文中一共展示了FloatingActionButton.setOnClickListener方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: onCreateView

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View rootView = inflater.inflate(R.layout.fragment_edit_observation, container, false);
    ButterKnife.bind(this, rootView);

    et_tickName.addTextChangedListener(new TextValidator(mContext, EditObservationFragment.this, et_tickName));
    //et_description.addTextChangedListener(new TextValidator(mContext, AddObservationFragment.this, et_tickSpecies));
    et_numOfTicks.addTextChangedListener(new TextValidator(mContext, EditObservationFragment.this, et_numOfTicks));
    // initialize the Floating button.

    final FloatingActionButton fab_addTickImage = (FloatingActionButton) rootView.findViewById(R.id.fab_add_tick_image);
    fab_addTickImage.setOnClickListener(this);

    btn_chooseFromGuide.setText(getString(R.string.text_edit_referTickGuide));

    // populate all the views with the Observation object restored from Bundle
    if (mObservation != null) {
        Picasso.with(mContext).load(mObservation.getImageUrl()).into(imageView_tickAddObservation);
        et_tickName.setText(mObservation.getTickName());
        et_description.setText(mObservation.getDescription());
        et_numOfTicks.setText(String.valueOf(mObservation.getNum_of_ticks()));
    }

    // initially the color of the button will be Greyish to disable user updating observation
    //setStateOfUpdateButton(false);
    btn_UpdateObservation.setOnClickListener(this);

    return rootView;
}
 
開發者ID:pmk2429,項目名稱:investickation,代碼行數:31,代碼來源:EditObservationFragment.java

示例8: onCreateView

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this mMapFragment
    View rootView = inflater.inflate(R.layout.fragment_activity_new, container, false);

    ButterKnife.bind(this, rootView);

    // reference for setting up the Activities Object.
    mNewActivity = new Activities();

    et_activityName.addTextChangedListener(new TextValidator(mContext, ActivityNewFragment.this, et_activityName));
    et_totalPeople.addTextChangedListener(new TextValidator(mContext, ActivityNewFragment.this, et_totalPeople));
    et_totalPets.addTextChangedListener(new TextValidator(mContext, ActivityNewFragment.this, et_totalPets));

    // Get the MapView from the XML layout and inflate it
    mapView = (MapView) rootView.findViewById(R.id.mapview_activity_map);


    // start the activity
    final FloatingActionButton addProject = (FloatingActionButton) rootView.findViewById(R.id.fab_activity_start);
    addProject.setOnClickListener(this);

    // in times of changing the Orientation of Screen, we have to get the MapView from savedInstanceState
    final Bundle mapViewSavedInstanceState = savedInstanceState != null ? savedInstanceState.getBundle("mapViewSaveState") : null;
    mapView.onCreate(mapViewSavedInstanceState);

    return rootView;
}
 
開發者ID:pmk2429,項目名稱:investickation,代碼行數:30,代碼來源:ActivityNewFragment.java

示例9: GeneralEvents

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
public void GeneralEvents (View view) {
    FloatingActionButton toSelfie = (FloatingActionButton) view.findViewById(R.id.toSelfie);
    toSelfie.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(ctx, Compromisos.class);
            startActivity(intent);
        }
    });
}
 
開發者ID:dannegm,項目名稱:BrillaMXAndroid,代碼行數:11,代碼來源:LeaderBoard.java

示例10: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preselfie);

    FloatingActionButton firstSelfie = (FloatingActionButton) findViewById(R.id.firstSelfie);
    firstSelfie.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Preselfie.this, Compromisos.class);
            startActivity(intent);
        }
    });
}
 
開發者ID:dannegm,項目名稱:BrillaMXAndroid,代碼行數:15,代碼來源:Preselfie.java

示例11: GeneralEvents

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
public void GeneralEvents () {
    FloatingActionButton toSelfie = (FloatingActionButton) findViewById(R.id.toSelfie);
    toSelfie.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(UserProfile.this, Compromisos.class);
            startActivity(intent);
        }
    });
}
 
開發者ID:dannegm,項目名稱:BrillaMXAndroid,代碼行數:11,代碼來源:UserProfile.java

示例12: setPlaySongFloatingButton

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
private void setPlaySongFloatingButton(View view, final String urlKey)
{
    FloatingActionButton playSongFloatingButton = (FloatingActionButton) view.findViewById(R.id.play_song_floating_button);
    playSongFloatingButton.setVisibility(View.VISIBLE);
    playSongFloatingButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            showYouTube(urlKey);
        }
    });
}
 
開發者ID:mcruncher,項目名稱:worshipsongs-android,代碼行數:14,代碼來源:SongContentPortraitViewFragment.java

示例13: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_macros);

        initToolbar();
        initDrawer();

        mListView = (CardListView) findViewById(R.id.listview);
        mListEmptyTextView = (TextView) findViewById(R.id.listEmptyText);
        mMacroList = MacroUtils.loadMacroList(mPrefs);

//        if (mMacroList.size() >= MACRO_SIZE_WARN) {
//            macroListLengthWarningDialog(mMacroList.size());
//        }

        mCards = new ArrayList<Card>();
        for (MacroEntry macroEntry : mMacroList) {
            mCards.add(macroEntryToCard(macroEntry));
        }

        mCardArrayAdapter = new CardArrayAdapter(this, mCards);
        if (mListView != null) {
            mListView.setAdapter(mCardArrayAdapter);
        }

        Drawable plus = new IconicsDrawable(this, FontAwesome.Icon.faw_plus).color(Color.DKGRAY).sizeDp(20);
        FloatingActionButton addButton = (FloatingActionButton) findViewById(R.id.add);
        addButton.setImageDrawable(plus);
        addButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                addMacro();
            }
        });
    }
 
開發者ID:mitchtech,項目名稱:XposedMacroExpand,代碼行數:37,代碼來源:EditMacrosActivity.java

示例14: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Initialize reminder database
    rb = new ReminderDatabase(getApplicationContext());

    // Initialize views
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mAddReminderButton = (FloatingActionButton) findViewById(R.id.add_reminder);
    mList = (RecyclerView) findViewById(R.id.reminder_list);
    mNoReminderView = (TextView) findViewById(R.id.no_reminder_text);

    // To check is there are saved reminders
    // If there are no reminders display a message asking the user to create reminders
    List<Reminder> mTest = rb.getAllReminders();

    if (mTest.isEmpty()) {
        mNoReminderView.setVisibility(View.VISIBLE);
    }

    // Create recycler view
    mList.setLayoutManager(getLayoutManager());
    registerForContextMenu(mList);
    mAdapter = new SimpleAdapter();
    mAdapter.setItemCount(getDefaultItemCount());
    mList.setAdapter(mAdapter);

    // Setup toolbar
    setSupportActionBar(mToolbar);
    mToolbar.setTitle(R.string.app_name);

    // On clicking the floating action button
    mAddReminderButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(v.getContext(), ReminderAddActivity.class);
            startActivity(intent);
        }
    });

    // Initialize alarm
    mAlarmReceiver = new AlarmReceiver();
}
 
開發者ID:attiqrehman1991,項目名稱:Task-Reminder,代碼行數:46,代碼來源:MainActivity.java

示例15: onCreate

import com.getbase.floatingactionbutton.FloatingActionButton; //導入方法依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nearby);

    Toolbar toolbar = (Toolbar) findViewById(R.id.action_toolbar);
    setSupportActionBar(toolbar);
    String address = (String) BmobUser.getObjectByKey("address");
    if (null == address) {
        address = "位置未指定";
    }
    mNearbyNameTextView = (TextView) findViewById(R.id.nearby_name_text_view);
    mNearbyNameTextView.setText(address);

    ActionBar actionBar = getSupportActionBar();
    if (null != actionBar) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
    }

    mExchangeFAB = (FloatingActionButton) findViewById(R.id.action_exchange);
    mExchangeFAB.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            onAddressPicker();
        }
    });

    mNearbyRecyclerView = (RecyclerView) findViewById(R.id.nearby_recycler_view);
    /*創建LinearLayoutManager對象,讓RecyclerView的元素倒序顯示,並且初始元素不默認從底部開始顯示*/
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setReverseLayout(true); /*讓RecyclerView的元素倒序顯示*/
    layoutManager.setStackFromEnd(true);/*初始元素不默認從底部開始顯示*/
    mNearbyRecyclerView.setLayoutManager(layoutManager);

    mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
    mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            mHandler.sendEmptyMessageDelayed(REFRESH_COMPLETE, 2000);
        }
    });

    mEmptyTextView = (TextView) findViewById(R.id.empty_nearby_view);

    updateUI();
}
 
開發者ID:InnoFang,項目名稱:ChangTu,代碼行數:48,代碼來源:NearbyActivity.java


注:本文中的com.getbase.floatingactionbutton.FloatingActionButton.setOnClickListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。