|
1 | 1 | # Android Target Instructions |
2 | | -Easy to implement the instructions for the users |
| 2 | + |
| 3 | +[](https://jitpack.io/#Kyash/android-target-instructions) |
| 4 | + |
| 5 | +Make easy to implement the instructions feature. |
| 6 | + |
| 7 | +## Download |
| 8 | + |
| 9 | +### Project build.gradle |
| 10 | + |
| 11 | +```groovy |
| 12 | +allprojects { |
| 13 | + repositories { |
| 14 | + ... |
| 15 | + maven { url "https://jitpack.io" } |
| 16 | + } |
| 17 | +} |
| 18 | +``` |
| 19 | + |
| 20 | +### App build.gradle |
| 21 | + |
| 22 | +```groovy |
| 23 | +dependencies { |
| 24 | + ... |
| 25 | + compile 'com.github.Kyash:android-target-instructions:LATEST_VERSION' |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +`LATEST_VERSION` is [](https://jitpack.io/#Kyash/android-target-instructions) |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +```kotlin |
| 34 | +val target1 = SimpleTarget.Builder(this@MainActivity).setCoordinate(binding.fab) |
| 35 | + .setTitle("Floating Action Button") |
| 36 | + .setRadius(100f) |
| 37 | + .setDescription("This is the floating action button.") |
| 38 | + .build() |
| 39 | + |
| 40 | +val target2 = SimpleTarget.Builder(this@MainActivity).setCoordinate(binding.firstText) |
| 41 | + .setTitle("First text") |
| 42 | + .setDescription("This is the first text.") |
| 43 | + .setHighlightPadding(R.dimen.simple_hightlight_padding) |
| 44 | + .setListener(object : Target.OnStateChangedListener { |
| 45 | + override fun onClosed() { |
| 46 | + binding.scrollview.smoothScrollBy(0, 10000) |
| 47 | + } |
| 48 | + }) |
| 49 | + .build() |
| 50 | + |
| 51 | +val target3 = SimpleTarget.Builder(this@MainActivity).setCoordinate(binding.secondText) |
| 52 | + .setTitle("Second text") |
| 53 | + .setDescription("This is the second text.") |
| 54 | + .setMessageLayoutResId(R.layout.layout_instruction_simple_message_black) |
| 55 | + .setHighlightHorizontalPadding(R.dimen.space_minus_16dp) |
| 56 | + .setStartDelayMillis(200L) |
| 57 | + .build() |
| 58 | + |
| 59 | +TargetInstructions.with(this@MainActivity) |
| 60 | + .setTargets(arrayListOf(target1, target2, target3)) |
| 61 | + .start() |
| 62 | +``` |
| 63 | + |
| 64 | +## Contributing |
| 65 | +We are always welcome your contribution! |
| 66 | +If you find a bug or want to add new feature, please raise issue. |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +``` |
| 71 | +Copyright 2018 Kyash |
| 72 | +
|
| 73 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 74 | +you may not use this file except in compliance with the License. |
| 75 | +You may obtain a copy of the License at |
| 76 | +
|
| 77 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 78 | +
|
| 79 | +Unless required by applicable law or agreed to in writing, software |
| 80 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 81 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 82 | +See the License for the specific language governing permissions and |
| 83 | +limitations under the License. |
| 84 | +``` |
0 commit comments