Merge pull request #11129 from osmandapp/wrong-recording-note
wrong recording note button is shown on profile change
This commit is contained in:
commit
fc5440120b
1 changed files with 5 additions and 3 deletions
|
@ -777,19 +777,21 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
if (mapInfoLayer != null) {
|
||||
recordControl = new TextInfoWidget(activity) {
|
||||
|
||||
private Integer cachedAction;
|
||||
private Boolean cachedRecording;
|
||||
|
||||
@Override
|
||||
public boolean updateInfo(DrawSettings drawSettings) {
|
||||
boolean recording = isRecording();
|
||||
if (!Algorithms.objectEquals(recording, cachedRecording)) {
|
||||
Integer action = AV_DEFAULT_ACTION.get();
|
||||
if (!Algorithms.objectEquals(recording, cachedAction) || !Algorithms.objectEquals(action, cachedRecording)) {
|
||||
cachedAction = action;
|
||||
cachedRecording = recording;
|
||||
if (recording) {
|
||||
setText(app.getString(R.string.shared_string_control_stop), null);
|
||||
setIcons(R.drawable.widget_icon_av_active, R.drawable.widget_icon_av_active_night);
|
||||
} else {
|
||||
setText(app.getString(R.string.shared_string_control_start), null);
|
||||
Integer action = AV_DEFAULT_ACTION.get();
|
||||
switch (action) {
|
||||
case AV_DEFAULT_ACTION_VIDEO:
|
||||
setIcons(R.drawable.widget_av_video_day, R.drawable.widget_av_video_night);
|
||||
|
@ -807,7 +809,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
};
|
||||
recordControl.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue