Skip to content

Commit 0564be2

Browse files
committed
🚧 Attempted to fix address bar
1 parent 5a01bf2 commit 0564be2

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

‎app/src/main/AndroidManifest.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
android:theme="@style/Theme.DotBrowser">
1212
<activity
1313
android:name=".subactivities.AddressBar"
14+
android:windowSoftInputMode="stateVisible"
1415
android:exported="false" />
1516
<activity
1617
android:name=".WelcomeActivity"

‎app/src/main/java/co/dothq/browser/subactivities/AddressBar.kt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package co.dothq.browser.subactivities
22

33
import android.app.Activity
4+
import android.content.Context
45
import android.content.Intent
56
import android.os.Bundle
67
import android.view.KeyEvent
78
import android.view.View
9+
import android.view.inputmethod.InputMethodManager
810
import android.widget.EditText
911
import android.widget.Toast
1012
import androidx.appcompat.app.AppCompatActivity
@@ -15,13 +17,18 @@ import co.dothq.browser.managers.StorageManager
1517
class AddressBar : AppCompatActivity() {
1618
override fun onCreate(savedInstanceState: Bundle?) {
1719
super.onCreate(savedInstanceState)
20+
this.initStatusbar()
1821
setContentView(R.layout.activity_address_bar)
1922
val uri :String = intent.getStringExtra("currentURI").toString();
2023

2124
val editBox = findViewById<EditText>(R.id.urlEnterBox);
2225
editBox.setText(uri);
2326

2427
editBox.requestFocus();
28+
val imm = getSystemService(
29+
INPUT_METHOD_SERVICE
30+
) as InputMethodManager
31+
imm.showSoftInput(editBox, 0)
2532
editBox.selectAll()
2633

2734
editBox.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
@@ -52,4 +59,13 @@ class AddressBar : AppCompatActivity() {
5259
super.onBackPressed()
5360
overridePendingTransition(0, 0)
5461
}
62+
63+
fun initStatusbar() {
64+
if (resources.getString(R.string.mode) == "Day") {
65+
getWindow().getDecorView()
66+
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
67+
} else {
68+
69+
}
70+
}
5571
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
android:layout_height="match_parent"
3131
android:background="@android:color/transparent"
3232
android:hint="@string/SEARCH_OR_ENTER_URL_TEXT"
33+
android:inputType="textUri"
3334
android:lines="1"
3435
android:minLines="1"
3536
android:paddingStart="5dp"
@@ -46,7 +47,8 @@
4647
android:layout_marginLeft="11dp"
4748
android:background="@drawable/invisible_button"
4849
android:orientation="vertical"
49-
android:padding="5sp">
50+
android:padding="5sp"
51+
android:visibility="gone">
5052

5153
<LinearLayout
5254
android:layout_width="20dp"

0 commit comments

Comments
 (0)