Text added to incall buttons
This commit is contained in:
parent
bb4bb45ea7
commit
7343d5810d
5 changed files with 123 additions and 78 deletions
|
@ -90,13 +90,16 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/transfer"
|
||||
android:background="@drawable/options_transfer"
|
||||
android:text="@string/button_transfer"
|
||||
android:gravity="center"
|
||||
android:paddingTop="50dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options_transfer"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<View
|
||||
|
@ -142,13 +145,16 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/addCall"
|
||||
android:background="@drawable/options_add_call_alt"
|
||||
android:text="@string/button_add_call"
|
||||
android:gravity="center"
|
||||
android:paddingTop="50dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options_add_call_alt"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<View
|
||||
|
@ -183,23 +189,27 @@
|
|||
android:scaleType="fitXY"
|
||||
android:src="@drawable/conference" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/video"
|
||||
android:background="@drawable/video_off"
|
||||
android:text="@string/button_video"
|
||||
android:gravity="center"
|
||||
android:paddingTop="35dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_switch_video"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/video_off" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/micro"
|
||||
android:background="@drawable/micro_on"
|
||||
android:text="@string/button_micro"
|
||||
android:gravity="center"
|
||||
android:paddingTop="35dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_toggle_micro"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/micro_on" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/hangUp"
|
||||
|
@ -210,22 +220,27 @@
|
|||
android:scaleType="fitXY"
|
||||
android:src="@drawable/hangup" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/speaker"
|
||||
android:background="@drawable/speaker_off"
|
||||
android:text="@string/button_speaker"
|
||||
android:gravity="center"
|
||||
android:paddingTop="35dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_toggle_speaker"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/speaker_off" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/options"
|
||||
android:background="@drawable/options"
|
||||
android:text="@string/button_options"
|
||||
android:gravity="center"
|
||||
android:paddingTop="35dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialer"
|
||||
|
|
|
@ -77,13 +77,16 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/transfer"
|
||||
android:background="@drawable/options_transfer"
|
||||
android:text="@string/button_transfer"
|
||||
android:gravity="center"
|
||||
android:paddingTop="50dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options_transfer"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -111,14 +114,16 @@
|
|||
android:layout_weight="1"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_add_call"
|
||||
<TextView
|
||||
android:id="@+id/addCall"
|
||||
android:background="@drawable/options_add_call_alt"
|
||||
android:text="@string/button_add_call"
|
||||
android:gravity="center"
|
||||
android:paddingTop="50dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options_add_call_alt"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -129,40 +134,49 @@
|
|||
android:layout_weight="1"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/video"
|
||||
android:background="@drawable/video_off"
|
||||
android:text="@string/button_video"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_switch_video"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/video_off" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/micro"
|
||||
android:background="@drawable/micro_on"
|
||||
android:text="@string/button_micro"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_toggle_micro"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/micro_on" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/speaker"
|
||||
android:background="@drawable/speaker_off"
|
||||
android:text="@string/button_speaker"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/content_description_toggle_speaker"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/speaker_off" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/options"
|
||||
android:background="@drawable/options"
|
||||
android:text="@string/button_options"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@color/text_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/options" />
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -283,6 +283,13 @@
|
|||
<string name="button_all_call">Tous</string>
|
||||
<string name="button_missed_call">Manqués</string>
|
||||
<string name="button_delete_all">Tout supprimer</string>
|
||||
|
||||
<string name="button_transfer">Transfert</string>
|
||||
<string name="button_add_call">Ajouter appel</string>
|
||||
<string name="button_video">Vidéo</string>
|
||||
<string name="button_micro">Micro</string>
|
||||
<string name="button_speaker">Haut parleur</string>
|
||||
<string name="button_options">Options</string>
|
||||
|
||||
<string name="share_picture_size_small">Petite</string>
|
||||
<string name="share_picture_size_medium">Moyenne</string>
|
||||
|
|
|
@ -334,6 +334,13 @@
|
|||
<string name="button_all_call">All</string>
|
||||
<string name="button_missed_call">Missed</string>
|
||||
<string name="button_delete_all">Delete All</string>
|
||||
|
||||
<string name="button_transfer">Transfer</string>
|
||||
<string name="button_add_call">Add call</string>
|
||||
<string name="button_video">Video</string>
|
||||
<string name="button_micro">Micro</string>
|
||||
<string name="button_speaker">Speaker</string>
|
||||
<string name="button_options">Options</string>
|
||||
|
||||
<string name="share_picture_size_small">Small</string>
|
||||
<string name="share_picture_size_medium">Medium</string>
|
||||
|
|
|
@ -50,6 +50,7 @@ import android.view.animation.AnimationUtils;
|
|||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
|
@ -64,7 +65,8 @@ public class InCallActivity extends FragmentActivity implements
|
|||
private Handler mHandler = new Handler();
|
||||
private Handler mControlsHandler = new Handler();
|
||||
private Runnable mControls;
|
||||
private ImageView video, micro, speaker, addCall, pause, hangUp, dialer, switchCamera, options, transfer, conference;
|
||||
private ImageView pause, hangUp, dialer, switchCamera, conference;
|
||||
private TextView video, micro, speaker, options, addCall, transfer;
|
||||
private StatusFragment status;
|
||||
private AudioCallFragment audioCallFragment;
|
||||
private VideoCallFragment videoCallFragment;
|
||||
|
@ -133,22 +135,22 @@ public class InCallActivity extends FragmentActivity implements
|
|||
}
|
||||
|
||||
private void initUI() {
|
||||
video = (ImageView) findViewById(R.id.video);
|
||||
video = (TextView) findViewById(R.id.video);
|
||||
video.setOnClickListener(this);
|
||||
video.setEnabled(false);
|
||||
micro = (ImageView) findViewById(R.id.micro);
|
||||
micro = (TextView) findViewById(R.id.micro);
|
||||
micro.setOnClickListener(this);
|
||||
micro.setEnabled(false);
|
||||
speaker = (ImageView) findViewById(R.id.speaker);
|
||||
speaker = (TextView) findViewById(R.id.speaker);
|
||||
speaker.setOnClickListener(this);
|
||||
speaker.setEnabled(false);
|
||||
addCall = (ImageView) findViewById(R.id.addCall);
|
||||
addCall = (TextView) findViewById(R.id.addCall);
|
||||
addCall.setOnClickListener(this);
|
||||
addCall.setEnabled(false);
|
||||
transfer = (ImageView) findViewById(R.id.transfer);
|
||||
transfer = (TextView) findViewById(R.id.transfer);
|
||||
transfer.setOnClickListener(this);
|
||||
transfer.setEnabled(false);
|
||||
options = (ImageView) findViewById(R.id.options);
|
||||
options = (TextView) findViewById(R.id.options);
|
||||
options.setOnClickListener(this);
|
||||
options.setEnabled(false);
|
||||
pause = (ImageView) findViewById(R.id.pause);
|
||||
|
@ -169,7 +171,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
mControlsLayout = (LinearLayout) findViewById(R.id.menu);
|
||||
|
||||
if (!isTransferAllowed) {
|
||||
addCall.setImageResource(R.drawable.options_add_call);
|
||||
addCall.setBackgroundResource(R.drawable.options_add_call);
|
||||
}
|
||||
|
||||
if (!isAnimationDisabled) {
|
||||
|
@ -193,22 +195,22 @@ public class InCallActivity extends FragmentActivity implements
|
|||
video.setEnabled(false);
|
||||
} else {
|
||||
if (isVideoEnabled) {
|
||||
video.setImageResource(R.drawable.video_on);
|
||||
video.setBackgroundResource(R.drawable.video_on);
|
||||
} else {
|
||||
video.setImageResource(R.drawable.video_off);
|
||||
video.setBackgroundResource(R.drawable.video_off);
|
||||
}
|
||||
}
|
||||
|
||||
if (isSpeakerEnabled) {
|
||||
speaker.setImageResource(R.drawable.speaker_on);
|
||||
speaker.setBackgroundResource(R.drawable.speaker_on);
|
||||
} else {
|
||||
speaker.setImageResource(R.drawable.speaker_off);
|
||||
speaker.setBackgroundResource(R.drawable.speaker_off);
|
||||
}
|
||||
|
||||
if (isMicMuted) {
|
||||
micro.setImageResource(R.drawable.micro_off);
|
||||
micro.setBackgroundResource(R.drawable.micro_off);
|
||||
} else {
|
||||
micro.setImageResource(R.drawable.micro_on);
|
||||
micro.setBackgroundResource(R.drawable.micro_on);
|
||||
}
|
||||
|
||||
if (LinphoneManager.getLc().getCallsNb() > 1) {
|
||||
|
@ -323,7 +325,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
LinphoneManager.getLc().updateCall(call, params);
|
||||
replaceFragmentVideoByAudio();
|
||||
|
||||
video.setImageResource(R.drawable.video_on);
|
||||
video.setBackgroundResource(R.drawable.video_on);
|
||||
setCallControlsVisibleAndRemoveCallbacks();
|
||||
|
||||
} else {
|
||||
|
@ -331,10 +333,10 @@ public class InCallActivity extends FragmentActivity implements
|
|||
|
||||
isSpeakerEnabled = true;
|
||||
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||
speaker.setImageResource(R.drawable.speaker_on);
|
||||
speaker.setBackgroundResource(R.drawable.speaker_on);
|
||||
|
||||
replaceFragmentAudioByVideo();
|
||||
video.setImageResource(R.drawable.video_off);
|
||||
video.setBackgroundResource(R.drawable.video_off);
|
||||
displayVideoCallControlsIfHidden();
|
||||
}
|
||||
}
|
||||
|
@ -372,9 +374,9 @@ public class InCallActivity extends FragmentActivity implements
|
|||
isMicMuted = !isMicMuted;
|
||||
lc.muteMic(isMicMuted);
|
||||
if (isMicMuted) {
|
||||
micro.setImageResource(R.drawable.micro_off);
|
||||
micro.setBackgroundResource(R.drawable.micro_off);
|
||||
} else {
|
||||
micro.setImageResource(R.drawable.micro_on);
|
||||
micro.setBackgroundResource(R.drawable.micro_on);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -382,10 +384,10 @@ public class InCallActivity extends FragmentActivity implements
|
|||
isSpeakerEnabled = !isSpeakerEnabled;
|
||||
if (isSpeakerEnabled) {
|
||||
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||
speaker.setImageResource(R.drawable.speaker_on);
|
||||
speaker.setBackgroundResource(R.drawable.speaker_on);
|
||||
} else {
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
speaker.setImageResource(R.drawable.speaker_off);
|
||||
speaker.setBackgroundResource(R.drawable.speaker_off);
|
||||
}
|
||||
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
|
||||
}
|
||||
|
@ -501,7 +503,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
mControlsLayout.setVisibility(View.GONE);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
numpad.setVisibility(View.GONE);
|
||||
options.setImageResource(R.drawable.options);
|
||||
options.setBackgroundResource(R.drawable.options);
|
||||
} else {
|
||||
Animation animation = slideOutTopToBottom;
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
|
@ -522,7 +524,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
mControlsLayout.setVisibility(View.GONE);
|
||||
switchCamera.setVisibility(View.INVISIBLE);
|
||||
numpad.setVisibility(View.GONE);
|
||||
options.setImageResource(R.drawable.options);
|
||||
options.setBackgroundResource(R.drawable.options);
|
||||
|
||||
animation.setAnimationListener(null);
|
||||
}
|
||||
|
@ -706,7 +708,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
options.setImageResource(R.drawable.options_alt);
|
||||
options.setBackgroundResource(R.drawable.options_alt);
|
||||
if (isTransferAllowed) {
|
||||
transfer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
@ -734,7 +736,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
addCall.setAnimation(null);
|
||||
options.setImageResource(R.drawable.options_alt);
|
||||
options.setBackgroundResource(R.drawable.options_alt);
|
||||
addCall.setVisibility(View.VISIBLE);
|
||||
if (isTransferAllowed) {
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
|
@ -762,7 +764,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
|
||||
|
||||
if (addCall.getVisibility() == View.VISIBLE) {
|
||||
options.setImageResource(R.drawable.options);
|
||||
options.setBackgroundResource(R.drawable.options);
|
||||
if (isAnimationDisabled) {
|
||||
if (isTransferAllowed) {
|
||||
transfer.setVisibility(View.INVISIBLE);
|
||||
|
@ -781,7 +783,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
transfer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
addCall.setVisibility(View.VISIBLE);
|
||||
options.setImageResource(R.drawable.options_alt);
|
||||
options.setBackgroundResource(R.drawable.options_alt);
|
||||
} else {
|
||||
if (isOrientationLandscape) {
|
||||
showAnimatedLandscapeCallOptions();
|
||||
|
|
Loading…
Reference in a new issue