This file contains hidden or 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
onView(withId(R.id.my_view)) | |
onView(allOf(withId(R.id.my_view), withText("Hello!"))) | |
onView(allOf(withId(R.id.my_view), not(withText("Unwanted")))) |
This file contains hidden or 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
package com.drawers.myapplication; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Point; | |
import android.os.Build; | |
import android.util.AttributeSet; | |
import android.view.Display; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains hidden or 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
import rx.Observable; | |
import java.util.Queue; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* Created by harshitbangar on 19/08/16. |
This file contains hidden or 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
import rx.Subscriber; | |
/** | |
* Created by harshitbangar on 19/08/16. | |
*/ | |
public class MainClass { | |
public static void main(String[] args) { | |
QueueLibraryManager queueLibraryManager = new QueueLibraryManager(); | |
queueLibraryManager.addToQueue("arbit").subscribe(new TestSubscriber()); |
This file contains hidden or 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
import android.text.TextUtils; | |
import io.realm.Case; | |
import io.realm.Realm; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public class RealmFullTextSearch { | |
public static <T extends RealmObject> RealmResults<T> search(Realm realm, Class<T> modelClass, String query, String fieldName, boolean partialSearch){ |
This file contains hidden or 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
public class ApplicationLifeCycleHandler implements Application.ActivityLifecycleCallbacks { | |
// Using the approach defined here - http://steveliles.github.io/is_my_android_app_currently_foreground_or_background.html | |
public interface Listener { | |
public void onBecameForeground(); | |
public void onBecameBackground(); | |
} | |
public class ClienStateIndicationListener implements Listener { | |
XMPPConnection xmppConnection; |
This file contains hidden or 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
/* | |
* The code is taken from ProjectMaxs. For details please look - https://github.com/ProjectMAXS/maxs/blob/73043374fa4ec0ce0d881bb8d42a241ef80fa9eb/transport-xmpp/src/org/projectmaxs/transport/xmpp/xmppservice/XMPPService.java | |
*/ | |
xmppConnection.addStanzaAcknowledgedListener(new StanzaListener() { | |
@Override | |
public void processPacket(Stanza packet) throws SmackException.NotConnectedException, InterruptedException { | |
removePacket(packet.getStanzaId()); | |
} | |
}); |
This file contains hidden or 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
/* | |
* The code is taken from ProjectMaxs. For details please look - https://github.com/ProjectMAXS/maxs/blob/73043374fa4ec0ce0d881bb8d42a241ef80fa9eb/transport-xmpp/src/org/projectmaxs/transport/xmpp/xmppservice/XMPPService.java | |
*/ | |
final Roster roster = Roster.getInstanceFor(connection); | |
// Setup the roster store | |
File rosterStoreDirectory = FileUtil.getFileDir(mContext, "rosterStore"); | |
RosterStore rosterStore = DirectoryRosterStore.init(rosterStoreDirectory); | |
roster.setRosterStore(rosterStore); |
This file contains hidden or 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
#!/bin/bash | |
# Pull this file down, make it executable and run it with sudo | |
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh | |
# chmod u+x build-erlang-17.0.sh | |
# sudo ./build-erlang-17.0.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
This file contains hidden or 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
### | |
### ejabberd configuration file | |
### | |
### | |
### The parameters used in this configuration file are explained in more detail | |
### in the ejabberd Installation and Operation Guide. | |
### Please consult the Guide in case of doubts, it is included with | |
### your copy of ejabberd, and is also available online at | |
### http://www.process-one.net/en/ejabberd/docs/ |