-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make use of eclipse/smarthome#4291 #386
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,8 @@ public abstract class OpenHABWidget { | |
private String type; | ||
private String url; | ||
private String period = ""; | ||
private String service = ""; | ||
private String service = ""; | ||
private boolean legend = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was aware of this problem, but couldn't find a good solution. Thanks! |
||
private float minValue =0; | ||
private float maxValue = 100; | ||
private float step = 1; | ||
|
@@ -192,6 +193,10 @@ public void setPeriod(String period) { | |
|
||
public void setService(String service) { this.service = service; } | ||
|
||
public boolean getLegend() { return legend; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above: Boolean |
||
|
||
public void setLegend(boolean legend) { this.legend = legend; } | ||
|
||
public int getHeight() { | ||
return height; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,14 @@ | |
package org.openhab.habdroid.ui; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
import android.net.Uri; | ||
import android.os.Build; | ||
import android.preference.PreferenceManager; | ||
import android.support.v7.widget.SwitchCompat; | ||
import android.util.DisplayMetrics; | ||
import android.util.Log; | ||
import android.util.TypedValue; | ||
import android.view.LayoutInflater; | ||
import android.view.MotionEvent; | ||
import android.view.View; | ||
|
@@ -44,6 +48,7 @@ | |
import org.openhab.habdroid.ui.widget.ColorPickerDialog; | ||
import org.openhab.habdroid.ui.widget.OnColorChangedListener; | ||
import org.openhab.habdroid.ui.widget.SegmentedControlButton; | ||
import org.openhab.habdroid.util.Constants; | ||
import org.openhab.habdroid.util.MjpegStreamer; | ||
import org.openhab.habdroid.util.MyAsyncHttpClient; | ||
import org.openhab.habdroid.util.MyHttpClient; | ||
|
@@ -499,10 +504,23 @@ public void onStopTrackingTouch(SeekBar seekBar) { | |
if (openHABWidget.getService() != null && openHABWidget.getService().length() > 0) { | ||
chartUrl += "&service=" + openHABWidget.getService(); | ||
} | ||
} | ||
// add theme attribute | ||
TypedValue chartTheme = new TypedValue(); | ||
if (getContext().getTheme().resolveAttribute(R.attr.chartTheme, chartTheme, true)) { | ||
chartUrl += "&theme=" + chartTheme.string; | ||
} | ||
|
||
// add dpi attribute | ||
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); | ||
DisplayMetrics metrics = new DisplayMetrics(); | ||
wm.getDefaultDisplay().getMetrics(metrics); | ||
int dpi = metrics.densityDpi; | ||
chartUrl += "&dpi=" + dpi; | ||
|
||
// add legend | ||
chartUrl += "&legend=" + openHABWidget.getLegend(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only add |
||
} | ||
Log.d(TAG, "Chart url = " + chartUrl); | ||
if (chartImage == null) | ||
Log.e(TAG, "chartImage == null !!!"); | ||
ViewGroup.LayoutParams chartLayoutParams = chartImage.getLayoutParams(); | ||
chartLayoutParams.height = (int) (screenWidth/2); | ||
chartImage.setLayoutParams(chartLayoutParams); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong setter called