Remove arrow icon from expendable card view android - java

I am using https://github.com/AleSpero/ExpandableCardView library to make an expendable card view. But i don't need the arrow placed in right side.
I also try to find for the attribute or method that can remove this but don't find any one. Please help me to solve this. I will be very grateful. Thanks in advance for your time.
card.setIcon(null);
but it remove only the left icon not the right icon.

Just add this lineandroid:groupIndicator="#null"
<ExpandableListView
android:id="#+id/ev_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="188dp"
android:background="#android:color/white"
android:dividerHeight="0dp"
android:groupIndicator="#null" />

On your MainActivity please use below code
val card : ImageButton = findViewById(R.id.card_arrow)
card.visibility=View.INVISIBL
or remove icon from this xml file expandable_cardview
<ImageButton
android:id="#+id/card_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_alignParentEnd="true"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="#string/expandable_card_view_image_content_description"/>

Related

Bottomnavigation: graphical glitch of the button

I am using BottomNavigation for my layout and after I press one button and change the page, the button looks as if I am still pressing it. It helps me if someone can give me a solution.
XML file
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:menu="#menu/bottom_nav_menu"
android:background="?android:attr/windowBackground"/>
The glitch:

Android EditText android:text not working

EditText
android:textSize="18.0sp"
android:textColor="#color/red"
android:id="#id/et_server_url"
android:layout_width="fill_parent"
android:layout_height="0.0dip"
android:layout_marginLeft="50.0dip"
android:layout_marginTop="10.0dip"
android:layout_marginRight="50.0dip"
android:text="#string/serverurl"
android:layout_weight="0.8"
android:layout_toRightOf="#id/iv_logo"
android:layout_below="#id/et_email"
android:layout_centerHorizontal="true"
android:enabled="false" />
In this code, Text is not displaying .
Note: I have to change this only in the layout. I didn't have any java files.so
try
android:background="#null"
or
android:background="#android:color/transparent"
in programmatically
setBackgroundDrawable(null);
or
setBackgroundColor(getResources().getColor(android.R.color.transparent))
I think you are using this edit text inside a RelativeLayout. So, remove this property and add height.
Remove this:-
android:layout_weight="0.8"
And Add this:-
android:layout_height="wrap_content"
You will be good to go.
And use,
EditText et_server_url = findViewById(R.id.et_server_url);
et_server_url.setEnabled(false); //To make it disabled
and
et_server_url.setEnabled(true); //to make it enabled
try to use this code
<EditText
android:id="#id/et_server_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/et_email"
android:layout_centerHorizontal="true"
android:layout_marginLeft="50.0dip"
android:layout_marginRight="50.0dip"
android:layout_marginTop="10.0dip"
android:layout_toRightOf="#id/iv_logo"
android:background="#drawable/background_editext"
android:fontFamily="sans-serif"
android:inputType="none"
android:paddingLeft="20.0dip"
android:paddingRight="20.0dip"
android:text="#string/serverurl"
android:textColor="#color/red"
android:textSize="18.0sp" />
you're hiding yout EditText that is why you can't see or edit it
bro your code working you can check android:text="#string/text" to android:text="text"
use hardcore string and check coz i am copy your code its working fine ...
and generally edittext use android:hint not android:text
and you can also set editable="false" in android:hint using...
check its may help you...otherwise tell me ..

Java Android Studio: Image View not loading from Drawable folder

I've been working on a simple java application, and wanted to add a logo as the homescreen is fairly empty. I tried using an image view, and after it didn't work I googled tutorials to make sure I was initiating it correctly. I didn't see any difference, but the actual image wouldn't load.
Xml code for image view:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src = "#drawable/logo"
android:layout_gravity="center"
android:contentDescription="#string/logo"
android:layout_below="#+id/textView"
android:layout_above="#+id/txtBody"
android:layout_alignRight="#+id/txtBody"
android:layout_alignEnd="#+id/txtBody"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:visibility="visible"
android:maxHeight="600dp"
android:maxWidth="600dp"
android:minHeight="100dp"
android:minWidth="100dp"
android:clickable="false" />
And here's a picture of the layout preview (With an arrow pointing to the outline of where it should be, and the resource circled in the correct folder) along with a picture of the logo
Any dice if you add
android:scaleType="fitCenter"
android:adjustViewBounds="true"
Edit: also are we sure nothing is overlapping it?

How to make marquee in android repeat just once

I have tried marquee limit 1 but it does not work
<TextView
android:id="#+id/marqueText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:marqueeRepeatLimit="1"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:gravity="center"
android:singleLine="true"
android:textSize="26sp" />
</RelativeLayout>
It seems to me that you are looking for the marquee animation. There is no XML attribute that you set for that purpose
This is a good link for the marquee animation in android. Hope it helps!
The XML attribute simply fades the textview if it goes out of your device screen.
Try using setSelected(true) method of TextView in onCreate()
TextView textView = (TextView) findViewById(R.id.marqueText);
textView.setSelected(true);

Android - Sliding Drawer Hang Out (Stuck Out)?

how to make the content of the sliding drawer a little "stuck out" (hang out)?
After pull
You can't do it with the stock widget.
However, someone asked about this before and an answer was posted by someone who has made a class to allow you to do just that. Follow the answer link for instructions.
The code is here
Here is an example to do it within your XML file
<SlidingDrawer
android:id="#+id/drawer"
android:layout_width = "320dp" //set what ever dimensions you find appopriate
android:layout_height = "440dp"
android:orientation = "vertical"
android:handle="#+id/handle"
android:content="#+id/content">
<ImageView
android:id="#+id/handle"
android:layout_width="48dp" // Set your dimensions. This will be your handle
android:layout_height="48dp"
android:src="#drawable/putHandleImageHere" />
<TextView android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text ="Hello World" />
---------------EDIT------------------
I reread your question and I see that your trying to have the content hang out. Try using
android:paddingTop="10dp"
or
android:layout_marginTop="10dp"
Let me know if that worked, good luck.

Categories