mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-04 10:23:06 +02:00
b270c45691
- add instant post workout track export
23 lines
751 B
Java
23 lines
751 B
Java
package de.dennisguse.opentracks.util;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.preference.Preference;
|
|
|
|
public class HackUtils {
|
|
|
|
private HackUtils() {
|
|
}
|
|
|
|
/**
|
|
* Triggers a redraw of the summary of a preference if it was set programmatically.
|
|
* Need to trigger androidx.preference.preferences.notifyChanged() to trigger a redraw, but method is protected.
|
|
* This workaround also works when this preference has not changed, but it's entries (see R.string.stats_rate_key).
|
|
* TODO
|
|
*/
|
|
public static void invalidatePreference(@NonNull Preference preference) {
|
|
boolean isEnabled = preference.isEnabled();
|
|
preference.setVisible(!isEnabled);
|
|
preference.setVisible(isEnabled);
|
|
}
|
|
}
|