rjsvieira / floatingMenu

An orbit-like action button
Apache License 2.0
305 stars 42 forks source link

How can i set button to fix place not movable? and how can i change default icon of floating button and also set text with Icon? #16

Closed kushanshah11 closed 1 month ago

kilicpl commented 6 years ago

Kushanshah11 hi. Programatically you can set fab.setMovementStyle(MovementStyle.ANCHORED) for fixing the place..

For changing the default icon, you can use something like final int sdk = android.os.Build.VERSION.SDK_INT; if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { fab_1.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.something) ); } else { fab_1.setBackground(ContextCompat.getDrawable(context, R.drawable.something)); }

at the worst case you can import the module to your app then can change it in your module.. But it shouldnt be required I believe

rjsvieira commented 6 years ago

Hello @kushanshah11 @kilicpl is right. The 'Anchored' keyword guarantees that the floating button is not moved around. To change the background of the Floating Menu, you can just treat the FloatingMenu as a simple Android View and change the background drawable. Regards,