-
Notifications
You must be signed in to change notification settings - Fork 1
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
679fdb9
commit 761fc08
Showing
14 changed files
with
32 additions
and
365 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
22 changes: 0 additions & 22 deletions
22
sample/src/main/java/graphsample/imanx/github/com/comgithubimanxgraphsample/Card.java
This file was deleted.
Oops, something went wrong.
47 changes: 1 addition & 46 deletions
47
...le/src/main/java/graphsample/imanx/github/com/comgithubimanxgraphsample/MainActivity.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 |
---|---|---|
@@ -1,61 +1,16 @@ | ||
package graphsample.imanx.github.com.comgithubimanxgraphsample; | ||
|
||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
|
||
import com.github.imanx.QLroid.Query; | ||
import com.github.imanx.QLroid.callback.Callback; | ||
import com.github.imanx.QLroid.request.Header; | ||
import com.github.imanx.QLroid.request.Request; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
public static final String TAG = MainActivity.class.getSimpleName(); | ||
|
||
private String baseUrl = "https://plus.zarinpal.com/api/graphql/my"; | ||
private String token = "Bearer eyJ0eXAiOiJKV1QiL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| ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Header header = new Header(); | ||
header.append("Authorization", token); | ||
header.append("Accept", "application/json"); | ||
|
||
getQuery().setHeader(header) | ||
.setTimeout(10) | ||
.build() | ||
.enqueue(new Callback() { | ||
@Override | ||
public void onResponse(String response) { | ||
Log.i(TAG, "onResponse: " + response); | ||
} | ||
|
||
@Override | ||
public void onFailure(int httpCode, String data) { | ||
Log.i(TAG, "onFailure: " + httpCode + " || " + data); | ||
} | ||
}); | ||
|
||
} | ||
|
||
public Request.Builder getQuery() { | ||
return new Request.Builder(this, Uri.parse(baseUrl), new Query(new Me()) { | ||
@Nullable | ||
@Override | ||
public String getOperationName() { | ||
return "Me"; | ||
} | ||
// TODO : Add sample use github GraphQL API | ||
|
||
// @Override | ||
// public String[] getResponseFields() { | ||
// return new String[]{"first_name", "avatar"}; | ||
// } | ||
}); | ||
} | ||
} |
4 changes: 0 additions & 4 deletions
4
sample/src/main/java/graphsample/imanx/github/com/comgithubimanxgraphsample/MaskedPan.java
This file was deleted.
Oops, something went wrong.
157 changes: 0 additions & 157 deletions
157
sample/src/main/java/graphsample/imanx/github/com/comgithubimanxgraphsample/Me.java
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
...c/main/java/graphsample/imanx/github/com/comgithubimanxgraphsample/TicketDepartments.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.