Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ jobs:
- name: Run Android Linter
run: ./gradlew lint

- name: Run Detekt
run: ./gradlew detekt

- name: Run unit tests
run: ./gradlew test
69 changes: 34 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Really simple as I wrote earlier
Firstly, you should declare your view in xml file

```xml
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -134,23 +134,23 @@ Firstly, you should declare menu items in xml
</menu>
```

each item tag has following attributes:
each item tag has the following attributes:

| property | type | description |
| ----- | ----- | ----- |
| **id** | reference | an id of menu item |
| **exb_color** | reference/color | color of element, it may be color reference or color |
| **icon** | reference | icon reference (vector drawables supported) |
| **title** | reference/text | item title |
| **exb_badgeColor** | color | notification badge background color. **It will override the color from layout attribute** |
| **exb_badgeTextColor** | color | notification badge text color. **It will override the color from layout attribute** |
| property | type | description |
|------------------------|-----------------|-------------------------------------------------------------------------------------------|
| **id** | reference | an id of menu item |
| **exb_color** | reference/color | color of element, it may be color reference or color |
| **icon** | reference | icon reference (vector drawables supported) |
| **title** | reference/text | item title |
| **exb_badgeColor** | color | notification badge background color. **It will override the color from layout attribute** |
| **exb_badgeTextColor** | color | notification badge text color. **It will override the color from layout attribute** |

Just like any Android menu 😉

Then you should reference this xml file at the view attributes

```xml
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand All @@ -165,23 +165,23 @@ Then you should reference this xml file at the view attributes

## Xml attributes

| property | type | description |
| ----- | ----- | ----- |
| **exb_elevation** | dimen | component elevation (important: api 21+) |
| **exb_backgroundColor** | color | bottom bar background color |
| **exb_transitionDuration** | integer | time between one item collapsed and another item expanded |
| **exb_backgroundCornerRadius** | dimen | bottom bar background corners radius |
| **exb_itemInactiveColor** | color | item menu color, when its inactive |
| **exb_itemBackgroundCornerRadius** | dimen | item background corner radius |
| **exb_itemStyle** | enum: normal, outline, stroke | controls the style of items. **normal** = items are filled with solid color; **outline** = no fill, only border; **stroke** = fill + border |
| **exb_itemBackgroundOpacity** | float | item background opacity (important: final color alpha calculates by next formulae alpha = opacity * 255) |
| **exb_item_vertical_margin** | dimen | top & bottom item margins |
| **exb_item_horizontal_margin** | dimen | left & right item margins |
| **exb_item_vertical_padding** | dimen | top & bottom item padding |
| **exb_item_horizontal_padding** | dimen | left & right item padding |
| **exb_items** | reference | xml supported menu format |
| **exb_notificationBadgeBackgroundColor** | color | notification badge background color. **Will be applied to all menu items** |
| **exb_notificationBadgeTextColor** | color | notification badge text color. **Will be applied to all menu items** |
| property | type | description |
|------------------------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| **exb_elevation** | dimen | component elevation (important: api 21+) |
| **exb_backgroundColor** | color | bottom bar background color |
| **exb_transitionDuration** | integer | time between one item collapsed and another item expanded |
| **exb_backgroundCornerRadius** | dimen | bottom bar background corners radius |
| **exb_itemInactiveColor** | color | item menu color, when its inactive |
| **exb_itemBackgroundCornerRadius** | dimen | item background corner radius |
| **exb_itemStyle** | enum: normal, outline, stroke | controls the style of items. **normal** = items are filled with solid color; **outline** = no fill, only border; **stroke** = fill + border |
| **exb_itemBackgroundOpacity** | float | item background opacity (important: final color alpha calculates by next formulae alpha = opacity * 255) |
| **exb_item_vertical_margin** | dimen | top & bottom item margins |
| **exb_item_horizontal_margin** | dimen | left & right item margins |
| **exb_item_vertical_padding** | dimen | top & bottom item padding |
| **exb_item_horizontal_padding** | dimen | left & right item padding |
| **exb_items** | reference | xml supported menu format |
| **exb_notificationBadgeBackgroundColor** | color | notification badge background color. **Will be applied to all menu items** |
| **exb_notificationBadgeTextColor** | color | notification badge text color. **Will be applied to all menu items** |

## Notification badges

Expand Down Expand Up @@ -220,13 +220,12 @@ But... if you need to support hiding the menu by list/grid scroll - then you are
This functionality is very simple to implement. You need to redeclare custom `Coordinator Layout Behavoir` to `ExpandableBottomBarScrollableBehavior`.

```xml
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_behavior="github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior"
app:items="@menu/bottom_bar" />

<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_gravity="bottom"
app:layout_behavior="github.com.st235.expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior"
app:items="@menu/bottom_bar" />
```

Really easy ;D
Expand Down
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ android {
}

dependencies {
implementation project(':lib-expandablebottombar')

implementation project(':expandablebottombar')
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22'

implementation 'androidx.appcompat:appcompat:1.6.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import androidx.appcompat.app.AppCompatActivity;

import github.com.st235.expandablebottombar.R;
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar;
import github.com.st235.lib_expandablebottombar.Menu;
import github.com.st235.lib_expandablebottombar.MenuItem;
import github.com.st235.lib_expandablebottombar.MenuItemDescriptor;
import github.com.st235.expandablebottombar.ExpandableBottomBar;
import github.com.st235.expandablebottombar.Menu;
import github.com.st235.expandablebottombar.MenuItemDescriptor;

public class JavaActivity extends AppCompatActivity {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.graphics.ColorUtils
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.expandablebottombar.ExpandableBottomBar

class NotificationBadgeActivity : AppCompatActivity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import android.view.ViewAnimationUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.core.graphics.ColorUtils
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.lib_expandablebottombar.MenuItemDescriptor
import github.com.st235.expandablebottombar.ExpandableBottomBar
import github.com.st235.expandablebottombar.MenuItemDescriptor


class ProgrammaticallyCreatedDemoActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.graphics.ColorUtils
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.expandablebottombar.ExpandableBottomBar

class XmlDeclaredActivity : AppCompatActivity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.Navigation
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.lib_expandablebottombar.navigation.ExpandableBottomBarNavigationUI
import github.com.st235.expandablebottombar.ExpandableBottomBar
import github.com.st235.expandablebottombar.navigation.ExpandableBottomBarNavigationUI

class NavigationComponentActivity: AppCompatActivity() {

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_coordinator_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:contentDescription="@string/coordinator_base_fab_content_description"
app:srcCompat="@drawable/ic_meow" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_java.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:layout_height="match_parent"
tools:context=".screens.JavaActivity">

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_notification_badge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
android:contentDescription="@string/coordinator_scroll_fab_content_description"
app:srcCompat="@drawable/ic_meow" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:exb_items="@menu/bottom_bar"
app:layout_behavior="github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior" />
app:layout_behavior="github.com.st235.expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:gravity="bottom"
tools:context=".screens.StylesActivity">

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -21,7 +21,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
Expand All @@ -32,7 +32,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_xml_declared.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/expandable_bottom_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activiy_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
app:navGraph="@navigation/navigation"
tools:ignore="FragmentTagUsage" />

<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
<github.com.st235.expandablebottombar.ExpandableBottomBar
android:id="@+id/bottomNavigation"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22'
classpath 'io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8'
classpath 'com.dropbox.dependency-guard:dependency-guard:0.5.0'
classpath 'org.jetbrains.kotlinx:binary-compatibility-validator:0.18.1'
}
}

Expand Down
File renamed without changes.
Loading
Loading