Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 0b0194b

Browse files
committed
fix lint checks
1 parent 53afbc1 commit 0b0194b

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

app/src/main/java/ai/elimu/crowdsource/ui/authentication/SignInWithWeb3Activity.java

+9-20
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111
import androidx.annotation.NonNull;
1212
import androidx.appcompat.app.AppCompatActivity;
1313

14-
import com.google.android.gms.auth.api.signin.GoogleSignIn;
15-
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
16-
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
17-
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
18-
import com.google.android.gms.common.SignInButton;
19-
import com.google.android.gms.common.api.ApiException;
20-
import com.google.android.gms.common.api.CommonStatusCodes;
21-
import com.google.android.gms.tasks.Task;
22-
2314
import org.json.JSONException;
2415
import org.json.JSONObject;
2516
import org.walletconnect.Session;
@@ -29,7 +20,6 @@
2920
import java.util.concurrent.Executors;
3021

3122
import ai.elimu.crowdsource.BaseApplication;
32-
import ai.elimu.crowdsource.BuildConfig;
3323
import ai.elimu.crowdsource.MainActivity;
3424
import ai.elimu.crowdsource.R;
3525
import ai.elimu.crowdsource.rest.ContributorService;
@@ -51,9 +41,8 @@
5141
*/
5242
public class SignInWithWeb3Activity extends AppCompatActivity implements Session.Callback {
5343

54-
private static String w3Account = "";
5544
public static final String W3_SIGN_MESSAGE = "elimu.ai";
56-
45+
private static String w3Account = "";
5746
private Button connectW3Button;
5847

5948
private ProgressBar signInProgressBar;
@@ -131,7 +120,7 @@ protected void onStart() {
131120
// Web3 Sign In button.
132121
initialSetup();
133122

134-
if (!w3Account.equals("")){
123+
if (!w3Account.equals("")) {
135124
updateUIW3(w3Account);
136125
}
137126

@@ -163,15 +152,15 @@ private void updateUIW3(String web3Account) {
163152
} catch (JSONException e) {
164153
Timber.e(e);
165154
}
166-
Timber.i("contributorJSONObject: " + contributorJSONObject);
155+
Timber.i("contributorJSONObject: %s", contributorJSONObject);
167156

168157
// Register the Contributor in the webapp's database
169158
BaseApplication baseApplication = (BaseApplication) getApplication();
170159
Retrofit retrofit = baseApplication.getRetrofit();
171160
ContributorService contributorService = retrofit.create(ContributorService.class);
172161
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), contributorJSONObject.toString());
173162
Call<ResponseBody> call = contributorService.createContributor(requestBody);
174-
Timber.i("call.request(): " + call.request());
163+
Timber.i("call.request(): %s", call.request());
175164
ExecutorService executorService = Executors.newSingleThreadExecutor();
176165
executorService.execute(new Runnable() {
177166
@Override
@@ -180,11 +169,11 @@ public void run() {
180169

181170
try {
182171
Response<ResponseBody> response = call.execute();
183-
Timber.i("response: " + response);
184-
Timber.i("response.isSuccessful(): " + response.isSuccessful());
172+
Timber.i("response: %s", response);
173+
Timber.i("response.isSuccessful(): %s", response.isSuccessful());
185174
if (response.isSuccessful()) {
186175
String bodyString = response.body().string();
187-
Timber.i("bodyString: " + bodyString);
176+
Timber.i("bodyString: %s", bodyString);
188177

189178
// Persist the Contributor's account details in SharedPreferences
190179
SharedPreferencesHelper.storeWeb3Account(getApplicationContext(), web3Account);
@@ -195,7 +184,7 @@ public void run() {
195184
finish();
196185
} else {
197186
String errorBodyString = response.errorBody().string();
198-
Timber.e("errorBodyString: " + errorBodyString);
187+
Timber.e("errorBodyString: %s", errorBodyString);
199188
// TODO: Handle error
200189

201190
runOnUiThread(() -> {
@@ -208,7 +197,7 @@ public void run() {
208197
});
209198
}
210199
} catch (IOException e) {
211-
Timber.e(e, null);
200+
Timber.e(e);
212201
// TODO: Handle error
213202

214203
runOnUiThread(() -> {

0 commit comments

Comments
 (0)