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


Java FloatingActionButton.setOnClickListener方法代码示例

本文整理汇总了Java中com.github.clans.fab.FloatingActionButton.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setOnClickListener方法的具体用法?Java FloatingActionButton.setOnClickListener怎么用?Java FloatingActionButton.setOnClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.clans.fab.FloatingActionButton的用法示例。


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

示例1: viewSetup

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
/**********************************Setup UI elements and their functionality***********************************/
private void viewSetup() {
    fabPoiDetailsAfterRoute = (android.support.design.widget.FloatingActionButton) findViewById(R.id.fabPoiDetailsAfterRoute);
    floatingActionButton = (FloatingActionMenu) findViewById(R.id.mainFab);
    floatingActionButton.setClosedOnTouchOutside(true);

    navigation = (BottomNavigationViewEx) findViewById(R.id.navigation);
    //setup bottom navigation
    navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
    navigation.setSelectedItemId(R.id.navigation_categories);
    navigation.enableAnimation(false);
    navigation.enableShiftingMode(false);
    navigation.enableItemShiftingMode(false);

    FloatingActionButton fabClearMap = (FloatingActionButton) findViewById(R.id.fabClearMap);
    FloatingActionButton fabLocation = (FloatingActionButton) findViewById(R.id.fabLocation);
    FloatingActionButton fabAdd = (FloatingActionButton) findViewById(R.id.fabAdd);
    FloatingActionButton fabSearch = (FloatingActionButton) findViewById(R.id.fabSearch);
    fabClearMap.setOnClickListener(clickListenerFAB);
    fabLocation.setOnClickListener(clickListenerFAB);
    fabAdd.setOnClickListener(clickListenerFAB);
    fabSearch.setOnClickListener(clickListenerFAB);
    fabPoiDetailsAfterRoute.setOnClickListener(clickListenerFAB);
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:25,代码来源:MainActivity.java

示例2: initView

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color_Actionbar)));
    }
    mCoordinatorLayout = findViewById(R.id.coordinator);

    RecyclerView recyclerView = findViewById(R.id.recycle_view);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    mAdapter = new LocationAdapter(this, new ArrayList<Location>());
    @SuppressWarnings("unchecked") SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, recyclerView);
    recyclerView.setAdapter(animatorAdapter);

    ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
    ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
    touchHelper.attachToRecyclerView(recyclerView);

    mView_FABMenu = findViewById(R.id.fab_menu_1);
    FloatingActionButton addLocation = findViewById(R.id.fab_action_1);
    addLocation.setVisibility(View.VISIBLE);
    addLocation.setLabelText(mContext.getResources().getString(R.string.add_location));
    addLocation.setOnClickListener(this);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:25,代码来源:LocationListActivity.java

示例3: onCreate

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initView();
    Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); }

    mFloatingActionMenu = (FloatingActionMenu)findViewById(R.id.menu);
    mLoadingFab = (FloatingActionButton)findViewById(R.id.fab_loading);
    mEmptyFab = (FloatingActionButton)findViewById(R.id.fab_empty);
    mErrorFab = (FloatingActionButton)findViewById(R.id.fab_error);
    mNoNetworkFab = (FloatingActionButton)findViewById(R.id.fab_no_network);
    mContentFab = (FloatingActionButton)findViewById(R.id.fab_content);
    mLoadingFab.setOnClickListener(this);
    mEmptyFab.setOnClickListener(this);
    mErrorFab.setOnClickListener(this);
    mNoNetworkFab.setOnClickListener(this);
    mContentFab.setOnClickListener(this);
    mMultipleStatusView.setOnRetryClickListener(mRetryClickListener);
}
 
开发者ID:qyxxjd,项目名称:MultipleStatusView,代码行数:22,代码来源:AbsActivity.java

示例4: onCreate

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

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final TextView contentView = (TextView)findViewById(R.id.content_view);
    FloatingActionButton fab = (FloatingActionButton)findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Snackbar.make(contentView, R.string.another_fab_snackbar, Snackbar.LENGTH_SHORT).show();
        }
    });
}
 
开发者ID:goofyz,项目名称:android-material-design-tutorial,代码行数:18,代码来源:AnotherFabActivity.java

示例5: initView

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {
    getViewByID();

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.color_Actionbar)));
        actionBar.setDisplayHomeAsUpEnabled(true);
        setTitle(getTitleString());
    }

    RecyclerView recyclerView = findViewById(R.id.recycle_view);
    recyclerView.setNestedScrollingEnabled(false);
    recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
    SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, recyclerView);
    recyclerView.setAdapter(animatorAdapter);

    ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
    ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
    touchHelper.attachToRecyclerView(recyclerView);

    fab_menu = findViewById(R.id.fab_menu_1);
    FloatingActionButton add_subject = findViewById(R.id.fab_action_1);
    add_subject.setVisibility(View.VISIBLE);
    add_subject.setOnClickListener(this);
    add_subject.setLabelText(mResources.getString(R.string.add_subject));

    //listener
    et_name.addTextChangedListener(this);
    et_home_phone.addTextChangedListener(this);
    et_work_phone.addTextChangedListener(this);

    et_name.setOnFocusChangeListener(this);

    setInfo();
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:36,代码来源:AddEditTeacherActivity.java

示例6: initView

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {

        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color_Actionbar)));
        }
        mCoordinatorLayout = findViewById(R.id.coordinator);

        RecyclerView recyclerView = findViewById(R.id.recycle_view);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new TeacherAdapter(this, new ArrayList<Teacher>());
        @SuppressWarnings("unchecked") SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, recyclerView);
        recyclerView.setAdapter(animatorAdapter);

        ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
        ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
        touchHelper.attachToRecyclerView(recyclerView);

        mView_FABMenu = findViewById(R.id.fab_menu_1);
        FloatingActionButton addTeacher = findViewById(R.id.fab_action_1);
        addTeacher.setVisibility(View.VISIBLE);
        addTeacher.setLabelText(mContext.getResources().getString(R.string.add_teacher));
        addTeacher.setOnClickListener(this);

        CoordinatorLayout.LayoutParams params =
                (CoordinatorLayout.LayoutParams) mView_FABMenu.getLayoutParams();
        params.setBehavior(new FloatingActionMenuBehavior());
        mView_FABMenu.requestLayout();

    }
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:32,代码来源:TeacherListActivity.java

示例7: initView

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color_Actionbar)));
    }

    mView_Coordinator = findViewById(R.id.coordinator);
    mView_SubjectName = findViewById(R.id.week_lesson_detail_subject_name);
    mView_SubjectArrow = findViewById(R.id.arrow);
    mView_Weekday = findViewById(R.id.week_lesson_detail_weekday);
    mView_Repeat = findViewById(R.id.week_lesson_detail_repeat);
    mView_Day = findViewById(R.id.week_lesson_detail_day);
    mView_FABMenu = findViewById(R.id.fab_menu_1);
    FloatingActionButton addDayLesson = findViewById(R.id.fab_action_1);
    FloatingActionButton editWeekLesson = findViewById(R.id.fab_action_2);
    addDayLesson.setVisibility(View.VISIBLE);
    editWeekLesson.setVisibility(View.VISIBLE);
    addDayLesson.setLabelText(mResources.getString(R.string.add_day_lesson));
    editWeekLesson.setLabelText(mResources.getString(R.string.edit_week_lesson));
    editWeekLesson.setImageResource(R.drawable.ic_edit_white_24dp);

    RecyclerView mView_RecyclerView = findViewById(R.id.recycle_view);
    mView_RecyclerView.setNestedScrollingEnabled(false);
    mView_RecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mAdapter = new DayLessonAdapter(mContext, new ArrayList<DayLesson>(), mColorText, mColorBackground);
    @SuppressWarnings("unchecked") SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, mView_RecyclerView);
    mView_RecyclerView.setAdapter(animatorAdapter);

    ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
    ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
    touchHelper.attachToRecyclerView(mView_RecyclerView);

    registerForContextMenu(mView_SubjectArrow);
    mView_SubjectArrow.setOnClickListener(this);
    mView_SubjectName.setOnClickListener(this);
    addDayLesson.setOnClickListener(this);
    editWeekLesson.setOnClickListener(this);
    setUpInfo();
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:41,代码来源:WeekLessonDetailActivity.java

示例8: initView

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initView() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color_Actionbar)));
    }
    mCoordinatorLayout = findViewById(R.id.coordinator);

    RecyclerView recyclerView = findViewById(R.id.recycle_view);
    RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
    if (animator instanceof DefaultItemAnimator) {
        ((DefaultItemAnimator) animator).setSupportsChangeAnimations(false);
    }
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    mAdapter = new SubjectAdapter(this, new ArrayList<Subject>());
    @SuppressWarnings("unchecked") SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, recyclerView);
    recyclerView.setAdapter(animatorAdapter);

    ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
    ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
    touchHelper.attachToRecyclerView(recyclerView);

    mView_FABMenu = findViewById(R.id.fab_menu_1);
    FloatingActionButton addSubject = findViewById(R.id.fab_action_1);
    addSubject.setVisibility(View.VISIBLE);
    addSubject.setLabelText(mContext.getResources().getString(R.string.add_subject));
    addSubject.setOnClickListener(this);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:29,代码来源:SubjectListActivity.java

示例9: setUpFloatingButtons

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void setUpFloatingButtons() {
    floatingActionButton = (FloatingActionButton) findViewById(R.id.adicionar_anotacoes);

    floatingActionButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(getApplicationContext(), AnotacaoDetalheActivity.class));
        }
    });
}
 
开发者ID:caiovidaln,项目名称:ifcalc,代码行数:11,代码来源:AnotacoesActivity.java

示例10: FabsController

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
public FabsController(Contract.View mainView, View mView) {
    this.mainView = mainView;

    fabMenu = mView.findViewById(R.id.main_fab);
    FloatingActionButton fab1 = fabMenu.findViewById(R.id.fab1);
    FloatingActionButton fab3 = fabMenu.findViewById(R.id.fab3);

    fabMenu.setOnClickListener(this);
    fab1.setOnClickListener(this);
    fab3.setOnClickListener(this);
}
 
开发者ID:pedromassango,项目名称:Programmers,代码行数:12,代码来源:FabsController.java

示例11: setupUploadMenu

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void setupUploadMenu() {
    uploadMenu = (FloatingActionMenu) findViewById(R.id.upload_menu);
    uploadMenu.setClosedOnTouchOutside(true);
    FloatingActionButton pictureFAB = (FloatingActionButton) findViewById(R.id.upload_image_fab);
    FloatingActionButton videoFAB = (FloatingActionButton) findViewById(R.id.upload_video_fab);
    FloatingActionButton audioFAB = (FloatingActionButton) findViewById(R.id.upload_audio_fab);
    FloatingActionButton galleryFAB = (FloatingActionButton) findViewById(R.id.upload_gallery_fab);
    pictureFAB.setOnClickListener(clickListenerFAB);
    videoFAB.setOnClickListener(clickListenerFAB);
    audioFAB.setOnClickListener(clickListenerFAB);
    galleryFAB.setOnClickListener(clickListenerFAB);
}
 
开发者ID:CommonsLab,项目名称:CommonsLab,代码行数:13,代码来源:MainActivity.java

示例12: setUpFab

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void setUpFab(View rootView) {
    fabNewCreditCard = (FloatingActionButton) rootView.findViewById(R.id.ccl_fab_add_cc);

    fabNewCreditCard.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent addCCIntent = new Intent(getActivity(), AddCreditCardActivity.class);
            startActivity(addCCIntent);
        }
    });
}
 
开发者ID:abicelis,项目名称:CreditCardExpenseManager,代码行数:12,代码来源:CreditCardListFragment.java

示例13: initializeGUI

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private void initializeGUI() {
    // Search Functionality
    etxtSearch = (EditText) findViewById(R.id.etxtSearch);
    etxtSearch.setOnEditorActionListener((v, actionId, event) -> {
        if (actionId == EditorInfo.IME_ACTION_SEARCH) {
            Search();
            return true;
        }
        return false;
    });

    // Labels
    lblOfflineResults = (TextView) findViewById(R.id.lblOfflineResults);
    lblOnlineResults = (TextView) findViewById(R.id.lblOnlineResults);

    // Adapters
    adapterOffline = new AdapterSavedItem(this);
    adapterOnline = new AdapterFatsecretItem(this);

    // ListViews
    listviewOfflineResults = (ListView) findViewById(R.id.listviewOfflineResults);
    listviewOfflineResults.setAdapter(adapterOffline);
    listviewOfflineResults.setOnItemClickListener(this);

    listviewOnlineResults = (ListView) findViewById(R.id.listviewOnlineResults);
    listviewOnlineResults.setAdapter(adapterOnline);
    listviewOnlineResults.setOnItemClickListener(this);

    // FABs
    fabCreateFood = (FloatingActionButton) findViewById(R.id.fabCreateNewFood);
    fabCreateFood.setOnClickListener(this);
    fabCreateMeal = (FloatingActionButton) findViewById(R.id.fabCreateNewMeal);
    fabCreateMeal.setOnClickListener(this);

    progressBarSearchFood = (ProgressBar)findViewById(R.id.progressBarSearchFood);
    progressBarSearchFood.setVisibility(View.GONE);
}
 
开发者ID:Karim94,项目名称:IIFYM,代码行数:38,代码来源:ActivityFoodSearch.java

示例14: getSettingButton

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private FloatingActionButton getSettingButton(Context context) {
    final FloatingActionButton settingBtn = new FloatingActionButton(context);
    settingBtn.setButtonSize(FloatingActionButton.SIZE_MINI);
    settingBtn.setColorNormalResId(R.color.app_logo_color_light);
    settingBtn.setColorPressedResId(R.color.app_logo_color);
    settingBtn.setImageResource(R.drawable.set);
    settingBtn.setTag(MENU_TYPE_SETTING);
    settingBtn.setLabelText(R.string.config_app);
    settingBtn.setOnClickListener(this);
    return settingBtn;
}
 
开发者ID:xiongwei-git,项目名称:OneNote,代码行数:12,代码来源:MainMenuHelper.java

示例15: getShareButton

import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
private FloatingActionButton getShareButton(Context context) {
    final FloatingActionButton shareBtn = new FloatingActionButton(context);
    shareBtn.setButtonSize(FloatingActionButton.SIZE_MINI);
    shareBtn.setImageResource(R.drawable.share);
    shareBtn.setTag(MENU_TYPE_SHARE);
    shareBtn.setLabelText(R.string.share_to);
    shareBtn.setColorNormalResId(R.color.app_logo_color_light);
    shareBtn.setColorPressedResId(R.color.app_logo_color);
    shareBtn.setOnClickListener(this);
    return shareBtn;
}
 
开发者ID:xiongwei-git,项目名称:OneNote,代码行数:12,代码来源:MainMenuHelper.java


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