Skip to content

Commit 133f4ad

Browse files
committed
🚧 Added open in browser button.
1 parent a09d9a9 commit 133f4ad

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎app/src/main/java/co/dothq/browser/BrowserActivity.kt‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,19 @@ class BrowserActivity : AppCompatActivity() {
115115
}
116116

117117
fun deepLinkActivitySetup() {
118-
val deepLinkCloseButton = findViewById<LinearLayout>(R.id.closeButtonDeeplink);
118+
val deeplinkHeader = findViewById<LinearLayout>(R.id.deeplinkAddressBar);
119+
val browserHeader = findViewById<LinearLayout>(R.id.normalAddressbar);
119120

120-
deepLinkCloseButton.setOnClickListener {
121+
val deeplinkCloseButton = findViewById<LinearLayout>(R.id.closeButtonDeeplink);
122+
val deeplinkOpenInBrowserButton = findViewById<LinearLayout>(R.id.openInBrowserButtonDeeplink);
123+
124+
deeplinkCloseButton.setOnClickListener {
121125
finish()
122126
}
127+
128+
deeplinkOpenInBrowserButton.setOnClickListener {
129+
browserHeader.visibility = View.VISIBLE;
130+
deeplinkHeader.visibility = View.GONE;
131+
}
123132
}
124133
}

‎app/src/main/res/layout/activity_main.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
</LinearLayout>
9494

9595
<LinearLayout
96+
android:id="@+id/openInBrowserButtonDeeplink"
9697
android:layout_width="40dp"
9798
android:layout_height="match_parent"
9899
android:layout_margin="2dp"

0 commit comments

Comments
 (0)