Comments (8)
from space-navigation-view.
this enhancement is more more more recommended and this is all I want from this awesome library.
please, Thank you
from space-navigation-view.
Please add it to your library.
from space-navigation-view.
i think this is basic requirement you should add it
from space-navigation-view.
You can do this by modifying the space_item_view.xml as below
<LinearLayout
android:id="@+id/main_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<ImageView
android:id="@+id/space_icon"
android:layout_width="@dimen/space_item_icon_default_size"
android:layout_gravity="center_horizontal"
android:src="@drawable/near_me"
android:layout_height="@dimen/space_item_icon_default_size" />
<TextView
android:id="@+id/space_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lines="1"
android:textSize="@dimen/space_item_text_default_size"
tools:text="Label One" />
</LinearLayout>
<RelativeLayout
android:id="@+id/badge_container"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/badge_left_margin"
android:layout_marginRight="2dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/main_content"
android:visibility="gone">
<TextView
android:id="@+id/badge_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="10sp"
android:textStyle="bold" />
</RelativeLayout>
from space-navigation-view.
Seems like there is no solution, I mean I tried a method, setTextAlignment() or sth like that, but whatever value I pass in this method, no change in the icon and text.
from space-navigation-view.
i solve this problem with below example.
You can do this by modifying the space_item_view.xml as below
<RelativeLayout
android:id="@+id/main_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<ImageView
android:id="@+id/space_icon"
android:layout_width="@dimen/space_item_icon_default_size"
android:layout_gravity="center"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_height="@dimen/space_item_icon_default_size" />
<TextView
android:id="@+id/space_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:lines="1"
android:layout_centerHorizontal="true"
android:layout_below="@+id/space_icon"
android:gravity="center"
android:textSize="@dimen/space_item_text_default_size"
tools:text="Label One" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/badge_container"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/badge_left_margin"
android:layout_marginRight="2dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/main_content"
android:visibility="gone">
<TextView
android:id="@+id/badge_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="10sp"
android:textStyle="bold" />
</RelativeLayout>
then you go to SpaceNavigationView.java class and modify this only.
public void showIconOnly(boolean value) {
isIconOnlyMode = value;
}
and in your activity/fragment where you want to implement this simply replace this spaceNavigationView.showIconOnly(); to spaceNavigationView.showIconOnly(false);
and voilla! your problem is solved
from space-navigation-view.
@kashifansari786 Can we modify SpaceNavigationView.java
? And How can we use space_item_view.xml
in the space navigation menu? Help me.
from space-navigation-view.
Related Issues (20)
- You can add shadows
- get Current item HOT 1
- How to show badge in centre button HOT 1
- setSelectedItem not available HOT 1
- How to create an activity by clicking on the bottom navigation button HOT 3
- how to changeCurrentItem(int tabIndexToSelect) ?
- How to increase size of center button icon. HOT 1
- Can't get space navigation border without activity's background color in a fragment. HOT 1
- How to remove redundant white space?
- Inactivity
- Icon and text should be possible to use it in two horizontal, vertical positions HOT 1
- Space navogation view
- Make icon of center item bigger than the rest
- Unable to find library on github anymore HOT 1
- Crashing on some devices after switching to Android Bundle HOT 1
- How to implementing Viewpager with this tablayout?
- Center item changes icon color on rotation
- setCentreButtonColor() does nothing and changeCenterButtonIcon() resets icon filter to black HOT 3
- app:centre_part_linear not found.
- Badgede display misplacement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from space-navigation-view.