当前位置: 首页>>代码示例>>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;未经允许,请勿转载。