use of uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt in project TeamCityApp by vase4kin.
the class BuildListViewImpl method showRunBuildPrompt.
/**
* {@inheritDoc}
*/
@Override
public void showRunBuildPrompt(final OnboardingManager.OnPromptShownListener listener) {
int color = getToolbarColor();
new MaterialTapTargetPrompt.Builder(mActivity).setTarget(mFloatingActionButton).setPrimaryText(R.string.title_onboarding_run_build).setSecondaryText(R.string.text_onboarding_run_build).setAnimationInterpolator(new FastOutSlowInInterpolator()).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
if (state == MaterialTapTargetPrompt.STATE_DISMISSED) {
listener.onPromptShown();
}
}
}).show();
}
use of uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt in project TeamCityApp by vase4kin.
the class RootDrawerViewImpl method showNavigationDrawerPrompt.
/**
* {@inheritDoc}
*/
@Override
public void showNavigationDrawerPrompt(final OnboardingManager.OnPromptShownListener listener) {
// Creating prompt
int color = ContextCompat.getColor(mActivity, mDefaultColor);
final MaterialTapTargetPrompt.Builder navigationDrawerPrompt = new MaterialTapTargetPrompt.Builder(mActivity).setPrimaryText(R.string.title_onboarding_navigation_drawer).setSecondaryText(R.string.text_onboarding_navigation_drawer).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_menu_black_24dp).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
listener.onPromptShown();
}
});
// Show prompt
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
navigationDrawerPrompt.setTarget(mToolbar.getChildAt(1));
navigationDrawerPrompt.show();
}
}, TIME_NAVIGATION_DRAWER_PROMPT);
}
use of uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt in project TeamCityApp by vase4kin.
the class OverviewViewImpl method showPrompt.
/**
* Show prompt
*
* @param secondaryText - secondary text
* @param listener - listener to receive callback when prompt is shown
*/
private void showPrompt(@StringRes int secondaryText, final OnboardingManager.OnPromptShownListener listener) {
// Creating prompt
final Toolbar toolbar = (Toolbar) mActivity.findViewById(R.id.toolbar);
int color = ((ColorDrawable) toolbar.getBackground()).getColor();
final MaterialTapTargetPrompt.Builder promptBuilder = new MaterialTapTargetPrompt.Builder(mActivity).setPrimaryText(R.string.title_onboarding_build_menu).setSecondaryText(secondaryText).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_more_vert_black_24dp).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
listener.onPromptShown();
}
});
// Show prompt
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
final View child = toolbar.getChildAt(2);
if (child instanceof ActionMenuView) {
final ActionMenuView actionMenuView = ((ActionMenuView) child);
promptBuilder.setTarget(actionMenuView.getChildAt(actionMenuView.getChildCount() - 1));
}
promptBuilder.show();
}
}, TIMEOUT_PROMPT);
}
use of uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt in project TeamCityApp by vase4kin.
the class BuildListViewImpl method showFilterBuildsPrompt.
/**
* {@inheritDoc}
*/
@Override
public void showFilterBuildsPrompt(final OnboardingManager.OnPromptShownListener listener) {
int color = getToolbarColor();
new MaterialTapTargetPrompt.Builder(mActivity).setTarget(R.id.filter_builds).setPrimaryText(R.string.title_onboarding_filter_builds).setSecondaryText(R.string.text_onboarding_filter_builds).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_filter_list_white_24px).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
listener.onPromptShown();
}
}).show();
}
use of uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt in project underlx by underlx.
the class MapFragment method showTargetPrompt.
private void showTargetPrompt() {
Context context = getContext();
boolean isFirstOpen = false;
if (context != null) {
SharedPreferences sharedPref = context.getSharedPreferences("settings", MODE_PRIVATE);
if (sharedPref != null) {
isFirstOpen = sharedPref.getBoolean("fuse_first_map_open", true);
}
}
if (!isFirstOpen) {
return;
}
new MaterialTapTargetPrompt.Builder(getActivity()).setTarget(R.id.fab).setPrimaryText(R.string.frag_map_switch_type_taptarget_title).setSecondaryText(R.string.frag_map_switch_type_taptarget_subtitle).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
if (state == MaterialTapTargetPrompt.STATE_FOCAL_PRESSED) {
// User has pressed the prompt target
Context context = getContext();
if (context != null) {
SharedPreferences sharedPref = context.getSharedPreferences("settings", MODE_PRIVATE);
SharedPreferences.Editor e = sharedPref.edit();
e.putBoolean("fuse_first_map_open", false);
e.apply();
}
}
}
}).setFocalColour(Color.TRANSPARENT).setBackgroundColour(ContextCompat.getColor(getContext(), R.color.colorPrimaryLight)).show();
}
Aggregations