summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChiao Cheng <chiaocheng@google.com>2013-07-19 19:10:55 -0700
committerChiao Cheng <chiaocheng@google.com>2013-07-22 11:39:09 -0700
commite331d604d5ab345b06976c0ff7a930930f6b9e41 (patch)
treea09f34a37d63c21b870592666575dad919a21824 /src
parented6adb062b06a0ad4d7bd2c1d3ea5d04c3370a0f (diff)
downloadpackages_apps_InCallUI-e331d604d5ab345b06976c0ff7a930930f6b9e41.tar.gz
packages_apps_InCallUI-e331d604d5ab345b06976c0ff7a930930f6b9e41.tar.bz2
packages_apps_InCallUI-e331d604d5ab345b06976c0ff7a930930f6b9e41.zip
Adding call card and buttons to UI.
- Created a fragment for call card and a fragment for UI. - Adding corresponding button images. Change-Id: I5facacd3a4346ab9d9ec2a67a2742dc27dbf5583
Diffstat (limited to 'src')
-rw-r--r--src/com/android/incallui/CallButtonFragment.java35
-rw-r--r--src/com/android/incallui/CallCardFragment.java35
-rw-r--r--src/com/android/incallui/CallHandlerService.java11
-rw-r--r--src/com/android/incallui/InCallActivity.java7
4 files changed, 84 insertions, 4 deletions
diff --git a/src/com/android/incallui/CallButtonFragment.java b/src/com/android/incallui/CallButtonFragment.java
new file mode 100644
index 00000000..856d186b
--- /dev/null
+++ b/src/com/android/incallui/CallButtonFragment.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.incallui;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * Fragment for call control buttons
+ */
+public class CallButtonFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.call_button_fragment, container, false);
+ }
+}
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java
new file mode 100644
index 00000000..fb60c0b0
--- /dev/null
+++ b/src/com/android/incallui/CallCardFragment.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.incallui;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * Fragment for call card.
+ */
+public class CallCardFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.call_card_fragment, container, false);
+ }
+}
diff --git a/src/com/android/incallui/CallHandlerService.java b/src/com/android/incallui/CallHandlerService.java
index 741701ce..b5f14970 100644
--- a/src/com/android/incallui/CallHandlerService.java
+++ b/src/com/android/incallui/CallHandlerService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Android Open Source Project
+ * Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License
*/
package com.android.incallui;
@@ -68,8 +68,11 @@ public class CallHandlerService extends Service {
// TODO(klp): Not sure if static call is ok. Might need to switch to normal service binding.
public static void answerCall(int callId) {
- Preconditions.checkState(mCallCommandService != null);
-
+ //Preconditions.checkState(mCallCommandService != null);
+ // TODO(klp): enable fail fast later.
+ if (mCallCommandService == null) {
+ return;
+ }
try {
mCallCommandService.answerCall(callId);
} catch (RemoteException e) {
diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java
index 67fe1ca7..380d4876 100644
--- a/src/com/android/incallui/InCallActivity.java
+++ b/src/com/android/incallui/InCallActivity.java
@@ -61,8 +61,15 @@ public class InCallActivity extends Activity {
@Override
protected void onResume() {
logD("onResume()...");
+
+ // TODO(klp): create once and reset when needed.
final AnswerFragment answerFragment = new AnswerFragment();
+ final CallCardFragment callCardFragment = new CallCardFragment();
+ final CallButtonFragment callButtonFragment = new CallButtonFragment();
final FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
+ fragmentTransaction.add(R.id.in_call_and_button_container, callCardFragment);
+ fragmentTransaction.add(R.id.in_call_and_button_container, callButtonFragment);
+
fragmentTransaction.add(R.id.main, answerFragment);
fragmentTransaction.commit();
super.onResume();