@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean b) { if (!b) return; float diff = item.weight - progress; item.weight = progress; item.isTouched = true; LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.weight = progress; findViewById(0x00001000 + item.position).setLayoutParams(params); helper.recountWeights(item.position, diff); // change weight of other elements // update other views LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); for (WeightItem weightItem : helper.itemsList) { TextView weTxt = (TextView) findViewById(0x00002000 + weightItem.position); weTxt.setText("weight of item " + weightItem.position + " w = " + weightItem.weight); if (weightItem.position == item.position) { continue; } params1.weight = weightItem.weight; findViewById(0x00001000 + weightItem.position).setLayoutParams(params1); } // TextView weightOfItemTxt = (TextView) findViewById(0x00002000 + item.position); // weightOfItemTxt.setText("weight of item " + item.position + " w = " + // item.weight); total.setText("total weightSum = " + helper.getTotalWeightSum()); weightView.invalidate(); changeView.invalidate(); }