I have problem with Google Maps V3. Basically I have application with HomeActivity (AppCompatActivity). In this activity I have HomeFragment (inherits from Fragment) and now what I want is to have SupportMapFragment from Google Maps library, so inside HomeFragment layout I put
<fragment
android:id="#+id/map"
android:name="com.google.android.libraries.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
In HomeFragment onCreateView callback I have
mapFragment = childFragmentManager.findFragmentById(R.id.map) as SupportMapFragment
mapFragment?.getMapAsync(this)
Map is showing, but the problem is I can't do anything - I mean I can't scroll or zoom this map, it is not responding.
I tried to put MapView instead of whole fragment and map was reacting to gestures. But this solution isn't perfect - for example isMyLocationEnabled doesn't show current location icon and click on button in right upper corner is not moving camera to location (yet callback is called).
Any idea how I can solve this one?
EDIT: Layout code
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="homeVM"
type="viewmodel.home.map.HomeViewModel" />
<variable
name="detailVM"
type="viewmodel.home.map.SheetDetailViewModel" />
<variable
name="shareVM"
type="viewmodel.home.map.HomeSheetShareViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/map"
android:name="com.google.android.libraries.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<FrameLayout
android:id="#+id/sidebarBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:foreground="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.openSidebar()}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:background="#drawable/white_bg_rounded"
android:padding="10dp"
android:tint="#color/warm_grey"
android:src="#drawable/ic_menu_warm_gray_24dp" />
</FrameLayout>
<LinearLayout
android:id="#+id/mapOptionsMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="72dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:animateLayoutChanges="true"
android:background="#drawable/white_bg_rounded"
android:divider="#drawable/line_background_margin_8"
android:orientation="vertical"
android:showDividers="middle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/mapTypeBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.mapType()}"
android:padding="10dp"
android:src="#drawable/ic_layers_warm_gray_24dp"
app:tint="#color/warm_grey" />
<ImageView
android:id="#+id/arBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.onArClick()}"
android:padding="10dp"
android:src="#drawable/ic_ar_warm_grey_24dp"
app:tint="#color/warm_grey" />
<ImageView
android:id="#+id/myTrackerLocationBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.myTrackerLocation()}"
android:padding="10dp"
android:scaleType="fitXY"
android:src="#drawable/ic_navigation_on_warm_gray_24dp"
app:tint="#color/warm_grey" />
<ImageView
android:id="#+id/myLocationBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.myLocation()}"
android:padding="8dp"
android:src="#drawable/ic_navigation_on_warm_gray_24dp"
app:tint="#color/warm_grey" />
</LinearLayout>
<LinearLayout
android:id="#+id/trackerOptionsMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:animateLayoutChanges="true"
android:background="#drawable/white_bg_rounded"
android:divider="#drawable/line_background_margin_8"
android:orientation="vertical"
android:showDividers="middle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/mapOptionsMenu">
<view.AnimatedRefreshImageView
android:id="#+id/refreshBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:onClick="#{(v) -> homeVM.refresh(shareVM.items)}"
app:layout_constraintBottom_toTopOf="#+id/myLocationBtn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/myTrackerLocationBtn"/>
<ImageView
android:id="#+id/supertracking_btn"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="#{(v) -> homeVM.superTracking(shareVM.selected.id)}"
android:padding="10dp"
android:src="#drawable/drawable_superlive" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/trackersSheet"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<activity.home.home.fragments.sheet.TrackersSheet
android:id="#+id/list_sheet"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
bind:items="#{shareVM.items}"
bind:visible="#{shareVM.selected == null}"/>
<activity.home.home.fragments.sheet.DetailSheet
android:id="#+id/detail_sheet"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
bind:isAutoSelect="#{shareVM.isAutoSelect}"
bind:setAutoSelectTracker="#{shareVM.items[0]}"
bind:tracker="#{shareVM.selected}"
bind:viewModel="#{detailVM}"
bind:visible="#{shareVM.selected != null || shareVM.isAutoSelect}">
</activity.home.home.fragments.sheet.DetailSheet>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.github.stkent.amplify.prompt.DefaultLayoutPromptView
android:id="#+id/prompt_view"
android:layout_width="match_parent"
android:layout_height="200dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:prompt_view_background_color="#color/blood_orange"
app:prompt_view_button_corner_radius="15dp"
app:prompt_view_critical_feedback_question_negative_button_label="#string/prompt_view_feedback_negative"
app:prompt_view_critical_feedback_question_positive_button_label="#string/prompt_view_feedback_positive"
app:prompt_view_critical_feedback_question_title="#string/prompt_view_feedback_question_title"
app:prompt_view_positive_feedback_question_negative_button_label="#string/prompt_view_rate_negative"
app:prompt_view_positive_feedback_question_positive_button_label="#string/prompt_view_rate_positive"
app:prompt_view_positive_feedback_question_title="#string/prompt_view_rate_title"
app:prompt_view_thanks_display_time_ms="2000"
app:prompt_view_user_opinion_question_negative_button_label="#string/general_no"
app:prompt_view_user_opinion_question_positive_button_label="#string/general_yes"
app:prompt_view_user_opinion_question_title="#string/prompt_view_question_title" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/productRating"
android:layout_width="match_parent"
android:layout_height="170dp"
android:background="#color/blood_orange"
android:visibility="#{homeVM.productRatingVisibility}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<TextView
android:id="#+id/productRatingTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:text="#string/product_rating_popup_title"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/productRatingMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:text="#string/product_rating_popup_message"
android:textColor="#color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/productRatingTitle" />
<Button
android:id="#+id/productRatingNoBtn"
style="#style/Button.Rounded.Orange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="#string/product_rating_nothanks_btn"
android:onClick="#{(v) -> homeVM.postponeRating()}"
app:layout_constraintEnd_toStartOf="#+id/guideline9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/productRatingMsg" />
<Button
android:id="#+id/productRatingYesBtn"
style="#style/Button.Rounded.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:text="#string/product_rating_answer_btn"
android:onClick="#{(v) -> homeVM.answerRating()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/guideline9"
app:layout_constraintTop_toBottomOf="#+id/productRatingMsg" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Ok, I figured it out. Finally. It wasn't Google Maps SDK issue, but something in code. We got this project in late state of development from other company and I wasn't aware of this.
It was all about this piece of code:
if (view is ViewGroup && !isHomeFragment()) {
view.hideSoftKeyboardOnTouchOutside()
}
fun ViewGroup.hideSoftKeyboardOnTouchOutside() {
this.childrenRecursiveSequence()
.filter { it !is EditText }
.forEach {
it.setOnTouchListener { view, _ ->
view.hideSoftKeyboard()
false
}
}
}
It was executed in base fragment onViewCreated callback on inheriting fragment view. Somehow it didn't affect MapBox map reaction to gestures unlike Google map, which was quite useless in that case.
Related
I've made a custom dialog in androidstudio (Java) but from a certain activity (google maps) the images are not showing, while when calling from another activity (basic activity), the images are showing. i haven't gotten a clue what the difference is between the two.
But when run and called from the app, it looks like this.
While the same dialog started from another activity is showing ok.
What could be the issue here?
This is the XML for that layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="1000dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="20dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/dlg_sa_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/dlg_bckgrnd_action" />
<TextView
android:id="#+id/dlg_sa_tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Starting new Action"
android:textColor="#color/white"
android:textSize="48sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/dlg_sa_btnOk"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginBottom="32dp"
android:background="#drawable/button_dialog"
android:text="Ok"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<Button
android:id="#+id/dlg_sa_btnCancel"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginBottom="32dp"
android:background="#drawable/button_dialog"
android:text="Cancel"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/dlg_sa_tvContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="Dialog Content"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="#+id/dlg_sa_btnCancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/dlg_sa_tvTitle" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/dlg_sa_background"
app:layout_constraintTop_toBottomOf="#+id/dlg_sa_tvTitle"
app:srcCompat="#drawable/purpleline" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
I need to show() the extended FAB and hide() it based on a boolean. I'm using it in a bottom sheet that extends BottomSheetDialogFragment. Problem is that it works when the bottom sheet is in expanded state, but not in the state in which the sheet opens by default. I also observe a strange behavior - the FAB shows by default when the sheet opens, for a fleeting second and disappears. I'm not sure what's causing this behavior. I tried hiding the FAB by default, but it does not work.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_gravity="top"
android:layout_height="match_parent"
android:layout_width="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context=".ui.attendance.employee.selection.EmployeeSelectionBottomSheet">
<TextView
android:id="#+id/copy_to_emp_title"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="wrap_content"
android:paddingBottom="16dp"
android:text="#string/copy_to"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:background="#color/palegrey"
android:id="#+id/copy_to_emp_search_cc"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:paddingBottom="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/copy_to_emp_title"
tools:visibility="visible">
<com.google.android.material.textfield.TextInputLayout
style="#style/TextInputLayoutAppearance"
android:hint="#string/enter_chip_txt"
android:id="#+id/copy_to_emp_search_til"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_width="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<HorizontalScrollView
android:id="#+id/copy_to_emp_hsv"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="503dp">
<com.google.android.material.chip.ChipGroup
android:id="#+id/copy_to_emp_cg"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_constraintBottom_toBottomOf="#+id/copy_to_emp_et"
app:layout_constraintEnd_toStartOf="#+id/copy_to_emp_et"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/copy_to_emp_et" />
<com.google.android.material.textfield.TextInputEditText
android:hint="#string/enter_chip_txt"
android:id="#+id/copy_to_emp_et"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/copy_to_emp_cg"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</HorizontalScrollView>
</com.google.android.material.textfield.TextInputLayout>
<TextView
style="#style/Body14Left4SemiBold"
android:id="#+id/copy_to_emp_filter"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="#string/filter"
app:layout_constraintBottom_toBottomOf="#+id/copy_to_emp_filter_icon"
app:layout_constraintStart_toStartOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toTopOf="#+id/copy_to_emp_filter_icon" />
<ImageView
android:id="#+id/copy_to_emp_filter_icon"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="wrap_content"
android:padding="3dp"
android:src="#{isFilterViewExpanded?#drawable/ic_arrow_up:#drawable/ic_arrow_down}"
app:layout_constraintEnd_toEndOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_search_til"
tools:src="#drawable/ic_arrow_down" />
<TextView
style="#style/Body14Left2Regular"
android:id="#+id/copy_to_emp_category_label"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="wrap_content"
android:text="#string/category"
app:layout_constraintStart_toStartOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_filter" />
<TextView
style="#style/Body14Left2Regular"
android:background="#drawable/rounded_rect_white_5"
android:id="#+id/copy_to_emp_category"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:layout_width="0dp"
android:padding="8dp"
android:text="#string/select_your_filter_category"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_category_label" />
<TextView
style="#style/Body14Left2Regular"
android:id="#+id/copy_to_emp_sub_category_label"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="wrap_content"
android:text="#string/sub_category"
app:layout_constraintStart_toStartOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_category" />
<TextView
style="#style/Body14Left2Regular"
android:background="#drawable/rounded_rect_white_5"
android:id="#+id/copy_to_emp_sub_category"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:layout_width="0dp"
android:padding="8dp"
android:text="#string/select_your_filter_sub_category"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/copy_to_emp_search_til"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_sub_category_label" />
<com.google.android.material.button.MaterialButton
android:id="#+id/copy_to_add_filter_btn"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="wrap_content"
android:text="Add Filter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/copy_to_emp_sub_category" />
<androidx.constraintlayout.widget.Group
android:id="#+id/copy_to_emp_group"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:visibility="#{isFilterViewExpanded?View.VISIBLE:View.GONE}"
app:constraint_referenced_ids="copy_to_emp_sub_category,copy_to_emp_sub_category_label,copy_to_emp_category,copy_to_emp_category_label, copy_to_add_filter_btn"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.chip.ChipGroup
android:id="#+id/copy_to_selected_filter_cg"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_width="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/copy_to_emp_search_cc" />
<TextView
android:id="#+id/copy_to_emp_count_tv"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_width="wrap_content"
android:text="All Employee (264)"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/copy_to_selected_filter_cg" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/copy_to_rv"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:minHeight="60dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/copy_to_emp_count_tv" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:backgroundTint="#color/blueberry"
android:id="#+id/copy_to_apply_changes_btn"
android:layout_gravity="bottom|center_horizontal"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_width="wrap_content"
android:text="Apply changes"
android:textColor="#color/whitetwo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
change ExtendedFloatingActionButton to FloatingActionButton
Add
<com.google.android.material.circularreveal.CircularRevealFrameLayout
/>
</com.google.android.material.circularreveal.CircularRevealFrameLayout>
fab.setOnClickListener {
fab.isExpanded = !fab.isExpanded
}
thats it
I have an activity LoginActivity and a fragment SignupSocialFragment.
The fragment is loaded inside of the FrameLayout inside the activity.
The problem is, that the LinearLayout (social_login_footer) in fragment which is constrained to the bottom of its parent is cut of when the fragment is displayed in the activity.
When I add padding/margin to the social_login_footerI can shift it into view but this does not work reliable.
Can anyone help with why the bottom part is cut of?
Shouldnt the ConstraintLayout match the height of its parent FrameLayout.
Code
activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/login_constraint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorBlack"
tools:context=".ui.login.LoginActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/login_constraint_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:id="#+id/login_lottie_animation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_fileName="background_rotation.json"
app:lottie_loop="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="#+id/login_logo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:adjustViewBounds="true"
android:contentDescription="#string/app_name"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.050000012"
app:srcCompat="#drawable/logo_white" />
<TextView
android:id="#+id/login_logo_subtitle"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="#string/slogan"
android:textColor="#color/colorWhite"
android:textSize="16sp"
android:translationY="-10dp"
app:layout_constraintEnd_toEndOf="#+id/login_logo"
app:layout_constraintStart_toStartOf="#+id/login_logo"
app:layout_constraintTop_toBottomOf="#id/login_logo" />
<FrameLayout
android:id="#+id/login_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
app:layout_constraintTop_toBottomOf="#+id/login_logo_subtitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
fragment_login_social.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#300000CC "
android:paddingStart="32dp"
android:paddingEnd="32dp"
tools:context=".ui.login.SignupSocialFragment">
<TextView
android:id="#+id/login_social_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="32dp"
android:fontFamily="#font/montserrat_light"
android:text="#string/login_subtitle"
android:textAlignment="center"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="#+id/social_login_email"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/social_login_email"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="#string/email_signup_btn"
app:layout_constraintBottom_toTopOf="#+id/social_login_facebook"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/login_social_text" />
<Button
android:id="#+id/social_login_facebook"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
app:icon="#drawable/facebook_logo"
app:iconGravity="textStart"
app:layout_constraintBottom_toTopOf="#+id/social_login_google"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/social_login_email" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/social_login_google"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="16dp"
android:background="#color/colorWhite"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/social_login_facebook">
<TextView
android:id="#+id/social_login_google_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="#string/google_signup_btn"
android:textColor="#android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/social_login_google_logo"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:src="#drawable/googleg_standard_color_18"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/social_login_google_txt"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="#+id/social_login_member"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:padding="4dp"
android:text="#string/already_member"
android:textSize="16sp"
android:clickable="true"
android:focusable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/social_login_google" />
<LinearLayout
android:id="#+id/social_login_footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<TextView
android:id="#+id/login_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/app_version"
android:layout_marginEnd="4dp"
android:textSize="12sp" />
<TextView
android:id="#+id/login_policy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="#string/privacy_link"
android:textSize="12sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Layout blueprints
Rendered on Nexus 5X API 28
After wasting some hours of my precious lifetime I have finally found it.
The problem is caused by the ImageViews android:adjustViewBounds="true" attribute.
After removing it everything works as expected.
Try adding android:fitsSystemWindows="true" to fragment_login_social.xml first child view
I have a layout that looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/main_read_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.project.books.flipview.FlipView
android:id="#+id/flip_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/color_black"
app:orientation="horizontal"
tools:context=".ReadActivity" >
</com.project.books.flipview.FlipView>
<include
android:id="#+id/readingtoolbar"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
layout="#layout/readingbar_layout" />
</android.support.constraint.ConstraintLayout>
The FlipView is a custom Framelayout that has a page turn animation like a book. The user is also able to pinch zoom on each page spread.
The Toolbar below has a selection of crayons. Once a user clicks on a color, an invisible fragment is launched and the user is able to draw on top of the page spread.
This is the toolbar Layout
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/readbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="#color/defaultdark_color"
app:layout_constraintBottom_toBottomOf="parent"
android:elevation="4dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/tabtools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="#drawable/icontools"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/tabdictionary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:layout_marginStart="16dp"
android:src="#drawable/icondictionary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#id/tabtools"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/tabassessment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:alpha="0.3"
android:scaleType="fitXY"
android:src="#drawable/iconassesment"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#id/tabdictionary"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/tabexit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:scaleType="fitXY"
android:src="#drawable/iconclose"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/eraser"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="4dp"
android:src="#drawable/drawingeraser"
android:scaleType="fitXY"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="#id/guide_eraser"
app:layout_constraintBottom_toBottomOf="parent" />
<ImageView
android:id="#+id/crayon_black"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingblack"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_blue"
app:layout_constraintStart_toEndOf="#+id/guide_eraser" />
<ImageView
android:id="#+id/crayon_blue"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingblue"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_green"
app:layout_constraintStart_toEndOf="#+id/crayon_black" />
<ImageView
android:id="#+id/crayon_green"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawinggreen"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_orange"
app:layout_constraintStart_toEndOf="#+id/crayon_blue" />
<ImageView
android:id="#+id/crayon_orange"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingorange"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_pink"
app:layout_constraintStart_toEndOf="#+id/crayon_green" />
<ImageView
android:id="#+id/crayon_pink"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingpink"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_red"
app:layout_constraintStart_toEndOf="#+id/crayon_orange" />
<ImageView
android:id="#+id/crayon_red"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingred"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_violet"
app:layout_constraintStart_toEndOf="#+id/crayon_pink" />
<ImageView
android:id="#+id/crayon_violet"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingviolet"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_white"
app:layout_constraintStart_toEndOf="#+id/crayon_red" />
<ImageView
android:id="#+id/crayon_white"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:src="#drawable/drawingwhite"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/crayon_yellow"
app:layout_constraintStart_toEndOf="#+id/crayon_violet" />
<ImageView
android:id="#+id/crayon_yellow"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:onClick="buttonClicked"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_marginTop="4dp"
android:src="#drawable/drawingyellow"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#id/crayon_white"
app:layout_constraintEnd_toStartOf="#id/guide_center"/>
<ImageView
android:id="#+id/clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/iconreset"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#+id/guide_center"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:visibility="gone"
android:actionProviderClass="android.widget.ShareActionProvider"
android:showAsAction="ifRoom"
android:src="#drawable/iconshare"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/tabexit2"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/tabexit2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:visibility="gone"
android:src="#drawable/iconclose"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Guideline
android:id="#+id/guide_eraser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.1"/>
<android.support.constraint.Guideline
android:id="#+id/guide_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6"/>
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>
The toolbar initially starts out as invisible. If you click anywhere on the page, it should slide out from the bottom. I am able to capture the click event by using the dispatchTouchEvent
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
if (ev!!.action == MotionEvent.ACTION_DOWN) {
startX = ev.x
startY = ev.y
}
if (ev.action == MotionEvent.ACTION_UP){
val endX = ev.x
val endY = ev.y
if (isAClick(startX, endX, startY, endY)) {
onSlideViewButtonClick(reading_toolbar!!)
return true
} else {
return super.dispatchTouchEvent(ev)
}
}
return super.dispatchTouchEvent(ev)
}
So the toolbar slides out but if I click on any crayon on the toolbar, it slides back down which it isn't supposed to do. Basically, what I want is that if the user clicks anywhere else EXCEPT on the toolbar itself, then it should slide back down.
I tried using onTouch so I can pass the view instead of dispatchTouchEvent but I can't seem to capture clicks even with the same logic. I can capture a drag event, though.
class ReadActivity : Activity(), FlipViewAdapter.Callback, FlipView.OnFlipListener, FlipView.OnOverFlipListener, View.OnTouchListener {
...
}
setting
flip_view.setOnTouchListener(this)
testing the click here
override fun onTouch(v: View?, ev: MotionEvent?): Boolean {
println("clicking")
// put actual clicking logic
return true
}
I'm facing a strange situation, I have designed a fragment to include a ScrollView but when i go to another fragment and back from backstack
View is Converted to another view not ScrollView and screen items overlaps
fragment XML:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context="com.eh.waseldriver.TripDetailsFragment"
tools:layout_editor_absoluteY="25dp">
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fillViewport="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/include"
layout="#layout/trip_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"></include>
<Button
android:id="#+id/btn_cancel_trip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
android:background="#drawable/withoutbackgroundcolor"
android:gravity="center"
android:padding="10dip"
android:text="طلب إلغاء الرحله"
android:textColor="#color/md_white_1000"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/recy_decoming_trips"
app:layout_constraintVertical_bias="1.0" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recy_decoming_trips"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/include"
app:layout_constraintEnd_toEndOf="#+id/include"
app:layout_constraintStart_toStartOf="#+id/include"
app:layout_constraintTop_toBottomOf="#+id/include" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
and the below xml code is the another fragment design
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.eh.waseldriver.ReportFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:text="من فضلك إدخل التفاصيل التى تود الابلاغ عنها"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/et_report"
android:layout_width="268dp"
android:layout_height="123dp"
android:layout_marginTop="48dp"
android:ems="10"
android:inputType="textMultiLine"
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView" />
<Button
android:id="#+id/bt_send_report"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginBottom="8dp"
android:background="#drawable/edittext_style"
android:text="إرسال"
android:textColor="#color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
Note that ConstraintLayout Tag is closed but not appearing on the above
also you could check this GIF to see what happens it may help in investigating what is the wrong
GIF Link
I want to know the cause and how to solve it