2020-11-14 10:06:55 +01:00
|
|
|
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo,
|
|
|
|
vanous
|
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
package nodomain.freeyourgadget.gadgetbridge.activities;
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
2021-05-27 23:11:00 +02:00
|
|
|
import androidx.preference.Preference;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
2020-11-14 10:06:55 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
|
|
|
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_ACTIVETIME_MINUTES;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_CALORIES_BURNT;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_DISTANCE_METERS;
|
2021-05-27 23:11:00 +02:00
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_GENDER;
|
2020-11-14 10:06:55 +01:00
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_HEIGHT_CM;
|
2021-05-27 23:11:00 +02:00
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_NAME;
|
2020-11-14 10:06:55 +01:00
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_SLEEP_DURATION;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_STEPS_GOAL;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_STEP_LENGTH_CM;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_WEIGHT_KG;
|
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_YEAR_OF_BIRTH;
|
|
|
|
|
|
|
|
public class AboutUserPreferencesActivity extends AbstractSettingsActivity {
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
addPreferencesFromResource(R.xml.about_user);
|
2021-05-27 23:11:00 +02:00
|
|
|
addPreferenceHandlerFor(PREF_USER_NAME);
|
|
|
|
addPreferenceHandlerFor(PREF_USER_YEAR_OF_BIRTH);
|
|
|
|
addPreferenceHandlerFor(PREF_USER_HEIGHT_CM);
|
|
|
|
addPreferenceHandlerFor(PREF_USER_WEIGHT_KG);
|
|
|
|
addPreferenceHandlerFor(PREF_USER_GENDER);
|
2021-09-21 16:37:19 +02:00
|
|
|
addPreferenceHandlerFor(PREF_USER_STEPS_GOAL);
|
2021-12-05 10:32:35 +01:00
|
|
|
|
|
|
|
addIntentNotificationListener(PREF_USER_STEPS_GOAL);
|
|
|
|
addIntentNotificationListener(PREF_USER_HEIGHT_CM);
|
|
|
|
addIntentNotificationListener(PREF_USER_SLEEP_DURATION);
|
|
|
|
addIntentNotificationListener(PREF_USER_STEP_LENGTH_CM);
|
|
|
|
addIntentNotificationListener(PREF_USER_DISTANCE_METERS);
|
2020-11-14 10:06:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String[] getPreferenceKeysWithSummary() {
|
|
|
|
return new String[]{
|
|
|
|
PREF_USER_YEAR_OF_BIRTH,
|
|
|
|
PREF_USER_HEIGHT_CM,
|
|
|
|
PREF_USER_WEIGHT_KG,
|
|
|
|
PREF_USER_SLEEP_DURATION,
|
|
|
|
PREF_USER_STEPS_GOAL,
|
|
|
|
PREF_USER_STEP_LENGTH_CM,
|
|
|
|
PREF_USER_ACTIVETIME_MINUTES,
|
|
|
|
PREF_USER_CALORIES_BURNT,
|
|
|
|
PREF_USER_DISTANCE_METERS,};
|
|
|
|
}
|
|
|
|
}
|