forked from PrivacyStreams/PrivacyStreams
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
face1bc
commit ee4043e
Showing
7 changed files
with
501 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
431 changes: 431 additions & 0 deletions
431
...reams-core/src/main/java/com/github/privacystreams/communication/IMUIUpdatesProvider.java
Large diffs are not rendered by default.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
...acystreams-core/src/main/java/com/github/privacystreams/communication/InstantMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.github.privacystreams.communication; | ||
|
||
|
||
import android.os.Build; | ||
import android.support.annotation.RequiresApi; | ||
import android.view.accessibility.AccessibilityNodeInfo; | ||
|
||
import com.github.privacystreams.core.providers.MStreamProvider; | ||
import com.github.privacystreams.utils.annotations.PSItemField; | ||
|
||
import java.util.List; | ||
|
||
public class InstantMessage extends Message{ | ||
/** | ||
* The current position of this message | ||
* represented by a long[] with left, top, right, bottom | ||
*/ | ||
@PSItemField(type = List.class) | ||
public static final String POSITION = "position"; | ||
|
||
/** | ||
* The root view of the page where this message comes from. | ||
*/ | ||
@PSItemField(type = AccessibilityNodeInfo.class) | ||
public static final String ROOT_NODE = "rootNode"; | ||
|
||
|
||
public InstantMessage(String type, | ||
String content, | ||
String packageName, | ||
String contact, | ||
long timestamp, | ||
int[] position, | ||
AccessibilityNodeInfo rootNode){ | ||
super(type, content, packageName, contact, timestamp); | ||
this.setFieldValue(POSITION, position); | ||
this.setFieldValue(ROOT_NODE, rootNode); | ||
} | ||
|
||
InstantMessage(String type, | ||
String content, | ||
String packageName, | ||
String contact, | ||
long timestamp) { | ||
super(type, content, packageName, contact, timestamp); | ||
} | ||
|
||
/** | ||
* Provide a live stream of new Message items in Instant Messenger (IM) apps, including WhatsApp and Facebook. | ||
* This provider requires Accessibility service turned on. | ||
* | ||
* @return the provider function | ||
*/ | ||
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2) | ||
public static MStreamProvider asUpdatesInIM(){ | ||
return new IMUIUpdatesProvider(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters