1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-24 07:38:45 +02:00

adjusted settings activity

This commit is contained in:
dakhnod 2019-09-25 00:19:59 +02:00
parent 8db0812ed0
commit f912ae28a2

View File

@ -251,15 +251,15 @@ public class ConfigActivity extends AbstractGBActivity {
public void run() {
EditText et = findViewById(R.id.stepGoalEt);
et.setOnEditorActionListener(null);
final String text = device.getDeviceInfo(QHybridSupport.ITEM_STEP_GOAL).getDetails();
et.setText(text);
et.setSelection(text.length());
//final String text = device.getDeviceInfo(QHybridSupport.ITEM_STEP_GOAL).getDetails();
//et.setText(text);
//et.setSelection(text.length());
et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == EditorInfo.IME_ACTION_DONE || i == EditorInfo.IME_ACTION_NEXT) {
String t = textView.getText().toString();
if (!t.equals(text)) {
if (!t.equals(null)) {
device.addDeviceInfo(new GenericItem(QHybridSupport.ITEM_STEP_GOAL, t));
Intent intent = new Intent(QHybridSupport.QHYBRID_COMMAND_UPDATE_SETTINGS);
intent.putExtra("EXTRA_SETTING", QHybridSupport.ITEM_STEP_GOAL);
@ -452,10 +452,4 @@ public class ConfigActivity extends AbstractGBActivity {
updateSettings();
}
};
class AddPackageConfig extends PackageConfig {
AddPackageConfig() {
super(null, null);
}
}
}