GboardOnboardingInstructionsFragment.java
5.07 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
package com.bitstrips.imoji.onboarding.gboard;
import android.animation.Animator;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import com.crashlytics.android.Crashlytics;
public class GboardOnboardingInstructionsFragment
extends BaseOnboardingFragment
implements ViewTreeObserver.OnGlobalLayoutListener, GboardFakeEditText.OnImageEnterredListener
{
private GboardFakeEditText c;
private View d;
private int e = 0;
private void a()
{
this.c.post(new Runnable()
{
public final void run()
{
Context localContext = GboardOnboardingInstructionsFragment.this.getContext();
if (localContext == null) {}
while (!GboardOnboardingInstructionsFragment.c(GboardOnboardingInstructionsFragment.this).requestFocus()) {
return;
}
((InputMethodManager)localContext.getSystemService("input_method")).showSoftInput(GboardOnboardingInstructionsFragment.c(GboardOnboardingInstructionsFragment.this), 1);
}
});
}
private void b()
{
((InputMethodManager)getContext().getSystemService("input_method")).hideSoftInputFromWindow(this.c.getWindowToken(), 0);
}
public static GboardOnboardingInstructionsFragment newInstance(GboardOnboardingSource paramGboardOnboardingSource)
{
GboardOnboardingInstructionsFragment localGboardOnboardingInstructionsFragment = new GboardOnboardingInstructionsFragment();
localGboardOnboardingInstructionsFragment.setArguments(BaseOnboardingFragment.createArguments(paramGboardOnboardingSource));
return localGboardOnboardingInstructionsFragment;
}
@Nullable
public View onCreateView(LayoutInflater paramLayoutInflater, @Nullable ViewGroup paramViewGroup, @Nullable Bundle paramBundle)
{
paramLayoutInflater = paramLayoutInflater.inflate(2130903117, paramViewGroup, false);
paramViewGroup = (Button)paramLayoutInflater.findViewById(2131689703);
paramBundle = (Button)paramLayoutInflater.findViewById(2131689748);
this.c = ((GboardFakeEditText)paramLayoutInflater.findViewById(2131689746));
this.d = paramLayoutInflater.findViewById(2131689745);
paramViewGroup.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
GboardOnboardingInstructionsFragment.a(GboardOnboardingInstructionsFragment.this);
GboardOnboardingInstructionsFragment.this.skip("instructions");
}
});
paramBundle.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
GboardOnboardingInstructionsFragment.b(GboardOnboardingInstructionsFragment.this);
}
});
this.c.setOnImageEnterredListener(this);
this.d.setAlpha(0.0F);
return paramLayoutInflater;
}
public void onDestroyView()
{
super.onDestroyView();
getView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
getActivity().getWindow().setSoftInputMode(16);
}
public void onGlobalLayout()
{
View localView = getView();
if (localView == null) {
return;
}
int i = localView.getRootView().getHeight() - localView.getHeight();
float f = getResources().getDisplayMetrics().density;
if (i > f * 150.0F)
{
localView = getView().findViewById(2131689747);
ViewGroup.LayoutParams localLayoutParams = localView.getLayoutParams();
getView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
localLayoutParams.height = (i - this.e);
localView.setLayoutParams(localLayoutParams);
this.d.setAlpha(1.0F);
GboardOnboardingUtils.fadeInAnimator(this.d).start();
getActivity().getWindow().setSoftInputMode(48);
return;
}
this.e = i;
}
public void onImageEnterred()
{
b();
finish();
if (didSaveInstanceState())
{
Crashlytics.logException(new IllegalStateException("Performing action after onSaveInstanceState!"));
return;
}
getFragmentManager().beginTransaction().setCustomAnimations(2130968609, 2130968612).replace(2131689651, GboardOnboardingFinishFragment.newInstance(getSource())).addToBackStack(null).commit();
}
public void onResume()
{
super.onResume();
getView().getViewTreeObserver().addOnGlobalLayoutListener(this);
a();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/onboarding/gboard/GboardOnboardingInstructionsFragment.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/