diff --git a/res/drawable/item_generic_selector.xml b/res/drawable/item_generic_selector.xml index 9a557e3ef415b2273db9d8c87508bb9393ddd5d6..da0ba9513f4559e7d5c7aed6f63c7d249f3cb0d7 100644 --- a/res/drawable/item_generic_selector.xml +++ b/res/drawable/item_generic_selector.xml @@ -5,22 +5,16 @@ <solid android:color="@color/darker_gray" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> <item android:state_focused="true"><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/light" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> <item><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/light" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> -</selector> +</selector> \ No newline at end of file diff --git a/res/drawable/item_history_selector.xml b/res/drawable/item_history_selector.xml index a211cff4d2990bf289ac1230f086fdc80b87b5c2..77f7649a1c310637f52282e30ba67d074557431d 100644 --- a/res/drawable/item_history_selector.xml +++ b/res/drawable/item_history_selector.xml @@ -5,22 +5,16 @@ <solid android:color="@color/transparent_grey" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> <item android:state_focused="true"><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/transparent_grey" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> <item><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/transparent_light" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> - - <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape></item> -</selector> +</selector> \ No newline at end of file diff --git a/res/layout/frag_history_detail.xml b/res/layout/frag_history_detail.xml index a4abfb24b178f81b29df27474ab4871f5b4694dd..e35588bbd6ea9e6b686d318d7e8f087bf285edcc 100644 --- a/res/layout/frag_history_detail.xml +++ b/res/layout/frag_history_detail.xml @@ -48,43 +48,6 @@ android:layout_height="match_parent" android:orientation="vertical" > - <RelativeLayout - android:id="@+id/call_main_action" - android:layout_width="match_parent" - android:layout_height="?android:attr/listPreferredItemHeight" - android:padding="5dp" > - - <TextView - android:id="@+id/history_entry_number" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:singleLine="true" - android:textSize="18sp" /> - - <TextView - android:id="@+id/history_entry_number_type" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:singleLine="true" - android:textSize="18sp" /> - - <View - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_toLeftOf="@+id/history_entry_text_message" - android:background="@drawable/divider" /> - - <ImageButton - android:id="@+id/history_entry_text_message" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" /> - </RelativeLayout> - <LinearLayout android:id="@+id/llMainHolder" android:layout_width="match_parent" @@ -92,6 +55,28 @@ android:layout_marginTop="@dimen/header_history_detail" android:orientation="vertical" > + <RelativeLayout + android:id="@+id/call_main_action" + android:layout_width="match_parent" + android:layout_height="?android:attr/listPreferredItemHeight" + android:background="@drawable/item_generic_selector" > + + <TextView + android:id="@+id/history_entry_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_centerVertical="true" + android:layout_marginLeft="10dp" + android:singleLine="true" + android:textSize="18sp" /> + </RelativeLayout> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="@drawable/divider" /> + <LinearLayout android:id="@+id/llMain" android:layout_width="match_parent" diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index a55ebeaaffcb26a0c351bca7ad381fcc84cc85c5..7828730c28eda306354a2d69152df804bad547d7 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -72,6 +72,9 @@ as that of the covered work. <string name="hist_out_calls">Sortant:%1$d</string> <string name="hist_no_history">Pas d\'historique</string> + <!-- DetailsHistory Fragment --> + <string name="detail_hist_call_number">Appeler %1$s</string> + <!-- Home Fragment --> <string name="home_conferences_title">Conférences</string> <string name="home_calls_title">Appels</string> diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml deleted file mode 100644 index d408cbc37ad420e5564150e1989cb39f73539d35..0000000000000000000000000000000000000000 --- a/res/values-v11/styles.xml +++ /dev/null @@ -1,5 +0,0 @@ -<resources> - - <style name="AppTheme" parent="android:Theme.Holo.Light" /> - -</resources> \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 878e8000bd1fd3f38385b86242b516059285ea74..8d53be7ac550291d32f57794bc2c23b91db360d7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -71,6 +71,9 @@ as that of the covered work. <string name="hist_no_history">No history</string> <string name="hist_in_calls">In:%1$d</string> <string name="hist_out_calls">Out:%1$d</string> + + <!-- DetailsHistory Fragment --> + <string name="detail_hist_call_number">Call %1$s</string> <!-- Home Fragment --> <string name="home_conferences_title">Conferences</string> diff --git a/src/org/sflphone/client/DetailHistoryActivity.java b/src/org/sflphone/client/DetailHistoryActivity.java index 27ef2633406db1b3240ff540e06b20cd2fb67c38..2c9da799c3981b3f58d6faea7a18dfbf2dcd77f7 100644 --- a/src/org/sflphone/client/DetailHistoryActivity.java +++ b/src/org/sflphone/client/DetailHistoryActivity.java @@ -34,6 +34,8 @@ package org.sflphone.client; import org.sflphone.R; import org.sflphone.fragments.DetailsHistoryEntryFragment; import org.sflphone.fragments.HistoryFragment; +import org.sflphone.model.Conference; +import org.sflphone.model.SipCall; import org.sflphone.service.ISipService; import org.sflphone.service.SipService; @@ -119,9 +121,16 @@ public class DetailHistoryActivity extends Activity implements DetailsHistoryEnt }; @Override - public void onCallDialed(String to) { - // TODO Stub de la méthode généré automatiquement - - } + public void onCall(SipCall call) { + Bundle bundle = new Bundle(); + Conference tmp = new Conference("-1"); + + tmp.getParticipants().add(call); + bundle.putParcelable("conference", tmp); + Intent intent = new Intent().setClass(this, CallActivity.class); + intent.putExtra("resuming", false); + intent.putExtras(bundle); + startActivity(intent); + } } \ No newline at end of file diff --git a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java index 7f03e3f8ff38e06fe4a4cdc05eab3ec745fa452e..72b990a02693b25539f1db072bc5cca9a5613b66 100644 --- a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java +++ b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java @@ -31,13 +31,19 @@ package org.sflphone.fragments; +import java.io.InvalidObjectException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.NavigableMap; import org.sflphone.R; import org.sflphone.adapters.ContactPictureTask; +import org.sflphone.model.Account; import org.sflphone.model.HistoryEntry; import org.sflphone.model.HistoryEntry.HistoryCall; +import org.sflphone.model.SipCall; import org.sflphone.service.ISipService; import org.sflphone.views.parallaxscrollview.AnotherView; @@ -63,7 +69,6 @@ import android.widget.TextView; public class DetailsHistoryEntryFragment extends Fragment { - View mheaderView; DetailHistoryAdapter mAdapter; HistoryEntry toDisplay; private static final String TAG = DetailsHistoryEntryFragment.class.getSimpleName(); @@ -84,16 +89,16 @@ public class DetailsHistoryEntryFragment extends Fragment { } @Override - public void onCallDialed(String to) { + public void onCall(SipCall call) { } }; public interface Callbacks { - public void onCallDialed(String to); - public ISipService getService(); + + public void onCall(SipCall call); } @@ -119,11 +124,6 @@ public class DetailsHistoryEntryFragment extends Fragment { super.onCreate(savedInstanceState); toDisplay = (HistoryEntry) getArguments().get("entry"); - - Log.i(TAG, "Ok, we got " + toDisplay.getIncoming_sum() + " incoming calls"); - Log.i(TAG, "Ok, we got " + toDisplay.getMissed_sum() + " missed calls"); - Log.i(TAG, "Ok, we got " + toDisplay.getOutgoing_sum() + " outgoing calls"); - mAdapter = new DetailHistoryAdapter(toDisplay.getCalls(), getActivity()); } @@ -145,13 +145,32 @@ public class DetailsHistoryEntryFragment extends Fragment { tasker.run(); anotherView = (AnotherView) inflatedView.findViewById(R.id.anotherView); - ((TextView) anotherView.findViewById(R.id.history_entry_number)).setText(toDisplay.getNumber()); + ((TextView) anotherView.findViewById(R.id.history_entry_number)).setText(getString(R.string.detail_hist_call_number, toDisplay.getNumber())); ((RelativeLayout) anotherView.findViewById(R.id.call_main_action)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - Log.i(TAG, "Clicking"); - mCallbacks.onCallDialed(toDisplay.getNumber()); + try { + SipCall.SipCallBuilder callBuilder = SipCall.SipCallBuilder.getInstance(); + + HashMap<String, String> details = (HashMap<String, String>) mCallbacks.getService().getAccountDetails(toDisplay.getAccountID()); + ArrayList<HashMap<String, String>> creds; + + creds = (ArrayList<HashMap<String, String>>) mCallbacks.getService().getCredentials(toDisplay.getAccountID()); + + callBuilder.startCallCreation().setAccount(new Account(toDisplay.getAccountID(), details, creds)) + .setCallType(SipCall.state.CALL_TYPE_OUTGOING); + callBuilder.setContact(toDisplay.getContact()); + + mCallbacks.onCall(callBuilder.build()); + + } catch (RemoteException e) { + // TODO Bloc catch généré automatiquement + e.printStackTrace(); + } catch (InvalidObjectException e) { + // TODO Bloc catch généré automatiquement + e.printStackTrace(); + } } }); diff --git a/src/org/sflphone/model/SipCall.java b/src/org/sflphone/model/SipCall.java index f70649b1a584d7ae61c62cf8e3888c61ba2d530e..d9db35a3d501980cef3bbca7246e720ebfd29779 100644 --- a/src/org/sflphone/model/SipCall.java +++ b/src/org/sflphone/model/SipCall.java @@ -35,8 +35,6 @@ import java.io.InvalidObjectException; import java.util.ArrayList; import java.util.Random; -import org.sflphone.service.StringMap; - import android.content.ContentResolver; import android.os.Parcel; import android.os.Parcelable; diff --git a/src/org/sflphone/service/SipService.java b/src/org/sflphone/service/SipService.java index e2c62f709f1a71801c71d701bdb93d5467829886..f4e79ffcd1c7205a2c15c3557dbf56d214133832 100644 --- a/src/org/sflphone/service/SipService.java +++ b/src/org/sflphone/service/SipService.java @@ -34,6 +34,7 @@ import java.util.Map.Entry; import java.util.Random; import org.sflphone.R; +import org.sflphone.client.CallActivity; import org.sflphone.client.HomeActivity; import org.sflphone.model.Codec; import org.sflphone.model.Conference;