Back to project page antigravity.
The source code is released under:
GNU General Public License
If you think the Android project antigravity listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.floatboth.antigravity.post; //from w w w. ja v a2 s . c o m import java.util.List; import java.util.Arrays; import com.floatboth.antigravity.data.*; public class LinkPostFactory implements PostFactory { public final File file; public LinkPostFactory(File file) { this.file = file; } public boolean isAvailable() { return file.isPublic; } public Post makePost(String text) { Post p = new Post(); p.text = text; p.entities = new Entities(); LinkEntity le = new LinkEntity(); le.pos = 0; le.len = text.length(); le.url = file.shortUrl; p.entities.links = Arrays.asList(le); return p; } public String factoryName() { return "Direct link"; } }