Skip to content

Commit a0c3085

Browse files
committed
library version downgrade
1 parent 5daafe1 commit a0c3085

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

app/src/main/java/com/pavel/responsecode/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ protected void onCreate(Bundle savedInstanceState) {
3131
@Override
3232
public void onClick(View view) {
3333

34-
if (!httpResponseCode.checkResponse(530)){
34+
if (!httpResponseCode.checkResponse(201)){
35+
3536
/**
3637
*
3738
* do what ever you want if status code is not 200 then automaticaly status will show through a toast
3839
*
3940
*/
41+
4042
}
4143
}
4244
});

responsecode/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 28
5-
6-
4+
compileSdkVersion 26
75

86
defaultConfig {
97
minSdkVersion 16
10-
targetSdkVersion 28
8+
targetSdkVersion 26
119
versionCode 1
1210
versionName "1.0"
1311

@@ -35,7 +33,7 @@ android {
3533
dependencies {
3634
implementation fileTree(dir: 'libs', include: ['*.jar'])
3735

38-
implementation 'com.android.support:appcompat-v7:28.0.0'
36+
implementation 'com.android.support:appcompat-v7:26.0.2'
3937
testImplementation 'junit:junit:4.12'
4038
androidTestImplementation 'com.android.support.test:runner:1.0.2'
4139
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

responsecode/src/main/java/com/pavel/response/code/HttpResponseCode.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public class HttpResponseCode {
1111
public boolean isShowStatus;
1212

1313
public HttpResponseCode(){
14-
1514
}
1615

1716
public HttpResponseCode(Context context , boolean isShowStatus){
@@ -21,14 +20,11 @@ public HttpResponseCode(Context context , boolean isShowStatus){
2120

2221

2322
public boolean checkResponse(int responseCode){
24-
2523
boolean returnResponse = false;
26-
2724
if (responseCode == 200){
2825
returnResponse = true;
2926
}
3027

31-
3228
else if(responseCode == 100 ){
3329
returnResponse = false;
3430
showStatus("Server continue working");
@@ -49,44 +45,36 @@ else if(responseCode == 201 ){
4945
showStatus("Server resources are created");
5046
}
5147

52-
5348
else if(responseCode == 202 ){
5449
returnResponse = false;
5550
showStatus("Server request accepted");
5651
}
5752

58-
59-
6053
else if(responseCode == 203 ){
6154
returnResponse = false;
6255
showStatus("Server Non-Authoritative Information ");
6356
}
6457

65-
6658
else if(responseCode == 204 ){
6759
returnResponse = false;
6860
showStatus("The server successfully processed the request and is not returning any content.");
6961
}
7062

71-
7263
else if(responseCode == 205 ){
7364
returnResponse = false;
7465
showStatus("Server is no returning any content");
7566
}
7667

77-
7868
else if(responseCode == 206 ){
7969
returnResponse = false;
8070
showStatus("The server is delivering only part of the resource ");
8171
}
8272

83-
8473
else if(responseCode == 207 ){
8574
returnResponse = false;
8675
showStatus(" XML message and can contain a number");
8776
}
8877

89-
9078
else if(responseCode == 208 ){
9179
returnResponse = false;
9280
showStatus("The members of a DAV binding have already been enumerated");

0 commit comments

Comments
 (0)