Skip to content

Commit

Permalink
update app
Browse files Browse the repository at this point in the history
  • Loading branch information
domjos1994 committed Dec 12, 2019
1 parent f65884c commit 289bb5e
Show file tree
Hide file tree
Showing 45 changed files with 163 additions and 741 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import de.domjos.unitrackerlibrary.utils.Crypto;
import de.domjos.customwidgets.utils.Crypto;

import static org.junit.Assert.assertEquals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import java.util.List;

import de.domjos.customwidgets.model.objects.BaseDescriptionObject;
import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.services.authentication.GithubTokenProvider;
import de.domjos.unitrackerlibrary.services.engine.Authentication;
import de.domjos.unitrackerlibrary.utils.Converter;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.customwidgets.utils.Converter;
import de.domjos.unitrackermobile.R;
import de.domjos.customwidgets.model.AbstractActivity;
import de.domjos.customwidgets.widgets.swiperefreshdeletelist.SwipeRefreshDeleteList;
Expand Down Expand Up @@ -252,7 +252,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Bitmap bitmap = IntentHelper.getImageFromGallery(requestCode, resultCode, data, this.getApplicationContext());
this.cmdAccountImageGallery.setImageBitmap(bitmap);
} catch (Exception ex) {
MessageHelper.printException(ex, AccountActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, AccountActivity.this);
}
}

Expand Down Expand Up @@ -291,32 +291,32 @@ protected void initControls() {
IBugService bugService = Helper.getCurrentBugService(this.currentAccount, this.getApplicationContext());
if (chkAccountGuest.isChecked() || bugService.testConnection()) {
AccountActivity.this.runOnUiThread(() -> {
MessageHelper.printMessage(this.getString(R.string.accounts_connection_successfully), AccountActivity.this);
MessageHelper.printMessage(this.getString(R.string.accounts_connection_successfully), R.mipmap.ic_launcher_round, AccountActivity.this);
MainActivity.GLOBALS.getSqLiteGeneral().insertOrUpdateAccount(this.currentAccount);
this.manageControls(false, true, false);
this.reload();
OnBoardingHelper.tutorialStep3(AccountActivity.this);
});
} else {
AccountActivity.this.runOnUiThread(() -> MessageHelper.printMessage(this.getString(R.string.accounts_connection_not_successfully), AccountActivity.this));
AccountActivity.this.runOnUiThread(() -> MessageHelper.printMessage(this.getString(R.string.accounts_connection_not_successfully), R.mipmap.ic_launcher_round, AccountActivity.this));
}
} catch (Exception ex) {
Log.v("Exception", ex.toString());
String msg = ex.getMessage();
if(msg!=null) {
if (msg.contains("PHP SOAP")) {
AccountActivity.this.runOnUiThread(() -> MessageHelper.printMessage(this.getString(R.string.messages_no_soap), AccountActivity.this));
AccountActivity.this.runOnUiThread(() -> MessageHelper.printMessage(this.getString(R.string.messages_no_soap), R.mipmap.ic_launcher_round, AccountActivity.this));
} else {
AccountActivity.this.runOnUiThread(() -> MessageHelper.printException(ex, AccountActivity.this));
AccountActivity.this.runOnUiThread(() -> MessageHelper.printException(ex, R.mipmap.ic_launcher_round, AccountActivity.this));
}
}
}
}).start();
} else {
MessageHelper.printMessage(this.getString(R.string.validator_no_success), this.getApplicationContext());
MessageHelper.printMessage(this.getString(R.string.validator_no_success), R.mipmap.ic_launcher_round, this.getApplicationContext());
}
} catch (Exception ex) {
MessageHelper.printException(ex, AccountActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, AccountActivity.this);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;

import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.interfaces.IFunctionImplemented;
import de.domjos.unitrackerlibrary.model.Administration;
Expand All @@ -43,7 +44,6 @@
import de.domjos.unitrackerlibrary.tasks.FieldTask;
import de.domjos.unitrackerlibrary.tasks.IssueTask;
import de.domjos.unitrackerlibrary.tasks.ProjectTask;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.unitrackermobile.R;
import de.domjos.customwidgets.model.AbstractActivity;
import de.domjos.unitrackermobile.helper.ArrayHelper;
Expand Down Expand Up @@ -94,7 +94,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
}
checkPermissions();
} catch (Exception ex) {
MessageHelper.printException(ex, AdministrationActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, AdministrationActivity.this);
}
}
@Override
Expand All @@ -116,7 +116,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
}
checkPermissions();
} catch (Exception ex) {
MessageHelper.printException(ex, AdministrationActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, AdministrationActivity.this);
}
}
@Override
Expand Down Expand Up @@ -243,7 +243,7 @@ private void reloadData1(int data, int projectPosition) {
}
}
} catch (Exception ex) {
MessageHelper.printException(ex, this.getApplicationContext());
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.getApplicationContext());
}
}

Expand Down Expand Up @@ -296,9 +296,9 @@ private void writeData(boolean move) {
this.getResources().getStringArray(R.array.administration_data)[this.spData1.getSelectedItemPosition()],
move ? this.getString(R.string.administration_move) : this.getString(R.string.administration_copy)
);
MessageHelper.printMessage(message, this.ctx);
MessageHelper.printMessage(message, R.mipmap.ic_launcher_round, this.ctx);
} catch (Exception ex) {
MessageHelper.printException(ex, this.getApplicationContext());
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.getApplicationContext());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Date;
import java.util.List;

import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.customwidgets.widgets.calendar.Event;
import de.domjos.customwidgets.widgets.calendar.WidgetCalendar;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
Expand All @@ -22,7 +23,6 @@
import de.domjos.unitrackerlibrary.tasks.IssueTask;
import de.domjos.unitrackerlibrary.tasks.ProjectTask;
import de.domjos.unitrackerlibrary.tasks.VersionTask;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.unitrackermobile.R;
import de.domjos.customwidgets.model.AbstractActivity;
import de.domjos.unitrackermobile.helper.Helper;
Expand Down Expand Up @@ -156,7 +156,7 @@ public void onPostExecute(Object o) {
projectTask.execute(0);
}
} catch (Exception ex) {
MessageHelper.printException(ex, CalendarActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, CalendarActivity.this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.LinkedList;
import java.util.List;

import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.export.TrackerXML;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.model.issues.CustomField;
Expand All @@ -51,8 +52,7 @@
import de.domjos.unitrackerlibrary.tasks.FieldTask;
import de.domjos.unitrackerlibrary.tasks.IssueTask;
import de.domjos.unitrackerlibrary.tasks.ProjectTask;
import de.domjos.unitrackerlibrary.utils.Converter;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.customwidgets.utils.Converter;
import de.domjos.unitrackermobile.R;
import de.domjos.customwidgets.model.AbstractActivity;
import de.domjos.unitrackermobile.helper.Helper;
Expand Down Expand Up @@ -109,7 +109,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
List<Project> projects = projectTask.execute(0).get();
projectAdapter.addAll(projects);
} catch (Exception ex) {
MessageHelper.printException(ex, ExportActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, ExportActivity.this);
}
}

Expand Down Expand Up @@ -138,7 +138,7 @@ public void onNothingSelected(AdapterView<?> parent) {
this.copyExampleContent(R.raw.example_projects, "example_projects.xslt", download);
this.copyExampleContent(R.raw.example_issues, "example_issues.xslt", download);
this.copyExampleContent(R.raw.example_custom_fields, "example_custom_fields.xslt", download);
MessageHelper.printMessage(this.getString(R.string.export_extended_xml_xslt_example_success), ExportActivity.this);
MessageHelper.printMessage(this.getString(R.string.export_extended_xml_xslt_example_success), R.mipmap.ic_launcher_round, ExportActivity.this);
}
});

Expand Down Expand Up @@ -204,12 +204,12 @@ public void onNothingSelected(AdapterView<?> parent) {
break;
}
exportTask.execute(objects.toArray()).get();
MessageHelper.printMessage(this.getString(R.string.export_success), ExportActivity.this);
MessageHelper.printMessage(this.getString(R.string.export_success), R.mipmap.ic_launcher_round, ExportActivity.this);
}
} catch (Exception ex) {
MessageHelper.printException(ex, ExportActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, ExportActivity.this);
} catch (OutOfMemoryError error) {
MessageHelper.printMessage(error.getMessage(), ExportActivity.this);
MessageHelper.printMessage(error.getMessage(), R.mipmap.ic_launcher_round, ExportActivity.this);
}
});
}
Expand All @@ -221,7 +221,7 @@ private void copyExampleContent(int resource, String name, String path) {
outputStreamWriter.write(content);
outputStreamWriter.close();
} catch (Exception ex) {
MessageHelper.printException(ex, ExportActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, ExportActivity.this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
import java.util.Objects;

import de.domjos.customwidgets.model.objects.BaseDescriptionObject;
import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.interfaces.IFunctionImplemented;
import de.domjos.unitrackerlibrary.model.issues.CustomField;
import de.domjos.unitrackerlibrary.model.projects.Project;
import de.domjos.unitrackerlibrary.services.engine.Authentication;
import de.domjos.unitrackerlibrary.tasks.FieldTask;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.unitrackermobile.R;
import de.domjos.customwidgets.model.AbstractActivity;
import de.domjos.customwidgets.widgets.swiperefreshdeletelist.SwipeRefreshDeleteList;
Expand Down Expand Up @@ -84,7 +84,7 @@ public void onDelete(BaseDescriptionObject listObject) {
new FieldTask(FieldActivity.this, bugService, currentProject.getId(), true, settings.showNotifications(), R.drawable.ic_text_fields_black_24dp).execute(((CustomField)listObject.getObject()).getId()).get();
manageControls(false, true, false);
} catch (Exception ex) {
MessageHelper.printException(ex, FieldActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, FieldActivity.this);
}
}
});
Expand Down Expand Up @@ -112,7 +112,7 @@ protected void reload() {
}
}
} catch (Exception ex) {
MessageHelper.printException(ex, FieldActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, FieldActivity.this);
}
}

Expand All @@ -136,7 +136,7 @@ protected void initControls() {
this.reload();
this.manageControls(false, true, false);
} catch (Exception ex) {
MessageHelper.printException(ex, FieldActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, FieldActivity.this);
}
break;
case R.id.navCancel:
Expand All @@ -150,10 +150,10 @@ protected void initControls() {
this.reload();
this.manageControls(false, true, false);
} else {
MessageHelper.printMessage(this.getString(R.string.validator_no_success), this.getApplicationContext());
MessageHelper.printMessage(this.getString(R.string.validator_no_success), R.mipmap.ic_launcher_round, this.getApplicationContext());
}
} catch (Exception ex) {
MessageHelper.printException(ex, FieldActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, FieldActivity.this);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@

import java.util.List;

import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.interfaces.IFunctionImplemented;
import de.domjos.unitrackerlibrary.model.issues.Issue;
import de.domjos.unitrackerlibrary.model.projects.Version;
import de.domjos.unitrackerlibrary.tasks.IssueTask;
import de.domjos.unitrackerlibrary.tasks.VersionTask;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.unitrackermobile.R;
import de.domjos.unitrackermobile.adapter.PagerAdapter;
import de.domjos.customwidgets.model.AbstractActivity;
Expand Down Expand Up @@ -82,7 +82,7 @@ protected void initControls() {
this.issue = new Issue();
}
} catch (Exception ex) {
MessageHelper.printException(ex, IssueActivity.this);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, IssueActivity.this);
}

// init Navigation-View
Expand Down Expand Up @@ -141,10 +141,10 @@ protected void initControls() {
this.setResult(RESULT_OK);
this.finish();
} else {
MessageHelper.printMessage(this.getString(R.string.validator_no_success), this.getApplicationContext());
MessageHelper.printMessage(this.getString(R.string.validator_no_success), R.mipmap.ic_launcher_round, this.getApplicationContext());
}
} catch (Exception ex) {
MessageHelper.printException(ex, this.getApplicationContext());
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.getApplicationContext());
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
import java.io.File;
import java.util.ArrayList;

import de.domjos.customwidgets.utils.MessageHelper;
import de.domjos.unitrackerlibrary.interfaces.IBugService;
import de.domjos.unitrackerlibrary.model.projects.Project;
import de.domjos.unitrackerlibrary.services.engine.Authentication;
import de.domjos.unitrackerlibrary.tasks.LocalSyncTask;
import de.domjos.unitrackerlibrary.tasks.ProjectTask;
import de.domjos.unitrackerlibrary.utils.MessageHelper;
import de.domjos.unitrackermobile.R;
import de.domjos.unitrackermobile.adapter.LocalSyncAdapter;
import de.domjos.customwidgets.model.AbstractActivity;
Expand Down Expand Up @@ -71,7 +71,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
try {
reloadProjects(position);
} catch (Exception ex) {
MessageHelper.printException(ex, activity);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, activity);
}
}

Expand Down Expand Up @@ -139,7 +139,7 @@ protected void initControls() {
this.sync();
}
} catch (Exception ex) {
MessageHelper.printException(ex, this.activity);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.activity);
}
}

Expand All @@ -165,10 +165,10 @@ private void sync() {
}

LocalSyncTask localSyncTask = new LocalSyncTask(this.activity, bugService, this.settings.showNotifications(), this.settings.getLocalSyncPath(), pid);
MessageHelper.printMessage(localSyncTask.execute().get(), LocalSyncActivity.this);
MessageHelper.printMessage(localSyncTask.execute().get(), R.mipmap.ic_launcher_round, LocalSyncActivity.this);
this.reload();
} catch (Exception ex) {
MessageHelper.printException(ex, this.activity);
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.activity);
}
}

Expand Down Expand Up @@ -224,7 +224,7 @@ private void reload(String search) {
this.expLvLocalSync.setAdapter(localSyncAdapter);
localSyncAdapter.notifyDataSetChanged();
} catch (Exception ex) {
MessageHelper.printException(ex, this.getApplicationContext());
MessageHelper.printException(ex, R.mipmap.ic_launcher_round, this.getApplicationContext());
}
}
}
Loading

0 comments on commit 289bb5e

Please sign in to comment.