Skip to content

Commit a4add02

Browse files
committed
Merge branch 'master' into androidx
2 parents 7e76cb6 + 3590c78 commit a4add02

File tree

8 files changed

+121
-15
lines changed

8 files changed

+121
-15
lines changed

anylayer/src/main/java/per/goweii/anylayer/DecorLayer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.content.res.Configuration;
77
import android.widget.FrameLayout;
88

9+
import androidx.annotation.CallSuper;
910
import androidx.annotation.NonNull;
1011

1112
import per.goweii.anylayer.utils.Utils;
@@ -74,38 +75,50 @@ public ListenerHolder getListenerHolder() {
7475
return (ListenerHolder) super.getListenerHolder();
7576
}
7677

78+
@CallSuper
7779
@Override
7880
protected void onAttach() {
7981
super.onAttach();
8082
getActivity().registerComponentCallbacks(mActivityComponentCallbacks);
8183
}
8284

85+
@CallSuper
8386
@Override
8487
protected void onAppear() {
8588
super.onAppear();
8689
}
8790

91+
@CallSuper
8892
@Override
8993
protected void onShow() {
9094
super.onShow();
9195
}
9296

97+
@CallSuper
9398
@Override
9499
protected void onDismiss() {
95100
super.onDismiss();
96101
}
97102

103+
@CallSuper
98104
@Override
99105
protected void onDisappear() {
100106
super.onDisappear();
101107
}
102108

109+
@CallSuper
103110
@Override
104111
protected void onDetach() {
105112
getActivity().unregisterComponentCallbacks(mActivityComponentCallbacks);
106113
super.onDetach();
107114
}
108115

116+
@CallSuper
117+
@Override
118+
protected void onDestroy() {
119+
super.onDestroy();
120+
}
121+
109122
protected void onActivityConfigChanged(@NonNull Configuration newConfig) {
110123
}
111124

anylayer/src/main/java/per/goweii/anylayer/FrameLayer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.view.ViewGroup;
77
import android.widget.FrameLayout;
88

9+
import androidx.annotation.CallSuper;
910
import androidx.annotation.IntRange;
1011
import androidx.annotation.NonNull;
1112
import androidx.annotation.Nullable;
@@ -99,31 +100,37 @@ protected ViewGroup onGetParent() {
99100
return parent;
100101
}
101102

103+
@CallSuper
102104
@Override
103105
protected void onAttach() {
104106
super.onAttach();
105107
}
106108

109+
@CallSuper
107110
@Override
108111
protected void onAppear() {
109112
super.onAppear();
110113
}
111114

115+
@CallSuper
112116
@Override
113117
protected void onShow() {
114118
super.onShow();
115119
}
116120

121+
@CallSuper
117122
@Override
118123
protected void onDismiss() {
119124
super.onDismiss();
120125
}
121126

127+
@CallSuper
122128
@Override
123129
protected void onDisappear() {
124130
super.onDisappear();
125131
}
126132

133+
@CallSuper
127134
@Override
128135
protected void onDetach() {
129136
super.onDetach();
@@ -143,6 +150,12 @@ protected void onDetach() {
143150
}
144151
}
145152

153+
@CallSuper
154+
@Override
155+
protected void onDestroy() {
156+
super.onDestroy();
157+
}
158+
146159
@Override
147160
public void onGlobalLayout() {
148161
super.onGlobalLayout();

anylayer/src/main/java/per/goweii/anylayer/dialog/DialogLayer.java

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import android.widget.FrameLayout;
1919
import android.widget.ImageView;
2020

21+
import androidx.annotation.CallSuper;
2122
import androidx.annotation.ColorInt;
2223
import androidx.annotation.ColorRes;
2324
import androidx.annotation.DrawableRes;
@@ -337,11 +338,13 @@ protected FrameLayout.LayoutParams generateContentDefaultLayoutParams() {
337338
FrameLayout.LayoutParams.WRAP_CONTENT);
338339
}
339340

341+
@CallSuper
340342
@Override
341343
protected void onCreate() {
342344
super.onCreate();
343345
}
344346

347+
@CallSuper
345348
@Override
346349
protected void onAttach() {
347350
super.onAttach();
@@ -351,33 +354,44 @@ protected void onAttach() {
351354
registerSoftInputCompat();
352355
}
353356

357+
@CallSuper
354358
@Override
355359
protected void onAppear() {
356360
super.onAppear();
357361
}
358362

363+
@CallSuper
359364
@Override
360365
protected void onShow() {
361366
super.onShow();
362367
}
363368

369+
@CallSuper
364370
@Override
365371
protected void onDismiss() {
366372
super.onDismiss();
367373
}
368374

375+
@CallSuper
369376
@Override
370377
protected void onDisappear() {
371378
super.onDisappear();
372379
}
373380

381+
@CallSuper
374382
@Override
375383
protected void onDetach() {
376384
super.onDetach();
377385
unregisterSoftInputCompat();
378386
getViewHolder().recycle();
379387
}
380388

389+
@CallSuper
390+
@Override
391+
protected void onDestroy() {
392+
super.onDestroy();
393+
}
394+
381395
@Override
382396
protected void onActivityConfigChanged(@NonNull Configuration newConfig) {
383397
super.onActivityConfigChanged(newConfig);
@@ -573,27 +587,28 @@ protected void initContent() {
573587
}
574588

575589
private void registerSoftInputCompat() {
590+
final SparseBooleanArray mapping = getConfig().mSoftInputMapping;
591+
if (mapping == null || mapping.size() == 0) {
592+
return;
593+
}
576594
if (mSoftInputHelper == null) {
577595
mSoftInputHelper = SoftInputHelper.attach(getActivity());
578596
} else {
579597
mSoftInputHelper.clear();
580598
}
581599
mSoftInputHelper.move(getViewHolder().getContentWrapper());
582-
final SparseBooleanArray mapping = getConfig().mSoftInputMapping;
583-
if (mapping != null) {
584-
for (int i = 0; i < mapping.size(); i++) {
585-
boolean alignToContentOrFocus = mapping.valueAt(i);
586-
int focusId = mapping.keyAt(i);
587-
if (focusId == View.NO_ID) {
588-
if (alignToContentOrFocus) {
589-
mSoftInputHelper.follow(getViewHolder().getContent());
590-
}
591-
} else {
592-
if (alignToContentOrFocus) {
593-
mSoftInputHelper.follow(getViewHolder().getContent(), getView(focusId));
594-
} else {
595-
mSoftInputHelper.follow(null, getView(focusId));
596-
}
600+
for (int i = 0; i < mapping.size(); i++) {
601+
boolean alignToContentOrFocus = mapping.valueAt(i);
602+
int focusId = mapping.keyAt(i);
603+
if (focusId == View.NO_ID) {
604+
if (alignToContentOrFocus) {
605+
mSoftInputHelper.follow(getViewHolder().getContent());
606+
}
607+
} else {
608+
if (alignToContentOrFocus) {
609+
mSoftInputHelper.follow(getViewHolder().getContent(), getView(focusId));
610+
} else {
611+
mSoftInputHelper.follow(null, getView(focusId));
597612
}
598613
}
599614
}

anylayer/src/main/java/per/goweii/anylayer/floats/FloatLayer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.view.ViewGroup;
1212
import android.widget.FrameLayout;
1313

14+
import androidx.annotation.CallSuper;
1415
import androidx.annotation.FloatRange;
1516
import androidx.annotation.IntRange;
1617
import androidx.annotation.LayoutRes;
@@ -128,41 +129,53 @@ protected Animator onCreateOutAnimator(@NonNull View view) {
128129
return AnimatorHelper.createZoomAlphaOutAnim(view);
129130
}
130131

132+
@CallSuper
131133
@Override
132134
protected void onAttach() {
133135
super.onAttach();
134136
initDragLayout();
135137
initFloatView();
136138
}
137139

140+
@CallSuper
138141
@Override
139142
protected void onAppear() {
140143
super.onAppear();
141144
initFloatViewDefConfig();
142145
toNormal();
143146
}
144147

148+
@CallSuper
145149
@Override
146150
protected void onShow() {
147151
super.onShow();
148152
getViewHolder().getChild().goEdge(getViewHolder().getFloat());
149153
}
150154

155+
@CallSuper
151156
@Override
152157
protected void onDismiss() {
153158
super.onDismiss();
154159
}
155160

161+
@CallSuper
156162
@Override
157163
protected void onDisappear() {
158164
super.onDisappear();
159165
}
160166

167+
@CallSuper
161168
@Override
162169
protected void onDetach() {
163170
super.onDetach();
164171
}
165172

173+
@CallSuper
174+
@Override
175+
protected void onDestroy() {
176+
super.onDestroy();
177+
}
178+
166179
private void initDragLayout() {
167180
final Config config = getConfig();
168181
final DragLayout dragLayout = getViewHolder().getChild();

anylayer/src/main/java/per/goweii/anylayer/guide/GuideLayer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.view.ViewGroup;
1111
import android.widget.FrameLayout;
1212

13+
import androidx.annotation.CallSuper;
1314
import androidx.annotation.ColorInt;
1415
import androidx.annotation.ColorRes;
1516
import androidx.annotation.IntRange;
@@ -106,6 +107,7 @@ protected FrameLayout.LayoutParams generateGuideDefaultLayoutParams() {
106107
FrameLayout.LayoutParams.WRAP_CONTENT);
107108
}
108109

110+
@CallSuper
109111
@Override
110112
protected void onAttach() {
111113
super.onAttach();
@@ -129,32 +131,43 @@ protected void onAttach() {
129131
}
130132
}
131133

134+
@CallSuper
132135
@Override
133136
protected void onAppear() {
134137
super.onAppear();
135138
updateLocation();
136139
}
137140

141+
@CallSuper
138142
@Override
139143
protected void onShow() {
140144
super.onShow();
141145
}
142146

147+
@CallSuper
143148
@Override
144149
protected void onDismiss() {
145150
super.onDismiss();
146151
}
147152

153+
@CallSuper
148154
@Override
149155
protected void onDisappear() {
150156
super.onDisappear();
151157
}
152158

159+
@CallSuper
153160
@Override
154161
protected void onDetach() {
155162
super.onDetach();
156163
}
157164

165+
@CallSuper
166+
@Override
167+
protected void onDestroy() {
168+
super.onDestroy();
169+
}
170+
158171
@Override
159172
public void onGlobalLayout() {
160173
super.onGlobalLayout();

0 commit comments

Comments
 (0)