SW create elements package

This commit is contained in:
Milos Kozak 2018-05-20 15:09:32 +02:00
parent d0ed4bd717
commit 5b9594bdbb
13 changed files with 37 additions and 22 deletions

View file

@ -33,6 +33,13 @@ import info.nightscout.androidaps.plugins.ProfileNS.NSProfileFragment;
import info.nightscout.androidaps.plugins.ProfileNS.NSProfilePlugin;
import info.nightscout.androidaps.plugins.ProfileSimple.SimpleProfileFragment;
import info.nightscout.androidaps.plugins.ProfileSimple.SimpleProfilePlugin;
import info.nightscout.androidaps.startupwizard.elements.SWButton;
import info.nightscout.androidaps.startupwizard.elements.SWFragment;
import info.nightscout.androidaps.startupwizard.elements.SWInfotext;
import info.nightscout.androidaps.startupwizard.elements.SWPlugin;
import info.nightscout.androidaps.startupwizard.elements.SWRadioButton;
import info.nightscout.androidaps.startupwizard.elements.SWEditString;
import info.nightscout.androidaps.startupwizard.elements.SWEditUrl;
import info.nightscout.androidaps.startupwizard.events.EventSWLabel;
import info.nightscout.androidaps.startupwizard.events.EventSWUpdate;
import info.nightscout.utils.ImportExportPrefs;
@ -91,11 +98,11 @@ public class SWDefinition {
)
.add(new SWScreen(R.string.nsclientinternal_title)
.skippable(true)
.add(new SWUrl()
.add(new SWEditUrl()
.preferenceId(R.string.key_nsclientinternal_url)
.label(R.string.nsclientinternal_url_title)
.comment(R.string.nsclientinternal_url_dialogmessage))
.add(new SWString()
.add(new SWEditString()
.preferenceId(R.string.key_nsclientinternal_api_secret)
.label(R.string.nsclientinternal_secret_dialogtitle)
.comment(R.string.nsclientinternal_secret_dialogmessage))

View file

@ -11,6 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.startupwizard.elements.SWItem;
import info.nightscout.androidaps.startupwizard.events.EventSWLabel;

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.startupwizard.elements.SWItem;
public class SWScreen {

View file

@ -22,6 +22,7 @@ import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.ConstraintsObjectives.events.EventObjectivesSaved;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientStatus;
import info.nightscout.androidaps.startupwizard.elements.SWItem;
import info.nightscout.androidaps.startupwizard.events.EventSWUpdate;
import info.nightscout.utils.LocaleHelper;
import info.nightscout.utils.OKDialog;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.view.View;
@ -8,6 +8,8 @@ import android.widget.LinearLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.startupwizard.SWValidator;
public class SWButton extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWButton.class);
@ -17,7 +19,7 @@ public class SWButton extends SWItem {
private Button button;
SWButton() {
public SWButton() {
super(Type.BUTTON);
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.view.View;
@ -14,7 +14,6 @@ import java.util.ArrayList;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.utils.SP;
/**

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.graphics.Typeface;
@ -14,10 +14,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SWString extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWString.class);
public class SWEditString extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWEditString.class);
public SWString() {
public SWEditString() {
super(Type.STRING);
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.graphics.Typeface;
@ -13,10 +13,10 @@ import android.widget.TextView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SWUrl extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWUrl.class);
public class SWEditUrl extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWEditUrl.class);
public SWUrl() {
public SWEditUrl() {
super(Type.URL);
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.support.v4.app.Fragment;
import android.view.View;
@ -7,6 +7,8 @@ import android.widget.LinearLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.startupwizard.SWDefinition;
public class SWFragment extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWFragment.class);

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.view.View;
@ -8,6 +8,8 @@ import android.widget.TextView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.startupwizard.SWValidator;
public class SWInfotext extends SWItem {
private static Logger log = LoggerFactory.getLogger(SWInfotext.class);
@ -16,7 +18,7 @@ public class SWInfotext extends SWItem {
private TextView l;
private SWValidator visibilityValidator;
SWInfotext() {
public SWInfotext() {
super(Type.TEXT);
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.view.View;
import android.widget.LinearLayout;
@ -14,7 +14,7 @@ import info.nightscout.utils.SP;
public class SWItem {
private static Logger log = LoggerFactory.getLogger(SWItem.class);
enum Type {
public enum Type {
NONE,
TEXT,
LISTENER,
@ -64,7 +64,7 @@ public class SWItem {
return this;
}
SWItem preferenceId(int preferenceId) {
public SWItem preferenceId(int preferenceId) {
this.preferenceId = preferenceId;
return this;
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.view.View;

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.startupwizard;
package info.nightscout.androidaps.startupwizard.elements;
import android.content.Context;
import android.view.View;