Skip to content

Commit

Permalink
version 1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashok-Varma authored and Ashok-Varma committed Apr 10, 2016
1 parent 30f853d commit 7e7bebf
Show file tree
Hide file tree
Showing 10 changed files with 391 additions and 124 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ Download [the latest JAR][mavenAarDownload] or grab via Maven:
<dependency>
<groupId>com.ashokvarma.android</groupId>
<artifactId>bottom-navigation-bar</artifactId>
<version>0.9.8</version>
<version>1.0.0</version>
<type>pom</type>
</dependency>
```
or Gradle:
```groovy
compile 'com.ashokvarma.android:bottom-navigation-bar:0.9.8'
compile 'com.ashokvarma.android:bottom-navigation-bar:1.0.0'
```
or Ivy:
```xml
<dependency org='com.ashokvarma.android' name='bottom-navigation-bar' rev='0.9.8'>
<dependency org='com.ashokvarma.android' name='bottom-navigation-bar' rev='1.0.0'>
<artifact name='$AID' ext='pom'></artifact>
</dependency>
```
Expand Down Expand Up @@ -163,5 +163,5 @@ limitations under the License.
```

[googlePage]: https://www.google.com/design/spec/components/bottom-navigation.html
[mavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/bottom-navigation-bar/0.9.8/bottom-navigation-bar-0.9.8.aar
[mavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/bottom-navigation-bar/1.0.0/bottom-navigation-bar-1.0.0.aar
[mavenLatestJarDownload]: https://search.maven.org/remote_content?g=com.ashokvarma.android&a=bottom-navigation-bar&v=LATEST
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
}

ext {
supportLibraryVersion = '23.2.1'
supportLibraryVersion = '23.3.0'
}

dependencies {
Expand Down
109 changes: 61 additions & 48 deletions app/src/main/java/com/ashokvarma/sample/BottomNavigationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ public class BottomNavigationActivity extends AppCompatActivity implements View.
CheckBox items4;
CheckBox items5;

Button refresh;
Button toggleHide;

TextView message;
TextView scrollableText;

int lastSelectedPosition = 0;

boolean hidden = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -46,7 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
items4 = (CheckBox) findViewById(R.id.items_4);
items5 = (CheckBox) findViewById(R.id.items_5);

refresh = (Button) findViewById(R.id.refresh);
toggleHide = (Button) findViewById(R.id.toggle_hide);

message = (TextView) findViewById(R.id.message);
scrollableText = (TextView) findViewById(R.id.scrollable_text);
Expand All @@ -59,60 +61,24 @@ protected void onCreate(Bundle savedInstanceState) {
items4.setOnCheckedChangeListener(this);
items5.setOnCheckedChangeListener(this);

refresh.setOnClickListener(this);
toggleHide.setOnClickListener(this);

bottomNavigationBar.setTabSelectedListener(this);

onClick(refresh);
refresh();
}

@Override
public void onClick(View v) {

if (v.getId() == R.id.refresh) {
bottomNavigationBar.clearAll();

setScrollableText(lastSelectedPosition);

if (modeClassic.isChecked()) {
bottomNavigationBar.setMode(BottomNavigationBar.MODE_CLASSIC);
} else if (modeShifting.isChecked()) {
bottomNavigationBar.setMode(BottomNavigationBar.MODE_SHIFTING);
}

if (bgStatic.isChecked()) {
bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC);
} else if (bgRipple.isChecked()) {
bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_RIPPLE);
}

if (items3.isChecked()) {
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_location_on_white_24dp, "Location").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_find_replace_white_24dp, "Find").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_favorite_white_24dp, "Favorites").setActiveColor(R.color.blue))
.setFirstSelectedPosition(lastSelectedPosition > 2 ? 2 : lastSelectedPosition)
.initialise();
} else if (items4.isChecked()) {
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_home_white_24dp, "Home").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_book_white_24dp, "Books").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_music_note_white_24dp, "Music").setActiveColor(R.color.blue))
.addItem(new BottomNavigationItem(R.drawable.ic_tv_white_24dp, "Movies & TV").setActiveColor(R.color.brown))
.setFirstSelectedPosition(lastSelectedPosition > 3 ? 3 : lastSelectedPosition)
.initialise();
} else {
items5.setChecked(true);
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_home_white_24dp, "Home").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_book_white_24dp, "Books").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_music_note_white_24dp, "Music").setActiveColor(R.color.blue))
.addItem(new BottomNavigationItem(R.drawable.ic_tv_white_24dp, "Movies & TV").setActiveColor(R.color.brown))
.addItem(new BottomNavigationItem(R.drawable.ic_videogame_asset_white_24dp, "Games").setActiveColor(R.color.grey))
.setFirstSelectedPosition(lastSelectedPosition)
.initialise();
if (v.getId() == R.id.toggle_hide) {
if (bottomNavigationBar != null) {
if (hidden) {
bottomNavigationBar.unHide();
} else {
bottomNavigationBar.hide();
}
hidden = !hidden;
}

}
}

Expand Down Expand Up @@ -150,6 +116,53 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
}
break;
}
refresh();
}

private void refresh() {

bottomNavigationBar.clearAll();

setScrollableText(lastSelectedPosition);

if (modeClassic.isChecked()) {
bottomNavigationBar.setMode(BottomNavigationBar.MODE_CLASSIC);
} else if (modeShifting.isChecked()) {
bottomNavigationBar.setMode(BottomNavigationBar.MODE_SHIFTING);
}

if (bgStatic.isChecked()) {
bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC);
} else if (bgRipple.isChecked()) {
bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_RIPPLE);
}

if (items3.isChecked()) {
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_location_on_white_24dp, "Location").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_find_replace_white_24dp, "Find").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_favorite_white_24dp, "Favorites").setActiveColor(R.color.blue))
.setFirstSelectedPosition(lastSelectedPosition > 2 ? 2 : lastSelectedPosition)
.initialise();
} else if (items4.isChecked()) {
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_home_white_24dp, "Home").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_book_white_24dp, "Books").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_music_note_white_24dp, "Music").setActiveColor(R.color.blue))
.addItem(new BottomNavigationItem(R.drawable.ic_tv_white_24dp, "Movies & TV").setActiveColor(R.color.brown))
.setFirstSelectedPosition(lastSelectedPosition > 3 ? 3 : lastSelectedPosition)
.initialise();
} else {
items5.setChecked(true);
bottomNavigationBar
.addItem(new BottomNavigationItem(R.drawable.ic_home_white_24dp, "Home").setActiveColor(R.color.orange))
.addItem(new BottomNavigationItem(R.drawable.ic_book_white_24dp, "Books").setActiveColor(R.color.teal))
.addItem(new BottomNavigationItem(R.drawable.ic_music_note_white_24dp, "Music").setActiveColor(R.color.blue))
.addItem(new BottomNavigationItem(R.drawable.ic_tv_white_24dp, "Movies & TV").setActiveColor(R.color.brown))
.addItem(new BottomNavigationItem(R.drawable.ic_videogame_asset_white_24dp, "Games").setActiveColor(R.color.grey))
.setFirstSelectedPosition(lastSelectedPosition)
.initialise();
}
}

@Override
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/res/layout/activity_bottom_navigation.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -9,8 +8,7 @@

<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -88,11 +86,11 @@
</LinearLayout>

<Button
android:id="@+id/refresh"
android:id="@+id/toggle_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Refresh" />
android:text="Toggle Hide" />

<TextView
android:id="@+id/message"
Expand Down
4 changes: 2 additions & 2 deletions bottom-navigation-bar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/Ashok-Varma/bottomnavigation'
gitUrl = 'https://github.com/Ashok-Varma/bottomnavigation.git'

libraryVersion = '0.9.8'
libraryVersion = '1.0.0'

developerId = 'Ashok-Varma'
developerName = 'Ashok Varma'
Expand Down Expand Up @@ -43,7 +43,7 @@ android {
}

ext {
supportLibraryVersion = '23.2.1'
supportLibraryVersion = '23.3.0'
}

dependencies {
Expand Down
Loading

0 comments on commit 7e7bebf

Please sign in to comment.