Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0065720a authored by Qi Wang's avatar Qi Wang Committed by Usman Abdullah
Browse files

Fix the bug that quick contact cannot be removed.

The "removed" button doesn't received drag and drop event since it's not
visible at the time the drag event starts. The workaround is to change
the visibility of its child view instead.

Change-Id: Iada912fcc36983ad758296f33092cc54ad6f9f5e
Fix: 28479593
(cherry-picked from b20b76437ae6aae8fe4da64097351cc80f030919)
(cherry picked from commit 22a193b7babae99256149a0536748c6ad9c6b943)
parent ddfb09b5
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -53,14 +53,17 @@

    </LinearLayout>

    <!-- Sets android:importantForAccessibility="no" to avoid being announced when navigating with
         talkback enabled. It will still be announced when user drag or drop contact onto it.
         This is required since drag and drop event is only sent to views are visible when drag
         starts. -->
    <com.android.dialer.list.RemoveView
        android:id="@+id/remove_view"
        android:layout_width="match_parent"
        android:layout_height="@dimen/tab_height"
        android:layout_marginTop="@dimen/action_bar_height_large"
        android:layout_alignParentTop="true"
        android:contentDescription="@string/remove_contact"
        android:visibility="gone" >
        android:importantForAccessibility="no" >

        <LinearLayout
            android:id="@+id/remove_view_content"
@@ -68,7 +71,8 @@
            android:layout_width="match_parent"
            android:background="@color/actionbar_background_color"
            android:gravity="center"
            android:orientation="horizontal">
            android:orientation="horizontal"
            android:visibility="gone">

            <ImageView
                android:layout_width="wrap_content"
+3 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public class ListsFragment extends Fragment
    private ViewPagerTabs mViewPagerTabs;
    private ViewPagerAdapter mViewPagerAdapter;
    private RemoveView mRemoveView;
    private View mRemoveViewContent;

    private SpeedDialFragment mSpeedDialFragment;
    private CallLogFragment mHistoryFragment;
@@ -251,6 +252,7 @@ public class ListsFragment extends Fragment
        addOnPageChangeListener(mViewPagerTabs);

        mRemoveView = (RemoveView) parentView.findViewById(R.id.remove_view);
        mRemoveViewContent = parentView.findViewById(R.id.remove_view_content);

        Trace.endSection();
        Trace.endSection();
@@ -422,7 +424,7 @@ public class ListsFragment extends Fragment


    public void showRemoveView(boolean show) {
        mRemoveView.setVisibility(show ? View.VISIBLE : View.GONE);
        mRemoveViewContent.setVisibility(show ? View.VISIBLE : View.GONE);
        mRemoveView.setAlpha(show ? 0 : 1);
        mRemoveView.animate().alpha(show ? 1 : 0).start();
    }