How can I draw this graph in Android using XML?


João Correia

I'm trying to draw a form in an image in Android XML. But so far my attempts have been unsuccessful. what should I do?

arrow

Thanks in advance

place

If you use RelativeLayout, you can make a black rectangle and put a white triangle image on top. I can't see how it could be a triangle without an image.

Well, I must have been a little brain dead yesterday. This is a better solution.

layout:

  <RelativeLayout android:layout_width="300dp"
                  android:layout_height="100dp"
                  android:layout_centerVertical="true"
                  android:layout_centerHorizontal="true"
                  android:background="@android:color/black">

       <View android:layout_width="100dp"
             android:layout_alignParentRight="true"
             android:layout_height="match_parent"
             android:background="@drawable/background_triangle_right"/>

  </RelativeLayout>

Drawable that draws triangles:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">



<item>
    <rotate
            android:fromDegrees="45"
            android:toDegrees="45"
            android:pivotX="87%"
            android:pivotY="140%">
        <shape
                android:shape="rectangle">
            <stroke android:color="@android:color/white" android:width="10dp"/>
            <solid
                    android:color="@android:color/white"/>
        </shape>
    </rotate>
</item>

</layer-list>

Related


How can I draw this graph in Android using XML?

João Correia I'm trying to draw a form in an image in Android XML. But so far my attempts have been unsuccessful. what should I do? Thanks in advance place If you use RelativeLayout, you can make a black rectangle and put a white triangle image on top. I can't

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw such a graph in Python?

Santos I want to draw a graph like the image below: I wrote the following code to plot the waveform for each time step. import matplotlib.pyplot as plt import numpy as np def u_0(x): a = 1.0/np.cosh(2.0*(x+8.0)) b = 1.0/np.cosh((x+1.0)) return 8.0

How can I draw this graph in Excel?

Pablo I have a CSV file with the following data This series has 500 rows. However, I need to plot whatever is on column A as the horizontal axis and whatever is on column B [0..499] as the vertical axis. I would like to label the horizontal axis values at ever

How can I draw a complete graph in R?

Mrsteve I want to draw complete graphs in R. How can I do this? I've only found one package on CRAN that has the ability to generate a full graph. But this package (i.e. "RnavGraph") is not installed but exits with error status. Further searching seems to be d

How can I draw this graph in R?

cooldood3490 I want to draw speedVS. Data are as follows:age Speed Age 15 <18 30 18-25 40 26-40 32 40+ How can I plot this as a scatterplot in R? I don't know how to do range. So far this is what I have. speed<-c(15,30,40,32) Peter Accu

How can I draw such a graph in Python?

Santos I want to draw a graph like the image below: I wrote the following code to plot the waveform for each time step. import matplotlib.pyplot as plt import numpy as np def u_0(x): a = 1.0/np.cosh(2.0*(x+8.0)) b = 1.0/np.cosh((x+1.0)) return 8.0

How can I draw this graph in Excel?

Pablo I have a CSV file with the following data This series has 500 rows. However, I need to plot whatever is on column A as the horizontal axis and whatever is on column B [0..499] as the vertical axis. I would like to label the horizontal axis values at ever

How can I draw this graph in R?

cooldood3490 I want to draw speedVS. Data are as follows:age Speed Age 15 <18 30 18-25 40 26-40 32 40+ How can I plot this as a scatterplot in R? I don't know how to do range. So far this is what I have. speed<-c(15,30,40,32) Peter Accu

I can't draw this graph

Dana Cassio Costa I've been trying to draw this graph all night. Please, can someone help me? Here's what I've done so far. The constant function is in the middle of the plot, not sure why, I can't add smaller ticks to the bottom and top of the plot. theta = c

I can't draw this graph

Dana Cassio Costa I've been trying to draw this graph all night. Please, can someone help me? Here's what I've done so far. The constant function is in the middle of the plot, not sure why, I can't add smaller ticks to the bottom and top of the plot. theta = c

I can't draw this graph

Dana Cassio Costa I've been trying to draw this graph all night. Please, can someone help me? Here's what I've done so far. The constant function is in the middle of the plot, not sure why, I can't add smaller ticks to the bottom and top of the plot. theta = c

I can't draw this graph

Dana Cassio Costa I've been trying to draw this graph all night. Please, can someone help me? Here's what I've done so far. The constant function is in the middle of the plot, not sure why, I can't add smaller ticks to the bottom and top of the plot. theta = c

I can't draw this graph

Dana Cassio Costa I've been trying to draw this graph all night. Please, can someone help me? Here's what I've done so far. The constant function is in the middle of the plot, not sure why, I can't add smaller ticks to the bottom and top of the plot. theta = c

How can I draw a legend for this graph with many features?

LAD: I have a matrix with Xonly 1 row as input . I have a matrix Ywith each row as the output of a function. If Ythere are 5 lines, then we have 5 different functions. I use the following code to plot all functions on the same graph: import numpy as np import