Code Monkey home page Code Monkey logo

Comments (8)

kashifansari786 avatar kashifansari786 commented on September 13, 2024 1

from space-navigation-view.

AbdelQuddous avatar AbdelQuddous commented on September 13, 2024

this enhancement is more more more recommended and this is all I want from this awesome library.
please, Thank you

from space-navigation-view.

majidkabir avatar majidkabir commented on September 13, 2024

Please add it to your library.

from space-navigation-view.

rasik1010 avatar rasik1010 commented on September 13, 2024

i think this is basic requirement you should add it

from space-navigation-view.

tai-nguyen175 avatar tai-nguyen175 commented on September 13, 2024

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.

pfieffer avatar pfieffer commented on September 13, 2024

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.

kashifansari786 avatar kashifansari786 commented on September 13, 2024

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.

pfieffer avatar pfieffer commented on September 13, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.