‫In this tutorial, we are going to talk about stroke patterns.
‫The default stroke pattern is a solid line for polylines and for the outlines of polygons and circles.
‫You can specify a custom pattern stroke pattern of pattern item objects where each item is a dot, a
‫dash or a gap.
‫Hello guys and welcome to Master Coding Channel and the complete Android Developer course.
‫Let's go back to the to Android studio and create a list.
‫So what this list will contain will contain of a general generics of type pattern items.
‫So first of all, I create a list pattern item and I will call it as a pattern and I will create an
‫array of arrays, dot as list and I will pass new.
‫Dot.
‫Method and I will put a gap new.
‫Gap.
‫As I told you, there are three types Gap dash or dot.
‫And I will specify here as a long of ten length of ten.
‫So now let's let's see how it works.
‫I will create a polyline.
‫We have seen before how to create a polyline.
‫First of all, I create a polyline option.
‫Called option equal new polyline options.
‫And I will add my marker one or lat long one and M2 and I will add M3 and I will add also M4.
‫These are the lat long that I have created before.
‫Okay.
‫And back to the to our polyline options.
‫I will add the comma.
‫I will create a polyline.
‫Here option and polyline is created by polyline.
‫It p equal new or sorry m map dot add polyline and I will pass the option and here we specify first
‫before we run it, I will show you how it looks like in default one because it is a solid line as default.
‫This is the default one I will create now a polyline.
‫Polyline or p dot set pattern.
‫Set pattern as a pattern that we have created and click run.
‫And here we go.
‫So, guys, it is that dashed and there is a gap for ten.
‫So let's see if we remove the value.
‫There is an error.
‫I will specify also a new dash of a 30 value 30.
‫Let's see it.
‫It will be.
‫It will be a dashed like this.
‫Let's look like.
‫Good.
‫Good shape.
‫Okay, so in this way, we have making it as dashed.
‫Let's let's increase the dash.
‫Let's see how it works and looks.
‫And here we go.
‫It's very nice.
‫So in this way we have created the pattern for Polylines and it's applicable for polygons and for circles.
‫Thank you guys.
‫I hope you subscribe to keep us making new tutorials and rate us five stars for keeping us making free
‫coupons and free tutorials on Udemy.
‫Thank you guys.
‫See you in the next videos.