本文整理汇总了Java中com.getkeepsafe.taptargetview.TapTarget类的典型用法代码示例。如果您正苦于以下问题:Java TapTarget类的具体用法?Java TapTarget怎么用?Java TapTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TapTarget类属于com.getkeepsafe.taptargetview包,在下文中一共展示了TapTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: focusWheelLense
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
/**
*
*/
private TapTarget focusWheelLense() { // `this` is an Activity
return TapTarget.forView(_activityView.getWheelMiddleLense(), "Wheel lense", "Wallet functions, such as SEND / RECEIVE")
// All options below are optional
.outerCircleColor(R.color.colorPrimary) // Specify a color for the outer circle
.outerCircleAlpha(0.5f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.colorAccent) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(android.R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.colorSecondary) // Specify the color of the description text
.textColor(android.R.color.white) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.colorContentBackgrounds) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.tintTarget(true) // Whether to tint the target view's color
.transparentTarget(true) // Specify a custom drawable to draw as the target
.targetRadius(60);
}
示例2: focusSettingsMenu
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
/**
*
*/
private TapTarget focusSettingsMenu() { // `this` is an Activity
return TapTarget.forView(_activityView.getSettingsMenu(), "Settings Menu", "Where you can restore and backup your wallet. Please BACKUP your wallet's seed right away!")
// All options below are optional
.outerCircleColor(R.color.colorPrimary) // Specify a color for the outer circle
.outerCircleAlpha(0.5f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.colorAccent) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(android.R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.colorSecondary) // Specify the color of the description text
.textColor(android.R.color.white) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.colorContentBackgrounds) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.tintTarget(true) // Whether to tint the target view's color
.transparentTarget(true) // Specify a custom drawable to draw as the target
.targetRadius(60);
}
示例3: focusSyncMeter
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
/**
*
*/
private TapTarget focusSyncMeter() { // `this` is an Activity
return TapTarget.forView(_activityView.getBtcSyncMeter(), "Sync Meter", "Syncing with the chain is in progress. This might take a few minutes, but you will only need to do it once")
// All options below are optional
.outerCircleColor(R.color.colorPrimary) // Specify a color for the outer circle
.outerCircleAlpha(0.5f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.colorAccent) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(android.R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.colorSecondary) // Specify the color of the description text
.textColor(android.R.color.white) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.colorContentBackgrounds) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.tintTarget(true) // Whether to tint the target view's color
.transparentTarget(true) // Specify a custom drawable to draw as the target
.targetRadius(60);
}
示例4: focusWheel
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
/**
*
*/
private TapTarget focusWheel() { // `this` is an Activity
return TapTarget.forView(_activityView.getWheelMenuLayout(), "This is the menu wheel", "Rotate to select menu items")
// All options below are optional
.outerCircleColor(R.color.colorPrimary) // Specify a color for the outer circle
.outerCircleAlpha(0.5f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.colorAccent) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(android.R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.colorSecondary) // Specify the color of the description text
.textColor(android.R.color.white) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.colorContentBackgrounds) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.tintTarget(true) // Whether to tint the target view's color
.transparentTarget(true) // Specify a custom drawable to draw as the target
.targetRadius(60);
}
示例5: ShowSequence
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
@ReactMethod
public void ShowSequence(final ReadableArray views, final ReadableMap props, final Promise promise) {
final Activity activity = this.getCurrentActivity();
final List<TapTarget> targetViews = new ArrayList<TapTarget>();
for (int i = 0;i < views.size();i++) {
int view = views.getInt(i);
targetViews.add(this.generateTapTarget(view, props.getMap(String.valueOf(view))));
}
this.getCurrentActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
TapTargetSequence tapTargetSequence = new TapTargetSequence(activity).targets(targetViews);
tapTargetSequence.continueOnCancel(true);
tapTargetSequence.start();
}
});
}
示例6: showTargetedAdvice
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
public static boolean showTargetedAdvice(Activity activity, final long advice, @StringRes int messageResId, View focusOn, boolean transparent) {
if (!Configuration.getAdviceState(advice))
return false;
TapTarget target;
if (transparent) {
Rect r = new Rect();
focusOn.getGlobalVisibleRect(r);
target = TapTarget.forBounds(r, activity.getString(messageResId)).transparentTarget(true);
} else {
target = TapTarget.forView(focusOn, activity.getString(messageResId));
}
target.outerCircleColor(R.color.explanationBackground)
.targetCircleColor(android.R.color.white)
.textColor(android.R.color.white);
showTargetedAdvice(activity, advice, target);
return true;
}
示例7: showTapTargetSequenceFor
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
public static void showTapTargetSequenceFor(@NonNull final Activity activity, @NonNull TapTargetSequenceType type) {
List<TapTarget> targets = new ArrayList<>();
if(!SharedPreferenceUtil.doShowTapTargetSequenceFor(activity, type))
return;
switch (type) {
case EDIT_IMAGE_ATTACHMENT_ACTIVITY:
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_edit_image_attachment_crop), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_crop_title), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_crop_description)).transparentTarget(true).cancelable(false));
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_edit_image_attachment_rotate), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_rotate_title), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_rotate_description)).transparentTarget(true).cancelable(false));
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_edit_image_attachment_camera), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_camera_title), activity.getResources().getString(R.string.ttsu_activity_edit_image_attachment_camera_description)).transparentTarget(true).cancelable(false));
doShowTapTargetSequenceFor(activity, targets, null);
break;
case PLACE_LIST_ACTIVITY:
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_place_list_no_items_container), activity.getResources().getString(R.string.ttsu_activity_place_list_no_items_container_title), activity.getResources().getString(R.string.ttsu_activity_place_list_no_items_container_description)).transparentTarget(true).cancelable(false).targetRadius(100));
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_place_list_fab), activity.getResources().getString(R.string.ttsu_activity_place_list_fab_title), activity.getResources().getString(R.string.ttsu_activity_place_list_fab_description)).transparentTarget(true).cancelable(false));
doShowTapTargetSequenceFor(activity, targets, null);
break;
case PLACE_ACTIVITY:
targets.add(TapTarget.forView(activity.findViewById(R.id.place_autocomplete_search_button), activity.getResources().getString(R.string.ttsu_activity_place_autocomplete_search_button_title), activity.getResources().getString(R.string.ttsu_activity_place_autocomplete_search_button_description)).transparentTarget(true).cancelable(false));
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_place_map), activity.getResources().getString(R.string.ttsu_activity_place_map_container_title), activity.getResources().getString(R.string.ttsu_activity_place_map_container_description)).transparentTarget(true).cancelable(false).targetRadius(100));
targets.add(TapTarget.forView(activity.findViewById(R.id.activity_place_radius_icon), activity.getResources().getString(R.string.ttsu_activity_place_radius_icon_title), activity.getResources().getString(R.string.ttsu_activity_place_radius_icon_description)).transparentTarget(true).cancelable(false));
doShowTapTargetSequenceFor(activity, targets, null);
break;
default:
Toast.makeText(activity, "TapTargetSequenceUtil(): Invalid TapTargetSequenceType", Toast.LENGTH_SHORT).show();
}
}
示例8: doShowTapTargetSequenceFor
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
private static void doShowTapTargetSequenceFor(@NonNull final Activity activity, @NonNull final List<TapTarget> targets, @Nullable final TapTargetSequence.Listener listener) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
new TapTargetSequence(activity)
.targets(targets)
.listener(listener)
.start();
}
}, DELAY);
}
示例9: showTabTargetView
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
@Override
public void showTabTargetView() {
TapTargetView.showFor(this, TapTarget.forView(findViewById(R.id.tab_setting) , "آموزش", "روی این تب کلیک کنید تا نحوهی اضافه کردن ویجت به صفحه رو ببینید") // All options below are optional
.outerCircleColor(R.color.primary_dark) // Specify a color for the outer circle
.outerCircleAlpha(0.96f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.low_primary) // Specify a color for the target circle
.titleTextSize(40) // Specify the size (in sp) of the title text
.descriptionTextSize(30) // Specify the size (in sp) of the description text
.dimColor(R.color.bb_tabletRightBorderDark) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.tintTarget(true) // Whether to tint the target view's color
.transparentTarget(false) // Specify whether the target is transparent (displays the content underneath)
.targetRadius(60));
}
示例10: ShowFor
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
@ReactMethod
public void ShowFor(final int view, final ReadableMap props, final Promise promise) {
final Activity activity = this.getCurrentActivity();
final TapTarget targetView = generateTapTarget(view, props);
this.getCurrentActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
TapTargetView.showFor(activity, targetView);
}
});
}
示例11: launchTutorial
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
private void launchTutorial()
{
final DeepLinkInfo deepLinkInfo = new DeepLinkInfo("deeplinktester://example", "Deep Link Tester", getPackageName(), new Date().getTime());
final View demoHeaderView = _adapter.createView(0, getLayoutInflater().inflate(R.layout.deep_link_info_layout, null, false), deepLinkInfo);
demoHeaderView.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.White, getTheme()));
_listView.addHeaderView(demoHeaderView);
new TapTargetSequence(this)
.targets(TapTarget.forView(findViewById(R.id.deep_link_input), getString(R.string.onboarding_input_title))
.dimColor(android.R.color.black)
.outerCircleColor(R.color.SlateGray)
.targetCircleColor(R.color.fabColorNormal)
.tintTarget(false),
TapTarget.forView(findViewById(R.id.deep_link_fire), getString(R.string.onboarding_launch_title))
.dimColor(android.R.color.black)
.outerCircleColor(R.color.SlateGray)
.targetCircleColor(R.color.fabColorNormal)
.tintTarget(false),
TapTarget.forView(demoHeaderView, getString(R.string.onboarding_history_title))
.dimColor(android.R.color.black)
.outerCircleColor(R.color.SlateGray)
.targetCircleColor(R.color.fabColorNormal)
.tintTarget(false))
.listener(new TapTargetSequence.Listener()
{
@Override
public void onSequenceFinish()
{
_listView.removeHeaderView(demoHeaderView);
}
@Override
public void onSequenceCanceled(TapTarget lastTarget)
{
_listView.removeHeaderView(demoHeaderView);
}
})
.start();
}
示例12: createTapTargetFromPoint
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
private TapTarget createTapTargetFromPoint(PointF point, final String title,
final String description) {
Rect viewRect = new Rect();
mCryptogramView.getGlobalVisibleRect(viewRect);
final int targetX = (int) (point.x + viewRect.left);
final int targetY = (int) (point.y + viewRect.top);
final int targetRadius = 48;
return TapTarget.forBounds(new Rect(targetX - targetRadius, targetY - targetRadius, targetX + targetRadius, targetY + targetRadius),
title, description);
}
示例13: showTapTargetView
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
public static void showTapTargetView(@NonNull Activity activity, @NonNull View target,
@StringRes int titleId, @StringRes int descriptionId,
@Nullable TapTargetView.Listener listener) {
final float tooltipAlpha = 0.9f;
TapTargetView.showFor(activity,
TapTarget.forView(target, activity.getString(titleId),
activity.getString(descriptionId))
.targetCircleColor(ResourceUtil.getThemedAttributeId(activity, R.attr.colorAccent))
.outerCircleColor(ResourceUtil.getThemedAttributeId(activity, R.attr.colorAccent))
.outerCircleAlpha(tooltipAlpha)
.cancelable(true)
.transparentTarget(true),
listener);
}
示例14: onCreate
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ButterKnife.bind(this);
boolean isUserFirstTime = UniversalPreferences.getInstance().get("isUserFirstTime", true);
instance = this;
flashcardDb = FlashcardDb.getInstance(getApplicationContext());
trashFlashcardDb = TrashFlashcardDb.getInstance(getApplicationContext());
cardDb = CardDb.getInstance(getApplicationContext());
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().replace(R.id.content_main, new AllSetsFragment()).commit();
getSupportActionBar().setTitle(getString(R.string.menu_all_sets));
}
if (isUserFirstTime) {
UniversalPreferences.getInstance().put("isUserFirstTime", false);
startActivity(new Intent(this, IntroActivity.class));
}
boolean userKnowsToAddSets = UniversalPreferences.getInstance().get("userKnowsToAddSets", false);
if (!userKnowsToAddSets) {
TapTargetView.showFor(this, // `this` is an Activity
TapTarget.forView(findViewById(R.id.fabAddSet), getString(R.string.create_sets), getString(R.string.lets_create_set))
// All options below are optional
.outerCircleColor(R.color.md_blue_500) // Specify a color for the outer circle
.targetCircleColor(R.color.md_white_1000) // Specify a color for the target circle
.titleTextSize(24) // Specify the size (in sp) of the title text
.titleTextColor(R.color.md_white_1000) // Specify the color of the title text
.descriptionTextSize(20) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.md_red_500) // Specify the color of the description text
.textColor(R.color.md_white_1000) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.md_black_1000) // If set, will dim behind the view with 30% opacity of the given color
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.transparentTarget(true) // Specify whether the target is transparent (displays the content underneath)
.targetRadius(40), // Specify the target radius (in dp)
new TapTargetView.Listener() { // The listener can listen for regular clicks, long clicks or cancels
@Override
public void onTargetClick(TapTargetView view) {
super.onTargetClick(view); // This call is optional
UniversalPreferences.getInstance().put("userKnowsToAddSets", true);
onClickFab();
}
});
}
}
示例15: showIconsIntro
import com.getkeepsafe.taptargetview.TapTarget; //导入依赖的package包/类
public static void showIconsIntro(@NonNull Context context) {
if (Preferences.get(context).isTimeToShowIconsIntro()) {
AppCompatActivity activity = (AppCompatActivity) context;
Toolbar toolbar = activity.findViewById(R.id.toolbar);
if (toolbar == null) return;
new Handler().postDelayed(() -> {
try {
int primary = ColorHelper.getAttributeColor(context, R.attr.toolbar_icon);
int secondary = ColorHelper.setColorAlpha(primary, 0.7f);
Typeface title = TypefaceHelper.getMedium(context);
Typeface description = TypefaceHelper.getRegular(context);
TapTarget tapTarget = TapTarget.forToolbarMenuItem(toolbar, R.id.menu_search,
context.getResources().getString(R.string.tap_intro_icons_search),
context.getResources().getString(R.string.tap_intro_icons_search_desc))
.titleTextColorInt(primary)
.descriptionTextColorInt(secondary)
.targetCircleColorInt(primary)
.drawShadow(Preferences.get(context).isTapIntroShadowEnabled());
if (title != null) {
tapTarget.textTypeface(title);
}
//if (description != null) {
//tapTarget.descriptionTypeface(description);
//}
TapTargetView.showFor(activity, tapTarget,
new TapTargetView.Listener() {
@Override
public void onTargetDismissed(TapTargetView view, boolean userInitiated) {
super.onTargetDismissed(view, userInitiated);
Preferences.get(context).setTimeToShowIconsIntro(false);
}
});
} catch (Exception e) {
LogUtil.e(Log.getStackTraceString(e));
}
}, 100);
}
}