Skip to content

Commit

Permalink
Update 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
GIGAMOLE committed Apr 11, 2016
1 parent 25c7a16 commit ab38909
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
Or Gradle Maven Central:

```groovy
compile 'com.github.devlight.navigationtabbar:library:1.1.2'
compile 'com.github.devlight.navigationtabbar:library:1.1.3'
```

Or Maven:
Expand All @@ -42,7 +42,7 @@ Or Maven:
<dependency>
<groupId>com.github.devlight.navigationtabbar</groupId>
<artifactId>library</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<type>aar</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: "com.jfrog.bintray"
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven'

version = "1.1.2"
version = "1.1.3"

android {
compileSdkVersion 23
Expand All @@ -29,7 +29,7 @@ android {
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.1.2"
versionName "1.1.3"
}
buildTypes {
release {
Expand Down
23 changes: 14 additions & 9 deletions library/src/main/java/com/gigamole/library/NavigationTabBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -969,12 +969,13 @@ else if (i == mIndex)

// Draw pointer with active color to wrap out active icon
if (mCornersRadius == 0) mIconsCanvas.drawRect(mPointerBounds, mIconPointerPaint);
else mIconsCanvas.drawRoundRect(mPointerBounds, mCornersRadius, mCornersRadius, mIconPointerPaint);
else
mIconsCanvas.drawRoundRect(mPointerBounds, mCornersRadius, mCornersRadius, mIconPointerPaint);

// Draw general bitmap
canvas.drawBitmap(mBitmap, 0.0f, 0.0f, null);
// Draw icons bitmap on top
canvas.drawBitmap( mIconsBitmap, 0.0f, pointerBadgeMargin, null);
canvas.drawBitmap(mIconsBitmap, 0.0f, pointerBadgeMargin, null);

// If is not badged, exit
if (!mIsBadged) return;
Expand Down Expand Up @@ -1068,7 +1069,7 @@ private void updateCurrentModel(
model.mIconMatrix.postScale(
model.mInactiveIconScale + matrixScale, model.mInactiveIconScale + matrixScale,
matrixCenterX, matrixCenterY + (mIsTitled && mTitleMode == TitleMode.ACTIVE ?
mTitleMargin * 0.5f * interpolation : 0.0f)
mTitleMargin * 0.5f * interpolation : 0.0f)
);

mModelTitlePaint.setTextSize(mModelTitleSize * textScale);
Expand Down Expand Up @@ -1097,7 +1098,7 @@ private void updateLastModel(
model.mInactiveIconScale + model.mActiveIconScaleBy - matrixLastScale,
model.mInactiveIconScale + model.mActiveIconScaleBy - matrixLastScale,
matrixCenterX, matrixCenterY + (mIsTitled && mTitleMode == TitleMode.ACTIVE ?
mTitleMargin * 0.5f - (mTitleMargin * 0.5f * lastInterpolation) : 0.0f)
mTitleMargin * 0.5f - (mTitleMargin * 0.5f * lastInterpolation) : 0.0f)
);

mModelTitlePaint.setTextSize(mModelTitleSize * textLastScale);
Expand Down Expand Up @@ -1241,17 +1242,21 @@ public static class Model {
public Model(final Drawable icon, final int color) {
mColor = color;
if (icon != null) {
if(icon instanceof BitmapDrawable) {
mIcon = ((BitmapDrawable) icon).getBitmap();
} else {
mIcon = Bitmap.createBitmap(icon.getIntrinsicWidth(),icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(mIcon);
if (icon instanceof BitmapDrawable) mIcon = ((BitmapDrawable) icon).getBitmap();
else {
mIcon = Bitmap.createBitmap(
icon.getIntrinsicWidth(),
icon.getIntrinsicHeight(),
Bitmap.Config.ARGB_8888
);
final Canvas canvas = new Canvas(mIcon);
icon.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
icon.draw(canvas);
}
} else {
mIcon = Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565);
}

mBadgeAnimator.addListener(new Animator.AnimatorListener() {

@Override
Expand Down

0 comments on commit ab38909

Please sign in to comment.