Skip to content
Snippets Groups Projects
Commit 3fa6457e authored by Christian Dresen's avatar Christian Dresen
Browse files

Warnings in MainManager behoben

parent ca78b94a
No related branches found
No related tags found
No related merge requests found
......@@ -6,23 +6,18 @@ import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.util.Log;
import android.widget.Toast;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import org.mindrot.jbcrypt.BCrypt;
import java.io.IOException;
import java.io.InputStream;
import java.security.Certificate;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
......@@ -35,7 +30,6 @@ import ms.warpzone.warppay.MainActivity;
import ms.warpzone.warppay.R;
import ms.warpzone.warppay.data.SQLiteService;
import ms.warpzone.warppay.data.models.local.Category;
import ms.warpzone.warppay.data.models.local.Product;
import ms.warpzone.warppay.data.models.local.User;
import ms.warpzone.warppay.data.RestService;
import ms.warpzone.warppay.data.models.rest.RestCategory;
......@@ -62,7 +56,6 @@ public class MainManager {
private boolean barcodeLearning=false;
private Timer timer;
private Timer screenSaverTimer;
public AlertDialog alertAmount;
private ProgressDialog pdRefresh = null;
private NotificationDialog ndRefreshError = null;
private Timer tmrRefresh;
......@@ -134,11 +127,11 @@ public class MainManager {
this.refreshData();
}
public void refreshData() {
void refreshData() {
this.refreshData(false);
}
public void refreshData(boolean disableDialog) {
private void refreshData(boolean disableDialog) {
if(this.ndRefreshError != null)
this.ndRefreshError.dismiss();
this.ndRefreshError = null;
......@@ -209,7 +202,7 @@ public class MainManager {
ndRefreshError.getBuilder().setNeutralButton("Refresh", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MainManager.getInstance().refreshData();
MainManager.this.refreshData();
}
});
......@@ -219,7 +212,7 @@ public class MainManager {
final Runnable runnable = new Runnable() {
@Override
public void run() {
MainManager.getInstance().refreshData();
MainManager.this.refreshData();
}
};
......@@ -234,7 +227,7 @@ public class MainManager {
}
}
public void setCurrentUser(User user) {
void setCurrentUser(User user) {
this.setCurrentUser(user,false);
}
......@@ -286,7 +279,7 @@ public class MainManager {
this.timer.schedule(t, 60000);
}
public void startRefreshTimer() {
private void startRefreshTimer() {
this.tmrRefresh = new Timer();
TimerTask t = new TimerTask() {
@Override
......@@ -305,7 +298,7 @@ public class MainManager {
this.tmrRefresh.schedule(t, 60000,60000);
}
public void stopRefreshTimer() {
private void stopRefreshTimer() {
if (this.tmrRefresh != null) {
this.tmrRefresh.cancel();
this.tmrRefresh.purge();
......@@ -331,7 +324,7 @@ public class MainManager {
this.screenSaverTimer.schedule(t, 4000);
}
public void stopScreenSaverTimer() {
private void stopScreenSaverTimer() {
if (this.screenSaverTimer != null) {
this.screenSaverTimer.cancel();
this.screenSaverTimer.purge();
......@@ -341,7 +334,7 @@ public class MainManager {
return this.dataManager.getCurrentUser();
}
public void clearCurrentUser() {
void clearCurrentUser() {
DataManager.getInstance().setLastCardId("");
this.dataManager.clearCurrentUser();
this.uiManager.clearCurrentUser();
......@@ -368,7 +361,7 @@ public class MainManager {
t.setAmount(amount);
t.setTrans_type(1);
t.setCash_paid(true);
ArrayList transactions = new ArrayList<>();
ArrayList<RestTransaction> transactions = new ArrayList<>();
transactions.add(t);
MainManager.getInstance().getRestService().saveTransaction(currentUser.getUserid(), transactions).enqueue(new Callback<Void>() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment