Skip to content

Button plugins for Zettel Notes : Markdown Note Taking app for Android

License

Notifications You must be signed in to change notification settings

damionx7/Zettel-Notes-Plugin-Buttons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugins for Zettel Notes

Steps to create new plugin

  1. Add maven { url "https://jitpack.io"} in build.gradle repositories (read more at https://jitpack.io/)
  2. Add implementation 'com.github.damionx7:Zettel-Notes-Plugin-Api:1.0.21' in build.gradle
  3. Add intent-filter in AndroidManifest.xml
<intent-filter>
    <action android:name="org.eu.thedoc.zettelnotes.intent.buttons" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
  1. Create Button class and make it extend ButtonInterface
public class Button
    extends ButtonInterface {

  private final Listener mListener = new Listener() {
    @Override
    public void onClick() {
      if (mCallback != null) {
        mCallback.insertText("\uD83D\uDE04");
      }
    }

    @Override
    public boolean onLongClick() {
      if (mCallback != null) {
        String selectedText = mCallback.getTextSelected(false);
        if (!selectedText.isEmpty()) {
          mCallback.replaceTextSelected("\uD83D\uDE04");
          return true;
        }
      }
      return false;
    }

  };

  @Override
  public String getName() {
    return "Plugin";
  }

  @Override
  public Listener getListener() {
    return mListener;
  }
}

About

Button plugins for Zettel Notes : Markdown Note Taking app for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages