Skip to content

Commit 949c4a4

Browse files
authored
kotlinization (#141)
remove all log kotlinizing major cleanup... kotlinize kotlinize FrameLayoutWithHole better kotlin kotlinize AdjustPaddingOverlayActivity kotlinize MyApplication k better kotlin kotlinize + bugfix kotlinize MemoryLeakTestActivity kotlinize NavDrawerActivity.kt kotlinize 3 activities kotlinize remaining files upgrade gradle plugin remove unused code remove unused code clean up clean up remove unused code remove unused code Add DSL builder for Pointer update readme: use github pages + docsify for better documentation add kotlin badge Minor README fixed hide license in README up major version add ruby script to update version update doc add source jar remove the unused remove javadoc, it's not helpful and failing disable javadoc try to disable javadoc for kotlin use local copy of mvn push; remove javadoc generation change 'compile' to 'implementation' temp fix gradle version again use own maven upload script fix sources.jar to include kotlin code
1 parent 777f5be commit 949c4a4

File tree

80 files changed

+2480
-3887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2480
-3887
lines changed

README.md

Lines changed: 11 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,153 +1,19 @@
1-
![asdf](https://api.travis-ci.org/worker8/TourGuide.svg?branch=master) ![](https://camo.githubusercontent.com/cf76db379873b010c163f9cf1b5de4f5730b5a67/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f6d69742f6d69742e7376673f763d313032)
1+
![](https://img.shields.io/badge/Kotlin-1.2.10-orange.svg) ![](https://api.travis-ci.org/worker8/TourGuide.svg?branch=master) ![](https://camo.githubusercontent.com/cf76db379873b010c163f9cf1b5de4f5730b5a67/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f6d69742f6d69742e7376673f763d313032)
22

33
# TourGuide
44
TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the example below(this is a trivial example for demo purpose):
55

6-
Let's say you have a button on your home screen that you want your users to click on:
6+
# Documentation
7+
Refer to this :point_down:
78

8-
![A button](https://raw.githubusercontent.com/worker8/all_my_media_files/695d9a2/2015-07-01_screenshot1.png)
9-
10-
Using TourGuide, the end result will look as below. A pointer, overlay and tooltip are added to the page to clearly notify user to tap on the "Get Started" button. Once user tap on the "Get Started" button, the overlay, pointer and tooltip will disappear.
11-
12-
![TourGuide at work](https://raw.githubusercontent.com/worker8/all_my_media_files/695d9a2/2015-07-01_screenshot.png)
13-
14-
The reason for having Overlay, Pointer and a Tooltip:
15-
- Overlay: Darken other UI elements on the screen, so that user can focus on one single UI element.
16-
- Tooltip: To give a text explanation
17-
- Pointer: An animated clicking gesture to indicate the clickable UI element
18-
19-
# Demo
20-
![Demo](https://raw.githubusercontent.com/worker8/all_my_media_files/25b3208/device-2015-07-01-114155.gif)
21-
22-
# How to setup
23-
Add the below dependencies into your app level build.gradle file:
24-
25-
```groovy
26-
repositories {
27-
mavenCentral()
28-
maven() {
29-
url "https://oss.sonatype.org/content/repositories/snapshots"
30-
}
31-
}
32-
dependencies {
33-
...
34-
compile ('com.github.worker8:tourguide:1.0.19-SNAPSHOT@aar') {
35-
transitive=true
36-
}
37-
}
38-
```
39-
40-
# MinSDK Version
41-
The minimum SDK version required by TourGuide is `API Level 11+ (Android 3.0.x, HONEYCOMB)`.
42-
43-
# How to use
44-
## Basic
45-
Let's say you have a button like this where you want user to click on:
46-
```java
47-
Button button = (Button)findViewById(R.id.button);
48-
```
49-
You can add the tutorial pointer on top of it by:
50-
```java
51-
TourGuide mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.Click)
52-
.setPointer(new Pointer())
53-
.setToolTip(new ToolTip().setTitle("Welcome!").setDescription("Click on Get Started to begin..."))
54-
.setOverlay(new Overlay())
55-
.playOn(button);
56-
```
57-
- `setPointer()` - This describe how the Pointer will look like, refer to [Pointer Customization Guide](#pointer_customization) on how to change the appearance, `null` can be passed in if a Pointer is not wanted.
58-
- `setToolTip` - This describe how the ToolTip will look like, refer to [ToolTip Customization Guide](#tooltip_customization) on how to change the appearance, `null` can be passed in if a ToolTip is not wanted.
59-
- `setOverlay` - This describe how the Overlay will look like, refer to [Overlay Customization Guide](#overlay_customization) on how to change the appearance, `null` can be passed in if an Overlay is not wanted.
60-
- `with` - Use TourGuide.Technique.Click for the moment, this will be removed in the future.
61-
- `mTourGuideHandler` - The return type is a handler to be used for clean up purpose.
62-
63-
When the user is done, you can dismiss the tutorial by calling:
64-
```java
65-
mTourGuideHandler.cleanUp();
66-
```
67-
## <a name="tooltip_customization"></a>ToolTip Customization Guide
68-
Tooltip is the box of text that gives further explanation of a UI element. In the basic example above, the ToolTip not customized, so the default style is used. However, you can customize it if you wish to.
69-
70-
```java
71-
Animation animation = new TranslateAnimation(0f, 0f, 200f, 0f);
72-
animation.setDuration(1000);
73-
animation.setFillAfter(true);
74-
animation.setInterpolator(new BounceInterpolator());
75-
76-
ToolTip toolTip = new ToolTip()
77-
.setTitle("Next Button")
78-
.setDescription("Click on Next button to proceed...")
79-
.setTextColor(Color.parseColor("#bdc3c7"))
80-
.setBackgroundColor(Color.parseColor("#e74c3c"))
81-
.setShadow(true)
82-
.setGravity(Gravity.TOP | Gravity.LEFT)
83-
.setEnterAnimation(animation);
84-
85-
TourGuide mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.Click)
86-
.setPointer(new Pointer())
87-
.setToolTip(toolTip)
88-
.setOverlay(new Overlay())
89-
.playOn(button);
90-
```
91-
92-
Most of the customization methods/parameters are self-explanatory, except `gravity` that deserves a mention. `gravity` is relative to targetted button where TourGuide `playOn()`. For example `.setGravity(Gravity.TOP | Gravity.LEFT)` will produce the following:
93-
94-
![ToolTip gravity](https://raw.githubusercontent.com/worker8/all_my_media_files/d0b17ba/2015-07-01_screenshot2.png)
95-
96-
## <a name="pointer_customization"></a>Pointer Customization Guide
97-
Pointer is the round button that is animating to indicate the clickable UI element. The default color is white and the default gravity is center. You can customize it by:
98-
```java
99-
new Pointer().setColor(Color.RED).setGravity(Gravity.BOTTOM|Gravity.RIGHT);
100-
```
101-
This is a comparison with and without the customization:
102-
103-
![Pointer Customization](https://raw.githubusercontent.com/worker8/all_my_media_files/64b8a3c/2015-07-01_screenshot5.png)
104-
105-
## <a name="overlay_customization"></a>Overlay Customization Guide
106-
Overlay is the semi-transparent background that is used to cover up other UI elements so that users can take focus on what to click on. The color and shape can be customized by:
107-
```java
108-
Overlay overlay = new Overlay()
109-
.setBackgroundColor(Color.parseColor("#AAFF0000"))
110-
.disableClick(true)
111-
.setStyle(Overlay.Style.Rectangle);
112-
```
113-
- `disableClick(true)` will make elements covered by the overlay to become unclickable. Refer to Overlay Customization Activity in the example.
114-
- `.setStyle()` Currently only 2 styles are available: `Overlay.Style.Rectangle` and `Overlay.Style.Circle`
115-
116-
# Running TourGuide in Sequence
117-
Running TourGuide in sequence is a very common use case where you want to show a few buttons in a row instead of just one. Running in sequence can be subdivided into 2 use cases:
118-
119-
- Case 1: When you want user to click on the button itself to proceed to next TourGuide
120-
- Refer to [ManualSequenceActivity.java in the demo](https://github.com/worker8/TourGuide/blob/master/app/src/main/java/tourguide/tourguidedemo/ManualSequenceActivity.java)
121-
122-
![](https://github.com/worker8/all_my_media_files/raw/master/button_itself.gif)
123-
124-
- Case 2: When you don't want user to actually click on the button itself, but the Overlay to proceed to next TourGuide
125-
- Refer to [OverlaySequenceTourActivity.java in the demo](https://github.com/worker8/TourGuide/blob/master/app/src/main/java/tourguide/tourguidedemo/OverlaySequenceTourActivity.java)
126-
127-
![](https://github.com/worker8/all_my_media_files/raw/master/click_overlay.gif)
128-
129-
130-
# Source code of Example
131-
Refer to this repo!
132-
133-
# Demo App
134-
[Playstore Link](https://play.google.com/store/apps/details?id=tourguide.tourguide)
135-
136-
# Roadmap
137-
[Refer to The Roadmap for tentative plans of TourGuide](https://github.com/worker8/TourGuide/wiki/Roadmap)
138-
139-
# Limitations
140-
[Features that are commonly asked for, but is still not working goes under Limitations](https://github.com/worker8/TourGuide/wiki/Limitations)
141-
142-
# Contributing
143-
You are very welcome to contribute to this project!
144-
145-
Before sending pull request, have a look at this: [Contributing Guidelines](https://github.com/worker8/TourGuide/wiki/Contributing-Guidelines)
146-
147-
Refer to [The Roadmap](https://github.com/worker8/TourGuide/wiki/Roadmap) if you're interested in developing a new feature or write some tests for TourGuide.
9+
http://worker8.github.io/TourGuide/
14810

14911
# License
150-
12+
<details>
13+
<summary>
14+
click to reveal License
15+
</summary>
16+
15117
The MIT License (MIT)
15218

15319
Copyright (c) 2016 Tan Jun Rong
@@ -170,3 +36,5 @@ Refer to [The Roadmap](https://github.com/worker8/TourGuide/wiki/Roadmap) if you
17036
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17137
SOFTWARE.
17238

39+
40+
</details>

README_pushing_to_maven.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
update versions
2-
1. increase version in gradle.properties (actual versions)
3-
2. update app's build.gradle snapshot version (sample app version)
4-
3. update README.md's version (instructions)
2+
3+
1. run `ruby update_version.rb`
4+
- this will increase the versionName & versionCode in gradle.properties
5+
2. update gh-pages branch install guide version
56

67
4. git push origin master
78
5. ./gradlew clean build uploadArchives

app/build.gradle

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,30 @@ android {
4949
}
5050
}
5151

52+
task sourcesJar(type: Jar) {
53+
from android.sourceSets.main.java.srcDirs
54+
classifier = 'sources'
55+
}
56+
57+
artifacts {
58+
archives sourcesJar
59+
}
60+
5261
dependencies {
53-
compile fileTree(dir: 'libs', include: ['*.jar'])
54-
compile "com.android.support:appcompat-v7:$supportVersion"
55-
compile "com.android.support:design:$supportVersion"
56-
compile project(':tourguide')
57-
// compile ('com.github.worker8:tourguide:1.0.19-SNAPSHOT@aar'){
58-
// transitive=true
59-
// }
62+
implementation fileTree(dir: 'libs', include: ['*.jar'])
63+
implementation "com.android.support:appcompat-v7:$supportVersion"
64+
implementation "com.android.support:design:$supportVersion"
65+
implementation project(':tourguide')
6066

6167
/* this is for debugging memory leak: https://github.com/square/leakcanary */
62-
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
63-
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
68+
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.3.1'
69+
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
6470

65-
// Set this dependency to build and run Espresso tests
66-
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1') {
71+
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1') {
6772
exclude group: 'com.android.support', module: 'support-annotations'
6873
}
69-
androidTestCompile 'com.android.support.test:runner:1.0.1'
74+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7075

71-
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
7276

7377
}
7478

app/src/androidTest/java/tourguide/tourguidedemo/ApplicationTest.java

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package tourguide.tourguidedemo
2+
3+
import android.app.Application
4+
import android.test.ApplicationTestCase
5+
6+
/**
7+
* [Testing Fundamentals](http://d.android.com/tools/testing/testing_android.html)
8+
*/
9+
class ApplicationTest : ApplicationTestCase<Application>(Application::class.java)

app/src/androidTest/java/tourguide/tourguidedemo/SequenceOverlayCMTest.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)