Commit 70e56d3c by Paktalin

Keyboard is hidden in MainActivity

parent 52cb61c2
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ui.AddWordActivity"
android:windowSoftInputMode="adjustResize"/>
<activity android:name=".ui.WordItemInfoActivity" /> <activity android:name=".ui.WordItemInfoActivity" />
</application> </application>
......
...@@ -77,8 +77,5 @@ class VocabularyAdapter(private val wordItems: MutableList<WordItem>, private va ...@@ -77,8 +77,5 @@ class VocabularyAdapter(private val wordItems: MutableList<WordItem>, private va
val layout: LinearLayout = itemView.findViewById(R.id.tableLayout) val layout: LinearLayout = itemView.findViewById(R.id.tableLayout)
} }
companion object { companion object { private val TAG = "VN/" + VocabularyAdapter::class.java.simpleName }
private val TAG = "VN/" + VocabularyAdapter::class.java.simpleName
}
} }
\ No newline at end of file
...@@ -28,10 +28,7 @@ class LogInActivity : AppCompatActivity() { ...@@ -28,10 +28,7 @@ class LogInActivity : AppCompatActivity() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
if (mAuth!!.currentUser != null) { if (mAuth!!.currentUser != null) { startUserActivity() }
Log.d(TAG, "there is a logged in user")
startUserActivity()
}
} }
private fun logIn() { private fun logIn() {
......
...@@ -10,6 +10,7 @@ import com.google.firebase.firestore.FirebaseFirestore ...@@ -10,6 +10,7 @@ import com.google.firebase.firestore.FirebaseFirestore
import com.paktalin.vocabularynotebook.R import com.paktalin.vocabularynotebook.R
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import android.view.WindowManager
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
...@@ -18,6 +19,7 @@ class MainActivity : AppCompatActivity() { ...@@ -18,6 +19,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
hideKeyboard()
setUpNavigationView() setUpNavigationView()
extractVocabularyData() extractVocabularyData()
} }
...@@ -54,6 +56,10 @@ class MainActivity : AppCompatActivity() { ...@@ -54,6 +56,10 @@ class MainActivity : AppCompatActivity() {
} }
} }
private fun hideKeyboard() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
}
companion object { companion object {
private val TAG = "VN/" + MainActivity::class.simpleName private val TAG = "VN/" + MainActivity::class.simpleName
} }
......
...@@ -62,24 +62,14 @@ class NewWordFragment : Fragment() { ...@@ -62,24 +62,14 @@ class NewWordFragment : Fragment() {
} }
private fun showAddWordButton() { private fun showAddWordButton() {
Log.d(TAG, "showAddWordButton") activity!!.findViewById<ImageButton>(R.id.btnAddWord).visibility = View.VISIBLE }
activity!!.findViewById<ImageButton>(R.id.btnAddWord).visibility = View.VISIBLE
}
private fun hideAddWordButton() { private fun hideAddWordButton() {
Log.d(TAG, "hideAddWordButton") activity!!.findViewById<ImageButton>(R.id.btnAddWord).visibility = View.GONE }
activity!!.findViewById<ImageButton>(R.id.btnAddWord).visibility = View.GONE
}
private fun hideClearButton() { private fun hideClearButton() { btnClear.visibility = View.GONE }
Log.d(TAG, "hideClearButton")
btnClear.visibility = View.GONE
}
private fun showClearButton() { private fun showClearButton() { btnClear.visibility = View.VISIBLE }
Log.d(TAG, "showClearButton")
btnClear.visibility = View.VISIBLE
}
private fun addWord() { private fun addWord() {
//todo get word data from edit texts and save it //todo get word data from edit texts and save it
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment