• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FloatingActionButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: randomBackground

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
/**
 * 随机设置fab背景色
 */
public static void randomBackground(FloatingActionButton b) {
    int color = GREY;
    int result = random.nextInt(21);
    if (result < 3) {
        color = HOLO_GREEN_LIGHT;
    } else if (result < 6) {
        color = HOLO_BLUE_LIGHT;
    } else if (result < 9) {
        color = HOLO_RED_LIGHT;
    } else if (result < 12) {
        color = HOLO_PURPLE;
    } else if (result < 15) {
        color = HOLO_ORANGE_LIGHT;
    }
    b.setColor(color);
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:20,代码来源:Util.java


示例2: onCreateView

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
						 Bundle savedInstanceState)
{
	mContext = container.getContext();
	View rootView = inflater.inflate(R.layout.fragment_sound_manager, container, false);
	mListView = (ListView) rootView.findViewById(R.id.listView_alarmSounds);

	mFAB = (FloatingActionButton) rootView.findViewById(R.id.fab_add_sound);
	mFAB.setOnClickListener(new View.OnClickListener()
	{
		@Override
		public void onClick(View v)
		{
			startAudioFileIntent();
		}
	});
	mFAB.listenTo(mListView);

	mProgressBar =
			(ProgressBar) rootView.findViewById(R.id.circleProgressBar_SoundList);
	setHasOptionsMenu(true);
	setupListView();
	return rootView;
}
 
开发者ID:AlphaBetaPeter,项目名称:alarming,代码行数:26,代码来源:SoundManagerFragment.java


示例3: setupTextEditor

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
private void setupTextEditor() {

        verticalScroll = (GoodScrollView) findViewById(R.id.vertical_scroll);
        horizontalScroll = (HorizontalScrollView) findViewById(R.id.horizontal_scroll);
        mEditor = (Editor) findViewById(R.id.editor);

        AccessoryView accessoryView = (AccessoryView) findViewById(R.id.accessoryView);
        accessoryView.setInterface(this);

        HorizontalScrollView parentAccessoryView = (HorizontalScrollView) findViewById(R.id.parent_accessory_view);
        ViewUtils.setVisible(parentAccessoryView, PreferenceHelper.getUseAccessoryView(this));


        if (PreferenceHelper.getWrapContent(this)) {
            horizontalScroll.removeView(mEditor);
            verticalScroll.removeView(horizontalScroll);
            verticalScroll.addView(mEditor);
        }

        verticalScroll.setScrollInterface(this);

        pageSystem = new PageSystem(this, this, "");

        pageSystemButtons = new PageSystemButtons(this, this,
                (FloatingActionButton) findViewById(R.id.fabPrev),
                (FloatingActionButton) findViewById(R.id.fabNext));

        mEditor.setupEditor();
    }
 
开发者ID:ujjwalagrawal17,项目名称:CodeCompilerApp,代码行数:30,代码来源:MainActivity.java


示例4: onCreateView

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
            savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_gnote_recycler, container, false);
        RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.rv_gnotes);

        int columnNum = 2;
        if (MyLitePrefs.getBoolean(MyLitePrefs.ONE_COLUMN)) {
            columnNum = 1;
        }
        recyclerView.setLayoutManager(new StaggeredGridLayoutManager(columnNum,
                StaggeredGridLayoutManager.VERTICAL));
        mAdapter = new GNoteRVAdapter(mContext, null, null, null);
        recyclerView.setAdapter(mAdapter);

        loaderManager = getLoaderManager();

        // / We don't need it begin load immediately when we enter SearchMode
//        loaderManager.initLoader(LOADER_ID, null, this);

        fabButton = (FloatingActionButton) view.findViewById(R.id.fabbutton);
        fabButton.setVisibility(View.GONE);

        // / In this fragment,we don't need it
        view.findViewById(R.id.refresher).setEnabled(false);
        return view;
    }
 
开发者ID:duanze,项目名称:PureNote,代码行数:28,代码来源:FiltratePage.java


示例5: onCreateView

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
						 Bundle savedInstanceState)
{
	mContext = getActivity();
	View rootView = inflater.inflate(R.layout.fragment_set_alarm, container, false);
	mAlarmListView = (RecyclerView) rootView.findViewById(R.id.cardListView_alarm);
	final LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
	layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
	mAlarmListView.setLayoutManager(layoutManager);

	mFAB = (FloatingActionButton) rootView.findViewById(R.id.fab_add_alarm);
	mFAB.setOnClickListener(new View.OnClickListener()
	{
		@Override
		public void onClick(View v)
		{
			SetAlarmFragment.this.addNewAlarm();
		}
	});

	// Fab listening disabled due to recyler view
	//mFAB.listenTo(mAlarmListView);

	setUpListView();
	PrefUtil.getApplicationPrefs(mContext)
			.registerOnSharedPreferenceChangeListener(this);
	return rootView;
}
 
开发者ID:AlphaBetaPeter,项目名称:alarming,代码行数:30,代码来源:SetAlarmFragment.java


示例6: onCreate

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mFab = (FloatingActionButton) findViewById(R.id.fabbutton);

    ListView listView = (ListView) findViewById(R.id.list_view);
    listView.setAdapter(new ArrayAdapter<String>(this,
            R.layout.list_item, getResources().getStringArray(R.array.planets_array)));
    mFab.listenTo(listView);

    getActionBar().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
}
 
开发者ID:CodePath-MAF,项目名称:AndroidClient,代码行数:14,代码来源:MainActivity.java


示例7: onCreate

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mFab = (FloatingActionButton) findViewById(R.id.fabbutton);

    ListView listView = (ListView) findViewById(R.id.list_view);
    listView.setAdapter(new ArrayAdapter<String>(this,
            R.layout.list_item, getResources().getStringArray(R.array.planets_array)));
    mFab.listenTo(listView);

    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
}
 
开发者ID:faizmalkani,项目名称:Fabulous,代码行数:14,代码来源:MainActivity.java


示例8: onCreateView

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
public View onCreateView(LayoutInflater inflater, ViewGroup container,
         Bundle savedInstanceState) {
     View rootView = inflater.inflate(R.layout.fragment_daily, container, false);
     
     // Set a listener to be invoked when the list should be refreshed.
     pullToRefreshView = (PullToRefreshListView)rootView.findViewById(R.id.daily_list);
     
     mass_sp = getActivity().getSharedPreferences(Constant.NEWS_ID, getActivity().MODE_PRIVATE);
     editor = mass_sp.edit();
     
     if(isExpired()) {
         // async to load news
         new GetDataTask().execute();
     }
     
     btn_new = (FloatingActionButton)rootView.findViewById(R.id.btn_new);
     btn_new.setOnTouchListener(new OnTouchListener() {

@Override
public boolean onTouch(View v, MotionEvent event) {
	int action = event.getAction();
    switch (action) {
    case MotionEvent.ACTION_MOVE:
    case MotionEvent.ACTION_DOWN:
    	btn_new.setPressed(true);
    	break;
    case MotionEvent.ACTION_UP:
    	if(!btn_new.isFocusable()) {
    		Log.d(TAG, "test....");
	    	Intent intent = new Intent(getActivity(),DailyEditActivity.class);  
           	getActivity().startActivity(intent);  
           	getActivity().overridePendingTransition(R.anim.in_from_bottom, R.anim.keep_unchanage);
    	}
    	btn_new.setPressed(false);
          	break;
    case MotionEvent.ACTION_CANCEL:
    	btn_new.setPressed(false);
    default:
    	break;
    }
    
	return true;
}
     	
     });
     
     pullToRefreshView.setOnRefreshListener(new OnRefreshListener<ListView>() {
         @Override
         public void onRefresh(PullToRefreshBase<ListView> refreshView) {
             // Do work to refresh the list here.
             new GetDataTask().execute();
         }
     });
     
     initListView();
     
     return rootView;
 }
 
开发者ID:youtaya,项目名称:crabapple,代码行数:59,代码来源:DailyFragment.java


示例9: setUpViews

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
protected void setUpViews() {
    lvLCDetails = (ParallaxListView) findViewById(R.id.lvLCDetails);
    lvLCDetails.setOnItemClickListener(postClickListener);
    btnCreatePost = (FloatingActionButton) findViewById(R.id.btnCreatePost);
}
 
开发者ID:CodePath-MAF,项目名称:AndroidClient,代码行数:6,代码来源:LCDetailsActivity.java


示例10: onCreate

import com.faizmalkani.floatingactionbutton.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    currentFolder = PreferenceHelper.defaultFolder(this);

    ThemeUtils.setTheme(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_file);

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

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    //final Actions action = (Actions) getIntent().getExtras().getSerializable("action");
    wantAFile = true; //action == Actions.SelectFile;

    listView = (ListView) findViewById(android.R.id.list);
    listView.setOnItemClickListener(this);
    listView.setTextFilterEnabled(true);

    FloatingActionButton mFab = (FloatingActionButton) findViewById(R.id.fabbutton);
    mFab.setColor(getResources().getColor(R.color.fab_light));
    mFab.setDrawable(getResources().getDrawable(R.drawable.ic_fab_add));

    mFab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            PopupMenu popup = new PopupMenu(SelectFileActivity.this, v);

            popup.getMenuInflater().inflate(R.menu.popup_new_file, popup.getMenu());

            popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                @Override
                public boolean onMenuItemClick(MenuItem item) {
                    int i = item.getItemId();
                    if (i == R.id.im_new_file) {
                        EditTextDialog.newInstance(EditTextDialog.Actions.NewFile).show(getFragmentManager().beginTransaction(), "dialog");
                        return true;
                    } else if (i == R.id.im_new_folder) {
                        EditTextDialog.newInstance(EditTextDialog.Actions.NewFolder).show(getFragmentManager().beginTransaction(), "dialog");
                        return true;
                    } else {
                        return false;
                    }
                }
            });

            popup.show();
        }
    });

    mFab.listenTo(listView);

    String lastNavigatedPath = PreferenceHelper.getWorkingFolder(this);

    File file = new File(lastNavigatedPath);

    if (!file.exists()) {
        PreferenceHelper.setWorkingFolder(this, PreferenceHelper.defaultFolder(this));
        file = new File(PreferenceHelper.defaultFolder(this));
    }

    new UpdateList().execute(file.getAbsolutePath());
}
 
开发者ID:vmihalachi,项目名称:turbo-editor,代码行数:65,代码来源:SelectFileActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TestRpcServiceProtos类代码示例发布时间:2022-05-23
下一篇:
Java DefaultConverterFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap