diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-06-27 19:53:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-06-27 19:53:55 +0000 |
commit | 1b4ec7b954ba2d8efae2f383697babe54b795f67 (patch) | |
tree | 4c051c4a8702f4256f83f0e55182e27b2ed5b840 /java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java | |
parent | cae28c6d5c04a79fb058043ce0c3e043e610309a (diff) | |
parent | d637af51091dc86a197da6520484e10a356a421b (diff) |
Merge changes I0f1ed20a,Ia68d3b13,I72047d59,Ieff3c7fb,I53c3896a, ...
* changes:
Added method to set Save and Redo buttons enabled/disabled Added logic to setState() method to change state of buttons
Update emergency call map and device number UI.
Fix SpeedDialUiItem.getDefaultVoiceChannel
Fix an AOSP build error caused by version codes
Update connection label.
Remove redundant version checks and annotations in the assisted dialing package.
Diffstat (limited to 'java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java')
-rw-r--r-- | java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java b/java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java index 39a791d5f..89e45dca7 100644 --- a/java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java +++ b/java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java @@ -21,6 +21,7 @@ import android.os.Bundle; import android.support.annotation.IntDef; import android.view.View; import android.view.View.OnClickListener; +import android.widget.Button; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -46,14 +47,21 @@ public class RecordVoicemailGreetingActivity extends Activity implements OnClick private int currentState; private int duration; private RecordButton recordButton; + private Button saveButton; + private Button redoButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_record_voicemail_greeting); + recordButton = findViewById(R.id.record_button); + saveButton = findViewById(R.id.save_button); + redoButton = findViewById(R.id.redo_button); + duration = 0; setState(RECORD_GREETING_INIT); + recordButton.setOnClickListener(this); } @Override @@ -83,18 +91,32 @@ public class RecordVoicemailGreetingActivity extends Activity implements OnClick case RECORD_GREETING_INIT: recordButton.setState(state); recordButton.setTracks(0, 0); + setSaveRedoButtonsEnabled(false); break; case RECORD_GREETING_PLAYING_BACK: case RECORD_GREETING_RECORDED: recordButton.setState(state); recordButton.setTracks(0, (float) duration / MAX_GREETING_DURATION_MS); + setSaveRedoButtonsEnabled(true); break; case RECORD_GREETING_RECORDING: recordButton.setState(state); recordButton.setTracks(0, 1f); + setSaveRedoButtonsEnabled(false); break; default: break; } } + + /** Enables/Disables save and redo buttons in the layout */ + private void setSaveRedoButtonsEnabled(boolean enabled) { + if (enabled) { + saveButton.setVisibility(View.VISIBLE); + redoButton.setVisibility(View.VISIBLE); + } else { + saveButton.setVisibility(View.GONE); + redoButton.setVisibility(View.GONE); + } + } } |