Rename cancel to pause in Transformer demo
The user might expect this button to back out to the configuration activity, but actually it toggles pause/resume (though `cancel` is the method called). PiperOrigin-RevId: 647273416
This commit is contained in:
parent
727645179b
commit
dcbded0fa9
@ -130,7 +130,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||
private TextView informationTextView;
|
||||
private ViewGroup progressViewGroup;
|
||||
private LinearProgressIndicator progressIndicator;
|
||||
private Button cancelButton;
|
||||
private Button pauseButton;
|
||||
private Button resumeButton;
|
||||
private Stopwatch exportStopwatch;
|
||||
private AspectRatioFrameLayout debugFrame;
|
||||
@ -157,8 +157,8 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||
informationTextView = findViewById(R.id.information_text_view);
|
||||
progressViewGroup = findViewById(R.id.progress_view_group);
|
||||
progressIndicator = findViewById(R.id.progress_indicator);
|
||||
cancelButton = findViewById(R.id.cancel_button);
|
||||
cancelButton.setOnClickListener(view -> cancelExport());
|
||||
pauseButton = findViewById(R.id.pause_button);
|
||||
pauseButton.setOnClickListener(view -> pauseExport());
|
||||
resumeButton = findViewById(R.id.resume_button);
|
||||
resumeButton.setOnClickListener(view -> startExport());
|
||||
debugFrame = findViewById(R.id.debug_aspect_ratio_frame_layout);
|
||||
@ -241,7 +241,7 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||
debugTextView.setVisibility(View.GONE);
|
||||
informationTextView.setText(R.string.export_started);
|
||||
progressViewGroup.setVisibility(View.VISIBLE);
|
||||
cancelButton.setVisibility(View.VISIBLE);
|
||||
pauseButton.setVisibility(View.VISIBLE);
|
||||
resumeButton.setVisibility(View.GONE);
|
||||
progressIndicator.setProgress(0);
|
||||
Handler mainHandler = new Handler(getMainLooper());
|
||||
@ -799,11 +799,11 @@ public final class TransformerActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelExport() {
|
||||
private void pauseExport() {
|
||||
transformer.cancel();
|
||||
transformer = null;
|
||||
exportStopwatch.stop();
|
||||
cancelButton.setVisibility(View.GONE);
|
||||
pauseButton.setVisibility(View.GONE);
|
||||
resumeButton.setVisibility(View.VISIBLE);
|
||||
if (oldOutputFile != null) {
|
||||
oldOutputFile.delete();
|
||||
|
@ -154,10 +154,10 @@
|
||||
android:text="@string/debug_preview" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel_button"
|
||||
android:id="@+id/pause_button"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:text="@string/cancel"/>
|
||||
android:text="@string/pause"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/resume_button"
|
||||
|
@ -42,7 +42,7 @@
|
||||
<string name="no_media_pipe_error" translatable="false">Failed to load MediaPipeShaderProgram. Check the README for instructions.</string>
|
||||
<string name="export" translatable="false">Export</string>
|
||||
<string name="debug_preview" translatable="false">Debug preview:</string>
|
||||
<string name="cancel" translatable="false">Cancel</string>
|
||||
<string name="pause" translatable="false">Pause</string>
|
||||
<string name="resume" translatable="false">Resume</string>
|
||||
<string name="debug_preview_not_available" translatable="false">No debug preview available.</string>
|
||||
<string name="export_started" translatable="false">Export started</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user