导航菜单

页面标题

页面副标题

CallApp v2.226 - PersonData.java 源代码

正在查看: CallApp v2.226 应用的 PersonData.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.callapp.contacts.model;

import a1.d0;
import android.os.Parcel;
import android.os.Parcelable;
import android.widget.ImageView;
import com.callapp.common.model.json.JSONDate;
import com.callapp.common.model.json.JSONFBEntity;
import com.callapp.contacts.R;
import com.callapp.contacts.activity.contact.cards.framework.horizontal.gallery.HorizontalCircleImageGalleryCard;
import com.callapp.contacts.api.helper.common.RemoteAccountHelper;
import com.callapp.contacts.util.ThemeUtils;
import com.callapp.framework.util.StringUtils;
import com.twitter.sdk.android.core.models.User;
import java.io.Serializable;
import java.util.Arrays;
import mj.m;

public class PersonData extends HorizontalCircleImageGalleryCard.PhotoPresentableDataImpl implements Parcelable, Serializable, Comparable<PersonData> {
    public static final Parcelable.Creator<PersonData> CREATOR = new Parcelable.Creator<PersonData>() {
        @Override
        public PersonData createFromParcel(Parcel parcel) {
            return new PersonData(parcel);
        }

        @Override
        public PersonData[] newArray(int i) {
            return new PersonData[i];
        }
    };
    private static int personDefaultBgColor = 0;
    private static final long serialVersionUID = -2865544500343608172L;
    private Integer birthdayDayInMonth;
    private Integer birthdayMonth;
    private String headline;
    private String id;
    private String imageUrl;
    private String name;
    private String phone;
    private String publicProfileUrl;
    private int type;
    private String unAccanetName;
    private String userName;

    public PersonData(JSONFBEntity jSONFBEntity) {
        this.name = jSONFBEntity.getName();
        this.id = jSONFBEntity.getId();
        this.publicProfileUrl = jSONFBEntity.getLink();
        this.imageUrl = jSONFBEntity.getProfileImageUrl();
        this.type = 1;
        this.phone = jSONFBEntity.getPhone();
        if (jSONFBEntity.getFormattedBirthday() != null) {
            JSONDate formattedBirthday = jSONFBEntity.getFormattedBirthday();
            this.birthdayDayInMonth = Integer.valueOf(formattedBirthday.getFormattedDay());
            this.birthdayMonth = Integer.valueOf(formattedBirthday.getFormattedMonth());
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            PersonData personData = (PersonData) obj;
            if (this.type == personData.type && m.a(this.id, personData.id) && m.a(this.name, personData.name) && m.a(this.userName, personData.userName) && m.a(this.publicProfileUrl, personData.publicProfileUrl) && m.a(this.imageUrl, personData.imageUrl) && m.a(this.headline, personData.headline) && m.a(this.unAccanetName, personData.unAccanetName) && m.a(this.birthdayDayInMonth, personData.birthdayDayInMonth) && m.a(this.birthdayMonth, personData.birthdayMonth) && m.a(this.phone, personData.phone)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public Integer getBackgroundColor() {
        if (personDefaultBgColor == 0) {
            personDefaultBgColor = ThemeUtils.getColor(R.color.colorPrimary);
        }
        return Integer.valueOf(personDefaultBgColor);
    }

    @Override
    public int getBadgeBackgroundColor() {
        return RemoteAccountHelper.getSocialBadgeBgColor(this.type);
    }

    @Override
    public int getBadgeResourceId() {
        return RemoteAccountHelper.getSocialBadgeResId(this.type);
    }

    public Integer getBirthdayDayInMonth() {
        return this.birthdayDayInMonth;
    }

    public Integer getBirthdayMonth() {
        return this.birthdayMonth;
    }

    public String getHeadline() {
        return this.headline;
    }

    public String getId() {
        return this.id;
    }

    @Override
    public String getImageUrl() {
        return this.imageUrl;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public String getPhone() {
        return this.phone;
    }

    public String getPublicProfileUrl() {
        return this.publicProfileUrl;
    }

    @Override
    public int getResourcePhoto() {
        return 0;
    }

    public ImageView.ScaleType getScaleType() {
        return ImageView.ScaleType.CENTER;
    }

    public int getType() {
        return this.type;
    }

    public String getUnAccanetName() {
        return this.unAccanetName;
    }

    public String getUserName() {
        return this.userName;
    }

    public int hashCode() {
        return Arrays.hashCode(new Object[]{this.id, this.name, this.userName, this.publicProfileUrl, this.imageUrl, this.headline, Integer.valueOf(this.type), this.unAccanetName, this.birthdayDayInMonth, this.birthdayMonth, this.phone});
    }

    @Override
    public boolean isDefaultProfileImageUrl() {
        RemoteAccountHelper remoteAccountHelper = RemoteAccountHelper.getRemoteAccountHelper(getType());
        if (remoteAccountHelper == null) {
            return false;
        }
        return remoteAccountHelper.u(getImageUrl());
    }

    public void readFromParcel(Parcel parcel) {
        this.userName = parcel.readString();
        this.name = parcel.readString();
        this.publicProfileUrl = parcel.readString();
        this.imageUrl = parcel.readString();
        this.headline = parcel.readString();
        this.id = parcel.readString();
        this.type = parcel.readInt();
        this.phone = parcel.readString();
    }

    public void setHeadline(String str) {
        this.headline = str;
    }

    public void setPhone(String str) {
        this.phone = str;
    }

    public void setUnAccanetName(String str) {
        this.unAccanetName = str;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.userName);
        parcel.writeString(this.name);
        parcel.writeString(this.publicProfileUrl);
        parcel.writeString(this.imageUrl);
        parcel.writeString(this.headline);
        parcel.writeString(this.id);
        parcel.writeInt(this.type);
        parcel.writeString(this.phone);
    }

    @Override
    public int compareTo(PersonData personData) {
        int i;
        int i2;
        String str;
        if (personData == null || (i = this.type) < (i2 = personData.type)) {
            return -1;
        }
        if (i <= i2 && (str = this.name) != null) {
            return str.compareToIgnoreCase(personData.name);
        }
        return 1;
    }

    public PersonData(int i, String str, String str2, String str3, String str4) {
        this.name = str2;
        this.id = str;
        this.publicProfileUrl = str3;
        this.imageUrl = str4;
        this.type = i;
    }

    public PersonData(User user) {
        this.name = user.name;
        String str = user.screenName;
        this.id = str;
        this.publicProfileUrl = d0.C("https://twitter.com/", str);
        this.imageUrl = user.profileImageUrl;
        if (StringUtils.x(this.id)) {
            this.headline = "@" + this.id;
        }
        this.type = 4;
    }

    public PersonData(Parcel parcel) {
        readFromParcel(parcel);
    }
}