1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Drain Droids

Android Studio For Beginners.Mobile Apps.Android Games.

Saturday, February 9, 2019

How to display android Bullet icon in Textview


Understanding how to make a list of line and android Bullet icon matters with the texView. In this tutorial, we will learn how to put bullet in front of line in android studio. Let assuming you want to do something like



5 Health Benefit of Eating Egg- For this, simply introduce a button, bolt it, and change Text Color to Black and Remove Background color. 


<Button
    android:id="@+id/button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:textColor="#454545"
    android:background="@null"
    android:text="5 Health Benefit of Eating Egg " />
To make the android Bullet icon, we will add this code \u25A0 in front of each sentence 
We will have something like this.The first \n only make the line while the \u25A0 displays bullets 
\n\u25A0 High in Cholesterol 
\n\u25A0 Raise HDL Cholesterol
\n\u25A0 Reduced Heart Disease
\n\u25A0 Protein Quality is high
\n\u25A0 High Nutritious

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <Button
                android:id="@+id/button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textStyle="bold"
                android:textColor="#454545"
                android:background="@null"
                android:text="5 Health Benefit of Eating Egg " />

            <TextView
                android:id="@+id/textView3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="
\n\u25A0 High in Cholesterol
\n\u25A0 Raise HDL Cholesterol
\n\u25A0 Reduced Heart Disease
\n\u25A0 Protein Quality is high
\n\u25A0 High Nutritious
" />
        </LinearLayout>
    </ScrollView>
</android.support.constraint.ConstraintLayout>

There are other android Bullet icon you can use If you don’t want the above bullet, you can see bellow other android Bullet icon style options.
• = \u2022, �-� = \u25CF, �-� = \u25CB, ▪ = \u25AA, □ = \u25A1, ► = \u25BA
Hope that was helpful Copy and paste the code to see result