diff --git a/ring-android/app/src/main/AndroidManifest.xml b/ring-android/app/src/main/AndroidManifest.xml index 4ba66ebb1a4dc6206d5581d679430ee4b3a32140..3bc3fa5dc00e391d62adc62bc8d7b02c2444fae9 100644 --- a/ring-android/app/src/main/AndroidManifest.xml +++ b/ring-android/app/src/main/AndroidManifest.xml @@ -128,7 +128,7 @@ as that of the covered work. android:name=".client.CallActivity" android:label="@string/app_name" android:screenOrientation="portrait" - android:theme="@style/AppThemeWithoutOverlay" + android:theme="@style/AppThemeWithoutOverlayCompat" android:windowSoftInputMode="adjustPan" > <intent-filter> <action android:name="android.intent.action.CALL_PRIVILEGED" /> diff --git a/ring-android/app/src/main/java/cx/ring/client/CallActivity.java b/ring-android/app/src/main/java/cx/ring/client/CallActivity.java index 9375f6c26bde5d423b757cbb637992b2c845654a..9c9a25c614b288c5cef768706ad28110ba68c5e5 100644 --- a/ring-android/app/src/main/java/cx/ring/client/CallActivity.java +++ b/ring-android/app/src/main/java/cx/ring/client/CallActivity.java @@ -33,13 +33,13 @@ package cx.ring.client; -import android.app.Activity; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; import android.util.Log; import cx.ring.R; import cx.ring.fragments.CallFragment; import cx.ring.model.Conversation; import cx.ring.model.SipUri; -import cx.ring.model.TextMessage; import cx.ring.model.account.Account; import cx.ring.model.CallContact; import cx.ring.model.Conference; @@ -64,13 +64,15 @@ import android.view.KeyEvent; import android.view.Window; import android.view.WindowManager; -public class CallActivity extends Activity implements LocalService.Callbacks, CallFragment.Callbacks, CallProximityManager.ProximityDirector { +import static cx.ring.service.LocalService.*; + +public class CallActivity extends AppCompatActivity implements Callbacks, CallFragment.Callbacks, CallProximityManager.ProximityDirector { @SuppressWarnings("unused") static final String TAG = "CallActivity"; private boolean init = false; private LocalService service; - CallFragment mCurrentCallFragment; + private CallFragment mCurrentCallFragment; private Conference mDisplayedConference; /* result code sent in case of call failure */ diff --git a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java index 1abbce9ef95f5dfee7ed53eda8f5512a4b223c08..6b29850d8452f3e6532bf0b9eb856a829325d334 100644 --- a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java +++ b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java @@ -50,6 +50,7 @@ import android.os.Bundle; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.os.RemoteException; +import android.support.v7.app.ActionBar; import android.util.Log; import android.view.*; import android.view.View.OnClickListener; @@ -255,6 +256,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa void terminateCall(); Conference getDisplayedConference(); void updateDisplayedConference(Conference c); + ActionBar getSupportActionBar(); } /** @@ -272,6 +274,8 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa @Override public void updateDisplayedConference(Conference c) { } @Override + public ActionBar getSupportActionBar() { return null; } + @Override public void startTimer() { } } private static final Callbacks sDummyCallbacks = new DummyCallbacks(); @@ -568,7 +572,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getActivity()); notificationManager.notify(getConference().notificationId, noti.build()); - getActivity().getActionBar().setTitle(contact.getDisplayName()); + mCallbacks.getSupportActionBar().setTitle(contact.getDisplayName()); /*synchronized (mBubbleModel) { mCallbacks.startTimer(); @@ -730,7 +734,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getActivity()); notificationManager.notify(getConference().notificationId, noti.build()); - getActivity().getActionBar().setTitle(contact.getDisplayName()); + mCallbacks.getSupportActionBar().setTitle(contact.getDisplayName()); /*getBubbleFor(getConference().getParticipants().get(0), mBubbleModel.getWidth() / 2, 2 * mBubbleModel.getHeight() / 3); @@ -812,7 +816,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getActivity()); notificationManager.notify(getConference().notificationId, noti.build()); - getActivity().getActionBar().setTitle(contact.getDisplayName()); + mCallbacks.getSupportActionBar().setTitle(contact.getDisplayName()); /*synchronized (mBubbleModel) { PointF c = mBubbleModel.getCircleCenter(); diff --git a/ring-android/app/src/main/java/cx/ring/fragments/CallListFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/CallListFragment.java index 74adc0dd9bec2ef42c68a42d12ccb0bd369165e8..bc842b04e9b117ae0077f97d976674179a4b3a9d 100644 --- a/ring-android/app/src/main/java/cx/ring/fragments/CallListFragment.java +++ b/ring-android/app/src/main/java/cx/ring/fragments/CallListFragment.java @@ -149,7 +149,7 @@ public class CallListFragment extends Fragment implements SearchView.OnQueryText } public void updateLists() { - if (mCallbacks.getService() != null) { + if (mCallbacks.getService() != null && mConferenceAdapter != null) { mConferenceAdapter.updateDataset(mCallbacks.getService().getConversations()); if (mCallbacks.getService().isConnected()) { error_msg_pane.setVisibility(View.GONE); @@ -188,7 +188,6 @@ public class CallListFragment extends Fragment implements SearchView.OnQueryText @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - contactList.addHeaderView(mHeader, null, false); mStarredGrid.setAdapter(mGridAdapter); } @@ -280,21 +279,16 @@ public class CallListFragment extends Fragment implements SearchView.OnQueryText } }); - mConferenceAdapter = new CallListAdapter(getActivity(), mCallbacks.getService().get40dpContactCache(), mCallbacks.getService().getThreadPool()); - mListAdapter = new ContactsAdapter(getActivity(), (HomeActivity)getActivity(), mCallbacks.getService().get40dpContactCache(), mCallbacks.getService().getThreadPool()); - mGridAdapter = new StarredContactsAdapter(getActivity()); - - LocalService service = mCallbacks.getService(); - if (service != null) - mConferenceAdapter.updateDataset(mCallbacks.getService().getConversations()); list = (ListView) inflatedView.findViewById(cx.ring.R.id.confs_list); list.setOnItemClickListener(callClickListener); - list.setOnItemLongClickListener(mItemLongClickListener); + //list.setOnItemLongClickListener(mItemLongClickListener); mHeader = (LinearLayout) inflater.inflate(R.layout.frag_contact_list_header, null); - contactList = (StickyListHeadersListView) inflatedView.findViewById(R.id.contacts_stickylv); + contactList.setDivider(null); + contactList.addHeaderView(mHeader, null, false); + mStarredGrid = (GridView) mHeader.findViewById(R.id.favorites_grid); llMain = (LinearLayout) mHeader.findViewById(R.id.llMain); favHeadLabel = (TextView) mHeader.findViewById(R.id.fav_head_label); @@ -314,11 +308,19 @@ public class CallListFragment extends Fragment implements SearchView.OnQueryText error_msg_pane = (ViewGroup) inflatedView.findViewById(R.id.error_msg_pane); error_msg_txt = (TextView) error_msg_pane.findViewById(R.id.error_msg_txt); - list.setAdapter(mConferenceAdapter); list.setVisibility(View.VISIBLE); contactList.setVisibility(View.GONE); - /*listSwitcher = (ViewSwitcher) inflatedView.findViewById(R.id.list_switcher); - listSwitcher.setDisplayedChild(0);*/ + + LocalService service = mCallbacks.getService(); + if (service == null) + return inflatedView; + + mConferenceAdapter = new CallListAdapter(getActivity(), service.get40dpContactCache(), service.getThreadPool()); + mListAdapter = new ContactsAdapter(getActivity(), (HomeActivity)getActivity(), service.get40dpContactCache(), service.getThreadPool()); + mGridAdapter = new StarredContactsAdapter(getActivity()); + + mConferenceAdapter.updateDataset(mCallbacks.getService().getConversations()); + list.setAdapter(mConferenceAdapter); return inflatedView; } diff --git a/ring-android/app/src/main/res/layout/activity_home.xml b/ring-android/app/src/main/res/layout/activity_home.xml index 8efc6e34e67f66c07b456a46b94ff1f3fc767d2c..3392b0310989848845b480f868a928f9c394e095 100644 --- a/ring-android/app/src/main/res/layout/activity_home.xml +++ b/ring-android/app/src/main/res/layout/activity_home.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?><!-- -Copyright (C) 2004-2014 Savoir-Faire Linux Inc. +Copyright (C) 2004-2015 Savoir-faire Linux Inc. Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> @@ -17,17 +17,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Additional permission under GNU GPL version 3 section 7: - -If you modify this program, or any covered work, by linking or -combining it with the OpenSSL project's OpenSSL library (or a -modified version of that library), containing parts covered by the -terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. -grants you additional permission to convey the resulting work. -Corresponding Source for a non-source form of such a combination -shall include the source code for the parts of OpenSSL used as well -as that of the covered work. --> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" @@ -39,63 +28,58 @@ as that of the covered work. android:fitsSystemWindows="true" tools:context=".client.HomeActivity"> - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <ViewStub - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:id="@+id/viewStub" /> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/main_toolbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_alignParentTop="true" - android:background="@color/actionbar" + <android.support.v7.widget.Toolbar + android:id="@+id/main_toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:background="@color/actionbar" - android:elevation="4dp" - android:gravity="bottom" - android:longClickable="true" - android:minHeight="?attr/actionBarSize" - android:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" - app:contentInsetStart="72dp" - app:elevation="4dp" - app:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" - app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" - app:titleMarginBottom="@dimen/action_bar_title_margin_bottom" /> + android:elevation="4dp" + android:gravity="bottom" + android:longClickable="true" + android:minHeight="?attr/actionBarSize" + android:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:contentInsetStart="72dp" + app:elevation="4dp" + app:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleMarginBottom="@dimen/action_bar_title_margin_bottom" /> - <android.support.design.widget.FloatingActionButton - android:id="@+id/action_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBottom="@+id/main_toolbar" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_marginBottom="@dimen/action_button_bpadding" - android:layout_marginLeft="16dp" - android:layout_marginStart="16dp" - android:adjustViewBounds="false" - android:baselineAlignBottom="false" - android:elevation="4dp" - android:visibility="gone" - app:elevation="4dp" - app:fabSize="mini" /> + <FrameLayout + android:id="@+id/main_frame" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_below="@id/main_toolbar" + android:orientation="vertical" /> - <FrameLayout - android:id="@+id/main_frame" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_below="@id/main_toolbar" - android:orientation="vertical" /> + <android.support.design.widget.FloatingActionButton + android:id="@+id/action_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBottom="@+id/main_toolbar" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_marginBottom="@dimen/action_button_bpadding" + android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" + android:adjustViewBounds="false" + android:baselineAlignBottom="false" + android:elevation="6dp" + android:visibility="gone" + app:elevation="6dp" + app:fabSize="mini" /> - </RelativeLayout> + </RelativeLayout> <android.support.design.widget.NavigationView android:id="@+id/left_drawer" diff --git a/ring-android/app/src/main/res/layout/frag_call_list.xml b/ring-android/app/src/main/res/layout/frag_call_list.xml index 0291a6d67dbcd56284806766ac621f57c631f728..a9d0a4c9eb6690465bc80ac87c7dd69e0285000e 100644 --- a/ring-android/app/src/main/res/layout/frag_call_list.xml +++ b/ring-android/app/src/main/res/layout/frag_call_list.xml @@ -23,17 +23,18 @@ along with this program; if not, write to the Free Software xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:animateLayoutChanges="true"> + android:animateLayoutChanges="true" + tools:context=".client.HomeActivity"> <RelativeLayout + android:id="@+id/error_msg_pane" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:id="@+id/error_msg_pane" - android:padding="16dp" + android:layout_alignParentTop="true" android:background="#e57373" + android:padding="16dp" android:visibility="gone"> <TextView @@ -50,50 +51,49 @@ along with this program; if not, write to the Free Software android:id="@+id/contacts_stickylv" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_alignParentLeft="true" + android:layout_below="@+id/error_msg_pane" + android:background="@android:color/white" android:clipToPadding="false" android:divider="@null" android:drawSelectorOnTop="true" + android:elevation="2dp" android:fastScrollEnabled="true" android:paddingBottom="8dp" android:paddingTop="8dp" android:scrollbarStyle="outsideOverlay" - android:layout_alignParentLeft="true" - android:layout_marginLeft="0dp" - android:layout_below="@+id/error_msg_pane" - android:elevation="8dp" - android:visibility="gone" - android:background="@android:color/white" /> + android:visibility="gone" /> <ListView android:id="@+id/confs_list" android:layout_width="match_parent" android:layout_height="match_parent" - android:clipToPadding="false" - android:divider="@null" - android:paddingBottom="8dp" - android:paddingTop="8dp" - tools:listitem="@layout/item_calllist" android:layout_alignParentLeft="true" + android:layout_below="@+id/error_msg_pane" android:layout_marginLeft="0dp" android:layout_marginTop="0dp" - android:layout_below="@+id/error_msg_pane" - android:elevation="8dp" android:background="@android:color/white" - android:visibility="gone" /> + android:clipToPadding="false" + android:divider="@null" + android:elevation="2dp" + android:paddingBottom="8dp" + android:paddingTop="8dp" + tools:listitem="@layout/item_calllist" /> <android.support.design.widget.FloatingActionButton android:id="@+id/newconv_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" android:layout_gravity="bottom|end" + android:layout_margin="@dimen/fab_compat_margin" + android:elevation="6dp" android:src="@drawable/ic_add_white_24dp" app:backgroundTint="@color/color_primary_light" app:elevation="6dp" app:pressedTranslationZ="12dp" - app:rippleColor="@color/color_primary_dark" - android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" - android:layout_alignParentEnd="true" - android:layout_margin="@dimen/fab_compat_margin" /> + app:rippleColor="@color/color_primary_dark" /> </RelativeLayout> \ No newline at end of file diff --git a/ring-android/app/src/main/res/layout/frag_contact_list.xml b/ring-android/app/src/main/res/layout/frag_contact_list.xml index 05fda0295206018c893b8be6c6eb909122fbd5e2..d50376e6a8864ddff76b9e4a79746ae78f56739f 100644 --- a/ring-android/app/src/main/res/layout/frag_contact_list.xml +++ b/ring-android/app/src/main/res/layout/frag_contact_list.xml @@ -1,5 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- +<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2004-2014 Savoir-Faire Linux Inc. Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> @@ -41,11 +40,12 @@ as that of the covered work. android:id="@+id/contacts_stickylv" android:layout_width="match_parent" android:layout_height="match_parent" + android:divider="@null" android:drawSelectorOnTop="true" android:fastScrollEnabled="true" android:scrollbarStyle="outsideOverlay" - android:divider="@null" - /> + android:paddingBottom="8dp" + android:paddingTop="8dp" /> <TextView android:id="@android:id/empty"