Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions openmrs-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ dependencies {
'com.google.dexmaker:dexmaker:1.2',
'com.jayway.android.robotium:robotium-solo:4.2'
)

androidTestImplementation files('libs/the-missing-android-xml-junit-test-runner-release-1.3_2.jar')
debugImplementation 'com.github.jainsahab:Snooper-Okhttp:1.5.4'
releaseImplementation 'com.github.jainsahab:Snooper-Okhttp-No-Op:1.5.4'
Expand All @@ -145,7 +144,6 @@ dependencies {
implementation 'net.zetetic:android-database-sqlcipher:4.1.3@aar'
implementation 'org.jdeferred:jdeferred-android-aar:1.2.4'
implementation "androidx.legacy:legacy-support-v13:$support_version"
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation "com.android.support:support-v4:28.0.+"
Expand Down Expand Up @@ -173,7 +171,6 @@ dependencies {
annotationProcessor "androidx.room:room-compiler:$room_version"
// Swipe reveal layout
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'

//Leak Canary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
}
Expand Down
Binary file removed openmrs-client/libs/activeandroid-3.1.0-SNAPSHOT.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void setPresenter(ProviderDashboardContract.Presenter presenter) {

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == EDIT_PROVIDER_REQ_CODE) {
if (resultCode == RESULT_OK) {
this.provider = (Provider) data.getSerializableExtra(ApplicationConstants.BundleKeys.PROVIDER_ID_BUNDLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import android.app.IntentService;
import android.content.Intent;

import com.activeandroid.query.Select;

import org.openmrs.mobile.api.repository.VisitRepository;
import org.openmrs.mobile.dao.PatientDAO;
import org.openmrs.mobile.dao.VisitDAO;
Expand All @@ -23,6 +21,7 @@
import org.openmrs.mobile.models.Encounter;
import org.openmrs.mobile.models.EncounterType;
import org.openmrs.mobile.models.Encountercreate;
import org.openmrs.mobile.utilities.ActiveAndroid.query.Select;
import org.openmrs.mobile.utilities.NetworkUtils;
import org.openmrs.mobile.utilities.ToastUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
import android.app.IntentService;
import android.content.Intent;

import com.activeandroid.ActiveAndroid;
import com.activeandroid.query.Delete;

import org.openmrs.mobile.models.EncounterType;
import org.openmrs.mobile.models.FormResource;
import org.openmrs.mobile.models.Results;
import org.openmrs.mobile.utilities.ActiveAndroid.ActiveAndroid;
import org.openmrs.mobile.utilities.ActiveAndroid.query.Delete;
import org.openmrs.mobile.utilities.NetworkUtils;
import org.openmrs.mobile.utilities.ToastUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.activeandroid.query.Select;

import org.jdeferred.android.AndroidDeferredManager;
import org.openmrs.mobile.api.EncounterService;
Expand All @@ -39,6 +38,7 @@
import org.openmrs.mobile.models.PatientIdentifier;
import org.openmrs.mobile.models.PatientPhoto;
import org.openmrs.mobile.models.Results;
import org.openmrs.mobile.utilities.ActiveAndroid.query.Select;
import org.openmrs.mobile.utilities.NetworkUtils;
import org.openmrs.mobile.utilities.ToastUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import android.os.Build;
import android.preference.PreferenceManager;

import com.activeandroid.ActiveAndroid;
import com.activeandroid.Configuration;
import com.prateekj.snooper.AndroidSnooper;

import net.sqlcipher.database.SQLiteDatabase;
Expand All @@ -35,6 +33,8 @@
import org.openmrs.mobile.models.Link;
import org.openmrs.mobile.models.Obscreate;
import org.openmrs.mobile.services.AuthenticateCheckService;
import org.openmrs.mobile.utilities.ActiveAndroid.ActiveAndroid;
import org.openmrs.mobile.utilities.ActiveAndroid.Configuration;
import org.openmrs.mobile.utilities.ApplicationConstants;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

package org.openmrs.mobile.dao;

import com.activeandroid.query.Select;

import net.sqlcipher.Cursor;

import org.openmrs.mobile.databases.DBOpenHelper;
Expand All @@ -25,6 +23,7 @@
import org.openmrs.mobile.models.Encounter;
import org.openmrs.mobile.models.EncounterType;
import org.openmrs.mobile.models.Observation;
import org.openmrs.mobile.utilities.ActiveAndroid.query.Select;
import org.openmrs.mobile.utilities.DateUtils;
import org.openmrs.mobile.utilities.FormService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

package org.openmrs.mobile.models;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import org.openmrs.mobile.utilities.ActiveAndroid.Model;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Column;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Table;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

package org.openmrs.mobile.models;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import org.openmrs.mobile.utilities.ActiveAndroid.Model;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Column;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Table;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@

package org.openmrs.mobile.models;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;

import org.openmrs.mobile.utilities.ActiveAndroid.Model;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Column;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Table;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

package org.openmrs.mobile.models;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import org.openmrs.mobile.utilities.ActiveAndroid.Model;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Column;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Table;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

package org.openmrs.mobile.models;

import com.activeandroid.Model;
import com.activeandroid.annotation.Table;
import org.openmrs.mobile.utilities.ActiveAndroid.Model;
import org.openmrs.mobile.utilities.ActiveAndroid.annotation.Table;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package org.openmrs.mobile.utilities.ActiveAndroid;

/*
* Copyright (C) 2010 Michael Pardo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import org.openmrs.mobile.utilities.ActiveAndroid.util.Log;


public final class ActiveAndroid {
//////////////////////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
//////////////////////////////////////////////////////////////////////////////////////

public static void initialize(Context context) {
initialize(new Configuration.Builder(context).create());
}

public static void initialize(Configuration configuration) {
initialize(configuration, false);
}

public static void initialize(Context context, boolean loggingEnabled) {
initialize(new Configuration.Builder(context).create(), loggingEnabled);
}

public static void initialize(Configuration configuration, boolean loggingEnabled) {
// Set logging enabled first
setLoggingEnabled(loggingEnabled);
Cache.initialize(configuration);
}

public static void clearCache() {
Cache.clear();
}

public static void dispose() {
Cache.dispose();
}

public static void setLoggingEnabled(boolean enabled) {
Log.setEnabled(enabled);
}

public static SQLiteDatabase getDatabase() {
return Cache.openDatabase();
}

public static void beginTransaction() {
Cache.openDatabase().beginTransaction();
}

public static void endTransaction() {
Cache.openDatabase().endTransaction();
}

public static void setTransactionSuccessful() {
Cache.openDatabase().setTransactionSuccessful();
}

public static boolean inTransaction() {
return Cache.openDatabase().inTransaction();
}

public static void execSQL(String sql) {
Cache.openDatabase().execSQL(sql);
}

public static void execSQL(String sql, Object[] bindArgs) {
Cache.openDatabase().execSQL(sql, bindArgs);
}
}
Loading