mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-21 16:17:45 +01:00
adjusted settings activity
This commit is contained in:
parent
8db0812ed0
commit
f912ae28a2
@ -251,15 +251,15 @@ public class ConfigActivity extends AbstractGBActivity {
|
|||||||
public void run() {
|
public void run() {
|
||||||
EditText et = findViewById(R.id.stepGoalEt);
|
EditText et = findViewById(R.id.stepGoalEt);
|
||||||
et.setOnEditorActionListener(null);
|
et.setOnEditorActionListener(null);
|
||||||
final String text = device.getDeviceInfo(QHybridSupport.ITEM_STEP_GOAL).getDetails();
|
//final String text = device.getDeviceInfo(QHybridSupport.ITEM_STEP_GOAL).getDetails();
|
||||||
et.setText(text);
|
//et.setText(text);
|
||||||
et.setSelection(text.length());
|
//et.setSelection(text.length());
|
||||||
et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
||||||
if (i == EditorInfo.IME_ACTION_DONE || i == EditorInfo.IME_ACTION_NEXT) {
|
if (i == EditorInfo.IME_ACTION_DONE || i == EditorInfo.IME_ACTION_NEXT) {
|
||||||
String t = textView.getText().toString();
|
String t = textView.getText().toString();
|
||||||
if (!t.equals(text)) {
|
if (!t.equals(null)) {
|
||||||
device.addDeviceInfo(new GenericItem(QHybridSupport.ITEM_STEP_GOAL, t));
|
device.addDeviceInfo(new GenericItem(QHybridSupport.ITEM_STEP_GOAL, t));
|
||||||
Intent intent = new Intent(QHybridSupport.QHYBRID_COMMAND_UPDATE_SETTINGS);
|
Intent intent = new Intent(QHybridSupport.QHYBRID_COMMAND_UPDATE_SETTINGS);
|
||||||
intent.putExtra("EXTRA_SETTING", QHybridSupport.ITEM_STEP_GOAL);
|
intent.putExtra("EXTRA_SETTING", QHybridSupport.ITEM_STEP_GOAL);
|
||||||
@ -452,10 +452,4 @@ public class ConfigActivity extends AbstractGBActivity {
|
|||||||
updateSettings();
|
updateSettings();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class AddPackageConfig extends PackageConfig {
|
|
||||||
AddPackageConfig() {
|
|
||||||
super(null, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user