GitHub原地址
TapTargetView is distributed usingjcenter.
repositories {? ? ? ? jcenter()? }? ? ? dependencies {? ? ? ? compile'com.getkeepsafe.taptargetview:taptargetview:1.10.0'}
TapTargetView 。showFor(this, // `this`是一種活動
TapTarget 。 forView(findViewById([R 。 ID 。目標), “這是一個目標”,“我們有最好的目標,相信我”)
//下面的所有選項都是可選
.outerCircleColor(? 。顏色。紅色)? ? ? //指定外圓彩色
.outerCircleAlpha(0.96f)? ? ? ? ? ? //指定阿爾法量外圓
.targetCircleColor(? 。顏色。白色)? ? //指定顏色為目標圓
.titleTextSize(20)? ? ? ? ? ? ? ? ? //標題文本的指定大小(SP)
.titleTextColor(? 。彩色。白色)? ? ? //指定標題文本的顏色
.descriptionTextSize(10)? ? ? ? ? ? //指定描述文本的大小(SP)
.descriptionTextColor(? 。顏色。紅色)? //指定描述文本的顏色
.textColor(? 。顏色。藍色)? ? ? ? ? ? //指定色彩兩者的標題和描述文本
.textTypeface(字樣。 SANS_SERIF)? //指定文本字樣
.dimColor(? 。顏色。黑色)? ? ? ? ? ? //如果設(shè)置,將變暗與給定顏色的30%的不透明度的觀點背后
.drawShadow(真)? ? ? ? ? ? ? ? ? ? //是否繪制陰影或不
.cancelable(false)? ? ? ? ? ? ? ? ? //是否在外部圓外輕擊視圖
.tintTarget(true)? ? ? ? ? ? ? ? ? ? //是否著色目標視圖的顏色
.transparentTarget(false)? ? ? ? ? ? //指定目標是否透明(顯示下面的內(nèi)容)
。圖標(可繪制)? ? ? ? ? ? ? ? ? ? ? //指定一個自定義的繪制對象作為目標
.targetRadius(60),? ? ? ? ? ? ? ? ? //指定目標半徑(在dp中)
new? TapTargetView。監(jiān)聽(){? ? ? ? ? //聽眾可收聽經(jīng)常點擊,點擊長或取消
@覆蓋
公共 無效 onTargetClick(TapTargetView? 視圖){
超。onTargetClick(視圖);? ? ? //這個調(diào)用是可選的
doSomething();
}
});