mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-19 06:51:57 +02:00
convert received bluetooth weight automatically to scale unit
avoid null pointer exception if selected subpage is not avaiable
This commit is contained in:
@@ -211,6 +211,8 @@ public class MainActivity extends ActionBarActivity implements
|
||||
setBluetoothStatusIcon(R.drawable.bluetooth_connection_success);
|
||||
ScaleData scaleBtData = (ScaleData) msg.obj;
|
||||
|
||||
scaleBtData.setConvertedWeight(scaleBtData.getWeight(), OpenScale.getInstance(getApplicationContext()).getSelectedScaleUser().scale_unit);
|
||||
|
||||
if (OpenScale.getInstance(getApplicationContext()).addScaleData(scaleBtData) == -1) {
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_no_selected_user), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@@ -156,9 +156,11 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
||||
}
|
||||
if (subpageView.getChildCount() > 1) {
|
||||
TextView selectedSubpageNrView = (TextView) subpageView.getChildAt(selectedSubpageNr + 1);
|
||||
if (selectedSubpageNrView != null) {
|
||||
selectedSubpageNrView.setTypeface(null, Typeface.BOLD);
|
||||
selectedSubpageNrView.setTextColor(ChartUtils.COLOR_BLUE);
|
||||
}
|
||||
}
|
||||
|
||||
Button moveSubpageRight = new Button(tableView.getContext());
|
||||
moveSubpageRight.setText(">");
|
||||
|
Reference in New Issue
Block a user