Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java

Issue 1820113003: Add Mic Toggle button to AppRTCDemo (Android). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java
index 04b563949d96817a38dc6add9d195445d77340f5..6523ffa443074f6f124da0eada037e703055aff4 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallFragment.java
@@ -31,6 +31,7 @@ public class CallFragment extends Fragment {
private ImageButton disconnectButton;
private ImageButton cameraSwitchButton;
private ImageButton videoScalingButton;
+ private ImageButton toggleMuteButton;
private TextView captureFormatText;
private SeekBar captureFormatSlider;
private OnCallEvents callEvents;
@@ -45,6 +46,7 @@ public class CallFragment extends Fragment {
public void onCameraSwitch();
public void onVideoScalingSwitch(ScalingType scalingType);
public void onCaptureFormatChange(int width, int height, int framerate);
+ public boolean onToggleMic();
}
@Override
@@ -62,6 +64,8 @@ public class CallFragment extends Fragment {
(ImageButton) controlView.findViewById(R.id.button_call_switch_camera);
videoScalingButton =
(ImageButton) controlView.findViewById(R.id.button_call_scaling_mode);
+ toggleMuteButton =
+ (ImageButton) controlView.findViewById(R.id.button_call_toggle_mic);
captureFormatText =
(TextView) controlView.findViewById(R.id.capture_format_text_call);
captureFormatSlider =
@@ -99,6 +103,14 @@ public class CallFragment extends Fragment {
});
scalingType = ScalingType.SCALE_ASPECT_FILL;
+ toggleMuteButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ boolean enabled = callEvents.onToggleMic();
+ toggleMuteButton.setAlpha(enabled ? 1.0f : 0.3f);
+ }
+ });
+
return controlView;
}

Powered by Google App Engine
This is Rietveld 408576698