Skip to content

Commit

Permalink
Overall: apply refresh value of 500 ms after applying many tasks
Browse files Browse the repository at this point in the history
Signed-off-by: sunilpaulmathew <sunil.kde@gmail.com>
  • Loading branch information
sunilpaulmathew committed Apr 2, 2019
1 parent 7ae2542 commit 9444c0a
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
ACLevelCard.setOnItemSelected(new SelectView.OnItemSelected() {
@Override
public void onItemSelected(SelectView selectView, int position, String item) {
mBattery.setFastChargeControlAC(item, getActivity());
mBattery.setFastChargeControlAC(item, getActivity());
getHandler().postDelayed(() -> {
ACLevelCard.setItem(mBattery.getFastChargeCustomAC());
},
500);
}
});
acci.addItem(ACLevelCard);
Expand All @@ -165,7 +169,11 @@ public void onItemSelected(SelectView selectView, int position, String item) {
USBLevelCard.setOnItemSelected(new SelectView.OnItemSelected() {
@Override
public void onItemSelected(SelectView selectView, int position, String item) {
mBattery.setFastChargeControlUSB(item, getActivity());
mBattery.setFastChargeControlUSB(item, getActivity());
getHandler().postDelayed(() -> {
USBLevelCard.setItem(mBattery.getFastChargeCustomUSB());
},
500);
}
});
acci.addItem(USBLevelCard);
Expand All @@ -179,7 +187,11 @@ public void onItemSelected(SelectView selectView, int position, String item) {
WirelessLevelCard.setOnItemSelected(new SelectView.OnItemSelected() {
@Override
public void onItemSelected(SelectView selectView, int position, String item) {
mBattery.setFastChargeControlWIRELESS(item, getActivity());
mBattery.setFastChargeControlWIRELESS(item, getActivity());
getHandler().postDelayed(() -> {
WirelessLevelCard.setItem(mBattery.getFastChargeCustomWIRELESS());
},
500);
}
});
acci.addItem(WirelessLevelCard);
Expand All @@ -193,7 +205,7 @@ public void onItemSelected(SelectView selectView, int position, String item) {
MtpFastCharge.addOnSwitchListener(new SwitchView.OnSwitchListener() {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mBattery.enableMtpForceFastCharge(isChecked, getActivity());
mBattery.enableMtpForceFastCharge(isChecked, getActivity());
}
});
acci.addItem(MtpFastCharge);
Expand Down Expand Up @@ -230,6 +242,10 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mBattery.setchargeLevelAC((position * 25), getActivity());
getHandler().postDelayed(() -> {
chargeLevelAC.setProgress(mBattery.getchargeLevelAC() / 25 );
},
500);
}

@Override
Expand All @@ -251,6 +267,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mBattery.setchargeLevelUSB((position * 25), getActivity());
getHandler().postDelayed(() -> {
chargeLevelUSB.setProgress(mBattery.getchargeLevelUSB() / 25 );
},
500);
}

@Override
Expand All @@ -272,6 +292,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mBattery.setchargeLevelWL((position * 25), getActivity());
getHandler().postDelayed(() -> {
chargeLevelWL.setProgress(mBattery.getchargeLevelWL() / 25 );
},
500);
}

@Override
Expand Down Expand Up @@ -316,7 +340,7 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
OnePlusOTG.addOnSwitchListener(new SwitchView.OnSwitchListener() {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mBattery.OPOTGenable(isChecked, getActivity());
mBattery.OPOTGenable(isChecked, getActivity());
}
});
acci.addItem(OnePlusOTG);
Expand All @@ -330,7 +354,7 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
enable.addOnSwitchListener(new SwitchView.OnSwitchListener() {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mBattery.enableThunderCharge(isChecked, getActivity());
mBattery.enableThunderCharge(isChecked, getActivity());
}
});

Expand All @@ -348,6 +372,10 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
public void onGenericValueSelected(GenericSelectView genericSelectView, String value) {
mBattery.setThunderChargeAC(value, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
acharge.setValue(mBattery.getThunderChargeAC());
},
500);
}
});

Expand All @@ -365,6 +393,10 @@ public void onGenericValueSelected(GenericSelectView genericSelectView, String v
public void onGenericValueSelected(GenericSelectView genericSelectView, String value) {
mBattery.setThunderChargeUSB(value, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
usbcharge.setValue(mBattery.getThunderChargeUSB());
},
500);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,10 @@ public void onGenericValueSelected(GenericSelectView genericSelectView, String v
public void onGenericValueSelected(GenericSelectView genericSelectView, String value) {
Misc.setValue(value, position, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
advStune.setValueRaw(advStune.getValue());
},
500);
}
});
class advsettingsManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
SimpleGPU.setSimpleGpuLaziness(position, getActivity());
getHandler().postDelayed(() -> {
laziness.setProgress(SimpleGPU.getSimpleGpuLaziness());
},
500);
}
});

Expand All @@ -270,6 +274,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
SimpleGPU.setSimpleGpuRampThreshold(position, getActivity());
getHandler().postDelayed(() -> {
rampThreshold.setProgress(SimpleGPU.getSimpleGpuRampThreshold());
},
500);
}
});

Expand Down Expand Up @@ -335,6 +343,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
AdrenoIdler.setAdrenoIdlerDownDiff(position, getActivity());
getHandler().postDelayed(() -> {
downDiff.setProgress(AdrenoIdler.getAdrenoIdlerDownDiff());
},
500);
}
});

Expand All @@ -356,6 +368,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
AdrenoIdler.setAdrenoIdlerIdleWait(position, getActivity());
getHandler().postDelayed(() -> {
idleWait.setProgress(AdrenoIdler.getAdrenoIdlerIdleWait());
},
500);
}
});

Expand All @@ -378,6 +394,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
AdrenoIdler.setAdrenoIdlerIdleWorkload(position + 1, getActivity());
getHandler().postDelayed(() -> {
idleWorkload.setProgress(AdrenoIdler.getAdrenoIdlerIdleWorkload() - 1);
},
500);
}
});

Expand Down Expand Up @@ -413,6 +433,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
Adrenoboost.setAdrenoBoost(position, getActivity());
getHandler().postDelayed(() -> {
boost.setProgress(Adrenoboost.getAdrenoBoost());
},
500);
}
});

Expand All @@ -438,6 +462,10 @@ private void devfreqBoostInit(List<RecyclerViewItem> items) {
public void onGenericValueSelected(GenericSelectView genericSelectView, String value) {
DevfreqBoost.setDevfreqboostDuration(value, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
dbduration.setValue(DevfreqBoost.getDevfreqboostDuration());
},
500);
}
});

Expand All @@ -456,6 +484,10 @@ public void onGenericValueSelected(GenericSelectView genericSelectView, String v
public void onGenericValueSelected(GenericSelectView genericSelectView, String value) {
DevfreqBoost.setDevfreqboostFreq(value, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
dbfreq.setValue(DevfreqBoost.getDevfreqboostFreq());
},
500);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ private void storageInit(final IO.Storage storage, List<RecyclerViewItem> items)
@Override
public void onItemSelected(SelectView selectView, int position, String item) {
mIO.setScheduler(storage, item, getActivity());
getHandler().postDelayed(() -> {
scheduler.setItem(mIO.getScheduler(storage));
},
500);
}
});

Expand Down Expand Up @@ -112,6 +116,10 @@ public void onClick(RecyclerViewItem item) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mIO.setReadahead(storage, (position + 1) * 128, getActivity());
getHandler().postDelayed(() -> {
readahead.setProgress(mIO.getReadahead(storage) / 128 - 1);
},
500);
}

@Override
Expand All @@ -131,6 +139,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mIO.enableRotational(storage, isChecked, getActivity());
getHandler().postDelayed(() -> {
rotational.setChecked(mIO.isRotationalEnabled(storage));
},
500);
}
});

Expand All @@ -146,6 +158,10 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mIO.enableIOstats(storage, isChecked, getActivity());
getHandler().postDelayed(() -> {
iostats.setChecked(mIO.isIOStatsEnabled(storage));
},
500);
}
});

Expand All @@ -161,6 +177,10 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
@Override
public void onChanged(SwitchView switchView, boolean isChecked) {
mIO.enableAddRandom(storage, isChecked, getActivity());
getHandler().postDelayed(() -> {
addRandom.setChecked(mIO.isAddRandomEnabled(storage));
},
500);
}
});

Expand All @@ -177,6 +197,10 @@ public void onChanged(SwitchView switchView, boolean isChecked) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mIO.setRqAffinity(storage, position, getActivity());
getHandler().postDelayed(() -> {
rqAffinity.setProgress(mIO.getRqAffinity(storage));
},
500);
}

@Override
Expand All @@ -197,6 +221,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
@Override
public void onStop(SeekBarView seekBarView, int position, String value) {
mIO.setNomerges(storage, position, getActivity());
getHandler().postDelayed(() -> {
Nomerges.setProgress(mIO.getNomerges(storage));
},
500);
}

@Override
Expand All @@ -217,6 +245,10 @@ public void onMove(SeekBarView seekBarView, int position, String value) {
NrRequests.setOnGenericValueListener((genericSelectView, value) -> {
mIO.setNrRequests(storage, value, getActivity());
genericSelectView.setValue(value);
getHandler().postDelayed(() -> {
NrRequests.setValueRaw(NrRequests.getValue());
},
500);
});

StorageCard.addItem(NrRequests);
Expand Down
Loading

0 comments on commit 9444c0a

Please sign in to comment.