diff --git a/app/build.gradle b/app/build.gradle index f388969d..b539e8f0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -89,7 +89,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'com.google.android.material:material:1.2.0-alpha06' + implementation 'com.google.android.material:material:1.3.0-alpha01' implementation 'androidx.cardview:cardview:1.0.0' implementation 'com.google.firebase:firebase-auth:19.2.0' implementation 'com.firebaseui:firebase-ui-auth:6.2.0' @@ -113,7 +113,7 @@ dependencies { implementation 'com.thefinestartist:finestwebview:1.2.7' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'com.jakewharton.threetenabp:threetenabp:1.1.2' - implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha02' + implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03' implementation 'com.github.bumptech.glide:glide:4.11.0' kapt 'com.github.bumptech.glide:compiler:4.11.0' implementation 'com.google.firebase:firebase-analytics:17.2.1' diff --git a/app/src/main/java/com/druger/aboutwork/fragments/AddReviewFragment.kt b/app/src/main/java/com/druger/aboutwork/fragments/AddReviewFragment.kt index 586e97c5..3d05a1cf 100644 --- a/app/src/main/java/com/druger/aboutwork/fragments/AddReviewFragment.kt +++ b/app/src/main/java/com/druger/aboutwork/fragments/AddReviewFragment.kt @@ -23,6 +23,8 @@ import com.druger.aboutwork.model.Review import com.druger.aboutwork.model.Vacancy import com.druger.aboutwork.presenters.AddReviewPresenter import com.druger.aboutwork.utils.Utils +import com.google.android.material.transition.MaterialArcMotion +import com.google.android.material.transition.MaterialContainerTransform import kotlinx.android.synthetic.main.content_review.* import kotlinx.android.synthetic.main.toolbar_review.* import moxy.presenter.InjectPresenter @@ -55,6 +57,13 @@ class AddReviewFragment : ReviewFragment(), AdapterView.OnItemSelectedListener, private const val COMPANY_NAME = "companyName" } + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + sharedElementEnterTransition = MaterialContainerTransform().apply { + setPathMotion(MaterialArcMotion()) + } + } + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { rootView = inflater.inflate(R.layout.fragment_review, container, false) getData(savedInstanceState) diff --git a/app/src/main/java/com/druger/aboutwork/fragments/CompaniesFragment.kt b/app/src/main/java/com/druger/aboutwork/fragments/CompaniesFragment.kt index fde78648..319c9c59 100644 --- a/app/src/main/java/com/druger/aboutwork/fragments/CompaniesFragment.kt +++ b/app/src/main/java/com/druger/aboutwork/fragments/CompaniesFragment.kt @@ -13,7 +13,6 @@ import com.druger.aboutwork.interfaces.OnItemClickListener import com.druger.aboutwork.interfaces.view.CompaniesView import com.druger.aboutwork.model.Review import com.druger.aboutwork.presenters.CompaniesPresenter -import com.google.android.material.transition.Hold import kotlinx.android.synthetic.main.fragment_companies.* import kotlinx.android.synthetic.main.network_error.* import kotlinx.android.synthetic.main.no_reviews.* @@ -35,11 +34,6 @@ class CompaniesFragment : BaseSupportFragment(), CompaniesView { @ProvidePresenter internal fun provideCompaniesPresenter() = CompaniesPresenter() - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - exitTransition = Hold() - } - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { rootView = inflater.inflate(R.layout.fragment_companies, container, false) @@ -129,7 +123,7 @@ class CompaniesFragment : BaseSupportFragment(), CompaniesView { private fun showSelectedReview(id: String) { val fragment = SelectedReviewFragment.newInstance(id, false) - replaceFragment(fragment, R.id.main_container, true, rvLastReviews) + replaceFragment(fragment, R.id.main_container, true) } override fun showProgress(show: Boolean) { diff --git a/app/src/main/java/com/druger/aboutwork/fragments/CompanyDetailFragment.kt b/app/src/main/java/com/druger/aboutwork/fragments/CompanyDetailFragment.kt index 90639e8e..fc3f45d8 100644 --- a/app/src/main/java/com/druger/aboutwork/fragments/CompanyDetailFragment.kt +++ b/app/src/main/java/com/druger/aboutwork/fragments/CompanyDetailFragment.kt @@ -21,6 +21,7 @@ import com.druger.aboutwork.interfaces.view.CompanyDetailView import com.druger.aboutwork.model.CompanyDetail import com.druger.aboutwork.model.Review import com.druger.aboutwork.presenters.CompanyDetailPresenter +import com.google.android.material.transition.Hold import com.thefinestartist.finestwebview.FinestWebView import kotlinx.android.synthetic.main.content_company_detail.* import kotlinx.android.synthetic.main.fragment_company_detail.* @@ -44,6 +45,11 @@ class CompanyDetailFragment : BaseSupportFragment(), CompanyDetailView, @ProvidePresenter internal fun provideCompanyDetailPresenter() = CompanyDetailPresenter() + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + exitTransition = Hold() + } + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { rootView = inflater.inflate(R.layout.fragment_company_detail, container, false) @@ -135,7 +141,7 @@ class CompanyDetailFragment : BaseSupportFragment(), CompanyDetailView, companyDetail?.id?.let { id -> companyDetail?.name?.let { name -> val review = AddReviewFragment.newInstance(id, name) - replaceFragment(review, R.id.main_container, true) + replaceFragment(review, R.id.main_container, true, fabAddReview) } } } diff --git a/app/src/main/java/com/druger/aboutwork/fragments/SelectedReviewFragment.kt b/app/src/main/java/com/druger/aboutwork/fragments/SelectedReviewFragment.kt index 165c5eec..d47f8201 100644 --- a/app/src/main/java/com/druger/aboutwork/fragments/SelectedReviewFragment.kt +++ b/app/src/main/java/com/druger/aboutwork/fragments/SelectedReviewFragment.kt @@ -29,7 +29,6 @@ import com.druger.aboutwork.model.Comment import com.druger.aboutwork.model.Review import com.druger.aboutwork.presenters.SelectedReviewPresenter import com.druger.aboutwork.utils.Utils -import com.google.android.material.transition.MaterialContainerTransform import com.google.firebase.auth.FirebaseUser import com.google.firebase.storage.StorageReference import kotlinx.android.synthetic.main.content_selected_review.* @@ -61,9 +60,6 @@ class SelectedReviewFragment : BaseSupportFragment(), SelectedReview { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - sharedElementEnterTransition = MaterialContainerTransform().apply { - duration = 450 - } photoAdapter = PhotoAdapter(mutableListOf(),false) } diff --git a/app/src/main/res/layout/fragment_companies.xml b/app/src/main/res/layout/fragment_companies.xml index cf1a18e6..379d71bb 100644 --- a/app/src/main/res/layout/fragment_companies.xml +++ b/app/src/main/res/layout/fragment_companies.xml @@ -48,7 +48,6 @@ android:layout_height="0dp" android:layout_marginTop="8dp" android:scrollbars="vertical" - android:transitionName="shared_element_container" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_company_detail.xml b/app/src/main/res/layout/fragment_company_detail.xml index fbf9230a..b919962d 100644 --- a/app/src/main/res/layout/fragment_company_detail.xml +++ b/app/src/main/res/layout/fragment_company_detail.xml @@ -29,10 +29,11 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" - app:srcCompat="@drawable/ic_add" - app:tint="@null" + android:transitionName="shared_element_container" app:backgroundTint="@color/colorAccent" - app:layout_behavior=".utils.recycler.ScrollAwareFABBehavior"/> + app:layout_behavior=".utils.recycler.ScrollAwareFABBehavior" + app:srcCompat="@drawable/ic_add" + app:tint="@null" /> diff --git a/app/src/main/res/layout/fragment_review.xml b/app/src/main/res/layout/fragment_review.xml index 86703163..8086b6ff 100644 --- a/app/src/main/res/layout/fragment_review.xml +++ b/app/src/main/res/layout/fragment_review.xml @@ -1,6 +1,7 @@ + android:layout_height="match_parent" + android:transitionName="shared_element_container"> diff --git a/app/src/main/res/layout/fragment_selected_review.xml b/app/src/main/res/layout/fragment_selected_review.xml index 83b06e84..a98393de 100644 --- a/app/src/main/res/layout/fragment_selected_review.xml +++ b/app/src/main/res/layout/fragment_selected_review.xml @@ -1,7 +1,6 @@ + android:layout_height="match_parent">