File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed
java/com/wireguard/android/activity Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 5
5
package com.wireguard.android.activity
6
6
7
7
import android.os.Bundle
8
- import android.view.View
9
- import android.view.ViewGroup
10
- import androidx.core.view.children
11
- import androidx.fragment.app.commit
12
- import com.wireguard.android.fragment.TunnelEditorFragment
8
+ import com.wireguard.android.R
13
9
import com.wireguard.android.model.ObservableTunnel
14
10
15
11
/* *
@@ -18,20 +14,11 @@ import com.wireguard.android.model.ObservableTunnel
18
14
class TunnelCreatorActivity : BaseActivity () {
19
15
override fun onCreate (savedInstanceState : Bundle ? ) {
20
16
super .onCreate(savedInstanceState)
21
- if (supportFragmentManager.findFragmentById(android.R .id.content) == null ) {
22
- supportFragmentManager.commit {
23
- add(android.R .id.content, TunnelEditorFragment ())
24
- }
25
- }
17
+ setContentView(R .layout.tunnel_creator_activity)
26
18
}
27
19
28
20
override fun onSelectedTunnelChanged (oldTunnel : ObservableTunnel ? , newTunnel : ObservableTunnel ? ): Boolean {
29
21
finish()
30
22
return true
31
23
}
32
-
33
- override fun onAttachedToWindow () {
34
- super .onAttachedToWindow()
35
- (findViewById<View ?>(android.R .id.content) as ? ViewGroup )?.children?.firstOrNull()?.fitsSystemWindows = true
36
- }
37
24
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <androidx .coordinatorlayout.widget.CoordinatorLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3
+ xmlns : tools =" http://schemas.android.com/tools"
4
+ android : id =" @+id/main_activity_container"
5
+ android : layout_width =" match_parent"
6
+ android : layout_height =" match_parent"
7
+ android : fitsSystemWindows =" true"
8
+ tools : context =" .activity.TunnelCreatorActivity" >
9
+
10
+ <androidx .fragment.app.FragmentContainerView xmlns : android =" http://schemas.android.com/apk/res/android"
11
+ android : id =" @+id/editor_fragment"
12
+ android : name =" com.wireguard.android.fragment.TunnelEditorFragment"
13
+ android : layout_width =" match_parent"
14
+ android : layout_height =" match_parent" />
15
+ </androidx .coordinatorlayout.widget.CoordinatorLayout>
You can’t perform that action at this time.
0 commit comments