Skip to content

Commit

Permalink
Fixed compiler warnings: redundant cast
Browse files Browse the repository at this point in the history
  • Loading branch information
mkulesh committed Jul 20, 2020
1 parent 6a2db77 commit 00b0745
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/mkulesh/mmd/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ protected void onCreate(Bundle savedInstanceState)
+ pm.getInstallerPackageName(getPackageName()));

// Action bar (v7 compatibility library): use Toolbar
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar = findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);

// Action bar drawer
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerLayout = findViewById(R.id.drawer_layout);

navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView = findViewById(R.id.nav_view);
if (navigationView != null)
{
navigationView.setNavigationItemSelectedListener(
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/mkulesh/mmd/MainFragmentExperiment.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public void onOrientationChanged(int orientation)
}
};

primaryButtonsSet = (FloatingButtonsSet) rootView.findViewById(R.id.main_flb_set_primary);
primaryButtonsSet = rootView.findViewById(R.id.main_flb_set_primary);

// surface preparation
surface = (SurfaceView) rootView.findViewById(R.id.experiment_view);
surface = rootView.findViewById(R.id.experiment_view);
surface.getHolder().setFormat(PixelFormat.TRANSPARENT);
touchListener = new SurfaceTouchListener(activity, surface);
surface.setOnTouchListener(touchListener);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/mkulesh/mmd/MainFragmentPotential.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ private void setPotential(PotentialType potentialType)
2.0 * Math.abs(potential.getPotentialMin()));

// value view
FunctionView v1 = (FunctionView) rootView.findViewById(R.id.activity_potential_value);
FunctionView v1 = rootView.findViewById(R.id.activity_potential_value);
v1.setPotential(potential, BasePotential.ValueType.VALUE, area);
v1.invalidate();

// derivative
FunctionView v2 = (FunctionView) rootView.findViewById(R.id.activity_potential_derivative);
FunctionView v2 = rootView.findViewById(R.id.activity_potential_derivative);
v2.setPotential(potential, BasePotential.ValueType.DERIVATIVE, area);
v2.invalidate();

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/mkulesh/mmd/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ protected void onCreate(Bundle savedInstanceState)

private void setupActionBar()
{
ViewGroup rootView = (ViewGroup) findViewById(R.id.action_bar_root); //id from appcompat
ViewGroup rootView = findViewById(R.id.action_bar_root); //id from appcompat
if (rootView != null)
{
View view = getLayoutInflater().inflate(R.layout.activity_toolbar, rootView, false);
rootView.addView(view, 0);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}

Expand Down Expand Up @@ -294,7 +294,7 @@ private void updateAreaPref(SharedPreferences sharedPref, String key, String val
prefEditor.putString(key, value);
prefEditor.commit();
((EditTextPreference) pref).setText(value);
((EditTextPreference) pref).setSummary(value);
pref.setSummary(value);
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/mkulesh/mmd/widgets/ControlDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void createSurfaceSchemaInterface()
{
setContentView(R.layout.surface_touch_schema);
getWindow().setLayout(par.width, par.height);
((Button) findViewById(R.id.button_cancel)).setOnClickListener(new View.OnClickListener()
(findViewById(R.id.button_cancel)).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
Expand All @@ -117,7 +117,7 @@ private void createSeekBarInterface()
{
setContentView(R.layout.control_dialog_seekbar);
((TextView) findViewById(R.id.control_dialog_title)).setText(par.title);
LinearLayout layout = (LinearLayout) findViewById(R.id.control_dialog_seekbar_sbarea);
LinearLayout layout = findViewById(R.id.control_dialog_seekbar_sbarea);
{
progressBar = par.isVertical ? new VerticalSeekBar(context) : new SeekBar(context);
ViewGroup.LayoutParams lp1 = new ViewGroup.LayoutParams(par.width, par.height);
Expand All @@ -132,7 +132,7 @@ private void createSeekBarInterface()
android.graphics.PorterDuff.Mode.SRC_IN);
layout.addView(progressBar);
}
progressText = (TextView) findViewById(R.id.control_dialog_seekbar_value);
progressText = findViewById(R.id.control_dialog_seekbar_value);
progressText.setText(decimalFormat.format(par.selectedValue));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public View getView(int position, View convertView, ViewGroup parent)
LayoutInflater inflater = ((Activity) getContext()).getLayoutInflater();
View row = inflater.inflate(textViewResourceId, parent, false);

CheckedTextView checkedTextView = (CheckedTextView) row.findViewById(R.id.image_list_item_checkbox);
CheckedTextView checkedTextView = row.findViewById(R.id.image_list_item_checkbox);
if (images != null && images.get(position) != null)
{
checkedTextView.setCompoundDrawablesWithIntrinsicBounds(
new BitmapDrawable(((Activity) getContext()).getResources(), images.get(position)), null, null,
new BitmapDrawable((getContext()).getResources(), images.get(position)), null, null,
null);
}
checkedTextView.setText(getItem(position));
Expand Down

0 comments on commit 00b0745

Please sign in to comment.