This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Android library providing a Floating Action Button (FAB) with an optional speed-dial menu. Originally by Mark Ormesher, forked under the OneBusAway organization. Published as uk.co.markormesher:android-fab.
# Build everything
./gradlew build
# Install demo app (debug)
./gradlew clean installDebug
# Build library only
./gradlew :fab:build
# Generate release artifact
./gradlew :fab:generateReleaseTwo Gradle modules defined in settings.gradle:
fab/— The library module (com.android.library). Contains the reusable FAB widget.app/— Demo application (com.android.application). Depends on:faband showcases all FAB features.
All under uk.co.markormesher.android_fab:
FloatingActionButton— The main widget. ExtendsRelativeLayout, manages positioning, animation, speed-dial menu lifecycle, state save/restore, and Snackbar-awareCoordinatorLayout.Behavior.SpeedDialMenuAdapter— Abstract adapter that consumers extend to provide menu items, handle clicks, and customize appearance.SpeedDialMenuItem— Data class pairing an icon (Drawable/resource) with a label (String/resource).SpeedDialMenuOpenListener/SpeedDialMenuCloseListener— Callback interfaces for menu state changes.extensions/RelativeLayoutLayoutParams— Kotlin extension for clearing parent alignment rules across SDK versions.
- Uses
kotlinx.android.syntheticview binding (Kotlin Android Extensions). - SDK-conditional code paths throughout:
CardViewon API 21+,LinearLayout/GradientDrawablefallbacks for API 14-20. - Layout variants:
layout-v21/provides separate FAB and menu item icon layouts for API 21+ (elevation/CardView support). - FAB position uses bitwise flags (
POSITION_TOP,POSITION_BOTTOM,POSITION_START,POSITION_END,POSITION_LEFT,POSITION_RIGHT). - RTL support via resource boolean (
R.bool.is_right_to_left) andsetPaddingRelative. - State preservation through
onSaveInstanceState/onRestoreInstanceStatewithBundle.
- Language: Kotlin (1.3.21)
- Build: Gradle with Android Gradle Plugin 3.2.1
- Min SDK: 14 / Target SDK: 28
- AndroidX: Uses
androidx.cardview,androidx.annotation,com.google.android.material - Publishing: Maven plugin, artifacts deployed to local release directory then zipped
Release builds require a secrets.properties file at the project root with keystore config. Without it, only debug builds work.