Search in sources :

Example 31 with GlitchRequest

use of com.tinyspeck.android.GlitchRequest in project glitch-hq-android by tinyspeck.

the class RecentSnapsFragment method getRecentSnaps.

private void getRecentSnaps(boolean bMore) {
    Map<String, String> params = new HashMap<String, String>();
    if (bMore && m_snapsCurrentPage > 0) {
        params.put("page", String.valueOf(m_snapsCurrentPage));
        m_bAppendMode = true;
    } else {
        m_bAppendMode = false;
    }
    GlitchRequest request = m_application.glitch.getRequest("snaps.getRecent", params);
    request.execute(this);
    m_requestCount = 1;
    ((HomeScreen) getActivity()).showSpinner(true);
}
Also used : HashMap(java.util.HashMap) GlitchRequest(com.tinyspeck.android.GlitchRequest)

Example 32 with GlitchRequest

use of com.tinyspeck.android.GlitchRequest in project glitch-hq-android by tinyspeck.

the class ProfileFragment method getProfileInfo.

public void getProfileInfo(boolean bMore) {
    String selfPlayerID = ((HomeScreen) getActivity()).getPlayerID();
    Map<String, String> params = new HashMap<String, String>();
    params.put("player_tsid", m_playerTsid);
    if (m_playerTsid != selfPlayerID)
        params.put("viewer_tsid", selfPlayerID);
    //       params.put("cat", "skill_learned" );
    if (bMore && m_actItemLast != null) {
        params.put("last", m_actItemLast);
        m_bAppendMode = true;
    } else
        m_bAppendMode = false;
    if (m_currentActType == ActivityFragment.ACTIVITY_TYPE_UPDATES)
        params.put("cat", "notes");
    GlitchRequest request1 = m_application.glitch.getRequest("activity.playerFeed", params);
    request1.execute(this);
    GlitchRequest request2 = m_application.glitch.getRequest("skills.listLearning");
    request2.execute(this);
    GlitchRequest request3 = m_application.glitch.getRequest("players.fullInfo", params);
    request3.execute(this);
    GlitchRequest request4 = m_application.glitch.getRequest("skills.listUnlearning");
    request4.execute(this);
    m_requestCount = 4;
    ((HomeScreen) getActivity()).showSpinner(true);
}
Also used : HashMap(java.util.HashMap) GlitchRequest(com.tinyspeck.android.GlitchRequest)

Example 33 with GlitchRequest

use of com.tinyspeck.android.GlitchRequest in project glitch-hq-android by tinyspeck.

the class ProfileFragment method AddOrRemoveFriend.

private void AddOrRemoveFriend(boolean bRemove, String player) {
    Map<String, String> params = new HashMap<String, String>();
    params.put("tsid", player);
    String command = bRemove ? "friends.remove" : "friends.add";
    GlitchRequest request0 = m_application.glitch.getRequest(command, params);
    request0.execute(this);
    m_requestCount = 1;
    ((HomeScreen) getActivity()).showSpinner(true);
}
Also used : HashMap(java.util.HashMap) GlitchRequest(com.tinyspeck.android.GlitchRequest)

Example 34 with GlitchRequest

use of com.tinyspeck.android.GlitchRequest in project glitch-hq-android by tinyspeck.

the class EncyclopediaLocationHubsFragment method getEncyclopediaLocationHubs.

private void getEncyclopediaLocationHubs() {
    if (m_application != null) {
        GlitchRequest request = m_application.glitch.getRequest("locations.getHubs");
        request.execute(this);
        m_requestCount = 1;
        ((HomeScreen) getActivity()).showSpinner(true);
    }
}
Also used : GlitchRequest(com.tinyspeck.android.GlitchRequest)

Example 35 with GlitchRequest

use of com.tinyspeck.android.GlitchRequest in project glitch-hq-android by tinyspeck.

the class MailComposeFragment method sendMail.

private void sendMail() {
    Map<String, String> params = new HashMap<String, String>();
    params.put("recipient", m_recipientTsid);
    params.put("message", m_composer.getText().toString());
    if (m_inReplyTo > 0) {
        params.put("in_reply_to", String.valueOf(m_inReplyTo));
    }
    GlitchRequest request = m_application.glitch.getRequest("mail.sendMessage", params);
    request.execute(this);
    m_requestCount = 1;
    ((HomeScreen) getActivity()).showSpinner(true);
}
Also used : HashMap(java.util.HashMap) GlitchRequest(com.tinyspeck.android.GlitchRequest)

Aggregations

GlitchRequest (com.tinyspeck.android.GlitchRequest)46 HashMap (java.util.HashMap)33 Vector (java.util.Vector)3 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 OnTouchListener (android.view.View.OnTouchListener)1 Button (android.widget.Button)1 FrameLayout (android.widget.FrameLayout)1 ImageView (android.widget.ImageView)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 Glitch (com.tinyspeck.android.Glitch)1 BaseFragment.skillAvailable (com.tinyspeck.glitchhq.BaseFragment.skillAvailable)1 Map (java.util.Map)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1