AvatarBottomBar.java
4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package com.bitstrips.imoji.abv3.bottombar;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Point;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import hi;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class AvatarBottomBar
extends FrameLayout
implements hi
{
private static final String a = AvatarBottomBar.class.getSimpleName();
private List<AvatarBottomBarItem> b;
private List<AvatarBottomBarViewHolder> c;
private LinearLayout d;
private HorizontalScrollView e;
private AvatarBottomBarViewHolder f;
private AvatarBuilderBottomBarListener g;
private int h;
public AvatarBottomBar(@NonNull Context paramContext)
{
super(paramContext);
init();
}
public AvatarBottomBar(@NonNull Context paramContext, @Nullable AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
init();
}
public void init()
{
View.inflate(getContext(), 2130903210, this);
this.e = ((HorizontalScrollView)findViewById(2131689945));
this.d = ((LinearLayout)findViewById(2131689946));
Display localDisplay = ((WindowManager)getContext().getSystemService("window")).getDefaultDisplay();
Point localPoint = new Point();
localDisplay.getSize(localPoint);
this.h = localPoint.x;
}
public void onSelected(AvatarBottomBarViewHolder paramAvatarBottomBarViewHolder, String paramString)
{
if (this.g != null) {
this.g.onBottomBarItemSelected(paramString);
}
}
public void setBottomBarItems(List<AvatarBottomBarItem> paramList)
{
this.d.removeAllViews();
this.c = new ArrayList();
this.b = paramList;
this.f = null;
int i = paramList.size();
int j = getResources().getDimensionPixelSize(2131361900);
int k = (int)(this.h / i);
i = j;
if (k > j) {
i = k;
}
paramList = paramList.iterator();
while (paramList.hasNext())
{
Object localObject = (AvatarBottomBarItem)paramList.next();
View localView = View.inflate(getContext(), 2130903158, null);
localObject = new AvatarBottomBarViewHolder(localView, (AvatarBottomBarItem)localObject, i);
((AvatarBottomBarViewHolder)localObject).setListener(this);
((AvatarBottomBarViewHolder)localObject).setAnimationsEnabled(true);
this.d.addView(localView);
this.c.add(localObject);
}
}
public void setListener(AvatarBuilderBottomBarListener paramAvatarBuilderBottomBarListener)
{
this.g = paramAvatarBuilderBottomBarListener;
}
public void setSelectedCategory(String paramString)
{
Iterator localIterator = this.c.iterator();
while (localIterator.hasNext())
{
Object localObject = (AvatarBottomBarViewHolder)localIterator.next();
int i = ((AvatarBottomBarViewHolder)localObject).indexOf(paramString);
if (i != -1)
{
if ((this.f != null) && (this.f != localObject)) {
this.f.setUnselected();
}
((AvatarBottomBarViewHolder)localObject).setSelected(i);
this.f = ((AvatarBottomBarViewHolder)localObject);
paramString = ((AvatarBottomBarViewHolder)localObject).getView();
i = ((AvatarBottomBarViewHolder)localObject).getContainerWidth();
localObject = new int[2];
paramString.getLocationOnScreen((int[])localObject);
float f1 = localObject[0];
float f2 = paramString.getX();
if ((f1 < 0.0F) || (i + f1 > this.h))
{
int j = (int)f2 - this.h / 2;
i = j;
if (j < 0) {
i = 0;
}
j = i;
if (i > this.d.getMeasuredWidth()) {
j = this.d.getMeasuredWidth();
}
this.e.smoothScrollTo(j, 0);
}
}
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/abv3/bottombar/AvatarBottomBar.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/