Skip to content

Instantly share code, notes, and snippets.

View babedev's full-sized avatar

Christopher Ng babedev

  • BabeDev
  • Bangkok, Thailand
View GitHub Profile
private void generateView() throws IOException {
TypeSpec mvpView = TypeSpec.interfaceBuilder(featureName + "View")
.build();
JavaFile javaFile = JavaFile.builder(packageName + "." + featureName.toLowerCase(), mvpView)
.build();
File file = new File("app/src/main/java");
javaFile.writeTo(file);
}
ViewTreeObserver viewTreeObserver = lvRoot.getViewTreeObserver();
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
listView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
View view = listView.getChildAt(1).findViewById(R.id.icon);
TapTargetView.showFor(TutorialActivity.this, TapTarget.forView(view
, "New Feature", "Click me!!!")
new TapTargetSequence(this)
.targets(
TapTarget.forView(findViewById(R.id.never), "Gonna"),
TapTarget.forView(findViewById(R.id.give), "You", "Up")
.dimColor(android.R.color.never)
.outerCircleColor(R.color.gonna)
.targetCircleColor(R.color.let)
.textColor(android.R.color.you),
TapTarget.forBounds(rickTarget, "Down", ":^)")
.cancelable(false)
TapTargetView.showFor(this, // `this` is an Activity
TapTarget.forView(findViewById(R.id.target), "This is a target", "We have the best targets, believe me")
// All options below are optional
.outerCircleColor(R.color.red) // Specify a color for the outer circle
.targetCircleColor(R.color.white) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.red) // Specify the color of the description text
.textColor(R.color.blue) // Specify a color for both the title and description text