KeyboardTabView.java
4.06 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package com.bitstrips.imoji.keyboard;
import android.content.Context;
import android.content.res.Resources;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import java.util.ArrayList;
import java.util.List;
public class KeyboardTabView
extends LinearLayout
implements ViewPager.OnPageChangeListener, View.OnClickListener
{
private ViewPager a;
private List<ImageButton> b;
private OnKeyboardTabButtonPress c;
public KeyboardTabView(Context paramContext)
{
super(paramContext);
setUp(paramContext);
}
public KeyboardTabView(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
setUp(paramContext);
}
public KeyboardTabView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
setUp(paramContext);
}
private void setFocus(int paramInt)
{
int j = 0;
if (j < 7)
{
int i;
if (j == 0) {
if (paramInt == j) {
i = 2130837748;
}
}
for (;;)
{
((ImageButton)this.b.get(j)).setImageResource(i);
j += 1;
break;
i = 2130837747;
continue;
if (paramInt == j) {
i = getDrawableIdFromName("tab_" + (j - 1) + "_sel");
} else {
i = getDrawableIdFromName("tab_" + (j - 1));
}
}
}
}
private void setUp(Context paramContext)
{
setOrientation(0);
setBackgroundColor(getResources().getColor(2131624039));
this.b = new ArrayList();
paramContext = (LayoutInflater)paramContext.getSystemService("layout_inflater");
int i = 0;
while (i < 7)
{
ImageButton localImageButton = (ImageButton)paramContext.inflate(2130903175, null);
localImageButton.setTag(Integer.valueOf(i));
localImageButton.setOnClickListener(this);
this.b.add(localImageButton);
addButton(localImageButton);
i += 1;
}
setFocus(0);
}
public void addButton(ImageButton paramImageButton)
{
addView(paramImageButton);
LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams)paramImageButton.getLayoutParams();
localLayoutParams.weight = 1.0F;
localLayoutParams.width = 0;
paramImageButton.setLayoutParams(localLayoutParams);
}
public void changeIcon(int paramInt1, int paramInt2)
{
((ImageButton)this.b.get(paramInt1)).setImageResource(paramInt2);
}
public int getDrawableIdFromName(String paramString)
{
return getContext().getResources().getIdentifier(paramString, "drawable", getContext().getPackageName());
}
public void onClick(View paramView)
{
if (this.a == null) {}
int i;
do
{
return;
i = ((Integer)paramView.getTag()).intValue();
if (this.a.getCurrentItem() == i) {
setFocus(i);
}
this.a.setCurrentItem(i, true);
} while (this.c == null);
this.c.onPress(i, (ImageButton)paramView);
}
public void onPageScrollStateChanged(int paramInt) {}
public void onPageScrolled(int paramInt1, float paramFloat, int paramInt2) {}
public void onPageSelected(int paramInt)
{
setFocus(paramInt);
}
public void setTabButtonPress(OnKeyboardTabButtonPress paramOnKeyboardTabButtonPress)
{
this.c = paramOnKeyboardTabButtonPress;
}
public void setupWithViewPager(ViewPager paramViewPager)
{
this.a = paramViewPager;
this.a.setOnPageChangeListener(this);
}
public static abstract interface OnKeyboardTabButtonPress
{
public abstract void onPress(int paramInt, ImageButton paramImageButton);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/keyboard/KeyboardTabView.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/