Commit 70e56d3c by Paktalin

Keyboard is hidden in MainActivity

parent 52cb61c2
......@@ -25,9 +25,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.AddWordActivity"
android:windowSoftInputMode="adjustResize"/>
<activity android:name=".ui.WordItemInfoActivity" />
</application>
......
......@@ -77,8 +77,5 @@ class VocabularyAdapter(private val wordItems: MutableList<WordItem>, private va
val layout: LinearLayout = itemView.findViewById(R.id.tableLayout)
}
companion object {
private val TAG = "VN/" + VocabularyAdapter::class.java.simpleName
}
companion object { private val TAG = "VN/" + VocabularyAdapter::class.java.simpleName }
}
\ No newline at end of file
......@@ -28,10 +28,7 @@ class LogInActivity : AppCompatActivity() {
override fun onStart() {
super.onStart()
if (mAuth!!.currentUser != null) {
Log.d(TAG, "there is a logged in user")
startUserActivity()
}
if (mAuth!!.currentUser != null) { startUserActivity() }
}
private fun logIn() {
......
......@@ -10,6 +10,7 @@ import com.google.firebase.firestore.FirebaseFirestore
import com.paktalin.vocabularynotebook.R
import kotlinx.android.synthetic.main.activity_main.*
import android.view.WindowManager
class MainActivity : AppCompatActivity() {
......@@ -18,6 +19,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
hideKeyboard()
setUpNavigationView()
extractVocabularyData()
}
......@@ -54,6 +56,10 @@ class MainActivity : AppCompatActivity() {
}
}
private fun hideKeyboard() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
}
companion object {
private val TAG = "VN/" + MainActivity::class.simpleName
}
......
......@@ -62,24 +62,14 @@ class NewWordFragment : Fragment() {
}
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() {
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() {
Log.d(TAG, "hideClearButton")
btnClear.visibility = View.GONE
}
private fun hideClearButton() { btnClear.visibility = View.GONE }
private fun showClearButton() {
Log.d(TAG, "showClearButton")
btnClear.visibility = View.VISIBLE
}
private fun showClearButton() { btnClear.visibility = View.VISIBLE }
private fun addWord() {
//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