Skip to content

Commit b205e41

Browse files
authored
Merge pull request #107 from st235/feature/detekt
Add Detekt lint to the library, bump version
2 parents eb640c1 + 0a6343e commit b205e41

85 files changed

Lines changed: 657 additions & 286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/static-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ jobs:
4545
- name: Run Android Linter
4646
run: ./gradlew lint
4747

48+
- name: Run Detekt
49+
run: ./gradlew detekt
50+
4851
- name: Run unit tests
4952
run: ./gradlew test

README.md

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Really simple as I wrote earlier
6060
Firstly, you should declare your view in xml file
6161

6262
```xml
63-
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
63+
<github.com.st235.expandablebottombar.ExpandableBottomBar
6464
android:id="@+id/expandable_bottom_bar"
6565
android:layout_width="0dp"
6666
android:layout_height="wrap_content"
@@ -134,23 +134,23 @@ Firstly, you should declare menu items in xml
134134
</menu>
135135
```
136136

137-
each item tag has following attributes:
137+
each item tag has the following attributes:
138138

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

148148
Just like any Android menu 😉
149149

150150
Then you should reference this xml file at the view attributes
151151

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

166166
## Xml attributes
167167

168-
| property | type | description |
169-
| ----- | ----- | ----- |
170-
| **exb_elevation** | dimen | component elevation (important: api 21+) |
171-
| **exb_backgroundColor** | color | bottom bar background color |
172-
| **exb_transitionDuration** | integer | time between one item collapsed and another item expanded |
173-
| **exb_backgroundCornerRadius** | dimen | bottom bar background corners radius |
174-
| **exb_itemInactiveColor** | color | item menu color, when its inactive |
175-
| **exb_itemBackgroundCornerRadius** | dimen | item background corner radius |
176-
| **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 |
177-
| **exb_itemBackgroundOpacity** | float | item background opacity (important: final color alpha calculates by next formulae alpha = opacity * 255) |
178-
| **exb_item_vertical_margin** | dimen | top & bottom item margins |
179-
| **exb_item_horizontal_margin** | dimen | left & right item margins |
180-
| **exb_item_vertical_padding** | dimen | top & bottom item padding |
181-
| **exb_item_horizontal_padding** | dimen | left & right item padding |
182-
| **exb_items** | reference | xml supported menu format |
183-
| **exb_notificationBadgeBackgroundColor** | color | notification badge background color. **Will be applied to all menu items** |
184-
| **exb_notificationBadgeTextColor** | color | notification badge text color. **Will be applied to all menu items** |
168+
| property | type | description |
169+
|------------------------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
170+
| **exb_elevation** | dimen | component elevation (important: api 21+) |
171+
| **exb_backgroundColor** | color | bottom bar background color |
172+
| **exb_transitionDuration** | integer | time between one item collapsed and another item expanded |
173+
| **exb_backgroundCornerRadius** | dimen | bottom bar background corners radius |
174+
| **exb_itemInactiveColor** | color | item menu color, when its inactive |
175+
| **exb_itemBackgroundCornerRadius** | dimen | item background corner radius |
176+
| **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 |
177+
| **exb_itemBackgroundOpacity** | float | item background opacity (important: final color alpha calculates by next formulae alpha = opacity * 255) |
178+
| **exb_item_vertical_margin** | dimen | top & bottom item margins |
179+
| **exb_item_horizontal_margin** | dimen | left & right item margins |
180+
| **exb_item_vertical_padding** | dimen | top & bottom item padding |
181+
| **exb_item_horizontal_padding** | dimen | left & right item padding |
182+
| **exb_items** | reference | xml supported menu format |
183+
| **exb_notificationBadgeBackgroundColor** | color | notification badge background color. **Will be applied to all menu items** |
184+
| **exb_notificationBadgeTextColor** | color | notification badge text color. **Will be applied to all menu items** |
185185

186186
## Notification badges
187187

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

222222
```xml
223-
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
224-
android:id="@+id/expandable_bottom_bar"
225-
android:layout_width="match_parent"
226-
android:layout_height="wrap_content"
227-
android:layout_gravity="bottom"
228-
app:layout_behavior="github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior"
229-
app:items="@menu/bottom_bar" />
223+
224+
<github.com.st235.expandablebottombar.ExpandableBottomBar
225+
android:id="@+id/expandable_bottom_bar" android:layout_width="match_parent"
226+
android:layout_height="wrap_content" android:layout_gravity="bottom"
227+
app:layout_behavior="github.com.st235.expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior"
228+
app:items="@menu/bottom_bar" />
230229
```
231230

232231
Really easy ;D

app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ android {
3535
}
3636

3737
dependencies {
38-
implementation project(':lib-expandablebottombar')
39-
38+
implementation project(':expandablebottombar')
4039
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22'
4140

4241
implementation 'androidx.appcompat:appcompat:1.6.1'

app/src/main/java/github/com/st235/expandablebottombar/screens/JavaActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
import androidx.appcompat.app.AppCompatActivity;
88

99
import github.com.st235.expandablebottombar.R;
10-
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar;
11-
import github.com.st235.lib_expandablebottombar.Menu;
12-
import github.com.st235.lib_expandablebottombar.MenuItem;
13-
import github.com.st235.lib_expandablebottombar.MenuItemDescriptor;
10+
import github.com.st235.expandablebottombar.ExpandableBottomBar;
11+
import github.com.st235.expandablebottombar.Menu;
12+
import github.com.st235.expandablebottombar.MenuItemDescriptor;
1413

1514
public class JavaActivity extends AppCompatActivity {
1615

app/src/main/java/github/com/st235/expandablebottombar/screens/NotificationBadgeActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import androidx.appcompat.app.AppCompatActivity
1010
import androidx.appcompat.widget.Toolbar
1111
import androidx.core.graphics.ColorUtils
1212
import github.com.st235.expandablebottombar.R
13-
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
13+
import github.com.st235.expandablebottombar.ExpandableBottomBar
1414

1515
class NotificationBadgeActivity : AppCompatActivity() {
1616

app/src/main/java/github/com/st235/expandablebottombar/screens/ProgrammaticallyCreatedDemoActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import android.view.ViewAnimationUtils
88
import androidx.appcompat.app.AppCompatActivity
99
import androidx.core.graphics.ColorUtils
1010
import github.com.st235.expandablebottombar.R
11-
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
12-
import github.com.st235.lib_expandablebottombar.MenuItemDescriptor
11+
import github.com.st235.expandablebottombar.ExpandableBottomBar
12+
import github.com.st235.expandablebottombar.MenuItemDescriptor
1313

1414

1515
class ProgrammaticallyCreatedDemoActivity : AppCompatActivity() {

app/src/main/java/github/com/st235/expandablebottombar/screens/XmlDeclaredActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import androidx.appcompat.app.AppCompatActivity
99
import androidx.appcompat.widget.Toolbar
1010
import androidx.core.graphics.ColorUtils
1111
import github.com.st235.expandablebottombar.R
12-
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
12+
import github.com.st235.expandablebottombar.ExpandableBottomBar
1313

1414
class XmlDeclaredActivity : AppCompatActivity() {
1515

app/src/main/java/github/com/st235/expandablebottombar/screens/navigation/NavigationComponentActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import android.os.Bundle
44
import androidx.appcompat.app.AppCompatActivity
55
import androidx.navigation.Navigation
66
import github.com.st235.expandablebottombar.R
7-
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
8-
import github.com.st235.lib_expandablebottombar.navigation.ExpandableBottomBarNavigationUI
7+
import github.com.st235.expandablebottombar.ExpandableBottomBar
8+
import github.com.st235.expandablebottombar.navigation.ExpandableBottomBarNavigationUI
99

1010
class NavigationComponentActivity: AppCompatActivity() {
1111

app/src/main/res/layout/activity_coordinator_layout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
android:contentDescription="@string/coordinator_base_fab_content_description"
1616
app:srcCompat="@drawable/ic_meow" />
1717

18-
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
18+
<github.com.st235.expandablebottombar.ExpandableBottomBar
1919
android:id="@+id/expandable_bottom_bar"
2020
android:layout_width="match_parent"
2121
android:layout_height="wrap_content"

app/src/main/res/layout/activity_java.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
android:layout_height="match_parent"
88
tools:context=".screens.JavaActivity">
99

10-
<github.com.st235.lib_expandablebottombar.ExpandableBottomBar
10+
<github.com.st235.expandablebottombar.ExpandableBottomBar
1111
android:id="@+id/expandable_bottom_bar"
1212
android:layout_width="0dp"
1313
android:layout_height="wrap_content"

0 commit comments

Comments
 (0)