File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed
library/src/main/java/com/hjq/window Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -315,9 +315,9 @@ easyWindow.setBlurBehindRadius(@IntRange(from = 0) int blurBehindRadius);
315315easyWindow. setScreenOrientation(int screenOrientation);
316316
317317// 设置悬浮窗可见性
318- easyWindow. setWindowVisibility (int visibility);
318+ easyWindow. setWindowViewVisibility (int visibility);
319319// 获取悬浮窗可见性
320- easyWindow. getWindowVisibility ();
320+ easyWindow. getWindowViewVisibility ();
321321// 设置悬浮窗根布局(一般情况下推荐使用 {@link #setContentView} 方法来填充布局)
322322easyWindow. setRootLayout(@NonNull ViewGroup viewGroup);
323323// 重新设置 WindowManager 参数集
Original file line number Diff line number Diff line change @@ -1155,7 +1155,7 @@ public void delayRecycle() {
11551155 }
11561156
11571157 /**
1158- * 获取悬浮窗可见性
1158+ * @deprecated 该 API 已经过时,随时会被删除,请尽早迁移到 {@link #getWindowVisibility()}
11591159 */
11601160 public int getWindowVisibility () {
11611161 if (mRootLayout == null ) {
@@ -1165,18 +1165,35 @@ public int getWindowVisibility() {
11651165 }
11661166
11671167 /**
1168- * 设置悬浮窗可见性
1168+ * 获取窗口视图可见性
1169+ */
1170+ public int getWindowViewVisibility () {
1171+ if (mRootLayout == null ) {
1172+ return View .GONE ;
1173+ }
1174+ return mRootLayout .getVisibility ();
1175+ }
1176+
1177+ /**
1178+ * @deprecated 该 API 已经过时,随时会被删除,请尽早迁移到 {@link #setWindowViewVisibility(int)}
1179+ */
1180+ public X setWindowVisibility (int visibility ) {
1181+ return setWindowViewVisibility (visibility );
1182+ }
1183+
1184+ /**
1185+ * 设置窗口视图的可见性
11691186 *
1170- * @param visibility 窗口可见性类型 ,有三种类型:
1187+ * @param visibility 可见性类型 ,有三种类型:
11711188 * {@link View#VISIBLE}
11721189 * {@link View#INVISIBLE}
11731190 * {@link View#GONE}
11741191 */
1175- public X setWindowVisibility (int visibility ) {
1192+ public X setWindowViewVisibility (int visibility ) {
11761193 if (mRootLayout == null ) {
11771194 return (X ) this ;
11781195 }
1179- if (getWindowVisibility () == visibility ) {
1196+ if (mRootLayout . getVisibility () == visibility ) {
11801197 return (X ) this ;
11811198 }
11821199 mRootLayout .setVisibility (visibility );
You can’t perform that action at this time.
0 commit comments