mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fix some codacy issues
This commit is contained in:
parent
c712b561d4
commit
1785e9b179
2 changed files with 11 additions and 7 deletions
|
|
@ -98,14 +98,14 @@ public class CommonsApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CommonsApplication getInstance() {
|
public static CommonsApplication getInstance() {
|
||||||
if(instance == null) {
|
if (instance == null) {
|
||||||
instance = new CommonsApplication();
|
instance = new CommonsApplication();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractHttpClient getHttpClient() {
|
public AbstractHttpClient getHttpClient() {
|
||||||
if(httpClient == null) {
|
if (httpClient == null) {
|
||||||
httpClient = newHttpClient();
|
httpClient = newHttpClient();
|
||||||
}
|
}
|
||||||
return httpClient;
|
return httpClient;
|
||||||
|
|
@ -123,7 +123,7 @@ public class CommonsApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MWApi getMWApi() {
|
public MWApi getMWApi() {
|
||||||
if(api == null) {
|
if (api == null) {
|
||||||
api = newMWApi();
|
api = newMWApi();
|
||||||
}
|
}
|
||||||
return api;
|
return api;
|
||||||
|
|
@ -134,14 +134,14 @@ public class CommonsApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CacheController getCacheData() {
|
public CacheController getCacheData() {
|
||||||
if(cacheData == null) {
|
if (cacheData == null) {
|
||||||
cacheData = new CacheController();
|
cacheData = new CacheController();
|
||||||
}
|
}
|
||||||
return cacheData;
|
return cacheData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RequestQueue getVolleyQueue() {
|
public RequestQueue getVolleyQueue() {
|
||||||
if(volleyQueue == null) {
|
if (volleyQueue == null) {
|
||||||
DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024);
|
DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024);
|
||||||
volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack()));
|
volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack()));
|
||||||
volleyQueue.start();
|
volleyQueue.start();
|
||||||
|
|
@ -150,7 +150,7 @@ public class CommonsApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized DBOpenHelper getDBOpenHelper() {
|
public synchronized DBOpenHelper getDBOpenHelper() {
|
||||||
if(dbOpenHelper == null) {
|
if (dbOpenHelper == null) {
|
||||||
dbOpenHelper = new DBOpenHelper(this);
|
dbOpenHelper = new DBOpenHelper(this);
|
||||||
}
|
}
|
||||||
return dbOpenHelper;
|
return dbOpenHelper;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,11 @@ public class SignupActivity extends BaseActivity {
|
||||||
//Signup success, so clear cookies, notify user, and load LoginActivity again
|
//Signup success, so clear cookies, notify user, and load LoginActivity again
|
||||||
Timber.d("Overriding URL %s", url);
|
Timber.d("Overriding URL %s", url);
|
||||||
|
|
||||||
Toast toast = Toast.makeText(CommonsApplication.getInstance(), "Account created!", Toast.LENGTH_LONG);
|
Toast toast = Toast.makeText(
|
||||||
|
CommonsApplication.getInstance(),
|
||||||
|
"Account created!",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
|
||||||
Intent intent = new Intent(CommonsApplication.getInstance(), LoginActivity.class);
|
Intent intent = new Intent(CommonsApplication.getInstance(), LoginActivity.class);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue