Skip to content

Commit

Permalink
Restructured whole project for better navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashok-Varma committed May 19, 2016
1 parent cc7d054 commit e58435e
Show file tree
Hide file tree
Showing 91 changed files with 48 additions and 24 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-BottomNavigation-green.svg?style=true)](https://android-arsenal.com/details/1/3612)


# BottomNavigation

**get sample apk from [Google Play Store][googlePlayStoreLink]**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.graphics.Color;
import android.support.annotation.ColorRes;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
Expand Down Expand Up @@ -224,7 +225,7 @@ protected BadgeItem setTextView(TextView mTextView) {
*/
protected int getBackgroundColor(Context context) {
if (this.mBackgroundColorResource != 0) {
return context.getResources().getColor(mBackgroundColorResource);
return ContextCompat.getColor(context, mBackgroundColorResource);
} else if (!TextUtils.isEmpty(mBackgroundColorCode)) {
return Color.parseColor(mBackgroundColorCode);
} else {
Expand All @@ -238,7 +239,7 @@ protected int getBackgroundColor(Context context) {
*/
protected int getTextColor(Context context) {
if (this.mTextColorResource != 0) {
return context.getResources().getColor(mTextColorResource);
return ContextCompat.getColor(context, mTextColorResource);
} else if (!TextUtils.isEmpty(mTextColorCode)) {
return Color.parseColor(mTextColorCode);
} else {
Expand All @@ -259,7 +260,7 @@ protected CharSequence getText() {
*/
protected int getBorderColor(Context context) {
if (this.mBorderColorResource != 0) {
return context.getResources().getColor(mBorderColorResource);
return ContextCompat.getColor(context, mBorderColorResource);
} else if (!TextUtils.isEmpty(mBorderColorCode)) {
return Color.parseColor(mBorderColorCode);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.support.annotation.ColorRes;
import android.support.annotation.IntDef;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
Expand Down Expand Up @@ -256,7 +257,7 @@ public BottomNavigationBar setBackgroundStyle(@BackgroundStyle int backgroundSty
* @return this, to allow builder pattern
*/
public BottomNavigationBar setActiveColor(@ColorRes int activeColor) {
this.mActiveColor = getContext().getResources().getColor(activeColor);
this.mActiveColor = ContextCompat.getColor(getContext(), activeColor);
return this;
}

Expand All @@ -274,7 +275,7 @@ public BottomNavigationBar setActiveColor(String activeColorCode) {
* @return this, to allow builder pattern
*/
public BottomNavigationBar setInActiveColor(@ColorRes int inActiveColor) {
this.mInActiveColor = getContext().getResources().getColor(inActiveColor);
this.mInActiveColor = ContextCompat.getColor(getContext(), inActiveColor);
return this;
}

Expand All @@ -292,7 +293,7 @@ public BottomNavigationBar setInActiveColor(String inActiveColorCode) {
* @return this, to allow builder pattern
*/
public BottomNavigationBar setBarBackgroundColor(@ColorRes int backgroundColor) {
this.mBackgroundColor = getContext().getResources().getColor(backgroundColor);
this.mBackgroundColor = ContextCompat.getColor(getContext(), backgroundColor);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected boolean isInActiveIconAvailable() {
*/
protected int getActiveColor(Context context) {
if (this.mActiveColorResource != 0) {
return context.getResources().getColor(mActiveColorResource);
return ContextCompat.getColor(context, mActiveColorResource);
} else if (!TextUtils.isEmpty(mActiveColorCode)) {
return Color.parseColor(mActiveColorCode);
} else if (this.mActiveColor != 0) {
Expand All @@ -233,7 +233,7 @@ protected int getActiveColor(Context context) {
*/
protected int getInActiveColor(Context context) {
if (this.mInActiveColorResource != 0) {
return context.getResources().getColor(mInActiveColorResource);
return ContextCompat.getColor(context, mInActiveColorResource);
} else if (!TextUtils.isEmpty(mInActiveColorCode)) {
return Color.parseColor(mInActiveColorCode);
} else if (this.mInActiveColor != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
android:id="@+id/fixed_bottom_navigation_icon"
android:layout_width="@dimen/fixed_icon_grid"
android:layout_height="@dimen/fixed_icon_grid"
android:contentDescription="@string/icon"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="fitXY" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:layout_width="@dimen/shifting_icon_grid"
android:layout_height="@dimen/shifting_icon_grid"
android:layout_gravity="center"
android:contentDescription="@string/icon"
android:gravity="center"
android:scaleType="fitXY" />

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions library/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="icon">icon</string>
</resources>
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/build.gradle → sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile project(':bottom-navigation-bar')
compile project(':library')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ashokvarma.bottomnavigation.sample">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -19,5 +21,5 @@
android:value="8ce6f72ae4c61f33d852ccccb2caab802b8f1113" />
</application>

<uses-permission android:name="android.permission.INTERNET" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="MODE_FIXED" />
android:text="@string/mode_fixed" />

<CheckBox
android:id="@+id/mode_shifting"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="MODE_SHIFTING" />
android:text="@string/mode_shifting" />
</LinearLayout>

<LinearLayout
Expand All @@ -46,15 +46,15 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="BS_STATIC" />
android:text="@string/bs_static" />

<CheckBox
android:id="@+id/bg_ripple"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="BS_RIPPLE" />
android:text="@string/bs_ripple" />
</LinearLayout>

<LinearLayout
Expand All @@ -67,30 +67,30 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="3 items" />
android:text="@string/_3_items" />

<CheckBox
android:id="@+id/items_4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4 items" />
android:text="@string/_4_items" />

<CheckBox
android:id="@+id/items_5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="5 items" />
android:text="@string/_5_items" />
</LinearLayout>

<CheckBox
android:id="@+id/auto_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Auto hide badge" />
android:text="@string/auto_hide_badge" />

<LinearLayout
android:layout_width="wrap_content"
Expand All @@ -103,14 +103,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Toggle Hide" />
android:text="@string/toggle_hide" />

<Button
android:id="@+id/toggle_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Toggle Badge" />
android:text="@string/toggle_badge" />

</LinearLayout>

Expand All @@ -119,14 +119,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="20dp" />
android:textSize="20sp" />

<TextView
android:id="@+id/scrollable_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="16dp" />
android:textSize="16sp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<item
android:id="@+id/menu_github"
android:title="Github"
android:title="@string/github"
android:icon="@drawable/ic_link_white_24dp"
app:showAsAction="ifRoom" />
</menu>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e58435e

Please sign in to comment.