本文整理汇总了Java中tourguide.tourguide.ToolTip类的典型用法代码示例。如果您正苦于以下问题:Java ToolTip类的具体用法?Java ToolTip怎么用?Java ToolTip使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolTip类属于tourguide.tourguide包,在下文中一共展示了ToolTip类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_basic);
Button button = (Button)findViewById(R.id.button1);
mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
.setPointer(new Pointer())
.setToolTip(new ToolTip()
.setTitle("Hey!")
.setDescription("Let's hope that there's no memory leak..."))
.setOverlay(new Overlay())
.playOn(button);
button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
mTutorialHandler.cleanUp();
}
});
}
开发者ID:worker8,项目名称:TourGuide,代码行数:23,代码来源:MemoryLeakTestActivity.java
示例2: onCreate
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = this;
setContentView(R.layout.activity_customization);
Button button = (Button)findViewById(R.id.button);
Animation animation = new TranslateAnimation(0f, 0f, 200f, 0f);
animation.setDuration(1000);
animation.setFillAfter(true);
animation.setInterpolator(new BounceInterpolator());
ToolTip toolTip = new ToolTip()
.setTitle("Next Button")
.setDescription("Click on Next button to proceed...")
.setTextColor(Color.parseColor("#bdc3c7"))
.setBackgroundColor(Color.parseColor("#e74c3c"))
.setShadow(true)
.setGravity(Gravity.TOP | Gravity.LEFT)
.setEnterAnimation(animation);
mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
.setToolTip(toolTip)
.setOverlay(new Overlay())
.setPointer(new Pointer())
.playOn(button);
button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
mTutorialHandler.cleanUp();
}
});
}
开发者ID:worker8,项目名称:TourGuide,代码行数:37,代码来源:ToolTipCustomizationActivity.java
示例3: onCreate
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = this;
setContentView(R.layout.activity_basic);
final Button button1 = (Button) findViewById(R.id.button1);
final Button button2 = (Button) findViewById(R.id.button2);
// the return handler is used to manipulate the cleanup of all the tutorial elements
mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
.setPointer(new Pointer()) // set pointer to null
.setToolTip(new ToolTip().setTitle("Welcome :)").setDescription("Have a nice and fun day!"))
.setOverlay(null)
.playOn(button1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mTourGuideHandler.cleanUp();
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTourGuideHandler.playOn(button1);
}
});
}
开发者ID:worker8,项目名称:TourGuide,代码行数:29,代码来源:NoOverlayActivity.java
示例4: beginChainTourGuide
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
private void beginChainTourGuide() {
Overlay overlay = new Overlay()
.setBackgroundColor(Color.parseColor("#EE2c3e50"))
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation);
ChainTourGuide tourGuide1 = ChainTourGuide.init(getActivity())
.setToolTip(new ToolTip()
.setTitle("Calories vs Macros")
.setDescription("What would you like to focus on?")
.setGravity(Gravity.BOTTOM)
)
.setOverlay(overlay)
.playLater(seggroupDisplay);
ChainTourGuide tourGuide2 = ChainTourGuide.init(getActivity())
.setToolTip(new ToolTip()
.setTitle("Set your goals")
.setDescription("Feel free to set your own goals!")
.setGravity(Gravity.BOTTOM | Gravity.RIGHT)
)
.setOverlay(overlay)
.playLater(etxtCarbs);
ChainTourGuide tourGuide3 = ChainTourGuide.init(getActivity())
.setToolTip(new ToolTip()
.setTitle("Reset")
.setDescription("We used your info to recommend starting goals. Push the Reset button to use the recommended goals.")
.setGravity(Gravity.BOTTOM)
)
.setOverlay(overlay)
.playLater(btnReset);
Sequence sequence = new Sequence.SequenceBuilder()
.add(tourGuide1, tourGuide2, tourGuide3)
.setDefaultOverlay(new Overlay())
.setDefaultPointer(null)
.setContinueMethod(Sequence.ContinueMethod.Overlay)
.build();
tourguide = ChainTourGuide.init(getActivity()).playInSequence(sequence);
}
开发者ID:Karim94,项目名称:IIFYM,代码行数:45,代码来源:FragmentGoals.java
示例5: beginChainTourGuide
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
private void beginChainTourGuide() {
Overlay overlay = new Overlay()
.setBackgroundColor(Color.parseColor("#EE2c3e50"))
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation);
/* Overlay overlayLast = new Overlay()
.setBackgroundColor(Color.parseColor("#EE2c3e50"))
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_user_macros, menu);
tourguide.cleanUp();
}
});*/
ChainTourGuide tourGuide1 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Calories vs Macros")
.setDescription("What would you like to focus on?")
.setGravity(Gravity.BOTTOM)
)
.setOverlay(overlay)
.playLater(seggroupDisplay);
ChainTourGuide tourGuide2 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Don't worry")
.setDescription("If you don't know where to start, " +
"here's a recommended starting point")
.setGravity(Gravity.BOTTOM | Gravity.RIGHT)
)
.setOverlay(overlay)
.playLater(etxtCarbs);
ChainTourGuide tourGuide3 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Reset")
.setDescription("Press the reset button to show recommended goals")
.setGravity(Gravity.BOTTOM)
)
.setOverlay(overlay)
.playLater(btnReset);
Sequence sequence = new Sequence.SequenceBuilder()
.add(tourGuide1, tourGuide2, tourGuide3)
.setDefaultOverlay(new Overlay())
.setDefaultPointer(null)
.setContinueMethod(Sequence.ContinueMethod.Overlay)
.build();
tourguide = ChainTourGuide.init(this).playInSequence(sequence);
}
开发者ID:Karim94,项目名称:IIFYM,代码行数:58,代码来源:ActivityRegisterGoals.java
示例6: runOverlayListenerContinueMethod
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
private void runOverlayListenerContinueMethod(){
// the return handler is used to manipulate the cleanup of all the tutorial elements
ChainTourGuide mTG1 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Hey!")
.setDescription("I'm the top fellow")
.setGravity(Gravity.RIGHT))
.playLater(button);
ChainTourGuide mTG2 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Hey!")
.setDescription("Just the middle man")
.setGravity(Gravity.BOTTOM | Gravity.LEFT))
.setOverlay(new Overlay()
.setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation))
.playLater(button2);
ChainTourGuide mTG3 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Hey!")
.setDescription("It's time to say goodbye")
.setGravity(Gravity.TOP | Gravity.RIGHT))
.playLater(button3);
mSequence = new Sequence.SequenceBuilder()
.add(mTG1, mTG2, mTG3)
.setDefaultOverlay(new Overlay()
.setEnterAnimation(enterAnimation).setExitAnimation(exitAnimation)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(SequenceTestActivity.this, "Bello! This is the default Overlay", Toast.LENGTH_SHORT).show();
mTutorialHandler.next();
}
}))
.setDefaultPointer(new Pointer())
.setContinueMethod(Sequence.ContinueMethod.OVERLAY_LISTENER)
.build();
mTutorialHandler = ChainTourGuide.init(this)
.playInSequence(mSequence);
}
开发者ID:worker8,项目名称:TourGuide,代码行数:44,代码来源:SequenceTestActivity.java
示例7: runOverlay_ContinueMethod
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
private void runOverlay_ContinueMethod(){
mDefaultOverlay = new Overlay()
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation);
// the return handler is used to manipulate the cleanup of all the tutorial elements
mOverlayTG1 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle(TEST_TITLE1)
.setDescription("1")
.setGravity(Gravity.BOTTOM)
)
// note that there is not Overlay here, so the default one will be used
.playLater(mButton1);
Log.d("ddw","mOverlayTG1.getOverlay(): "+mOverlayTG1.getOverlay());
mOverlayTG2 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle(TEST_TITLE2)
.setDescription("2")
.setGravity(Gravity.BOTTOM | Gravity.LEFT)
.setBackgroundColor(Color.parseColor("#c0392b"))
)
.setOverlay(new Overlay()
.setBackgroundColor(Color.parseColor("#EE2c3e50"))
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation)
)
.playLater(mButton2);
mOverlayTG3 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle(TEST_TITLE3)
.setDescription("3")
.setGravity(Gravity.TOP)
)
// note that there is not Overlay here, so the default one will be used
.playLater(mButton3);
if (mIsTestException){
mDefaultOverlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// do nothing, just for test purpose
}
});
}
Sequence sequence = new Sequence.SequenceBuilder()
.add(mOverlayTG1, mOverlayTG2, mOverlayTG3)
.setDefaultOverlay(mDefaultOverlay)
.setDefaultPointer(null)
.setContinueMethod(Sequence.ContinueMethod.OVERLAY)
.build();
mSequenceManagerTG = ChainTourGuide.init(this).playInSequence(sequence);
}
开发者ID:worker8,项目名称:TourGuide,代码行数:54,代码来源:SequenceOverlayCMTestActivity.java
示例8: onCreate
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
/* Get parameters from main activity */
Intent intent = getIntent();
int tooltip_num = intent.getIntExtra(TOOLTIP_NUM, 1);
super.onCreate(savedInstanceState);
mActivity = this;
int gravity;
if (tooltip_num == 1) {
setContentView(R.layout.activity_tooltip_gravity_i);
gravity = Gravity.RIGHT | Gravity.BOTTOM;
} else if (tooltip_num == 2) {
setContentView(R.layout.activity_tooltip_gravity_ii);
gravity = Gravity.LEFT | Gravity.BOTTOM;
} else if (tooltip_num == 3) {
setContentView(R.layout.activity_tooltip_gravity_iii);
gravity = Gravity.LEFT | Gravity.TOP;
} else {
setContentView(R.layout.activity_tooltip_gravity_iv);
gravity = Gravity.RIGHT | Gravity.TOP;
}
Button button = (Button)findViewById(R.id.button);
ToolTip toolTip = new ToolTip().
setTitle("Welcome!").
setDescription("This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....This is a really really long title....").
setBackgroundColor(Color.parseColor("#2980b9")).
setTextColor(Color.parseColor("#FFFFFF")).
setGravity(gravity).
setShadow(true);
mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK)
.setPointer(new Pointer())
.setToolTip(toolTip)
.setOverlay(new Overlay())
.playOn(button);
button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
mTutorialHandler.cleanUp();
}
});
}
开发者ID:worker8,项目名称:TourGuide,代码行数:47,代码来源:ToolTipMeasureTestActivity.java
示例9: onCreate
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = this;
setContentView(R.layout.activity_nav_drawer);
/* get views from xml */
mTextView1 = (TextView)findViewById(R.id.item1);
Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
/* setup toolbar */
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
toolbar.setTitle("Nav Drawer Example");
mTutorialHandler = TourGuide.init(mActivity).with(TourGuide.Technique.CLICK)
.setPointer(new Pointer())
.setToolTip(new ToolTip().setTitle(null).setDescription("hello world"))
.setOverlay(new Overlay().setBackgroundColor(Color.parseColor("#66FF0000")));
final ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(
this, mDrawerLayout, toolbar, R.string.drawer_open_string, R.string.drawer_close_string){
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
/* We need call playOn only after the drawer is opened,
so that TourGuide knows the updated location of the targetted view */
mTutorialHandler.playOn(mTextView1);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
/* setup clean up code */
mTextView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTutorialHandler.cleanUp();
mDrawerLayout.closeDrawers();
}
});
final ViewTreeObserver viewTreeObserver = mTextView1.getViewTreeObserver();
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mTextView1.getViewTreeObserver().removeGlobalOnLayoutListener(this);// make sure this only run once
mDrawerLayout.openDrawer(Gravity.LEFT);
}
});
}
开发者ID:worker8,项目名称:TourGuide,代码行数:55,代码来源:NavDrawerActivity.java
示例10: runOverlay_ContinueMethod
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
private void runOverlay_ContinueMethod(){
// the return handler is used to manipulate the cleanup of all the tutorial elements
ChainTourGuide tourGuide1 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("ContinueMethod.OVERLAY")
.setDescription("When using this ContinueMethod, you can't specify the additional action before going to next TourGuide.")
.setGravity(Gravity.BOTTOM)
)
// note that there is no Overlay here, so the default one will be used
.playLater(mButton1);
ChainTourGuide tourGuide2 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("Tip")
.setDescription("Individual Overlay will be used when it's supplied.")
.setGravity(Gravity.BOTTOM | Gravity.LEFT)
.setBackgroundColor(Color.parseColor("#c0392b"))
)
.setOverlay(new Overlay()
.setBackgroundColor(Color.parseColor("#EE2c3e50"))
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation)
)
.playLater(mButton2);
ChainTourGuide tourGuide3 = ChainTourGuide.init(this)
.setToolTip(new ToolTip()
.setTitle("ContinueMethod.OVERLAY")
.setDescription("When using this ContinueMethod, you don't need to call tourGuide.next() explicitly, TourGuide will do it for you.")
.setGravity(Gravity.TOP)
)
// note that there is no Overlay here, so the default one will be used
.playLater(mButton3);
Sequence sequence = new Sequence.SequenceBuilder()
.add(tourGuide1, tourGuide2, tourGuide3)
.setDefaultOverlay(new Overlay()
.setEnterAnimation(mEnterAnimation)
.setExitAnimation(mExitAnimation)
)
.setDefaultPointer(null)
.setContinueMethod(Sequence.ContinueMethod.OVERLAY)
.build();
ChainTourGuide.init(this).playInSequence(sequence);
}
开发者ID:worker8,项目名称:TourGuide,代码行数:48,代码来源:OverlaySequenceTourActivity.java
示例11: onCreateView
import tourguide.tourguide.ToolTip; //导入依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_widget_list, container, false);
getActivity().setTitle("Saved Widgets");
addNewWidgetButton = (FloatingActionButton) rootView.findViewById(R.id.fabAddNewWidget);
// Fix a margin issue in pre-lollipop floating action buttons
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) addNewWidgetButton.getLayoutParams();
p.setMargins(0, 0, 0, 0); // get rid of margins since shadow area is now the margin
addNewWidgetButton.setLayoutParams(p);
}
widgetListViewAdapter = new ListViewAdapter(getActivity());
try {
listViewArray = Utils.getArrivalTimeWidgetsFromStorage(getActivity());
} catch (IOException e) {
Log.e(TAG, "Error in getting previous widget list", e);
listViewArray = new ArrayList<>();
}
if (listViewArray != null) {
if (listViewArray.isEmpty()) {
tourGuide = TourGuide.init(getActivity()).with(TourGuide.Technique.Click)
.setPointer(new Pointer())
.setToolTip(new ToolTip()
.setTitle("No saved widgets")
.setDescription("Tap the button to add your first widget!")
.setGravity(Gravity.TOP | Gravity.LEFT))
.playOn(addNewWidgetButton);
}
widgetListViewAdapter.setWidgetList(listViewArray);
}
setListAdapter(widgetListViewAdapter);
addNewWidgetButton.setOnClickListener(view -> {
if (tourGuide != null) tourGuide.cleanUp();
getFragmentManager().beginTransaction()
.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out)
.replace(R.id.widget_container, new SelectAgencyFragment())
.addToBackStack(null)
.commit();
});
return rootView;
}
开发者ID:shyamu,项目名称:TransLoc-Android-Widget,代码行数:46,代码来源:WidgetListFragment.java
注:本文中的tourguide.tourguide.ToolTip类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论