Commit 52b96bce by Paktalin

Completely replaced progress bar inclusion with fragment

parent 54f4a681
......@@ -25,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -5,14 +5,10 @@ import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.View
import com.google.firebase.auth.FirebaseAuth
import com.paktalin.vocabularynotebook.*
import kotlinx.android.synthetic.main.activity_log_in.*
import com.paktalin.vocabularynotebook.R
import com.paktalin.vocabularynotebook.UserManager
import com.paktalin.vocabularynotebook.fieldsNotEmpty
import com.paktalin.vocabularynotebook.shortToast
class LogInActivity : AppCompatActivity() {
private var mAuth: FirebaseAuth? = null
......@@ -78,9 +74,9 @@ class LogInActivity : AppCompatActivity() {
startActivity(userActivityIntent)
}
private fun showProgressBar() { progress.visibility = View.VISIBLE }
private fun showProgressBar() { addProgressBar(supportFragmentManager, R.id.container_login) }
private fun hideProgressBar() { progress.visibility = View.GONE }
private fun hideProgressBar() { removeProgressBar(supportFragmentManager) }
@SuppressLint("SetTextI18n")
private fun createRandomUser() {
......
......@@ -104,7 +104,7 @@ class MainActivity : AppCompatActivity() {
}
fun addProgressBar() {
addProgressBar(supportFragmentManager, R.id.frameLayout)
addProgressBar(supportFragmentManager, R.id.container_main)
}
fun removeProgressBar() {
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:id="@+id/container_login"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
......@@ -7,11 +8,6 @@
android:layout_height="match_parent"
tools:context=".ui.LogInActivity">
<include
android:id="@+id/progress"
layout="@layout/progress"
android:visibility="gone"/>
<EditText
android:id="@+id/etEmail"
android:layout_width="wrap_content"
......
......@@ -9,17 +9,11 @@
android:background="#66330E">
<FrameLayout
android:id="@+id/frameLayout"
android:id="@+id/container_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/notebook_sheet" />
<include
android:id="@+id/progress"
layout="@layout/progress"
android:visibility="gone" />
</FrameLayout>
<android.support.design.widget.NavigationView
......
......@@ -6,7 +6,7 @@
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frameLayout"
android:id="@+id/container_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/small_margin"
......@@ -42,7 +42,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/frameLayout"
app:layout_constraintTop_toBottomOf="@+id/container_main"
app:layout_constraintVertical_bias="0.0">
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>
\ No newline at end of file
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