some code imp
This commit is contained in:
@@ -44,7 +44,7 @@ import com.vk.im.ui.views.avatars.StoryBorderView;
|
||||
|
||||
import b.h.g.r.MathExt;
|
||||
|
||||
public final class DialogItemView extends ViewGroup {
|
||||
public class DialogItemView extends ViewGroup{
|
||||
private final int B;
|
||||
private final int C;
|
||||
private final int D;
|
||||
@@ -52,8 +52,7 @@ public final class DialogItemView extends ViewGroup {
|
||||
private final String F;
|
||||
private final TypingDrawable G;
|
||||
private final RecordingDrawable H;
|
||||
private boolean I;
|
||||
private final int f15757J;
|
||||
private final int J;
|
||||
private final AvatarView K;
|
||||
private final AppCompatImageView L;
|
||||
private final StoryBorderView M;
|
||||
@@ -76,19 +75,20 @@ public final class DialogItemView extends ViewGroup {
|
||||
private final AppCompatImageView e0;
|
||||
private final AppCompatImageView f0;
|
||||
private final RoundCornerColorDrawable g;
|
||||
private boolean g0;
|
||||
private final int h;
|
||||
private boolean I;
|
||||
private boolean g0;
|
||||
private boolean h0;
|
||||
|
||||
public DialogItemView(Context context) {
|
||||
public DialogItemView(Context context){
|
||||
this(context, null, 0, 6);
|
||||
}
|
||||
|
||||
public DialogItemView(Context context, AttributeSet attributeSet) {
|
||||
public DialogItemView(Context context, AttributeSet attributeSet){
|
||||
this(context, attributeSet, 0, 4);
|
||||
}
|
||||
|
||||
public DialogItemView(Context context, AttributeSet attributeSet, int i) {
|
||||
public DialogItemView(Context context, AttributeSet attributeSet, int i){
|
||||
super(context, attributeSet, i);
|
||||
Resources resources = getResources();
|
||||
this.a = resources.getDisplayMetrics();
|
||||
@@ -123,13 +123,13 @@ public final class DialogItemView extends ViewGroup {
|
||||
int dimensionPixelSize4 = obtainStyledAttributes.getDimensionPixelSize(o.DialogItemView_vkim_avatar_story_border_width, Screen.a(2));
|
||||
int dimensionPixelSize5 = obtainStyledAttributes.getDimensionPixelSize(o.DialogItemView_vkim_avatar_story_size, Screen.a(68));
|
||||
boolean z = obtainStyledAttributes.getBoolean(o.DialogItemView_vkim_avatar_combine, false);
|
||||
this.f15757J = obtainStyledAttributes.getDimensionPixelSize(o.DialogItemView_vkim_avatar_size, Screen.a(64));
|
||||
this.J = obtainStyledAttributes.getDimensionPixelSize(o.DialogItemView_vkim_avatar_size, Screen.a(64));
|
||||
obtainStyledAttributes.recycle();
|
||||
this.K = new AvatarView(context, null, 6);
|
||||
this.K.setViewSize(this.f15757J);
|
||||
this.K.setViewSize(this.J);
|
||||
this.K.setDividerSize(a(2));
|
||||
this.K.setCombineAvatars(z);
|
||||
int i3 = this.f15757J;
|
||||
int i3 = this.J;
|
||||
this.K.setLayoutParams(a(this, i3, i3, 0, 0, a(12), 0, 44, null));
|
||||
this.M = new StoryBorderView(context, null, 6);
|
||||
this.M.setBorderColor(color2);
|
||||
@@ -255,40 +255,130 @@ public final class DialogItemView extends ViewGroup {
|
||||
addView(this.f0);
|
||||
}
|
||||
|
||||
private final Drawable getDrOnlineMobile() {
|
||||
public DialogItemView(Context context, AttributeSet attributeSet, int i, int i2){
|
||||
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
||||
}
|
||||
|
||||
public static ViewPropertyAnimator b(View view, float f, long j, long j2, Runnable runnable, int i, Object obj){
|
||||
if ((i & 1) != 0) {
|
||||
f = 0.0f;
|
||||
}
|
||||
|
||||
if ((i & 2) != 0) {
|
||||
j = 300;
|
||||
}
|
||||
|
||||
if ((i & 4) != 0) {
|
||||
j2 = 0;
|
||||
}
|
||||
|
||||
if ((i & 8) != 0) {
|
||||
runnable = null;
|
||||
}
|
||||
|
||||
return AnimationExtKt.b(view, f, j, j2, runnable);
|
||||
}
|
||||
|
||||
public static void a(View view, float f, float f2, int i, Object obj){
|
||||
if ((i & 1) != 0) {
|
||||
f = 1.0f;
|
||||
}
|
||||
|
||||
if ((i & 2) != 0) {
|
||||
f2 = 0.0f;
|
||||
}
|
||||
|
||||
AnimationExtKt.a(view, f, f2);
|
||||
}
|
||||
|
||||
public static ViewPropertyAnimator a(View view, float f, long j, long j2, Runnable runnable, int i, Object obj){
|
||||
if ((i & 1) != 0) {
|
||||
f = 1.0f;
|
||||
}
|
||||
|
||||
if ((i & 2) != 0) {
|
||||
j = 300;
|
||||
}
|
||||
|
||||
if ((i & 4) != 0) {
|
||||
j2 = 0;
|
||||
}
|
||||
|
||||
if ((i & 8) != 0) {
|
||||
runnable = null;
|
||||
}
|
||||
|
||||
return AnimationExtKt.a(view, f, j, j2, runnable);
|
||||
}
|
||||
|
||||
static void a(DialogItemView dialogItemView, int i, int i2, int i3, int i4, Object obj){
|
||||
if ((i4 & 4) != 0) {
|
||||
i3 = 0;
|
||||
}
|
||||
dialogItemView.a(i, i2, i3);
|
||||
}
|
||||
|
||||
static ViewGroup.MarginLayoutParams a(DialogItemView dialogItemView, int i, int i2, int i3, int i4, int i5, int i6, int i7, Object obj){
|
||||
if ((i7 & 1) != 0) {
|
||||
i = -2;
|
||||
}
|
||||
if ((i7 & 2) != 0) {
|
||||
i2 = -2;
|
||||
}
|
||||
if ((i7 & 4) != 0) {
|
||||
i3 = 0;
|
||||
}
|
||||
if ((i7 & 8) != 0) {
|
||||
i4 = 0;
|
||||
}
|
||||
if ((i7 & 16) != 0) {
|
||||
i5 = 0;
|
||||
}
|
||||
if ((i7 & 32) != 0) {
|
||||
i6 = 0;
|
||||
}
|
||||
return dialogItemView.a(i, i2, i3, i4, i5, i6);
|
||||
}
|
||||
|
||||
private Drawable getDrOnlineMobile(){
|
||||
return ContextExtKt.c(getContext(), f.ic_online_mobile_vkapp_composite_16);
|
||||
}
|
||||
|
||||
private final Drawable getDrOnlineVkMe() {
|
||||
private Drawable getDrOnlineVkMe(){
|
||||
return ContextExtKt.c(getContext(), f.ic_online_mobile_vkme_composite_16);
|
||||
}
|
||||
|
||||
private final Drawable getDrOnlineWeb() {
|
||||
private Drawable getDrOnlineWeb(){
|
||||
return ContextExtKt.c(getContext(), f.ic_online_web_composite_16);
|
||||
}
|
||||
|
||||
private final int getTimeMargin() {
|
||||
private int getTimeMargin(){
|
||||
Layout layout = this.T.getLayout();
|
||||
|
||||
if (layout == null) {
|
||||
layout = this.U.getLayout();
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
if (layout != null) {
|
||||
int lineBaseline = layout.getLineBaseline(0);
|
||||
Layout layout2 = this.R.getLayout();
|
||||
|
||||
if (layout2 != null) {
|
||||
i = layout2.getLineBaseline(0);
|
||||
}
|
||||
|
||||
return lineBaseline - i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private final int getTitleColorHighlight() {
|
||||
private int getTitleColorHighlight(){
|
||||
return ContextExtKt.a(getContext(), vkim_administration_title);
|
||||
}
|
||||
|
||||
private final void h(int i, int i2, int i3, int i4) {
|
||||
private void h(int i, int i2, int i3, int i4){
|
||||
int paddingLeft = getPaddingLeft();
|
||||
int paddingTop = getPaddingTop();
|
||||
int measuredWidth = getMeasuredWidth() - getPaddingRight();
|
||||
@@ -305,9 +395,11 @@ public final class DialogItemView extends ViewGroup {
|
||||
i(i5, max3, i6, o + max3);
|
||||
int k = k();
|
||||
int j = j();
|
||||
|
||||
if (n()) {
|
||||
max = max2 - (j / 2);
|
||||
}
|
||||
|
||||
int max4 = Math.max(bottom, max);
|
||||
e(i6, max4, k + i6, j + max4);
|
||||
int t = t();
|
||||
@@ -320,136 +412,112 @@ public final class DialogItemView extends ViewGroup {
|
||||
j(measuredWidth - r, max6, measuredWidth, q + max6);
|
||||
}
|
||||
|
||||
private final int i() {
|
||||
private int i(){
|
||||
return g(this.K);
|
||||
}
|
||||
|
||||
private final int j() {
|
||||
private int j(){
|
||||
return f(this.T) + Math.max(f(this.V), f(this.U));
|
||||
}
|
||||
|
||||
private final int k() {
|
||||
private int k(){
|
||||
return Math.max(g(this.T), g(this.V) + g(this.U));
|
||||
}
|
||||
|
||||
private final int l() {
|
||||
private int l(){
|
||||
return Math.max(Math.max(f(this.N), f(this.R)), Math.max(f(this.O), f(this.P)));
|
||||
}
|
||||
|
||||
private final int m() {
|
||||
private int m(){
|
||||
return View.MeasureSpec.makeMeasureSpec(0, 0);
|
||||
}
|
||||
|
||||
private final boolean n() {
|
||||
private boolean n(){
|
||||
return e(this.S);
|
||||
}
|
||||
|
||||
private final int o() {
|
||||
private int o(){
|
||||
return f(this.S);
|
||||
}
|
||||
|
||||
private final int p() {
|
||||
private int p(){
|
||||
return g(this.S);
|
||||
}
|
||||
|
||||
private final int q() {
|
||||
private int q(){
|
||||
return MathExt.a(f(this.b0), f(this.c0), f(this.d0), f(this.e0), f(this.f0));
|
||||
}
|
||||
|
||||
private final int r() {
|
||||
private int r(){
|
||||
return g(this.b0) + MathExt.a(g(this.c0), g(this.d0), g(this.e0), g(this.f0));
|
||||
}
|
||||
|
||||
private final int s() {
|
||||
private int s(){
|
||||
return Math.max(f(this.a0), f(this.W));
|
||||
}
|
||||
|
||||
private final void setAttach(CharSequence charSequence) {
|
||||
private void setAttach(CharSequence charSequence){
|
||||
int i = VISIBLE;
|
||||
|
||||
if (charSequence == null || charSequence.length() == 0) {
|
||||
i = GONE;
|
||||
}
|
||||
|
||||
this.U.setVisibility(i);
|
||||
this.U.setText(charSequence);
|
||||
}
|
||||
|
||||
private final void setBodyLinesCount(int i) {
|
||||
private void setBodyLinesCount(int i){
|
||||
boolean z = i == 1;
|
||||
this.T.setSingleLine(z);
|
||||
this.T.setMaxLines(i);
|
||||
}
|
||||
|
||||
private final int t() {
|
||||
private int t(){
|
||||
return g(this.a0) + g(this.W);
|
||||
}
|
||||
|
||||
private final void u() {
|
||||
private void u(){
|
||||
ViewExtKt.b(this.b0, this.g0 | this.h0);
|
||||
}
|
||||
|
||||
public final void a(Dialog dialog, ProfilesSimpleInfo profilesSimpleInfo) {
|
||||
public void a(Dialog dialog, ProfilesSimpleInfo profilesSimpleInfo){
|
||||
this.K.a(dialog, profilesSimpleInfo);
|
||||
}
|
||||
|
||||
public final void b() {
|
||||
public void b(){
|
||||
a(null, (ComposingType) null);
|
||||
}
|
||||
|
||||
public final void c() {
|
||||
public void c(){
|
||||
a(getDrOnlineMobile());
|
||||
}
|
||||
|
||||
public final void d() {
|
||||
public void d(){
|
||||
a(getDrOnlineVkMe());
|
||||
}
|
||||
|
||||
public final void e() {
|
||||
public void e(){
|
||||
a(getDrOnlineWeb());
|
||||
}
|
||||
|
||||
public final void f() {
|
||||
public void f(){
|
||||
this.S.setVisibility(GONE);
|
||||
this.S.e();
|
||||
}
|
||||
|
||||
public final void g() {
|
||||
public void g(){
|
||||
b(this.L, 0.0f, 0L, 0L, null, 15, null);
|
||||
}
|
||||
|
||||
public static ViewPropertyAnimator b(View view, float f, long j, long j2, Runnable runnable, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
f = 0.0f;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
j = 300;
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
j2 = 0;
|
||||
}
|
||||
if ((i & 8) != 0) {
|
||||
runnable = null;
|
||||
}
|
||||
return AnimationExtKt.b(view, f, j, j2, runnable);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
protected void onDetachedFromWindow(){
|
||||
super.onDetachedFromWindow();
|
||||
a(this.L, 0.0f, 0.0f, 3, null);
|
||||
}
|
||||
|
||||
public static void a(View view, float f, float f2, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
f = 1.0f;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
f2 = 0.0f;
|
||||
}
|
||||
AnimationExtKt.a(view, f, f2);
|
||||
}
|
||||
|
||||
@Override // android.view.ViewGroup, android.view.View
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
||||
protected void onLayout(boolean z, int i, int i2, int i3, int i4){
|
||||
if (this.E) {
|
||||
g(i, i2, i3, i4);
|
||||
} else {
|
||||
@@ -458,7 +526,7 @@ public final class DialogItemView extends ViewGroup {
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onMeasure(int i, int i2) {
|
||||
protected void onMeasure(int i, int i2){
|
||||
if (this.E) {
|
||||
c(i);
|
||||
} else {
|
||||
@@ -466,73 +534,81 @@ public final class DialogItemView extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
public final void setAvatar(Profile profile) {
|
||||
public void setAvatar(Profile profile){
|
||||
this.K.a(profile);
|
||||
}
|
||||
|
||||
public final void setBombVisible(boolean z) {
|
||||
public void setBombVisible(boolean z){
|
||||
if (z) {
|
||||
this.b0.setImageResource(f.ic_bomb_composite_24);
|
||||
}
|
||||
|
||||
this.h0 = z;
|
||||
|
||||
u();
|
||||
}
|
||||
|
||||
public final void setCasperIconColor(@ColorInt int i) {
|
||||
public void setCasperIconColor(@ColorInt int i){
|
||||
ViewExtKt.a(this.Q, i);
|
||||
}
|
||||
|
||||
public final void setCasperIconVisible(boolean z) {
|
||||
public void setCasperIconVisible(boolean z){
|
||||
this.Q.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setErrorVisible(boolean z) {
|
||||
public void setErrorVisible(boolean z){
|
||||
this.f0.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setGiftVisible(boolean z) {
|
||||
public void setGiftVisible(boolean z){
|
||||
this.V.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setHasStories(boolean z) {
|
||||
public void setHasStories(boolean z){
|
||||
if (this.I == z) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.I = z;
|
||||
int i = VISIBLE;
|
||||
|
||||
if (z) {
|
||||
int borderWidth = this.M.getBorderWidth();
|
||||
this.K.setViewSize(this.f15757J - (borderWidth * 2));
|
||||
this.K.setViewSize(this.J - (borderWidth * 2));
|
||||
this.K.setPadding(borderWidth, borderWidth, borderWidth, borderWidth);
|
||||
} else {
|
||||
this.K.setViewSize(this.f15757J);
|
||||
this.K.setViewSize(this.J);
|
||||
this.K.setPadding(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (!z) {
|
||||
i = GONE;
|
||||
}
|
||||
|
||||
this.M.setVisibility(i);
|
||||
setClipChildren(!z);
|
||||
setClipToPadding(!z);
|
||||
}
|
||||
|
||||
public final void setMentionVisible(boolean z) {
|
||||
public void setMentionVisible(boolean z){
|
||||
if (z) {
|
||||
this.b0.setImageResource(f.ic_mention_composite_24);
|
||||
}
|
||||
|
||||
this.g0 = z;
|
||||
|
||||
u();
|
||||
}
|
||||
|
||||
public final void setMutedVisible(boolean z) {
|
||||
public void setMutedVisible(boolean z){
|
||||
this.P.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setOnStoryClickListener(View.OnClickListener onClickListener) {
|
||||
public void setOnStoryClickListener(View.OnClickListener onClickListener){
|
||||
ViewExtKt.b(this.M, onClickListener);
|
||||
}
|
||||
|
||||
public final void setSender(Profile profile) {
|
||||
public void setSender(Profile profile){
|
||||
if (profile == null) {
|
||||
f();
|
||||
return;
|
||||
@@ -541,45 +617,29 @@ public final class DialogItemView extends ViewGroup {
|
||||
this.S.a(profile);
|
||||
}
|
||||
|
||||
public final void setSendingVisible(boolean z) {
|
||||
public void setSendingVisible(boolean z){
|
||||
this.e0.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setTime(CharSequence charSequence) {
|
||||
public void setTime(CharSequence charSequence){
|
||||
this.R.setText(charSequence);
|
||||
}
|
||||
|
||||
public final void setUnreadOutVisible(boolean z) {
|
||||
public void setUnreadOutVisible(boolean z){
|
||||
this.d0.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public final void setVerifiedVisible(boolean z) {
|
||||
public void setVerifiedVisible(boolean z){
|
||||
this.O.setVisibility(z ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
private final void a(Drawable drawable) {
|
||||
private void a(Drawable drawable){
|
||||
ViewExtKt.c(this.L, a(16), a(20));
|
||||
this.L.setImageDrawable(drawable);
|
||||
a(this.L, 0.0f, 0L, 0L, null, 15, null);
|
||||
}
|
||||
|
||||
public static ViewPropertyAnimator a(View view, float f, long j, long j2, Runnable runnable, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
f = 1.0f;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
j = 300;
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
j2 = 0;
|
||||
}
|
||||
if ((i & 8) != 0) {
|
||||
runnable = null;
|
||||
}
|
||||
return AnimationExtKt.a(view, f, j, j2, runnable);
|
||||
}
|
||||
|
||||
private final void c(int i) {
|
||||
private void c(int i){
|
||||
int size = (View.MeasureSpec.getSize(i) - getPaddingLeft()) - getPaddingRight();
|
||||
d(b(size - this.K.getViewSize()), m());
|
||||
int r = r();
|
||||
@@ -595,7 +655,7 @@ public final class DialogItemView extends ViewGroup {
|
||||
setMeasuredDimension(View.MeasureSpec.getSize(i), getPaddingTop() + getPaddingBottom() + Math.max(f(this.K), l() + Math.max(Math.max(o(), j()), Math.max(s(), q()))));
|
||||
}
|
||||
|
||||
private final void d(int i) {
|
||||
private void d(int i){
|
||||
int size = (View.MeasureSpec.getSize(i) - getPaddingLeft()) - getPaddingRight();
|
||||
d(b(size - this.K.getViewSize()), m());
|
||||
int r = r();
|
||||
@@ -612,7 +672,7 @@ public final class DialogItemView extends ViewGroup {
|
||||
setMeasuredDimension(View.MeasureSpec.getSize(i), getPaddingTop() + getPaddingBottom() + Math.max(f(this.K), l() + Math.max(Math.max(o(), j()), Math.max(s(), q()))));
|
||||
}
|
||||
|
||||
private final void e(int i, int i2, int i3, int i4) {
|
||||
private void e(int i, int i2, int i3, int i4){
|
||||
if (e(this.T) && e(this.U)) {
|
||||
c(i, i2, i3, i4);
|
||||
} else if (e(this.T)) {
|
||||
@@ -623,7 +683,7 @@ public final class DialogItemView extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
private final void g(int i, int i2, int i3, int i4) {
|
||||
private void g(int i, int i2, int i3, int i4){
|
||||
int paddingLeft = getPaddingLeft();
|
||||
int paddingTop = getPaddingTop();
|
||||
int measuredWidth = getMeasuredWidth() - getPaddingRight();
|
||||
@@ -646,12 +706,12 @@ public final class DialogItemView extends ViewGroup {
|
||||
j(measuredWidth - r, i8, measuredWidth, q + i8);
|
||||
}
|
||||
|
||||
private final void i(int i, int i2, int i3, int i4) {
|
||||
private void i(int i, int i2, int i3, int i4){
|
||||
AvatarView avatarView = this.S;
|
||||
b(avatarView, i + b(avatarView), ((i2 + ((i4 - i2) / 2)) - (this.S.getMeasuredHeight() / 2)) + d(this.S));
|
||||
}
|
||||
|
||||
private final void j(int i, int i2, int i3, int i4) {
|
||||
private void j(int i, int i2, int i3, int i4){
|
||||
int i5 = i2 + ((i4 - i2) / 2);
|
||||
AppCompatImageView appCompatImageView = this.b0;
|
||||
b(appCompatImageView, b(appCompatImageView) + i, (i5 - (this.b0.getMeasuredHeight() / 2)) + d(this.b0));
|
||||
@@ -668,22 +728,26 @@ public final class DialogItemView extends ViewGroup {
|
||||
b(appCompatImageView4, i + b(appCompatImageView4), (i5 - (this.f0.getMeasuredHeight() / 2)) + d(this.f0));
|
||||
}
|
||||
|
||||
private final void k(int i, int i2, int i3, int i4) {
|
||||
private void k(int i, int i2, int i3, int i4){
|
||||
int i5 = i2 + ((i4 - i2) / 2);
|
||||
TextView textView = this.W;
|
||||
b(textView, b(textView) + i, (i5 - (this.W.getMeasuredHeight() / 2)) + d(this.W));
|
||||
|
||||
if (e(this.W)) {
|
||||
i = this.W.getRight() + c(this.W);
|
||||
}
|
||||
|
||||
AppCompatImageView appCompatImageView = this.a0;
|
||||
b(appCompatImageView, i + b(appCompatImageView), (i5 - (this.a0.getMeasuredHeight() / 2)) + d(this.a0));
|
||||
}
|
||||
|
||||
public final void b(CharSequence charSequence, boolean z) {
|
||||
public void b(CharSequence charSequence, boolean z){
|
||||
int i = VISIBLE;
|
||||
|
||||
if (charSequence == null || charSequence.length() == 0) {
|
||||
i = GONE;
|
||||
}
|
||||
|
||||
this.c0.setVisibility(i);
|
||||
this.c0.setText(charSequence);
|
||||
Context context = getContext();
|
||||
@@ -691,30 +755,35 @@ public final class DialogItemView extends ViewGroup {
|
||||
this.g.a(z ? this.B : this.h);
|
||||
}
|
||||
|
||||
private final void f(int i, int i2, int i3, int i4) {
|
||||
private void f(int i, int i2, int i3, int i4){
|
||||
TextView textView = this.N;
|
||||
b(textView, i + b(textView), d(this.N) + i2);
|
||||
int right = this.N.getRight() + c(this.N);
|
||||
int d2 = i2 + d(this.N) + (this.N.getMeasuredHeight() / 2);
|
||||
AppCompatImageView appCompatImageView = this.O;
|
||||
b(appCompatImageView, b(appCompatImageView) + right, (d2 - (this.O.getMeasuredHeight() / 2)) + d(this.O));
|
||||
|
||||
if (e(this.O)) {
|
||||
right = this.O.getRight() + c(this.O);
|
||||
}
|
||||
|
||||
AppCompatImageView appCompatImageView2 = this.Q;
|
||||
b(appCompatImageView2, b(appCompatImageView2) + right, (d2 - (this.Q.getMeasuredHeight() / 2)) + d(this.Q));
|
||||
|
||||
if (e(this.Q)) {
|
||||
right = this.Q.getRight() + c(this.Q);
|
||||
}
|
||||
|
||||
AppCompatImageView appCompatImageView3 = this.P;
|
||||
b(appCompatImageView3, right + b(appCompatImageView3), (d2 - (this.P.getMeasuredHeight() / 2)) + d(this.P));
|
||||
|
||||
if (!this.E) {
|
||||
TextView textView2 = this.R;
|
||||
b(textView2, (i3 - c(textView2)) - this.R.getMeasuredWidth(), (d2 - (this.R.getMeasuredHeight() / 2)) + d(this.R));
|
||||
}
|
||||
}
|
||||
|
||||
private final void l(int i, int i2, int i3, int i4) {
|
||||
private void l(int i, int i2, int i3, int i4){
|
||||
TextView textView = this.W;
|
||||
b(textView, i + b(textView), i2);
|
||||
int right = this.W.getRight() + c(this.W);
|
||||
@@ -722,41 +791,43 @@ public final class DialogItemView extends ViewGroup {
|
||||
b(appCompatImageView, right + b(appCompatImageView), (((this.W.getBottom() + this.W.getTop()) / 2) - (this.a0.getMeasuredHeight() / 2)) + d(this.a0));
|
||||
}
|
||||
|
||||
private final void e(int i, int i2) {
|
||||
private void e(int i, int i2){
|
||||
b(this.a0, i, 0, i2, 0);
|
||||
b(this.W, i, g(this.a0), i2, 0);
|
||||
}
|
||||
|
||||
public final void a(CharSequence charSequence, boolean z) {
|
||||
public void a(CharSequence charSequence, boolean z){
|
||||
this.N.setText(charSequence);
|
||||
this.N.setTextColor(z ? getTitleColorHighlight() : this.f15761e);
|
||||
}
|
||||
|
||||
private final void b(int i, int i2) {
|
||||
private void b(int i, int i2){
|
||||
b(this.O, i, 0, i2, 0);
|
||||
b(this.Q, i, 0, i2, 0);
|
||||
b(this.P, i, 0, i2, 0);
|
||||
b(this.R, i, 0, i2, 0);
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
public void a(){
|
||||
a(null, 1);
|
||||
setAttach(null);
|
||||
}
|
||||
|
||||
private final boolean e(View view) {
|
||||
return view.getVisibility() == 0;
|
||||
private boolean e(View view){
|
||||
return view.getVisibility() == VISIBLE;
|
||||
}
|
||||
|
||||
public final void a(CharSequence charSequence, int i, CharSequence charSequence2) {
|
||||
public void a(CharSequence charSequence, int i, CharSequence charSequence2){
|
||||
boolean z = false;
|
||||
|
||||
if (!(charSequence == null || charSequence.length() == 0)) {
|
||||
a(charSequence, i);
|
||||
setAttach(charSequence2);
|
||||
} else {
|
||||
a(null, 1);
|
||||
setAttach(charSequence2);
|
||||
}
|
||||
|
||||
setAttach(charSequence2);
|
||||
|
||||
if (charSequence == null || charSequence.length() == 0) {
|
||||
if (charSequence2 == null || charSequence2.length() == 0) {
|
||||
z = true;
|
||||
@@ -769,11 +840,11 @@ public final class DialogItemView extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
private final void b(int i, int i2, int i3) {
|
||||
private void b(int i, int i2, int i3){
|
||||
a(this.N, i, i3, i2, 0);
|
||||
}
|
||||
|
||||
private final void b(int i, int i2, int i3, int i4) {
|
||||
private void b(int i, int i2, int i3, int i4){
|
||||
int g = e(this.V) ? g(this.V) + i : i;
|
||||
TextView textView = this.U;
|
||||
a(textView, g + b(textView), i2 + d(this.U));
|
||||
@@ -781,72 +852,80 @@ public final class DialogItemView extends ViewGroup {
|
||||
b(appCompatImageView, i + b(appCompatImageView), (this.U.getTop() + (this.U.getMeasuredHeight() / 2)) - (this.V.getMeasuredHeight() / 2));
|
||||
}
|
||||
|
||||
private final void a(CharSequence charSequence, int i) {
|
||||
private void a(CharSequence charSequence, int i){
|
||||
int i2 = VISIBLE;
|
||||
|
||||
if (charSequence == null || charSequence.length() == 0) {
|
||||
i2 = GONE;
|
||||
}
|
||||
|
||||
this.T.setVisibility(i2);
|
||||
this.T.setText(charSequence);
|
||||
setBodyLinesCount(i);
|
||||
}
|
||||
|
||||
private final void b(View view, int i, int i2, int i3, int i4) {
|
||||
private void b(View view, int i, int i2, int i3, int i4){
|
||||
if (view.getVisibility() != GONE) {
|
||||
a(view, i, i2, i3, i4);
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(CharSequence charSequence, ComposingType composingType) {
|
||||
public void a(CharSequence charSequence, ComposingType composingType){
|
||||
Drawable drawable = composingType == ComposingType.AUDIO ? this.H : this.G;
|
||||
boolean z = false;
|
||||
drawable.setVisible(!(charSequence == null || charSequence.length() == 0), false);
|
||||
this.a0.setImageDrawable(drawable);
|
||||
ViewExtKt.b(this.a0, !(charSequence == null || charSequence.length() == 0));
|
||||
|
||||
if (charSequence == null || charSequence.length() == 0) {
|
||||
z = true;
|
||||
}
|
||||
|
||||
ViewExtKt.b(this.W, !z);
|
||||
this.W.setText(charSequence);
|
||||
}
|
||||
|
||||
private final void b(View view, int i, int i2) {
|
||||
if (view.getVisibility() == 0) {
|
||||
private void b(View view, int i, int i2){
|
||||
if (view.getVisibility() == VISIBLE) {
|
||||
a(view, i, i2);
|
||||
}
|
||||
}
|
||||
|
||||
private final int b(View view) {
|
||||
private int b(View view){
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
|
||||
if (marginLayoutParams != null) {
|
||||
return marginLayoutParams.leftMargin;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private final int b(int i) {
|
||||
private int b(int i){
|
||||
return View.MeasureSpec.makeMeasureSpec(i, MeasureSpec.AT_MOST);
|
||||
}
|
||||
|
||||
private final int g(View view) {
|
||||
private int g(View view){
|
||||
if (view.getVisibility() == GONE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int measuredWidth = view.getMeasuredWidth();
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
return marginLayoutParams != null ? measuredWidth + marginLayoutParams.leftMargin + marginLayoutParams.rightMargin : measuredWidth;
|
||||
}
|
||||
|
||||
private final void a(int i, int i2) {
|
||||
private void a(int i, int i2){
|
||||
a(this.K, i, 0, i2, 0);
|
||||
b(this.M, i, 0, i2, 0);
|
||||
b(this.L, i, 0, i2, 0);
|
||||
}
|
||||
|
||||
private final int f(View view) {
|
||||
private int f(View view){
|
||||
if (view.getVisibility() == GONE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int measuredHeight = view.getMeasuredHeight();
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
if (marginLayoutParams != null) {
|
||||
@@ -855,40 +934,42 @@ public final class DialogItemView extends ViewGroup {
|
||||
return measuredHeight;
|
||||
}
|
||||
|
||||
private final void a(int i, int i2, int i3, int i4) {
|
||||
private void a(int i, int i2, int i3, int i4){
|
||||
AvatarView avatarView = this.K;
|
||||
a(avatarView, i + b(avatarView), i2 + d(this.K));
|
||||
a(this.M, this.K.getLeft() - this.K.getPaddingLeft(), this.K.getTop() - this.K.getPaddingTop());
|
||||
b(this.L, this.K.getRight() - this.L.getMeasuredWidth(), this.K.getBottom() - this.L.getMeasuredHeight());
|
||||
}
|
||||
|
||||
private final void c(int i, int i2) {
|
||||
private void c(int i, int i2){
|
||||
b(this.S, i, 0, i2, 0);
|
||||
}
|
||||
|
||||
private final void c(int i, int i2, int i3, int i4) {
|
||||
private void c(int i, int i2, int i3, int i4){
|
||||
d(i, i2, i3, f(this.T) + i2);
|
||||
b(i, i2 + f(this.T), i3, i4);
|
||||
}
|
||||
|
||||
private final int h() {
|
||||
private int h(){
|
||||
return f(this.K);
|
||||
}
|
||||
|
||||
private final void d(int i, int i2, int i3, int i4) {
|
||||
private void d(int i, int i2, int i3, int i4){
|
||||
TextView textView = this.T;
|
||||
a(textView, i + b(textView), i2 + d(this.T));
|
||||
}
|
||||
|
||||
private final int c(View view) {
|
||||
private int c(View view){
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
|
||||
if (marginLayoutParams != null) {
|
||||
return marginLayoutParams.rightMargin;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private final void d(int i, int i2) {
|
||||
private void d(int i, int i2){
|
||||
b(this.b0, i, 0, i2, 0);
|
||||
b(this.c0, i, 0, i2, 0);
|
||||
b(this.d0, i, 0, i2, 0);
|
||||
@@ -896,50 +977,23 @@ public final class DialogItemView extends ViewGroup {
|
||||
b(this.f0, i, 0, i2, 0);
|
||||
}
|
||||
|
||||
static /* synthetic */ void a(DialogItemView dialogItemView, int i, int i2, int i3, int i4, Object obj) {
|
||||
if ((i4 & 4) != 0) {
|
||||
i3 = 0;
|
||||
}
|
||||
dialogItemView.a(i, i2, i3);
|
||||
}
|
||||
|
||||
private final void a(int i, int i2, int i3) {
|
||||
private void a(int i, int i2, int i3){
|
||||
b(this.T, i, i3, i2, 0);
|
||||
b(this.V, i, i3, i2, 0);
|
||||
b(this.U, i, i3 + g(this.V), i2, 0);
|
||||
}
|
||||
|
||||
private final int d(View view) {
|
||||
private int d(View view){
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
|
||||
if (marginLayoutParams != null) {
|
||||
return marginLayoutParams.topMargin;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static /* synthetic */ ViewGroup.MarginLayoutParams a(DialogItemView dialogItemView, int i, int i2, int i3, int i4, int i5, int i6, int i7, Object obj) {
|
||||
if ((i7 & 1) != 0) {
|
||||
i = -2;
|
||||
}
|
||||
if ((i7 & 2) != 0) {
|
||||
i2 = -2;
|
||||
}
|
||||
if ((i7 & 4) != 0) {
|
||||
i3 = 0;
|
||||
}
|
||||
if ((i7 & 8) != 0) {
|
||||
i4 = 0;
|
||||
}
|
||||
if ((i7 & 16) != 0) {
|
||||
i5 = 0;
|
||||
}
|
||||
if ((i7 & 32) != 0) {
|
||||
i6 = 0;
|
||||
}
|
||||
return dialogItemView.a(i, i2, i3, i4, i5, i6);
|
||||
}
|
||||
|
||||
private final ViewGroup.MarginLayoutParams a(int i, int i2, int i3, int i4, int i5, int i6) {
|
||||
private ViewGroup.MarginLayoutParams a(int i, int i2, int i3, int i4, int i5, int i6){
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams(i, i2);
|
||||
marginLayoutParams.leftMargin = i3;
|
||||
marginLayoutParams.topMargin = i4;
|
||||
@@ -948,31 +1002,29 @@ public final class DialogItemView extends ViewGroup {
|
||||
return marginLayoutParams;
|
||||
}
|
||||
|
||||
public final int a(int i) {
|
||||
public int a(int i){
|
||||
return (int) (i * (this.a.densityDpi / 160.0f));
|
||||
}
|
||||
|
||||
public final int a(float f2) {
|
||||
public int a(float f2){
|
||||
return (int) (f2 * (this.a.densityDpi / 160.0f));
|
||||
}
|
||||
|
||||
private final void a(View view, int i, int i2, int i3, int i4) {
|
||||
private void a(View view, int i, int i2, int i3, int i4){
|
||||
view.measure(ViewGroup.getChildMeasureSpec(i, i2 + b(view) + c(view), view.getLayoutParams().width), ViewGroup.getChildMeasureSpec(i3, i4 + d(view) + a(view), view.getLayoutParams().height));
|
||||
}
|
||||
|
||||
private final void a(View view, int i, int i2) {
|
||||
private void a(View view, int i, int i2){
|
||||
view.layout(i, i2, view.getMeasuredWidth() + i, view.getMeasuredHeight() + i2);
|
||||
}
|
||||
|
||||
private final int a(View view) {
|
||||
private int a(View view){
|
||||
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
|
||||
if (marginLayoutParams != null) {
|
||||
return marginLayoutParams.bottomMargin;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public DialogItemView(Context context, AttributeSet attributeSet, int i, int i2) {
|
||||
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user