- New dashboard element "DCI summary table"
- Cluster objects shown on status maps
- Android console:
- - Support for KitKat Wear and Lollipop
+ - Added date in X axis (graphs) when the time frame is greather that one day
+ - Added 10 minutes, 12 hours, 5 days, 30 days options in draw graph for last values tab (5, 7, and 30 days asks for confirmation of long task execution)
+ - Fixed graphical problem (checkbox) in last values tab
+ - Support for KitKat Wear and Lollipop, updated support library v4
- Fixed issues: #61, #306, #381, #488, #565, #628, #634, #667, #672, #673, #674, #675, #677, #678, #679, #682, #684, #686, #688, #689, #691, #700, #704, #705
<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@+id/graph_half_hour" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_half_hour"></item>
- <item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour" android:icon="@drawable/ic_menu_line_chart" android:showAsAction="always"></item>
+ <item android:id="@+id/graph_ten_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_ten_minutes"></item>
+ <item android:id="@+id/graph_thirty_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_thirty_minutes"></item>
+ <item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour" android:icon="@drawable/ic_menu_line_chart" android:showAsAction="ifRoom"></item>
<item android:id="@+id/graph_two_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_two_hours"></item>
<item android:id="@+id/graph_four_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_four_hours"></item>
+ <item android:id="@+id/graph_twelve_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_twelve_hours"></item>
<item android:id="@+id/graph_one_day" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_day"></item>
+ <item android:id="@+id/graph_five_days" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_five_days"></item>
<item android:id="@+id/graph_one_week" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_week"></item>
+ <item android:id="@+id/graph_one_month" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_month"></item>
<item android:id="@+id/bar_chart" android:title="@string/last_values_bar_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:icon="@drawable/ic_menu_bar_chart" android:showAsAction="always"></item>
<item android:id="@+id/pie_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:title="@string/last_values_pie_chart" android:icon="@drawable/ic_menu_pie_chart" android:showAsAction="always"></item>
</menu>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@+id/graph_half_hour" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_half_hour"></item>
+ <item android:id="@+id/graph_ten_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_ten_minutes"></item>
+ <item android:id="@+id/graph_thirty_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_thirty_minutes"></item>
<item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour"></item>
<item android:id="@+id/graph_two_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_two_hours"></item>
<item android:id="@+id/graph_four_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_four_hours"></item>
+ <item android:id="@+id/graph_twelve_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_twelve_hours"></item>
<item android:id="@+id/graph_one_day" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_day"></item>
+ <item android:id="@+id/graph_five_days" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_five_days"></item>
<item android:id="@+id/graph_one_week" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_week"></item>
+ <item android:id="@+id/graph_one_month" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_month"></item>
<item android:id="@+id/bar_chart" android:title="@string/last_values_bar_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false"></item>
<item android:id="@+id/pie_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:title="@string/last_values_pie_chart"></item>
</menu>
<string name="tools">Tools</string>
<string name="confirm_tool_execution">Confirm execution</string>
<string name="no_items">No items to show…</string>
-
+ <string name="warning">Warning</string>
+ <string name="long_time_execution">This task could take a long time to execute. Would you like to proceed anyway?</string>
+
<string name="progress_gathering_data">Gathering data…</string>
<string name="progress_processing_data">Processing data…</string>
<string name="pref_alarm_sound_minor">Minor alarm sound</string>
<string name="pref_alarm_sound_major">Major alarm sound</string>
<string name="pref_alarm_sound_critical">Critical alarm sound</string>
+ <string name="pref_alarm_sound_unknown">Unknown alarm sound</string>
+ <string name="pref_alarm_sound_terminate">Terminate alarm sound</string>
+ <string name="pref_alarm_sound_resolve">Resolve alarm sound</string>
<string name="pref_global_notification_toast">Toast notification</string>
<string name="pref_global_notification_toast_enabled">Toast is enabled</string>
<string name="pref_global_notification_toast_disabled">Toast is disabled</string>
<string name="last_values_na">N/A</string>
<string name="last_values_pie_chart">Pie Chart</string>
<string name="last_values_bar_chart">Bar Chart</string>
- <string name="last_values_graph_half_hour">Graph last half hour</string>
+ <string name="last_values_graph_ten_minutes">Graph last 10 minutes</string>
+ <string name="last_values_graph_thirty_minutes">Graph last 30 minutes</string>
<string name="last_values_graph_one_hour">Graph last hour</string>
- <string name="last_values_graph_two_hours">Graph last two hours</string>
- <string name="last_values_graph_four_hours">Graph last four hours</string>
+ <string name="last_values_graph_two_hours">Graph last 2 hours</string>
+ <string name="last_values_graph_four_hours">Graph last 4 hours</string>
+ <string name="last_values_graph_twelve_hours">Graph last 12 hours</string>
<string name="last_values_graph_one_day">Graph last day</string>
+ <string name="last_values_graph_two_day">Graph last 2 days</string>
+ <string name="last_values_graph_five_days">Graph last 5 days</string>
<string name="last_values_graph_one_week">Graph last week</string>
- <string name="table_value_placeholder"><< TABLE >></string>
+ <string name="last_values_graph_one_month">Graph last month</string>
+ <string name="table_value_placeholder"><< TABLE >></string>
<string name="table_last_values">Table last values</string>
<string name="if_manage">Manage</string>
<RingtonePreference android:key="alarm.sound.minor" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_minor" android:icon="@drawable/status_minor" />
<RingtonePreference android:key="alarm.sound.major" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_major" android:icon="@drawable/status_major" />
<RingtonePreference android:key="alarm.sound.critical" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_critical" android:icon="@drawable/status_critical" />
+<!-- Not really useful
+ <RingtonePreference android:key="alarm.sound.unknown" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_unknown" android:icon="@drawable/status_unknown" />
+ <RingtonePreference android:key="alarm.sound.terminate" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_terminate" android:icon="@drawable/status_terminate" />
+ <RingtonePreference android:key="alarm.sound.resolve" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_resolve" android:icon="@drawable/status_resolve" />
+ -->
</PreferenceCategory>
</PreferenceScreen>
<RingtonePreference android:key="alarm.sound.minor" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_minor" android:icon="@drawable/status_minor" />
<RingtonePreference android:key="alarm.sound.major" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_major" android:icon="@drawable/status_major" />
<RingtonePreference android:key="alarm.sound.critical" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_critical" android:icon="@drawable/status_critical" />
- </PreferenceCategory>
+<!-- Not really useful
+ <RingtonePreference android:key="alarm.sound.unknown" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_unknown" android:icon="@drawable/status_unknown" />
+ <RingtonePreference android:key="alarm.sound.terminate" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_terminate" android:icon="@drawable/status_terminate" />
+ <RingtonePreference android:key="alarm.sound.resolve" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_resolve" android:icon="@drawable/status_resolve" />
+ -->
+ </PreferenceCategory>
</PreferenceScreen>
public class CustomLabel implements CustomLabelFormatter
{
private int m = 1;
+ private boolean drawDate = false;
- public CustomLabel(int m)
+ public CustomLabel(int m, boolean drawDate)
{
this.m = m;
+ this.drawDate = drawDate;
}
-
@Override
public String formatLabel(double value, boolean isValueX)
{
if (isValueX)
{
- SimpleDateFormat s = new SimpleDateFormat("HH:mm:ss");
+ SimpleDateFormat s = new SimpleDateFormat(drawDate ? "yyyy.MM.dd HH:mm:ss" : "HH:mm:ss");
return s.format(new Date((long)value));
}
else
graphView.getGraphViewStyle().setHorizontalLabelsColor(Color.WHITE);
graphView.getGraphViewStyle().setTextSize(Integer.parseInt(sp.getString("global.graph.textsize", "10")));
graphView.getGraphViewStyle().setLegendWidth(240);
- graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1"))));
+ graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1")), (timeTo - timeFrom) > 86400 * 1000));
// TOOD: 2014May25 Find a best way to handle this setting
//graphView.setShowLegend(showLegend);
graphView.setShowLegend(sp.getBoolean("global.graph.legend", true));
listView = (ListView)findViewById(R.id.NodeList);
listView.setAdapter(adapter);
- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
+ {
@Override
@SuppressWarnings("rawtypes")
public void onItemClick(AdapterView parent, View v, int position, long id)
AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo)menuInfo;
selectedObject = (AbstractObject)adapter.getItem(info.position);
-
+
GeoLocation gl = selectedObject.getGeolocation();
if ((gl == null) || (gl.getType() == GeoLocation.UNSET))
{
/* (non-Javadoc)
* @see android.app.Activity#onContextItemSelected(android.view.MenuItem)
*/
+ @SuppressWarnings("deprecation")
@Override
public boolean onContextItemSelected(MenuItem item)
{
if (selectedObject == null)
return super.onContextItemSelected(item);
- switch(item.getItemId())
+ switch (item.getItemId())
{
case R.id.find_switch_port:
Intent fspIntent = new Intent(this, ConnectionPointBrowser.class);
{
startActivity(intent);
}
- catch(ActivityNotFoundException e)
+ catch (ActivityNotFoundException e)
{
Toast.makeText(getApplicationContext(), "Navigation unavailable", Toast.LENGTH_LONG);
}
}
break;
}
-
+
return super.onContextItemSelected(item);
}
import org.netxms.ui.android.main.views.CheckableLinearLayout;
import org.netxms.ui.android.service.ClientConnectorService;
+import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.res.Resources;
* @see android.widget.Adapter#getView(int, android.view.View,
* android.view.ViewGroup)
*/
+ @SuppressLint("RtlHardcoded")
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
graphView = new LineGraphView(context, config.getTitle());
graphView.getGraphViewStyle().setTextSize(Integer.parseInt(sp.getString("global.graph.textsize", "10")));
graphView.getGraphViewStyle().setLegendWidth(240);
- graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1"))));
// TODO: 2014May25 Find a best way to handle this setting
//graphView.setShowLegend(config.isShowLegend());
graphView.setShowLegend(sp.getBoolean("global.graph.legend", true));
final long endTime = System.currentTimeMillis();
final long startTime = endTime - config.getTimeRangeMillis();
+ graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1")), (endTime - startTime) > 86400 * 1000));
try
{
import org.netxms.ui.android.main.activities.TableLastValues;
import org.netxms.ui.android.main.adapters.LastValuesAdapter;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
public class LastValuesFragment extends AbstractListFragment implements LoaderManager.LoaderCallbacks<DciValue[]>
{
- private LastValuesAdapter adapter = null;
- private DciValueLoader loader = null;
- private ListView lv = null;
private static final Integer[] DEFAULT_COLORS = { 0x40699C, 0x9E413E, 0x7F9A48, 0x695185, 0x3C8DA3, 0xCC7B38, 0x4F81BD, 0xC0504D,
0x9BBB59, 0x8064A2, 0x4BACC6, 0xF79646, 0xAABAD7, 0xD9AAA9, 0xC6D6AC, 0xBAB0C9 };
private static final int MAX_COLORS = DEFAULT_COLORS.length;
+ private LastValuesAdapter adapter = null;
+ private DciValueLoader loader = null;
+ private ListView lv = null;
+ private long timeFrame = 0;
+ private ArrayList<Long> items = null;
+
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
public void onActivityCreated(Bundle savedInstanceState)
{
super.onActivityCreated(savedInstanceState);
- adapter = new LastValuesAdapter(getActivity().getApplicationContext());
+ adapter = new LastValuesAdapter(getActivity());
setListAdapter(adapter);
setListShown(false, true);
loader = (DciValueLoader)getActivity().getSupportLoaderManager().initLoader(R.layout.lastvalues_fragment, null, this);
@Override
public Loader<DciValue[]> onCreateLoader(int arg0, Bundle arg1)
{
- return new DciValueLoader(getActivity().getApplicationContext());
+ return new DciValueLoader(getActivity());
}
@Override
*/
private boolean handleItemSelection(MenuItem item)
{
+ ArrayList<Long> idList = getLastValuesSelection(item);
switch (item.getItemId())
{
case R.id.table_last_value:
- return showTableLastValue(getLastValuesSelection(item));
- case R.id.graph_half_hour:
- return drawGraph(1800, getLastValuesSelection(item));
+ return showTableLastValue(idList);
+ case R.id.graph_ten_minutes:
+ return drawGraph(10 * 60, idList);
+ case R.id.graph_thirty_minutes:
+ return drawGraph(30 * 60, idList);
case R.id.graph_one_hour:
- return drawGraph(3600, getLastValuesSelection(item));
+ return drawGraph(3600, idList);
case R.id.graph_two_hours:
- return drawGraph(7200, getLastValuesSelection(item));
+ return drawGraph(2 * 3600, idList);
case R.id.graph_four_hours:
- return drawGraph(14400, getLastValuesSelection(item));
+ return drawGraph(4 * 3600, idList);
+ case R.id.graph_twelve_hours:
+ return drawGraph(12 * 3600, idList);
case R.id.graph_one_day:
- return drawGraph(86400, getLastValuesSelection(item));
+ return drawGraph(86400, idList);
+ case R.id.graph_five_days:
+ return longExecutionDrawGraph(5 * 86400, idList);
case R.id.graph_one_week:
- return drawGraph(604800, getLastValuesSelection(item));
+ return longExecutionDrawGraph(7 * 86400, idList);
+ case R.id.graph_one_month:
+ return longExecutionDrawGraph(30 * 86400, idList);
case R.id.bar_chart:
return drawComparisonChart(DrawBarChart.class);
case R.id.pie_chart:
/**
* Show last value for table DCI
*
- * @param position
+ * @param idList list of DCI to graph
* @return
*/
private boolean showTableLastValue(ArrayList<Long> idList)
}
/**
- * @param secsBack
- * @param val
- * @return
+ * Draw graph for the specified time slot after confirmation of long task execution
+ *
+ * @param secsBack seconds back since current time
+ * @param idList list of DCI to graph
+ * @return Always true
+ */
+ private boolean longExecutionDrawGraph(long secsBack, ArrayList<Long> idList)
+ {
+ timeFrame = secsBack;
+ items = idList;
+
+ new AlertDialog.Builder(getActivity())
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setTitle(R.string.warning)
+ .setMessage(R.string.long_time_execution)
+ .setCancelable(true)
+ .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener()
+ {
+ @Override
+ public void onClick(DialogInterface dialog, int which)
+ {
+ if (items != null)
+ drawGraph(timeFrame, items);
+ }
+ })
+ .setNegativeButton(R.string.no, null)
+ .show();
+ return true;
+ }
+
+ /**
+ * Draw graph for the specified time slot
+ *
+ * @param secsBack seconds back since current time
+ * @param idList list of DCI to graph
+ * @return Always true
*/
private boolean drawGraph(long secsBack, ArrayList<Long> idList)
{
case CRITICAL: // Critical
return sp.getString("alarm.sound.critical", "");
case UNKNOWN: // Unknown
- return sp.getString("alarm.sound.unknown", ""); // TODO: 2014Oct10 Implement corresponding settings section
+ return sp.getString("alarm.sound.unknown", "");
case TERMINATE: // Terminate
- return sp.getString("alarm.sound.terminate", ""); // TODO: 2014Oct10 Implement corresponding settings section
+ return sp.getString("alarm.sound.terminate", "");
case RESOLVE: // Resolve
- return sp.getString("alarm.sound.resolve", ""); // TODO: 2014Oct10 Implement corresponding settings section
+ return sp.getString("alarm.sound.resolve", "");
}
return "";
}
case CRITICAL: // Critical
return R.drawable.status_critical;
case UNKNOWN: // Unknown
+ return R.drawable.status_unknown;
case TERMINATE: // Terminate
+ return R.drawable.status_terminate;
case RESOLVE: // Resolve
- return android.R.drawable.stat_notify_sdcard; // TODO: 2014Oct10 Implement corresponding icon
+ return R.drawable.status_resolve;
}
return android.R.drawable.stat_notify_sdcard;
}
* Initiates a scan only for a certain set of barcode types, given as strings corresponding to their names in ZXing's
* {@code BarcodeFormat} class like "UPC_A". You can supply constants like {@link #PRODUCT_CODE_TYPES} for example.
*/
+ @SuppressWarnings("deprecation")
public AlertDialog initiateScan(Collection<String> desiredBarcodeFormats)
{
Intent intentScan = new Intent(BS_PACKAGE + ".SCAN");
*
* @param text the text string to encode as a barcode
*/
+ @SuppressWarnings("deprecation")
public void shareText(CharSequence text)
{
Intent intent = new Intent();