Commit 0ee62465 authored by rahadi's avatar rahadi

Package Refactoring

parent 03291f77
......@@ -225,6 +225,8 @@ dependencies {
compile 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-messaging:10.0.1'
implementation 'me.texy.treeview:treeview_lib:1.0.3'
}
// Must be at bottom to prevent dependency collisions
......
......@@ -10,8 +10,8 @@ import org.junit.After;
import org.junit.Before;
import id.ac.stis.capi.TestUtils;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.preferences.PreferenceKeys;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.preferences.PreferenceKeys;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
......
......@@ -12,8 +12,8 @@ import java.util.Collections;
import java.util.Map;
import java.util.Set;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
public final class TestUtils {
private TestUtils() {}
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package id.ac.stis.capi.dao;
package id.ac.stis.capi.odk.dao;
import android.database.Cursor;
import android.support.test.runner.AndroidJUnit4;
......@@ -23,10 +23,10 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.dto.Form;
import id.ac.stis.capi.provider.FormsProviderAPI;
import id.ac.stis.capi.utilities.ResetUtility;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.dto.Form;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.utilities.ResetUtility;
import java.io.File;
import java.io.IOException;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package id.ac.stis.capi.dao;
package id.ac.stis.capi.odk.dao;
import android.database.Cursor;
import android.support.test.runner.AndroidJUnit4;
......@@ -23,9 +23,9 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.dto.Instance;
import id.ac.stis.capi.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import java.util.List;
......
package id.ac.stis.capi.tasks;
package id.ac.stis.capi.odk.tasks;
import org.junit.Test;
import id.ac.stis.capi.MockedServerTest;
import id.ac.stis.capi.logic.FormDetails;
import id.ac.stis.capi.odk.logic.FormDetails;
import java.util.Map;
......
package id.ac.stis.capi.tasks;
package id.ac.stis.capi.odk.tasks;
import android.net.Uri;
......@@ -9,10 +9,10 @@ import org.junit.Before;
import org.junit.Test;
import id.ac.stis.capi.MockedServerTest;
import id.ac.stis.capi.dao.InstancesDao;
import id.ac.stis.capi.dto.Instance;
import id.ac.stis.capi.provider.InstanceProviderAPI;
import id.ac.stis.capi.tasks.InstanceUploaderTask.Outcome;
import id.ac.stis.capi.odk.dao.InstancesDao;
import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.tasks.InstanceUploaderTask.Outcome;
import okhttp3.mockwebserver.RecordedRequest;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package id.ac.stis.capi.utilities;
package id.ac.stis.capi.odk.utilities;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
......@@ -23,7 +23,7 @@ import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.odk.application.Collect;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package id.ac.stis.capi.utilities;
package id.ac.stis.capi.odk.utilities;
import android.content.Context;
import android.support.test.filters.Suppress;
......@@ -23,8 +23,8 @@ import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.logic.DatePickerDetails;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.logic.DatePickerDetails;
import java.util.Date;
import java.util.Locale;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package id.ac.stis.capi.utilities;
package id.ac.stis.capi.odk.utilities;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
......@@ -26,9 +26,9 @@ import org.javarosa.form.api.FormEntryPrompt;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.widgets.ImageWidget;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.odk.widgets.ImageWidget;
import java.io.File;
import java.io.IOException;
......@@ -40,7 +40,7 @@ import timber.log.Timber;
import static junit.framework.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static id.ac.stis.capi.utilities.ApplicationConstants.XML_OPENROSA_NAMESPACE;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.XML_OPENROSA_NAMESPACE;
@RunWith(AndroidJUnit4.class)
public class ImageConverterTest {
......
package id.ac.stis.capi.utilities;
package id.ac.stis.capi.odk.utilities;
import org.junit.Before;
import org.junit.Test;
import id.ac.stis.capi.MockedServerTest;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.odk.application.Collect;
import org.opendatakit.httpclientandroidlib.client.HttpClient;
import org.opendatakit.httpclientandroidlib.client.methods.HttpGet;
import org.opendatakit.httpclientandroidlib.protocol.HttpContext;
......
This diff is collapsed.
package id.ac.stis.capi.collectiva;
import id.ac.stis.capi.dto.Instance;
import id.ac.stis.capi.odk.dto.Instance;
import java.util.HashMap;
......
......@@ -2,7 +2,7 @@ package id.ac.stis.capi.collectiva;
import android.util.Log;
import id.ac.stis.capi.utilities.FileUtils;
import id.ac.stis.capi.odk.utilities.FileUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......
......@@ -43,43 +43,43 @@ import android.widget.Toast;
import org.apache.commons.lang3.ArrayUtils;
import id.ac.stis.capi.R;
import id.ac.stis.capi.activities.FormEntryActivity;
import id.ac.stis.capi.activities.GoogleSheetsUploaderActivity;
import id.ac.stis.capi.activities.InstanceUploaderActivity;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.odk.activities.FormEntryActivity;
import id.ac.stis.capi.odk.activities.GoogleSheetsUploaderActivity;
import id.ac.stis.capi.odk.activities.InstanceUploaderActivity;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.collectiva.CapiInstance;
import id.ac.stis.capi.collectiva.preferences.CapiInstancePreferences;
import id.ac.stis.capi.collectiva.ParseXml;
import id.ac.stis.capi.collectiva.preferences.Constants;
import id.ac.stis.capi.collectiva.adapter.CapiInstanceAdapter;
import id.ac.stis.capi.dao.FormsDao;
import id.ac.stis.capi.dao.InstancesDao;
import id.ac.stis.capi.dto.Instance;
import id.ac.stis.capi.listeners.DeleteInstancesListener;
import id.ac.stis.capi.listeners.DiskSyncListener;
import id.ac.stis.capi.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.preferences.PreferenceKeys;
import id.ac.stis.capi.provider.FormsProviderAPI;
import id.ac.stis.capi.provider.InstanceProviderAPI;
import id.ac.stis.capi.provider.InstanceProviderAPI.InstanceColumns;
import id.ac.stis.capi.receivers.NetworkReceiver;
import id.ac.stis.capi.tasks.DeleteInstancesTask;
import id.ac.stis.capi.tasks.InstanceSyncTask;
import id.ac.stis.capi.utilities.ApplicationConstants;
import id.ac.stis.capi.utilities.PlayServicesUtil;
import id.ac.stis.capi.utilities.ToastUtils;
import id.ac.stis.capi.odk.dao.FormsDao;
import id.ac.stis.capi.odk.dao.InstancesDao;
import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.listeners.DeleteInstancesListener;
import id.ac.stis.capi.odk.listeners.DiskSyncListener;
import id.ac.stis.capi.odk.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.odk.preferences.PreferenceKeys;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI.InstanceColumns;
import id.ac.stis.capi.odk.receivers.NetworkReceiver;
import id.ac.stis.capi.odk.tasks.DeleteInstancesTask;
import id.ac.stis.capi.odk.tasks.InstanceSyncTask;
import id.ac.stis.capi.odk.utilities.ApplicationConstants;
import id.ac.stis.capi.odk.utilities.PlayServicesUtil;
import id.ac.stis.capi.odk.utilities.ToastUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_DATE_ASC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_DATE_DESC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_NAME_ASC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_NAME_DESC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_STATUS_ASC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_STATUS_DESC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_DATE_ASC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_DATE_DESC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_NAME_ASC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_NAME_DESC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_STATUS_ASC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_STATUS_DESC;
/**
* Responsible for displaying all the valid instances in the instance directory.
......
......@@ -22,9 +22,9 @@ import com.rahadi.vsen.tasks.UserRegisterTask;
import org.json.JSONArray;
import org.json.JSONObject;
import id.ac.stis.capi.R;
import id.ac.stis.capi.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.preferences.PreferenceKeys;
import id.ac.stis.capi.preferences.PreferencesActivity;
import id.ac.stis.capi.odk.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.odk.preferences.PreferenceKeys;
import id.ac.stis.capi.odk.preferences.PreferencesActivity;
import id.ac.stis.capi.revalidasi.notifikasi.GetUuidTask;
import timber.log.Timber;
......
......@@ -48,11 +48,11 @@ import org.json.JSONArray;
import java.util.ArrayList;
import id.ac.stis.capi.R;
import id.ac.stis.capi.activities.SplashScreenActivity;
import id.ac.stis.capi.odk.activities.SplashScreenActivity;
import id.ac.stis.capi.collectiva.fragment.CapiFormFragment;
import id.ac.stis.capi.collectiva.preferences.CapiInstancePreferences;
import id.ac.stis.capi.database.ItemsetDbAdapter;
import id.ac.stis.capi.listeners.DiskSyncListener;
import id.ac.stis.capi.odk.database.ItemsetDbAdapter;
import id.ac.stis.capi.odk.listeners.DiskSyncListener;
import id.ac.stis.capi.pemutakhiran.fragments.BSFragment;
import id.ac.stis.capi.petawbdigital.activities.GeoPointMapboxRevoActivity;
import id.ac.stis.capi.petawbdigital.assets.VAR;
......@@ -60,11 +60,11 @@ import id.ac.stis.capi.petawbdigital.externals.AksesDataOdk;
import id.ac.stis.capi.petawbdigital.fragments.WbFragment;
import id.ac.stis.capi.petawbdigital.models.BlokSensus;
import id.ac.stis.capi.petawbdigital.models.Form;
import id.ac.stis.capi.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.preferences.PreferenceKeys;
import id.ac.stis.capi.odk.preferences.GeneralSharedPreferences;
import id.ac.stis.capi.odk.preferences.PreferenceKeys;
import id.ac.stis.capi.revalidasi.fragments.DataDownloadFragment;
import id.ac.stis.capi.revalidasi.notifikasi.GetUuidTask;
import id.ac.stis.capi.tasks.DiskSyncTask;
import id.ac.stis.capi.odk.tasks.DiskSyncTask;
import timber.log.Timber;
/**
......
......@@ -31,11 +31,11 @@ import id.ac.stis.capi.R;
import id.ac.stis.capi.collectiva.CapiInstance;
import id.ac.stis.capi.collectiva.preferences.Constants;
import id.ac.stis.capi.collectiva.activity.CapiInstanceActivity;
import id.ac.stis.capi.dao.FormsDao;
import id.ac.stis.capi.dto.Instance;
import id.ac.stis.capi.provider.FormsProviderAPI.FormsColumns;
import id.ac.stis.capi.provider.InstanceProviderAPI;
import id.ac.stis.capi.utilities.ApplicationConstants;
import id.ac.stis.capi.odk.dao.FormsDao;
import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.provider.FormsProviderAPI.FormsColumns;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.utilities.ApplicationConstants;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......
......@@ -37,18 +37,18 @@ import org.kxml2.kdom.Document;
import org.kxml2.kdom.Element;
import org.kxml2.kdom.Node;
import id.ac.stis.capi.R;
import id.ac.stis.capi.adapters.CapiFormAdapter;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.odk.adapters.CapiFormAdapter;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.collectiva.preferences.CapiInstancePreferences;
import id.ac.stis.capi.dao.FormsDao;
import id.ac.stis.capi.listeners.FormDownloaderListener;
import id.ac.stis.capi.listeners.FormListDownloaderListener;
import id.ac.stis.capi.logic.FormDetails;
import id.ac.stis.capi.odk.dao.FormsDao;
import id.ac.stis.capi.odk.listeners.FormDownloaderListener;
import id.ac.stis.capi.odk.listeners.FormListDownloaderListener;
import id.ac.stis.capi.odk.logic.FormDetails;
import id.ac.stis.capi.petawbdigital.assets.SessionManager;
import id.ac.stis.capi.provider.FormsProviderAPI;
import id.ac.stis.capi.tasks.DownloadFormListTask;
import id.ac.stis.capi.tasks.DownloadFormsTask;
import id.ac.stis.capi.utilities.AuthDialogUtility;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.tasks.DownloadFormListTask;
import id.ac.stis.capi.odk.tasks.DownloadFormsTask;
import id.ac.stis.capi.odk.utilities.AuthDialogUtility;
import java.io.File;
import java.io.FileInputStream;
......@@ -63,10 +63,10 @@ import java.util.Set;
import timber.log.Timber;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_DATE_ASC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_DATE_DESC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_NAME_ASC;
import static id.ac.stis.capi.utilities.ApplicationConstants.SortingOrder.BY_NAME_DESC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_DATE_ASC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_DATE_DESC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_NAME_ASC;
import static id.ac.stis.capi.odk.utilities.ApplicationConstants.SortingOrder.BY_NAME_DESC;
/**
* @author Muhammad Tohir
......
......@@ -33,12 +33,12 @@ import android.widget.TextView;
import org.javarosa.core.model.FormIndex;
import org.javarosa.core.model.data.IAnswerData;
import id.ac.stis.capi.R;
import id.ac.stis.capi.activities.FormEntryActivity;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.odk.activities.FormEntryActivity;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.collectiva.loader.ErrorHierarchy;
import id.ac.stis.capi.collectiva.loader.ErrorHierarchyAdapter;
import id.ac.stis.capi.collectiva.loader.ErrorHierarchyLoader;
import id.ac.stis.capi.logic.FormController;
import id.ac.stis.capi.odk.logic.FormController;
import java.util.ArrayList;
import java.util.HashMap;
......
......@@ -39,12 +39,12 @@ import org.javarosa.form.api.FormEntryCaption;
import org.javarosa.form.api.FormEntryController;
import org.javarosa.form.api.FormEntryPrompt;
import id.ac.stis.capi.R;
import id.ac.stis.capi.activities.FormEntryActivity;
import id.ac.stis.capi.adapters.HierarchyListAdapter;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.logic.FormController;
import id.ac.stis.capi.logic.HierarchyElement;
import id.ac.stis.capi.utilities.FormEntryPromptUtils;
import id.ac.stis.capi.odk.activities.FormEntryActivity;
import id.ac.stis.capi.odk.adapters.HierarchyListAdapter;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.logic.FormController;
import id.ac.stis.capi.odk.logic.HierarchyElement;
import id.ac.stis.capi.odk.utilities.FormEntryPromptUtils;
import java.util.ArrayList;
import java.util.List;
......
......@@ -10,9 +10,9 @@ import android.widget.TextView;
import org.javarosa.core.model.FormIndex;
import org.javarosa.form.api.FormEntryCaption;
import id.ac.stis.capi.R;
import id.ac.stis.capi.activities.FormEntryActivity;
import id.ac.stis.capi.application.Collect;
import id.ac.stis.capi.logic.FormController;
import id.ac.stis.capi.odk.activities.FormEntryActivity;
import id.ac.stis.capi.odk.application.Collect;
import id.ac.stis.capi.odk.logic.FormController;
import java.util.ArrayList;
......
......@@ -5,8 +5,8 @@ import android.content.Context;
import org.javarosa.core.model.FormIndex;
import org.javarosa.core.model.data.IAnswerData;
import id.ac.stis.capi.exception.JavaRosaException;
import id.ac.stis.capi.logic.FormController;
import id.ac.stis.capi.odk.exception.JavaRosaException;
import id.ac.stis.capi.odk.logic.FormController;
import java.util.ArrayList;
import java.util.HashMap;
......
......@@ -26,11 +26,11 @@ import com.rahadi.vsen.fragments.VsenPreferenceFragment;
import id.ac.stis.capi.R;
import id.ac.stis.capi.collectiva.ParseXml;
import id.ac.stis.capi.dao.FormsDao;
import id.ac.stis.capi.odk.dao.FormsDao;
import id.ac.stis.capi.petawbdigital.activities.KonfigurasiPeta;
import id.ac.stis.capi.preferences.PreferenceKeys;
import id.ac.stis.capi.preferences.PreferencesActivity;
import id.ac.stis.capi.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.preferences.PreferenceKeys;
import id.ac.stis.capi.odk.preferences.PreferencesActivity;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
......
package id.ac.stis.capi.lessthink.binders;
import android.view.View;
import android.widget.TextView;
import id.rahadi.skripsi.R;
import me.texy.treeview.TreeNode;
import me.texy.treeview.base.BaseNodeViewBinder;
/**
* Author : Rahadi Jalu
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public class FirstLevelNodeViewBinder extends BaseNodeViewBinder {
private TextView mainText;
public FirstLevelNodeViewBinder(View itemView) {
super(itemView);
mainText = itemView.findViewById(R.id.text_main);
}
@Override
public int getLayoutId() {
return R.layout.item_node_first;
}
@Override
public void bindView(TreeNode treeNode) {
mainText.setText(treeNode.getValue().toString());
}
}
package id.ac.stis.capi.lessthink.binders;
import android.view.View;
import me.texy.treeview.base.BaseNodeViewBinder;
import me.texy.treeview.base.BaseNodeViewFactory;
/**
* Author : Rahadi Jalu
* Email : 14.8325@stis.ac.id
* Company: Politeknik Statistika STIS
*/
public class NodeViewFactory extends BaseNodeViewFactory {
@Override
public BaseNodeViewBinder getNodeViewBinder(View view, int level) {
switch (level) {
case 0:
return new FirstLevelNodeViewBinder(view);
case 1:
return new FirstLevelNodeViewBinder(view);