summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAbhisek Devkota <ciwrl@cyanogenmod.com>2014-06-14 00:40:07 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-06-14 00:40:07 +0000
commitacce9b9390d7db3f15d58060cc3211b496bb95b2 (patch)
treee409d77ed6d0d803216431b4996395ba2322c542 /src
parentdb221939fde437d56870dd89281d1fad83e8ecdb (diff)
parent9c32d37c200c4231fa552e8e17c46b8dc76bdd43 (diff)
downloadpackages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.tar.gz
packages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.tar.bz2
packages_apps_InCallUI-acce9b9390d7db3f15d58060cc3211b496bb95b2.zip
Merge "incallui: make navigation bar translucent + other fixes" into cm-11.0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/incallui/AnswerFragment.java4
-rw-r--r--src/com/android/incallui/ConferenceManagerFragment.java8
-rw-r--r--src/com/android/incallui/InCallActivity.java25
3 files changed, 36 insertions, 1 deletions
diff --git a/src/com/android/incallui/AnswerFragment.java b/src/com/android/incallui/AnswerFragment.java
index 1a5e8b6e..dbf9ace0 100644
--- a/src/com/android/incallui/AnswerFragment.java
+++ b/src/com/android/incallui/AnswerFragment.java
@@ -29,6 +29,7 @@ import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@@ -102,13 +103,16 @@ public class AnswerFragment extends BaseFragment<AnswerPresenter, AnswerPresente
@Override
public void showAnswerUi(boolean show) {
+ final Window window = getActivity().getWindow();
getView().setVisibility(show ? View.VISIBLE : View.GONE);
Log.d(this, "Show answer UI: " + show);
if (show) {
mGlowpad.startPing();
+ window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
} else {
mGlowpad.stopPing();
+ window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
}
diff --git a/src/com/android/incallui/ConferenceManagerFragment.java b/src/com/android/incallui/ConferenceManagerFragment.java
index 119b5f35..3dab85c4 100644
--- a/src/com/android/incallui/ConferenceManagerFragment.java
+++ b/src/com/android/incallui/ConferenceManagerFragment.java
@@ -16,6 +16,7 @@
package com.android.incallui;
+import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
@@ -77,6 +78,11 @@ public class ConferenceManagerFragment
@Override
public void onClick(View v) {
getPresenter().manageConferenceDoneClicked();
+
+ final Activity activity = getActivity();
+ if (activity instanceof InCallActivity) {
+ ((InCallActivity) activity).onManageConferenceDoneClicked();
+ }
}
});
@@ -205,4 +211,4 @@ public class ConferenceManagerFragment
mConferenceTime.stop();
}
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java
index 043bec09..15335645 100644
--- a/src/com/android/incallui/InCallActivity.java
+++ b/src/com/android/incallui/InCallActivity.java
@@ -66,6 +66,7 @@ public class InCallActivity extends Activity {
/** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */
private boolean mShowDialpadRequested;
+ private boolean mConferenceManagerShown;
// This enum maps to Phone.SuppService defined in telephony
private enum SuppService {
@@ -129,6 +130,7 @@ public class InCallActivity extends Activity {
mCallButtonFragment.displayDialpad(true);
mShowDialpadRequested = false;
}
+ updateSystemBarTranslucency();
}
// onPause is guaranteed to be called when the InCallActivity goes
@@ -244,6 +246,8 @@ public class InCallActivity extends Activity {
return;
} else if (mConferenceManagerFragment.isVisible()) {
mConferenceManagerFragment.setVisible(false);
+ mConferenceManagerShown = false;
+ updateSystemBarTranslucency();
return;
}
@@ -474,9 +478,30 @@ public class InCallActivity extends Activity {
public void displayManageConferencePanel(boolean showPanel) {
if (showPanel) {
mConferenceManagerFragment.setVisible(true);
+ mConferenceManagerShown = true;
+ updateSystemBarTranslucency();
}
}
+ public void onManageConferenceDoneClicked() {
+ if (mConferenceManagerShown && !mConferenceManagerFragment.isVisible()) {
+ mConferenceManagerShown = false;
+ updateSystemBarTranslucency();
+ }
+ }
+
+ private void updateSystemBarTranslucency() {
+ final boolean doTranslucency = !mConferenceManagerShown;
+ final Window window = getWindow();
+
+ if (doTranslucency) {
+ window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ } else {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ }
+ window.getDecorView().requestFitSystemWindows();
+ }
+
// The function is called when Modify Call button gets pressed.
// The function creates and displays modify call options.
public void displayModifyCallOptions(final int callId) {