You can create your own view using Slant top using Canvas, and then place it on top of your text element to achieve this look.
Code snippet for slant top custom view :- public class SlantView extends View { private Context mContext; Paint paint ; Path path; public SlantView(Context ctx, AttributeSet attrs) { super(ctx, attrs); mContext = ctx; setWillNotDraw(false); paint = new Paint(Paint.ANTI_ALIAS_FLAG); } @Override protected void onDraw(Canvas canvas) { int w = getWidth(), h = getHeight(); paint.setStrokeWidth(2); paint.setColor(Color.WHITE); paint.setStyle(Paint.Style.FILL_AND_STROKE); paint.setAntiAlias(true); path = new Path(); path.setFillType(Path.FillType.EVEN_ODD); path.moveTo(0,0); path.lineTo(0,h); path.lineTo(w,h); path.close(); canvas.drawPath(path, paint); } }
Code snippet for use with TextView
<com.pix.app.views.SlantView android:layout_width="match_parent" android:layout_height="30dp" android:id="@+id/slant_view" /> <TextView-----/>

source share