Skip to content

Commit

Permalink
Wrapping up first MVP
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizoku-oh committed Aug 18, 2023
1 parent 2e29a8a commit fb02511
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
Expand Down Expand Up @@ -78,7 +77,7 @@ public void onResponse(@NonNull Call<Token> call, @NonNull Response<Token> respo
}

@Override
public void onFailure(@NonNull Call<Token> call, Throwable t) {
public void onFailure(@NonNull Call<Token> call, @NonNull Throwable t) {
Snackbar.make(findViewById(R.id.linearLayout),
"Failed to login", Snackbar.LENGTH_SHORT)
.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class ProfileActivity extends AppCompatActivity {
TextView usernameTextView;
TextView balanceTextView;
ApiClient apiClient;

Call<GetUser> apiCall;
Retrofit retrofit;
String fullToken;
Expand Down Expand Up @@ -70,7 +69,7 @@ public void onResponse(@NonNull Call<GetUser> call, @NonNull Response<GetUser> r
}

@Override
public void onFailure(Call<GetUser> call, Throwable t) {
public void onFailure(@NonNull Call<GetUser> call, @NonNull Throwable t) {
Log.e(TAG, "onFailure: " + t.getMessage());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void onResponse(@NonNull Call<GetUser> call, @NonNull Response<GetUser> r
"User created, login to continue", Snackbar.LENGTH_LONG)
.show();
loginIntent = new Intent(SignUpActivity.this, LoginActivity.class);
loginIntent.putExtra("email", response.body().getEmail().toString());
loginIntent.putExtra("email", response.body().getEmail());
startActivity(loginIntent);
} else {
Log.v(TAG, "response is not successful");
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/restokenapp/models/Token.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example.restokenapp.models;

import androidx.annotation.NonNull;

import com.google.gson.annotations.SerializedName;

public class Token {
Expand Down Expand Up @@ -35,6 +37,7 @@ public String getFullToken() {
return this.tokenType + " " + this.accessToken;
}

@NonNull
@Override
public String toString() {
return "Token {" +
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_sign_up.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
android:drawableEnd="@drawable/user_icon"
android:drawableTint="@color/colorTextBlack"
android:fontFamily="@font/seg_ui_semibold"
android:hint="username"
android:hint="Username"
android:inputType="textPersonName"
android:paddingLeft="26dp"
android:paddingRight="26dp"
Expand Down

0 comments on commit fb02511

Please sign in to comment.