Skip to content

Commit

Permalink
Improvements in version 1.2.8
Browse files Browse the repository at this point in the history
- Added all parameters to Advanced mode
- Added autocomplete edit boxes
- Extend Preferences and Settings
- Adjust Sharing functionality
  • Loading branch information
wasat committed Jun 3, 2016
1 parent b91a008 commit 4aef418
Show file tree
Hide file tree
Showing 59 changed files with 778 additions and 273 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ SmartHMA/app/app.iml

SmartHMA/.idea/inspectionProfiles
SmartHMA/.idea/inspectionProfiles

SmartHMA/app/src/release/res/values/google_maps_api.xml
SmartHMA/app/src/debug/res/values/google_maps_api.xml
3 changes: 3 additions & 0 deletions SmartHMA/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ gradle
.idea/vcs.xml
*.iml
.idea/copyright
app/src/main/java/pl/wasat/smarthma/tmp/
/app/src/release/res/values/google_maps_api.xml
/app/src/debug/res/values/google_maps_api.xml
32 changes: 32 additions & 0 deletions SmartHMA/.idea/dictionaries/Daniel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions SmartHMA/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ dependencies {
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-identity:9.0.0'
//compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.1'
compile 'com.google.android.gms:play-services-identity:9.0.1'
compile 'com.google.maps.android:android-maps-utils:0.4.2'
compile 'com.octo.android.robospice:robospice:1.4.14'
compile 'com.octo.android.robospice:robospice-ui-spicelist:1.4.14'
Expand Down
11 changes: 5 additions & 6 deletions SmartHMA/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
android:required="true"/>
<uses-feature
android:name="android.hardware.location"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
android:required="false" />

<application
android:name=".SmartHMApplication"
Expand All @@ -35,7 +35,7 @@
android:theme="@style/AppNoActionBarTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCMZWIkdMS9FlyCt0eb_cMosMTFrt7FZxY"/>
android:value="@string/google_maps_key" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/app_id"/>
Expand Down Expand Up @@ -65,8 +65,7 @@
<activity
android:name=".ui.activities.ProductsBrowserActivity"
android:label="@string/activity_name_products_browser"
android:screenOrientation="sensorLandscape">
</activity>
android:screenOrientation="sensorLandscape" />
<activity
android:name=".ui.activities.SearchActivity"
android:label="@string/activity_name_search_eo_data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* This file is a part of module SmartHMA project.
*/
public class CatalogueArrayAdapter extends ArrayAdapter {
private List<Option> options;
private Context context;
private final List<Option> options;
private final Context context;


public CatalogueArrayAdapter(Context context, int resource, List<Option> objects) {
Expand All @@ -29,8 +29,6 @@ public CatalogueArrayAdapter(Context context, int resource, List<Option> objects
this.context = context;
}

ViewHolder holder;

class ViewHolder {
ImageView icon;
TextView title;
Expand All @@ -42,6 +40,7 @@ public View getView(int position, View convertView,
.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);

ViewHolder holder;
if (convertView == null) {
convertView = inflater.inflate(
R.layout.view_cell_cataloque, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class Const {
/* public static String getOsddBaseUrl() {
return OSDD_BASE_URL;
}*/

/*
public static void setHttpEsaBaseUrl() {
HTTP_BASE_URL = HTTP_ESA_BASE_URL;
setHttpBaseUrls();
Expand All @@ -116,6 +116,11 @@ public static void setHttpSmaadBaseUrl() {
public static void setHttpObeosBaseUrl() {
HTTP_BASE_URL = HTTP_OBEOS_BASE_URL;
setHttpBaseUrls();
}*/

public static void setHttpBaseUrl(String host) {
HTTP_BASE_URL = host;
setHttpBaseUrls();
}

private static void setHttpBaseUrls() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class AmznAreaPickerMapFragment extends Fragment implements
private ArrayList<LatLng> markedPtList;
private LatLngBounds.Builder areaBoundsBuilder;

protected AmazonMap mMap;
private AmazonMap mMap;
private Polygon areaPolygon;
private SupportMapFragment supportMapFrag;
private int areaDrawType;
Expand Down Expand Up @@ -338,7 +338,7 @@ private void animateToBounds(int padding) {
}
}

public void initCallbacksWhenMapIsReady(final int padding) {
private void initCallbacksWhenMapIsReady(final int padding) {
mMap.setOnMapLoadedCallback(new AmazonMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
public class AmznBaseMapFragment extends SupportMapFragment {

public OnBaseMapFragmentListener mListener;
AmazonMap mMap;
LatLngBounds targetBounds;
private AmazonMap mMap;
private LatLngBounds targetBounds;
private SupportMapFragment supportMapFrag;
private OnBaseMapFragmentPublicListener publicListener;
private BroadcastReceiver mReceiver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pl.wasat.smarthma.helper.enums.Opts;
import pl.wasat.smarthma.model.feed.Link;
import pl.wasat.smarthma.model.osdd.OSDDMatcher;
import pl.wasat.smarthma.preferences.GlobalPreferences;
import pl.wasat.smarthma.preferences.SharedPrefs;
import pl.wasat.smarthma.utils.obj.LatLngBoundsExt;
import pl.wasat.smarthma.utils.obj.LatLngExt;
Expand Down Expand Up @@ -43,27 +44,31 @@ public class FedeoRequestParams extends OSDDMatcher implements Serializable {
public FedeoRequestParams() {
this.params = new HashMap<>();
IS_URL_TEMPLATE = true;
IS_BUILD_FROM_SHARED = true;
setDefaultParams();
}

public FedeoRequestParams(Boolean isUrlTemplate) {
this.params = new HashMap<>();
IS_URL_TEMPLATE = isUrlTemplate;
IS_BUILD_FROM_SHARED = true;
setDefaultParams();
}

public FedeoRequestParams(boolean initAreaTime, boolean isUrlTemplate) {
this.params = new HashMap<>();
IS_URL_TEMPLATE = isUrlTemplate;
IS_BUILD_FROM_SHARED = true;
setDefaultParams();
if (initAreaTime) buildFromShared();
}

private void setDefaultParams() {
IS_BUILD_FROM_SHARED = true;
this.params.put(PARAM_KEY_START_RECORD, "1");
this.params.put(PARAM_KEY_MAX_RECORDS, "30");
this.params.put(PARAM_KEY_START_PAGE, "1");
GlobalPreferences globalPreferences = new GlobalPreferences(SmartHMApplication.getAppContext());

this.params.put(PARAM_KEY_START_RECORD, globalPreferences.getFedeoStartRecord());
this.params.put(PARAM_KEY_MAX_RECORDS, globalPreferences.getFedeoMaxRecords());
this.params.put(PARAM_KEY_START_PAGE, globalPreferences.getFedeoStartPage());
this.params.put(PARAM_KEY_RECORD_SCHEMA, PARAM_VALUE_SERVER_CHOICE);
//this.params.put(PARAM_KEY_RECORD_SCHEMA, PARAM_VALUE_ISO);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void validateURLsForming() {
private void obtainPolygonFromOMMetadata(Entry entry) {
Footprint footprintRaw = entry.getEarthObservation()
.getFeatureOfInterest().getFootprint();
List<Pos> footprintPosList = new ArrayList<>();
List<Pos> footprintPosList;
if (footprintRaw.getMultiExtentOf().getMultiSurface() != null) {
footprintPosList = footprintRaw.getMultiExtentOf()
.getMultiSurface().getSurfaceMembers().getPolygon()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* Created by Daniel on 2016-05-20.
* This file is a part of module SmartHMA NavIn project.
* This file is a part of module SmartHMA project.
*/
public class GeometryMembers implements Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public List<Pos> getPosList() {
return posList;
}

public void setPosList(List<Pos> posList) {
private void setPosList(List<Pos> posList) {
if (!posList.isEmpty()) {
this.posList = posList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* Created by Daniel on 2016-05-20.
* This file is a part of module SmartHMA NavIn project.
* This file is a part of module SmartHMA project.
*/
public class MultiGeometry implements Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Body {

@SerializedName("outline")
@Expose
private List<Outline> outline = new ArrayList<Outline>();
private List<Outline> outline = new ArrayList<>();

/**
* @return The outline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Head() {
@Expose
private String windowRight;

public void invoke() {
private void invoke() {
this.dateCreated = DateUtils.timestampToDateTimeStr(System.currentTimeMillis());
this.dateModified = DateUtils.timestampToDateTimeStr(System.currentTimeMillis());
this.expansionState = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pl.wasat.smarthma.model.osdd;

import java.util.ArrayList;
import java.util.List;

/**
Expand All @@ -8,26 +9,6 @@
*/
public class OSDDMatcher {

//http://fedeo.esa.int/opensearch/request/?
// httpAccept=application/atom%2Bxml&
// parentIdentifier=EOP:SPOT:ALL&
// startRecord={startIndex?}&
// startPage={startPage?}&
// maximumRecords={count?}&
// startDate={time:start}&
// endDate={time:end}&
// bbox={geo:box?}&name={geo:name?}&lat={geo:lat?}&lon={geo:lon?}&radius={geo:radius?}&
// uid={geo:uid?}&productType={eo:productType?}&platform={eo:platform?}&platformSerialIdentifier={eo:platformSerialIdentifier?}&
// instrument={eo:instrument?}&sensorType={eo:sensorType?}&compositeType={eo:compositeType?}&processingLevel={eo:processingLevel?}&
// orbitType={eo:orbitType?}&resolution={eo:resolution?}&productionStatus={eo:productionStatus?}&acquisitionType={eo:acquisitionType?}&
// orbitNumber={eo:orbitNumber?}&orbitDirection={eo:orbitDirection?}&track={eo:track?}&frame={eo:frame?}&
// swathIdentifier={eo:swathIdentifier?}&cloudCover={eo:cloudCover?}&snowCover={eo:snowCover?}&acquisitionStation={eo:acquisitionStation?}&
// productQualityStatus={eo:productQualityStatus?}&processorName={eo:processorName?}&sensorMode={eo:sensorMode?}&
// archivingCenter={eo:archivingCenter?}&acquisitionSubType={eo:acquisitionSubType?}&
// startTimeFromAscendingNode={eo:startTimeFromAscendingNode?}&completionTimeFromAscendingNode={eo:completionTimeFromAscendingNode?}&
// illuminationAzimuthAngle={eo:illuminationAzimuthAngle?}&illuminationElevationAngle={eo:illuminationElevationAngle?}&
// recordSchema={sru:recordSchema?}

public static final String PARAM_NAME_PARENT_IDENTIFIER = "parentIdentifier";
public static final String PARAM_NAME_TYPE = "type";
public static final String PARAM_NAME_RECORD_SCHEMA = "recordSchema";
Expand All @@ -45,8 +26,6 @@ public class OSDDMatcher {
public static final String PARAM_NAME_USERNAME = "username";
public static final String PARAM_NAME_PASSWORD = "password";

//public static final String PARAM_NAME_ = "";
//public static final String PARAM_NAME_ = "";
//public static final String PARAM_NAME_ = "";
//public static final String PARAM_NAME_ = "";

Expand All @@ -68,6 +47,7 @@ public class OSDDMatcher {
public static final String PARAM_KEY_TITLE = "{dc:title}";
public static final String PARAM_KEY_ORGANISATION = "{eo:organisationName}";
public static final String PARAM_KEY_PLATFORM = "{eo:platform}";
public static final String PARAM_KEY_INSTRUMENT = "{eo:instrument}";
public static final String PARAM_KEY_USERNAME = "{wsse:Username}";
public static final String PARAM_KEY_PASSWORD = "{wsse:Password}";

Expand All @@ -86,6 +66,21 @@ public static Parameter findParentIdParam(List<Parameter> osddParams) {
return null;
}

public static List<String> generateOptionValuesList(List<Parameter> osddParams, String paramKey) {
List<String> optLabels = new ArrayList<>();
if (osddParams != null) {
for (Parameter param : osddParams) {
if (param.getValue().equalsIgnoreCase(paramKey)) {
for (Option opt : param.getOptions()) {
optLabels.add(opt.getValue());
}
return optLabels;
}
}
}
return optLabels;
}

public static String findOptionValue(List<Option> options, String label) {
for (Option opt : options) {
if (opt.getLabel().equalsIgnoreCase(label)) return opt.getValue();
Expand All @@ -94,7 +89,7 @@ public static String findOptionValue(List<Option> options, String label) {
}

public static String getParamName(String paramKey) {
String paramName = "";
String paramName;
switch (paramKey) {
case PARAM_KEY_BBOX:
paramName = PARAM_NAME_BBOX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ public class Option {
* @return The Label
*/
public String getLabel() {
return Label;
return Label.trim();
}

/**
* @param Label The _label
*/
public void setLabel(String Label) {
this.Label = Label;
this.Label = Label.trim();
}

/**
* @return The Value
*/
public String getValue() {
return Value;
return Value.trim();
}

/**
* @param Value The _value
*/
public void setValue(String Value) {
this.Value = Value;
this.Value = Value.trim();
}

/**
Expand Down
Loading

0 comments on commit 4aef418

Please sign in to comment.