diff options
| author | Jorge Ruesga <jorge@ruesga.com> | 2014-06-02 01:37:42 +0200 |
|---|---|---|
| committer | Danny Baumann <dannybaumann@web.de> | 2014-06-11 08:22:24 +0200 |
| commit | 9c32d37c200c4231fa552e8e17c46b8dc76bdd43 (patch) | |
| tree | 7af1fae85fcd01f2aad85eb89f858b9ec86a5162 /src | |
| parent | 7447da68a32912382a13d4fdaba871a4948f1587 (diff) | |
| download | packages_apps_InCallUI-9c32d37c200c4231fa552e8e17c46b8dc76bdd43.tar.gz packages_apps_InCallUI-9c32d37c200c4231fa552e8e17c46b8dc76bdd43.tar.bz2 packages_apps_InCallUI-9c32d37c200c4231fa552e8e17c46b8dc76bdd43.zip | |
incallui: make navigation bar translucent + other fixes
* Make navigation bar translucent when available, minimizing thec bad
effect of the black navigation bar.
* Complete change Ie76cbc53c176d94bfb2402bf50eae6161fbb2198, displaying
the caller photo in complete full window size.
* Sync Msim layouts with normal layouts
Patchset 3: Use full translucent bars (status + navigation)
Patchset 4: Revert layouts
Patchset 5: Simplification, use transparent status bar during call
Patchset 6: Fix dialpad layout
Patchset 7: update translucency flags when hiding conference manager
Patchset 8: also make status bar translucent when dialpad is shown
Change-Id: I3a9e4e248f19b951dd6a127b6f63a0cd62047497
JIRA: CYAN-4048
Issue: https://jira.cyanogenmod.org/browse/CYAN-4048
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/incallui/AnswerFragment.java | 4 | ||||
| -rw-r--r-- | src/com/android/incallui/ConferenceManagerFragment.java | 8 | ||||
| -rw-r--r-- | src/com/android/incallui/InCallActivity.java | 25 |
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) { |
