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

Commit c9e0f354 authored by Qi Wang's avatar Qi Wang Committed by Android (Google) Code Review
Browse files

Merge "Add spam indicator for notification and incoming call of incallui."

parents df9366d4 bf5cb809
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -163,6 +163,14 @@
            android:scaleType="fitCenter"
            android:visibility="gone" />

        <ImageView android:id="@+id/spamIcon"
            android:src="@drawable/blocked_contact"
            android:layout_width="24dp"
            android:layout_height="match_parent"
            android:layout_marginEnd="8dp"
            android:scaleType="fitCenter"
            android:visibility="gone" />

        <!-- Label (like "Mobile" or "Work", if present) and phone number, side by side -->
        <LinearLayout android:id="@+id/labelAndNumber"
            android:layout_width="wrap_content"
+5 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@
        <item>#7B1FA2</item>
        <item>#C2185B</item>
        <item>#C53929</item>
        <item>#A52714</item>
    </array>

    <!-- Darker versions of background_colors, two shades darker. These colors are used for the
@@ -109,8 +110,12 @@
        <item>#6A1B9A</item>
        <item>#AD1457</item>
        <item>#B93221</item>
        <item>#841F10</item>
    </array>

    <!-- Background color for spam. This color must match one of background_colors above. -->
    <color name="incall_call_spam_background_color">#A52714</color>

    <!-- Ripple color used over light backgrounds. -->
    <color name="ripple_light">#40000000</color>

+4 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@
    <string name="notification_incoming_work_call_wifi">Incoming Wi-Fi work call</string>
    <!-- The "label" of the in-call Notification for an incoming ringing video call. -->
    <string name="notification_incoming_video_call">Incoming video call</string>
    <!-- The "label" of the in-call Notification for an incoming ringing spam call. -->
    <string name="notification_incoming_spam_call">Incoming suspected spam call</string>
    <!-- The "label" of the in-call Notification for upgrading an existing call to a video call. -->
    <string name="notification_requesting_video_call">Incoming video request</string>
    <!-- Label for the "Voicemail" notification item, when expanded. -->
@@ -523,4 +525,6 @@
    <string name="open_now">Open now</string>
    <!-- Displayed when a place is closed. -->
    <string name="closed_now">Closed now</string>
    <!-- Label for spam call in primary info. [CHAR LIMIT=20] -->
    <string name="label_spam_caller">Suspected spam caller</string>
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -389,6 +389,16 @@ public class Call {

    private LogState mLogState = new LogState();

    private boolean mIsSpam;

    public void setSpam(boolean isSpam) {
        mIsSpam = isSpam;
    }

    public boolean isSpam() {
        return mIsSpam;
    }

    /**
     * Used only to create mock calls for testing
     */
+15 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
    private TextView mCallTypeLabel;
    private ImageView mHdAudioIcon;
    private ImageView mForwardIcon;
    private ImageView mSpamIcon;
    private View mCallNumberAndLabel;
    private TextView mElapsedTime;
    private Drawable mPrimaryPhotoDrawable;
@@ -280,6 +281,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
        mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel);
        mHdAudioIcon = (ImageView) view.findViewById(R.id.hdAudioIcon);
        mForwardIcon = (ImageView) view.findViewById(R.id.forwardIcon);
        mSpamIcon = (ImageView) view.findViewById(R.id.spamIcon);
        mCallNumberAndLabel = view.findViewById(R.id.labelAndNumber);
        mCallTypeLabel = (TextView) view.findViewById(R.id.callTypeLabel);
        mElapsedTime = (TextView) view.findViewById(R.id.elapsedTime);
@@ -1207,6 +1209,19 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
        mForwardIcon.setVisibility(visible ? View.VISIBLE : View.GONE);
    }

    /**
     * Changes the visibility of the spam icon.
     *
     * @param visible {@code true} if the UI should show the spam icon.
     */
    @Override
    public void showSpamIndicator(boolean visible) {
        if (visible) {
            mSpamIcon.setVisibility(View.VISIBLE);
            mNumberLabel.setText(R.string.label_spam_caller);
            mPhoneNumber.setVisibility(View.GONE);
        }
    }

    /**
     * Changes the visibility of the "manage conference call" button.
Loading