mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 08:43:15 +02:00
Remove redundant casts
This commit is contained in:
@@ -91,7 +91,7 @@ public class BluetoothExingtechY1 extends BluetoothCommunication {
|
||||
}
|
||||
|
||||
private void parseBytes(byte[] weightBytes) {
|
||||
int userId = (int)(weightBytes[0] & 0x0F);
|
||||
int userId = weightBytes[0] & 0x0F;
|
||||
int gender = (int)(weightBytes[1]); // 0x00 male; 0x01 female
|
||||
int age = (int)(weightBytes[2]); // 10 ~ 99
|
||||
int height = (int)(weightBytes[3]); // 0 ~ 255
|
||||
|
@@ -111,12 +111,12 @@ public class MainActivity extends BaseAppCompatActivity
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
// Find our drawer view
|
||||
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
|
||||
// Find our drawer view
|
||||
navDrawer = (NavigationView) findViewById(R.id.navigation_view);
|
||||
navDrawer = findViewById(R.id.navigation_view);
|
||||
|
||||
navBottomDrawer = (BottomNavigationView) findViewById(R.id.navigation_bottom_view);
|
||||
navBottomDrawer = findViewById(R.id.navigation_bottom_view);
|
||||
navBottomDrawer.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||
|
@@ -82,7 +82,7 @@ public class DataEntryActivity extends BaseAppCompatActivity {
|
||||
|
||||
setContentView(R.layout.activity_dataentry);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.dataEntryToolbar);
|
||||
Toolbar toolbar = findViewById(R.id.dataEntryToolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
@@ -95,9 +95,9 @@ public class DataEntryActivity extends BaseAppCompatActivity {
|
||||
dataEntryMeasurements = MeasurementView.getMeasurementList(
|
||||
context, MeasurementView.DateTimeOrder.LAST);
|
||||
|
||||
txtDataNr = (TextView) findViewById(R.id.txtDataNr);
|
||||
btnLeft = (Button) findViewById(R.id.btnLeft);
|
||||
btnRight = (Button) findViewById(R.id.btnRight);
|
||||
txtDataNr = findViewById(R.id.txtDataNr);
|
||||
btnLeft = findViewById(R.id.btnLeft);
|
||||
btnRight = findViewById(R.id.btnRight);
|
||||
|
||||
btnLeft.setVisibility(View.INVISIBLE);
|
||||
btnRight.setVisibility(View.INVISIBLE);
|
||||
|
@@ -74,21 +74,21 @@ public class UserSettingsActivity extends BaseAppCompatActivity {
|
||||
setContentView(R.layout.activity_usersettings);
|
||||
context = this;
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.userEntryToolbar);
|
||||
Toolbar toolbar = findViewById(R.id.userEntryToolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setTitle(R.string.label_add_user);
|
||||
|
||||
txtUserName = (EditText) findViewById(R.id.txtUserName);
|
||||
txtBodyHeight = (EditText) findViewById(R.id.txtBodyHeight);
|
||||
radioScaleUnit = (RadioGroup) findViewById(R.id.groupScaleUnit);
|
||||
radioGender = (RadioGroup) findViewById(R.id.groupGender);
|
||||
txtInitialWeight = (EditText) findViewById(R.id.txtInitialWeight);
|
||||
txtGoalWeight = (EditText) findViewById(R.id.txtGoalWeight);
|
||||
txtUserName = findViewById(R.id.txtUserName);
|
||||
txtBodyHeight = findViewById(R.id.txtBodyHeight);
|
||||
radioScaleUnit = findViewById(R.id.groupScaleUnit);
|
||||
radioGender = findViewById(R.id.groupGender);
|
||||
txtInitialWeight = findViewById(R.id.txtInitialWeight);
|
||||
txtGoalWeight = findViewById(R.id.txtGoalWeight);
|
||||
|
||||
txtBirthday = (EditText) findViewById(R.id.txtBirthday);
|
||||
txtGoalDate = (EditText) findViewById(R.id.txtGoalDate);
|
||||
txtBirthday = findViewById(R.id.txtBirthday);
|
||||
txtGoalDate = findViewById(R.id.txtGoalDate);
|
||||
|
||||
Calendar birthdayCal = Calendar.getInstance();
|
||||
birthdayCal.setTime(birthday);
|
||||
|
@@ -123,8 +123,8 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
||||
|
||||
graphView = inflater.inflate(R.layout.fragment_graph, container, false);
|
||||
|
||||
chartBottom = (LineChartView) graphView.findViewById(R.id.chart_bottom);
|
||||
chartTop = (ColumnChartView) graphView.findViewById(R.id.chart_top);
|
||||
chartBottom = graphView.findViewById(R.id.chart_bottom);
|
||||
chartTop = graphView.findViewById(R.id.chart_top);
|
||||
|
||||
chartBottom.setOnTouchListener(new chartBottomListener());
|
||||
chartBottom.setOnValueTouchListener(new chartBottomValueTouchListener());
|
||||
@@ -133,10 +133,10 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
||||
// HACK: get default text color from hidden text view to set the correct axis colors
|
||||
textColor = ((TextView)graphView.findViewById(R.id.colorHack)).getCurrentTextColor();
|
||||
|
||||
txtYear = (TextView) graphView.findViewById(R.id.txtYear);
|
||||
txtYear = graphView.findViewById(R.id.txtYear);
|
||||
txtYear.setText(Integer.toString(calYears.get(Calendar.YEAR)));
|
||||
|
||||
floatingActionBar = (LinearLayout) graphView.findViewById(R.id.floatingActionBar);
|
||||
floatingActionBar = graphView.findViewById(R.id.floatingActionBar);
|
||||
|
||||
ImageView optionMenu = graphView.findViewById(R.id.optionMenu);
|
||||
optionMenu.setOnClickListener(new View.OnClickListener() {
|
||||
|
@@ -102,13 +102,13 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener
|
||||
|
||||
context = overviewView.getContext();
|
||||
|
||||
txtTitleUser = (TextView) overviewView.findViewById(R.id.txtTitleUser);
|
||||
txtTitleLastMeasurement = (TextView) overviewView.findViewById(R.id.txtTitleLastMeasurment);
|
||||
txtTitleUser = overviewView.findViewById(R.id.txtTitleUser);
|
||||
txtTitleLastMeasurement = overviewView.findViewById(R.id.txtTitleLastMeasurment);
|
||||
|
||||
pieChartLast = (PieChartView) overviewView.findViewById(R.id.pieChartLast);
|
||||
lineChartLast = (LineChartView) overviewView.findViewById(R.id.lineChartLast);
|
||||
pieChartLast = overviewView.findViewById(R.id.pieChartLast);
|
||||
lineChartLast = overviewView.findViewById(R.id.lineChartLast);
|
||||
|
||||
spinUser = (Spinner) overviewView.findViewById(R.id.spinUser);
|
||||
spinUser = overviewView.findViewById(R.id.spinUser);
|
||||
|
||||
lineChartLast.setOnValueTouchListener(new LineChartTouchListener());
|
||||
|
||||
|
@@ -80,13 +80,13 @@ public class StatisticsFragment extends Fragment implements FragmentUpdateListen
|
||||
image.setColorFilter(color);
|
||||
}
|
||||
|
||||
txtGoalWeight = (TextView) statisticsView.findViewById(R.id.txtGoalWeight);
|
||||
txtGoalDiff = (TextView) statisticsView.findViewById(R.id.txtGoalDiff);
|
||||
txtGoalDayLeft = (TextView) statisticsView.findViewById(R.id.txtGoalDayLeft);
|
||||
txtGoalWeight = statisticsView.findViewById(R.id.txtGoalWeight);
|
||||
txtGoalDiff = statisticsView.findViewById(R.id.txtGoalDiff);
|
||||
txtGoalDayLeft = statisticsView.findViewById(R.id.txtGoalDayLeft);
|
||||
|
||||
txtLabelGoalWeight = (TextView) statisticsView.findViewById(R.id.txtLabelGoalWeight);
|
||||
txtLabelGoalDiff = (TextView) statisticsView.findViewById(R.id.txtLabelGoalDiff);
|
||||
txtLabelDayLeft = (TextView) statisticsView.findViewById(R.id.txtLabelDayLeft);
|
||||
txtLabelGoalWeight = statisticsView.findViewById(R.id.txtLabelGoalWeight);
|
||||
txtLabelGoalDiff = statisticsView.findViewById(R.id.txtLabelGoalDiff);
|
||||
txtLabelDayLeft = statisticsView.findViewById(R.id.txtLabelDayLeft);
|
||||
|
||||
TableLayout tableWeekAveragesLayoutColumnA = statisticsView.findViewById(R.id.tableWeekAveragesLayoutColumnA);
|
||||
TableLayout tableWeekAveragesLayoutColumnB = statisticsView.findViewById(R.id.tableWeekAveragesLayoutColumnB);
|
||||
|
@@ -70,10 +70,10 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
||||
{
|
||||
tableView = inflater.inflate(R.layout.fragment_table, container, false);
|
||||
|
||||
subpageView = (LinearLayout) tableView.findViewById(R.id.subpageView);
|
||||
subpageView = tableView.findViewById(R.id.subpageView);
|
||||
|
||||
tableDataView = (ListView) tableView.findViewById(R.id.tableDataView);
|
||||
tableHeaderView = (LinearLayout) tableView.findViewById(R.id.tableHeaderView);
|
||||
tableDataView = tableView.findViewById(R.id.tableDataView);
|
||||
tableHeaderView = tableView.findViewById(R.id.tableHeaderView);
|
||||
|
||||
tableDataView.setAdapter(new ListViewAdapter());
|
||||
tableDataView.setOnItemClickListener(new onClickListenerRow());
|
||||
|
Reference in New Issue
Block a user