diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-07-19 19:10:55 -0700 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-07-22 11:39:09 -0700 |
commit | 550f92b42a5387875d994a9b72050eaec2018649 (patch) | |
tree | 0427af488aae9503077d65d7524ab6a73b389f65 /InCallUI/src/com/android | |
parent | 66b2c28f44344d850202eab63e9f058c0da115f0 (diff) |
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 'InCallUI/src/com/android')
4 files changed, 84 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java new file mode 100644 index 000000000..856d186bc --- /dev/null +++ b/InCallUI/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/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java new file mode 100644 index 000000000..fb60c0b03 --- /dev/null +++ b/InCallUI/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/InCallUI/src/com/android/incallui/CallHandlerService.java b/InCallUI/src/com/android/incallui/CallHandlerService.java index 741701ce5..b5f149704 100644 --- a/InCallUI/src/com/android/incallui/CallHandlerService.java +++ b/InCallUI/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/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 67fe1ca70..380d48764 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/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(); |