Skip to content

Commit

Permalink
Public domain for the methods for GET
Browse files Browse the repository at this point in the history
  • Loading branch information
F4pl0 committed Sep 7, 2019
1 parent e4d7617 commit 6948bd0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.F4pl0:FARLA:0.1.1'
implementation 'com.github.F4pl0:FARLA:0.1.2'
}
14 changes: 2 additions & 12 deletions app/src/main/java/com/f4pl0/farlaexample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,14 @@
import android.widget.Toast;

import com.f4pl0.farla.FARLA;
import com.f4pl0.farla.FarlaGetRequest;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FARLA farla = new FARLA();
farla.GET("http://webhook.site/7a7ca4d3-e601-4950-83bf-47e7bb769dd0", "asd", new FARLA.onResult() {
@Override
public void resultSuccess(String response) {
Toast.makeText(MainActivity.this, response, Toast.LENGTH_SHORT).show();
}

@Override
public void resultFailure(int reason) {
Toast.makeText(MainActivity.this, "FAIL:"+reason, Toast.LENGTH_SHORT).show();
}
});
new FarlaGetRequest(this).
}
}
6 changes: 3 additions & 3 deletions farla/src/main/java/com/f4pl0/farla/FarlaGetRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ public interface onGetRequestListener{
void onFailure(int error);
}

FarlaGetRequest setURL(String URL){
public FarlaGetRequest setURL(String URL){
this.URL = URL;
return this;
}

FarlaGetRequest setListener(onGetRequestListener listener){
public FarlaGetRequest setListener(onGetRequestListener listener){
this.listener = listener;
return this;
}

void execute(){
public void execute(){
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL,
new Response.Listener<String>() {
@Override
Expand Down

0 comments on commit 6948bd0

Please sign in to comment.