Skip to content

Commit

Permalink
Merge remote-tracking branch 'master/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpopli1891 committed Oct 14, 2016
2 parents 1dc5e3f + 30789d7 commit 69bf4f0
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .idea/dictionaries/Chatikyan.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Download sample [apk][7]

Gradle:
```groovy
compile 'com.github.armcha:SpaceNavigationView:1.3.2'
compile 'com.github.armcha:SpaceNavigationView:1.4.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.armcha</groupId>
<artifactId>SpaceNavigationView</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
<type>pom</type>
</dependency>
```
Expand Down Expand Up @@ -264,13 +264,22 @@ Set centre button icon color
```java
spaceNavigationView.setCentreButtonIconColor(ContextCompat.getColor(context,R.color.yourColor));
```
If you want to disable default white color filter, just call
```java
spaceNavigationView.setCentreButtonIconColorFilterEnabled(false);
```

[10]: https://github.com/armcha/Space-Navigation-View/issues/16
[11]: https://github.com/armcha/Space-Navigation-View/issues/18
[12]: https://github.com/armcha/Space-Navigation-View/issues/17
[13]: https://github.com/armcha/Space-Navigation-View/issues/25

##Versions

##1.4.0
* Added method do disable centre button default color filter
* Fixed issue [#25][13]

##1.3.2
* Added method setCentreButtonIconColor [#17][12]

Expand Down
2 changes: 1 addition & 1 deletion Sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.luseen.spacenavigationview"
minSdkVersion 14
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.luseen.spacenavigationview;

import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
Expand All @@ -26,15 +27,15 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
spaceNavigationView = (SpaceNavigationView) findViewById(R.id.space);
spaceNavigationView.initWithSaveInstanceState(savedInstanceState);
spaceNavigationView.addSpaceItem(new SpaceItem("HOME", R.drawable.home));
spaceNavigationView.addSpaceItem(new SpaceItem("HOME", R.drawable.account));
spaceNavigationView.addSpaceItem(new SpaceItem("SEARCH", R.drawable.magnify));
//spaceNavigationView.addSpaceItem(new SpaceItem("LIKE", R.drawable.bell));
//spaceNavigationView.addSpaceItem(new SpaceItem("ACCOUNT", R.drawable.account));
//spaceNavigationView.showIconOnly();
spaceNavigationView.shouldShowFullBadgeText(true);
spaceNavigationView.setCentreButtonIconColorFilterEnabled(false);

//spaceNavigationView.setCentreButtonIconColor(ContextCompat.getColor(this,R.color.colorPrimary));

Expand All @@ -46,6 +47,7 @@ protected void onCreate(Bundle savedInstanceState) {
public void onCentreButtonClick() {
Log.d("onCentreButtonClick ", "onCentreButtonClick");
spaceNavigationView.shouldShowFullBadgeText(true);
//Snackbar.make(spaceNavigationView,"Deleted Saved Selection.", Snackbar.LENGTH_LONG).show();
}

@Override
Expand All @@ -71,6 +73,17 @@ public void onItemLongClick(int itemIndex, String itemName) {
}
});

setUpRecyclerView();
}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
spaceNavigationView.onSaveInstanceState(outState);
}

private void setUpRecyclerView() {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
RecyclerAdapter adapter = new RecyclerAdapter(dummyStrings());
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
Expand All @@ -85,13 +98,6 @@ public void onClick(int position) {
}
}
});

}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
spaceNavigationView.onSaveInstanceState(outState);
}

private List<String> dummyStrings() {
Expand Down
Binary file added Sample/src/main/res/drawable/account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Sample/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<resources>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
Expand Down
4 changes: 2 additions & 2 deletions spacelib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
buildToolsVersion "24.0.3"

defaultConfig {
minSdkVersion 14
Expand Down Expand Up @@ -32,7 +32,7 @@ dependencies {
publish {
groupId = 'com.github.armcha'
artifactId = 'SpaceNavigationView'
publishVersion = '1.3.2'
publishVersion = '1.4.0'
desc = 'Spaces Navigation View'
licences = ['MIT']
website = 'https://github.com/armcha/Space-Navigation-View'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
Expand All @@ -42,6 +43,7 @@
import java.util.HashMap;
import java.util.List;

//@CoordinatorLayout.DefaultBehavior(SpaceNavigationViewBehavior.class)
public class SpaceNavigationView extends RelativeLayout {

private static final String TAG = "SpaceNavigationView";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.luseen.spacenavigation;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Interpolator;

/**
* Created by Chatikyan on 13.10.2016.
*/

public class SpaceNavigationViewBehavior<V extends View> extends CoordinatorLayout.Behavior<V> {

public SpaceNavigationViewBehavior(Context context, AttributeSet attrs) {
super();
}

public SpaceNavigationViewBehavior() {
super();
}

@Override
public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) {
return dependency instanceof Snackbar.SnackbarLayout;
}

@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, final V child, View dependency) {
float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
child.setTranslationY(translationY);
return true;
}
}

0 comments on commit 69bf4f0

Please sign in to comment.