Tabnine Logo
OneStepHelper
Code IndexAdd Tabnine to your IDE (free)

How to use
OneStepHelper
in
smartisanos.api

Best Java code snippets using smartisanos.api.OneStepHelper (Showing top 11 results out of 315)

origin: SmartisanTech/SmartisanOS-SDK

public static synchronized OneStepHelper getInstance(Context context) {
  if (mInstance == null) {
    mInstance = new OneStepHelper(context);
  }
  return mInstance;
}
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      File f = createTestFileIfNotExists("drag_file_test.txt");
      mOneStepHelper.dragFile(view, f, "text/plain", f.getName());
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      File f = new File(SAMPLE_FILE_DIR, DRAG_IMG_FILE_NAME);
      if (!f.exists()) {
        copyAssetFile2Sdcard(DRAG_IMG_FILE_NAME);
      }
      mOneStepHelper.dragImage(view, f, "image/jpeg");
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View v) {
    if (mOneStepHelper.isOneStepShowing()) {
      mOneStepHelper.dragLink(v, "http://t.tt");
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View v) {
    if (mOneStepHelper.isOneStepShowing()) {
      mOneStepHelper.dragText(v, "永远年轻,永远热泪盈眶!");
      return true;
    }else {
      Toast.makeText(MainActivity.this, "还没进入OneStep模式呢.", Toast.LENGTH_SHORT).show();
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

@Override
public void onClick(View view) {
  if (mOneStepHelper.isOneStepShowing()) {
    mTextDragPopupWindow = mOneStepHelper.showDragPopupText(btn_show_popup,
        dragListener,
        "One Step",
        btn_show_popup.getLeft(),
        btn_show_popup.getTop());
  }
}
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      int size = 3;
      File[] files = new File[size];
      String[] mimeTypes = new String[size];
      File f1 = new File(SAMPLE_FILE_DIR, DRAG_IMG_FILE_NAME);
      if (!f1.exists()) {
        copyAssetFile2Sdcard(DRAG_IMG_FILE_NAME);
      }
      files[0] = f1;
      mimeTypes[0] = "image/jpeg";
      File f2 = new File(SAMPLE_FILE_DIR, "music_cover.png");
      if (!f2.exists()) {
        copyAssetFile2Sdcard("music_cover.png");
      }
      files[1] = f2;
      mimeTypes[1] = "image/png";
      File f3 = new File(SAMPLE_FILE_DIR, "ic_fso_folder.png");
      if (!f3.exists()) {
        copyAssetFile2Sdcard("ic_fso_folder.png");
      }
      files[2] = f3;
      mimeTypes[2] = "image/png";
      mOneStepHelper.dragMultipleImages(view, files, mimeTypes);
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

mOneStepHelper = OneStepHelper.getInstance(MainActivity.this);
View textView = findViewById(R.id.text);
textView.setOnLongClickListener(new View.OnLongClickListener() {
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      //3张图片的尺寸请参考 OneStepHelper 接口说明。
      //background 或 content 为空时使用默认图片;
      //content 和 avatar 同时为空时,相当于调用 mOneStepHelper.dragText(View, CharSequence);
      Bitmap background = null;
      Bitmap content = BitmapFactory.decodeResource(getResources(), R.mipmap.drag_card_content);
      Bitmap avatar = BitmapFactory.decodeResource(getResources(), R.mipmap.music_cover);
      mOneStepHelper.dragText(view, "拖拽的文本内容", background, content, avatar);
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      File f = createTestFileIfNotExists("drag_file_test.mp3");
      Bitmap content = BitmapFactory.decodeResource(getResources(), R.mipmap.drag_card_content);
      Bitmap avatar = BitmapFactory.decodeResource(getResources(), R.mipmap.music_cover);
      mOneStepHelper.dragFile(view, f, "audio/mpeg", null, content, avatar);
      return true;
    }
    return false;
  }
});
origin: SmartisanTech/SmartisanOS-SDK

  @Override
  public boolean onLongClick(View view) {
    if (mOneStepHelper.isOneStepShowing()) {
      File f = new File(SAMPLE_FILE_DIR, DRAG_IMG_FILE_NAME);
      if (!f.exists()) {
        copyAssetFile2Sdcard(DRAG_IMG_FILE_NAME);
      }
      Bitmap specificContent = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_fso_folder);
      mOneStepHelper.dragImage(view, specificContent, f, "image/png");
      return true;
    }
    return false;
  }
});
smartisanos.apiOneStepHelper

Most used methods

  • <init>
  • dragFile
    Long Press and Drag to share a File. We will add file icon for the drag bubble by the file extension
  • dragImage
    Long Press and Drag to share a image.
  • dragLink
    Long Press and Drag to share link. This Method will display a link icon when drag. For example: Smar
  • dragMultipleImages
    Long Press and Drag to share multi images.
  • dragText
    Long Press and Drag to share java.lang.CharSequence content. You can set the style of popup bubble,
  • getInstance
  • isOneStepShowing
    Whether in one step mode or not.
  • showDragPopupText
    Popup drag window to share text. For example: Smartisan Browser App long press and share an select t

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now