Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix safe area observing for example query #124 #126

Merged
merged 111 commits into from
Jan 3, 2023

Conversation

iphone201988
Copy link
Contributor

No description provided.

twodayslate and others added 30 commits July 2, 2022 03:51
* Issue 80,81

Delete all option

* Added confirmation dialog and changed the placement
* Issue 104

* Updates in Device info section and connectivity tab

* Added a filter as per netUtils interface function

* Updates 104

Removed the data usage from interface and added 3 rows in data usage in device tab.
@twodayslate twodayslate linked an issue Dec 9, 2022 that may be closed by this pull request
.ignoresSafeArea(.all, edges: .horizontal)
)
.ignoresSafeArea()
}.ignoresSafeArea()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just have the relevant changes in the PR

@twodayslate
Copy link
Owner

Please rebase

@iphone201988
Copy link
Contributor Author

https://we.tl/t-OjRjdFyePK already up to date

@@ -10,7 +10,7 @@ struct HostViewSectionFocusView: View {
ScrollView {
HostViewSectionContent(sectionModel: model, canQuery: true)
}
HostBarView(url: url, date: date)
HostBarView(url: url, date: date).background(Color(UIColor.systemGroupedBackground))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HostBarView(url: url, date: date).background(Color(UIColor.systemGroupedBackground))

https://we.tl/t-FPltFCM832 Without background color , it will show like the given screenshot, there will be no background color.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just ignore the safe area?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://we.tl/t-2KPswENwxO attached screenshots , in case we use only the ignore safe area , or even without that there is no background color, but if we want background color , then we need to give background color

@twodayslate
Copy link
Owner

@iphone201988
Copy link
Contributor Author

Does https://twitter.com/natpanferova/status/1590676836488732678?s=46&t=DunNho2WvomMLprYw9b4pw help?

If you check this link ,

Background color also given same as I implemented in snippet.

Please check these screenshots: https://we.tl/t-ujdUL7nHMj
I have added the code as suggested, but we need to provide the background color.

If background color is not provided it will show as: https://we.tl/t-SS3ovvpGF7

@twodayslate
Copy link
Owner

twodayslate commented Dec 29, 2022

This seemed to work for me

diff --git a/ec3730/Views/Host/HostBarView.swift b/ec3730/Views/Host/HostBarView.swift
index 294cbc7..33358a6 100644
--- a/ec3730/Views/Host/HostBarView.swift
+++ b/ec3730/Views/Host/HostBarView.swift
@@ -41,11 +41,6 @@ struct HostBarView: View {
                 Spacer()
             }
         }
-        .background(
-            VisualEffectView(effect: UIBlurEffect(style: .systemMaterial))
-                .ignoresSafeArea(.all, edges: .horizontal)
-        )
-        .ignoresSafeArea()
         .confirmationDialog("Information", isPresented: $showInfo) {
             Button(action: {
                 UIPasteboard.general.string = url.absoluteString
@@ -58,6 +53,10 @@ struct HostBarView: View {
                 Label("Copy Date", systemImage: "doc.on.doc")
             })
         }
+        .background(
+            VisualEffectView(effect: UIBlurEffect(style: .systemMaterial))
+                .ignoresSafeArea()
+        )
     }
 }
 
diff --git a/ec3730/Views/Host/HostViewSectionFocusView.swift b/ec3730/Views/Host/HostViewSectionFocusView.swift
index 5f2f32d..0062999 100644
--- a/ec3730/Views/Host/HostViewSectionFocusView.swift
+++ b/ec3730/Views/Host/HostViewSectionFocusView.swift
@@ -10,10 +10,18 @@ struct HostViewSectionFocusView: View {
                 ScrollView {
                     HostViewSectionContent(sectionModel: model, canQuery: true)
                 }
-                HostBarView(url: url, date: date)
+                .safeAreaInset(edge: .bottom, spacing: 0) {
+                    HostBarView(url: url, date: date)
+                }
             }
             .navigationTitle(model.service.name)
             .navigationBarTitleDisplayMode(.inline)
         }
     }
 }
+
+struct HostViewSectionFocusViewPreview: PreviewProvider {
+    static var previews: some View {
+        HostViewSectionFocusView(model: WhoisXmlDnsSectionModel(), url: URL(string: "https://google.com")!, date: .now)
+    }
+}

@twodayslate
Copy link
Owner

It's also used in HostResult.swift

@iphone201988
Copy link
Contributor Author

Please Suggest , on which ticket we can work upon next

1.#108
Add status progress bar for source view · Issue #108 · twodayslate/NetUtilsgithub.com
2.#101
Create Image enum/extension · Issue #101 · twodayslate/NetUtilsgithub.com
3.#102
Create UserDefaults extensions · Issue #102 · twodayslate/NetUtilsgithub.com
4.#98
Disable navigation to PingSetList if there are no ping sets · Issue #98 · twodayslate/NetUtilsgithub.com
5.#82
Hide host lookup bar on scroll · Issue #82 · twodayslate/NetUtilsgithub.com
6.#111

@iphone201988
Copy link
Contributor Author

It's also used in HostResult.swift

https://we.tl/t-QxHhGQZNh6 This view has tabbar below , please check screenshot, If any updation required let me know.

@twodayslate
Copy link
Owner

Can that use the safe area unset as well?

@twodayslate twodayslate merged commit 13dfa03 into twodayslate:master Jan 3, 2023
iphone201988 added a commit to iphone201988/NetUtils that referenced this pull request Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix safe area observing for example query
4 participants