Created
November 29, 2017 12:41
-
-
Save pavi2410/5bf27bb73b87ae8edb47833aa2a0f0a6 to your computer and use it in GitHub Desktop.
using official android fab lib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FloatingActionButton fab = new FloatingActionButton(context); | |
fab.setId(View.generateViewId()); | |
fab.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Log.d("DEBUG", "onFabFoo"); | |
}}); | |
fab.setImageResource(R.drawable.btn_plus); | |
fab.setElevation(2); | |
fab.setSize(FloatingActionButton.SIZE_MINI); | |
fab.setFocusable(true); | |
RelativeLayout.LayoutParams lay = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); | |
lay.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); | |
lay.addRule(RelativeLayout.ALIGN_PARENT_LEFT); | |
lay.setMargins(2,2,2,2); | |
fab.setLayoutParams(lay); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment