From 75bb38ba1ff6379cdf393a4ac95c4a890afe0fca Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 29 Jul 2018 00:08:28 +0200 Subject: [PATCH] move activities to new package --- app/src/main/AndroidManifest.xml | 10 +++++----- .../java/info/nightscout/androidaps/MainActivity.java | 4 ++++ .../androidaps/{ => activities}/AgreementActivity.java | 4 +++- .../{ => activities}/HistoryBrowseActivity.java | 4 +++- .../{ => activities}/PreferencesActivity.java | 5 ++++- .../{ => activities}/SingleFragmentActivity.java | 7 ++++--- .../androidaps/{ => activities}/TDDStatsActivity.java | 6 +++--- .../androidaps/plugins/Actions/ActionsFragment.java | 4 ++-- .../plugins/ConfigBuilder/ConfigBuilderFragment.java | 2 +- .../androidaps/plugins/PumpDanaR/DanaRFragment.java | 3 +-- .../androidaps/setupwizard/SWDefinition.java | 8 +------- app/src/main/res/layout/activity_agreement.xml | 2 +- app/src/main/res/layout/activity_historybrowse.xml | 2 +- 13 files changed, 33 insertions(+), 28 deletions(-) rename app/src/main/java/info/nightscout/androidaps/{ => activities}/AgreementActivity.java (91%) rename app/src/main/java/info/nightscout/androidaps/{ => activities}/HistoryBrowseActivity.java (99%) rename app/src/main/java/info/nightscout/androidaps/{ => activities}/PreferencesActivity.java (98%) rename app/src/main/java/info/nightscout/androidaps/{ => activities}/SingleFragmentActivity.java (91%) rename app/src/main/java/info/nightscout/androidaps/{ => activities}/TDDStatsActivity.java (99%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 83ed7c1885..df47773259 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -40,17 +40,17 @@ - + - + - + @@ -66,7 +66,7 @@ - + - diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index 1742f3349f..a4370ff683 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -38,6 +38,10 @@ import com.squareup.otto.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import info.nightscout.androidaps.activities.AgreementActivity; +import info.nightscout.androidaps.activities.HistoryBrowseActivity; +import info.nightscout.androidaps.activities.PreferencesActivity; +import info.nightscout.androidaps.activities.SingleFragmentActivity; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventFeatureRunning; diff --git a/app/src/main/java/info/nightscout/androidaps/AgreementActivity.java b/app/src/main/java/info/nightscout/androidaps/activities/AgreementActivity.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/AgreementActivity.java rename to app/src/main/java/info/nightscout/androidaps/activities/AgreementActivity.java index 3a30659884..582b10d57d 100644 --- a/app/src/main/java/info/nightscout/androidaps/AgreementActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/activities/AgreementActivity.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps; +package info.nightscout.androidaps.activities; import android.app.Activity; import android.content.Intent; @@ -9,6 +9,8 @@ import android.view.View; import android.widget.Button; import android.widget.CheckBox; +import info.nightscout.androidaps.MainActivity; +import info.nightscout.androidaps.R; import info.nightscout.utils.SP; public class AgreementActivity extends Activity { diff --git a/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java rename to app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.java index d106fb9985..8d4b691116 100644 --- a/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps; +package info.nightscout.androidaps.activities; import android.os.Bundle; import android.os.SystemClock; @@ -29,6 +29,8 @@ import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.OnLongClick; +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.events.EventCustomCalculationFinished; import info.nightscout.androidaps.interfaces.PumpInterface; diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java rename to app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.java index 349828b7cb..8876737be3 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps; +package info.nightscout.androidaps.activities; import android.content.SharedPreferences; import android.os.Bundle; @@ -11,6 +11,9 @@ import android.preference.PreferenceGroup; import android.preference.PreferenceManager; import android.text.TextUtils; +import info.nightscout.androidaps.Config; +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.interfaces.PluginBase; diff --git a/app/src/main/java/info/nightscout/androidaps/SingleFragmentActivity.java b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/SingleFragmentActivity.java rename to app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.java index 567799fe5e..04fd7a6be7 100644 --- a/app/src/main/java/info/nightscout/androidaps/SingleFragmentActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.java @@ -1,16 +1,17 @@ -package info.nightscout.androidaps; +package info.nightscout.androidaps.activities; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; -import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; +import info.nightscout.androidaps.activities.PreferencesActivity; import info.nightscout.androidaps.interfaces.PluginBase; -import info.nightscout.androidaps.tabs.TabPageAdapter; import info.nightscout.utils.PasswordProtection; public class SingleFragmentActivity extends AppCompatActivity { diff --git a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java rename to app/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.java index 7bc3ee31c5..34e5fa42ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps; +package info.nightscout.androidaps.activities; import android.app.Activity; import android.graphics.Color; @@ -33,14 +33,14 @@ import java.util.Date; import java.util.LinkedList; import java.util.List; +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; -import info.nightscout.androidaps.db.DanaRHistoryRecord; import info.nightscout.androidaps.db.TDD; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin; -import info.nightscout.androidaps.plugins.PumpDanaR.comm.RecordTypes; import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRSyncStatus; import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java index 0fb505bda7..96d3bbc3d2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsFragment.java @@ -14,10 +14,10 @@ import com.crashlytics.android.answers.CustomEvent; import com.squareup.otto.Subscribe; import info.nightscout.androidaps.Config; -import info.nightscout.androidaps.HistoryBrowseActivity; +import info.nightscout.androidaps.activities.HistoryBrowseActivity; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; -import info.nightscout.androidaps.TDDStatsActivity; +import info.nightscout.androidaps.activities.TDDStatsActivity; import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.events.EventExtendedBolusChange; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index 3e60ca2b77..3df78c9a28 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -26,7 +26,7 @@ import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.Unbinder; import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.PreferencesActivity; +import info.nightscout.androidaps.activities.PreferencesActivity; import info.nightscout.androidaps.R; import info.nightscout.androidaps.events.EventConfigBuilderChange; import info.nightscout.androidaps.events.EventRefreshGui; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java index bbb363cc9d..db1b10ddbe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java @@ -27,7 +27,7 @@ import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; -import info.nightscout.androidaps.TDDStatsActivity; +import info.nightscout.androidaps.activities.TDDStatsActivity; import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.events.EventExtendedBolusChange; import info.nightscout.androidaps.events.EventPumpStatusChanged; @@ -44,7 +44,6 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.androidaps.queue.events.EventQueueChanged; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; -import info.nightscout.utils.FabricPrivacy; import info.nightscout.utils.SetWarnColor; public class DanaRFragment extends SubscriberFragment { diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java index c1669b73d0..acd967f24a 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java @@ -1,13 +1,8 @@ package info.nightscout.androidaps.setupwizard; import android.Manifest; -import android.content.ActivityNotFoundException; -import android.content.Context; import android.content.Intent; -import android.net.Uri; import android.os.Build; -import android.os.PowerManager; -import android.provider.Settings; import android.support.v7.app.AppCompatActivity; import com.squareup.otto.Subscribe; @@ -21,7 +16,7 @@ import java.util.List; import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.PreferencesActivity; +import info.nightscout.androidaps.activities.PreferencesActivity; import info.nightscout.androidaps.R; import info.nightscout.androidaps.events.EventConfigBuilderChange; import info.nightscout.androidaps.events.EventPumpStatusChanged; @@ -59,7 +54,6 @@ import info.nightscout.utils.ImportExportPrefs; import info.nightscout.utils.LocaleHelper; import info.nightscout.utils.PasswordProtection; import info.nightscout.utils.SP; -import info.nightscout.utils.ToastUtils; public class SWDefinition { private static Logger log = LoggerFactory.getLogger(SWDefinition.class); diff --git a/app/src/main/res/layout/activity_agreement.xml b/app/src/main/res/layout/activity_agreement.xml index e5f5c8ddf1..9a17432930 100644 --- a/app/src/main/res/layout/activity_agreement.xml +++ b/app/src/main/res/layout/activity_agreement.xml @@ -4,7 +4,7 @@ android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizo android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" -tools:context="info.nightscout.androidaps.AgreementActivity"> +tools:context="info.nightscout.androidaps.activities.AgreementActivity"> + tools:context="info.nightscout.androidaps.activities.HistoryBrowseActivity">