Skip to content

Commit

Permalink
🚧 Attempted to fix address bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ejaz4 committed Jan 2, 2022
1 parent 5a01bf2 commit 0564be2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:theme="@style/Theme.DotBrowser">
<activity
android:name=".subactivities.AddressBar"
android:windowSoftInputMode="stateVisible"
android:exported="false" />
<activity
android:name=".WelcomeActivity"
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/co/dothq/browser/subactivities/AddressBar.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package co.dothq.browser.subactivities

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
Expand All @@ -15,13 +17,18 @@ import co.dothq.browser.managers.StorageManager
class AddressBar : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.initStatusbar()
setContentView(R.layout.activity_address_bar)
val uri :String = intent.getStringExtra("currentURI").toString();

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

editBox.requestFocus();
val imm = getSystemService(
INPUT_METHOD_SERVICE
) as InputMethodManager
imm.showSoftInput(editBox, 0)
editBox.selectAll()

editBox.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
Expand Down Expand Up @@ -52,4 +59,13 @@ class AddressBar : AppCompatActivity() {
super.onBackPressed()
overridePendingTransition(0, 0)
}

fun initStatusbar() {
if (resources.getString(R.string.mode) == "Day") {
getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
} else {

}
}
}
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_address_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:hint="@string/SEARCH_OR_ENTER_URL_TEXT"
android:inputType="textUri"
android:lines="1"
android:minLines="1"
android:paddingStart="5dp"
Expand All @@ -46,7 +47,8 @@
android:layout_marginLeft="11dp"
android:background="@drawable/invisible_button"
android:orientation="vertical"
android:padding="5sp">
android:padding="5sp"
android:visibility="gone">

<LinearLayout
android:layout_width="20dp"
Expand Down

0 comments on commit 0564be2

Please sign in to comment.