Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当某些视图的可见性状态从View.VISIBLE更改为View.Goe并返回View.VISIBLE时,整个布局将消失_Android_Androidx - Fatal编程技术网

Android 当某些视图的可见性状态从View.VISIBLE更改为View.Goe并返回View.VISIBLE时,整个布局将消失

Android 当某些视图的可见性状态从View.VISIBLE更改为View.Goe并返回View.VISIBLE时,整个布局将消失,android,androidx,Android,Androidx,当在末尾调用View.VISIBLE时,整个布局将消失 这是在我将我的项目升级到androidx之后开始的。我只在牛轧糖前版本的android上面临这个问题 我正在更改id为“@+id/RecyclerViewU容器”的ContrainLayout的可见性状态 和id为“@+id/done_Button”的按钮 我在下面分享了我的XML文件的内容 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http:/

当在末尾调用View.VISIBLE时,整个布局将消失

这是在我将我的项目升级到androidx之后开始的。我只在牛轧糖前版本的android上面临这个问题

我正在更改id为“@+id/RecyclerViewU容器”的ContrainLayout的可见性状态 和id为“@+id/done_Button”的按钮

我在下面分享了我的XML文件的内容

<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="@color/white"
tools:context="com.ts.marham_connect.fragments.extendedprofile.AreaOfInterestFragment">

<ScrollView
    android:id="@+id/scroll_view"
    android:layout_width="match_parent"
    android:layout_height="@dimen/zero"
    app:layout_constraintBottom_toTopOf="@+id/done_button"
    app:layout_constraintTop_toTopOf="parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/recyclerview_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:layout_marginBottom="@dimen/fifteen">


        <TextView
            android:id="@+id/areas_of_interest"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/thirty"
            android:layout_marginTop="@dimen/twenty"
            android:text="Areas of Interest"
            android:textColor="@color/grey_1"
            android:textSize="@dimen/twenty_text"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/sub_heading_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/thirty"
            android:layout_marginTop="@dimen/ten"
            android:text="Add areas of your interest to attract patients(Only 4)"
            android:textColor="@color/text_color"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/areas_of_interest" />


        <TextView
            android:id="@+id/add_your_interest_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/thirty"
            android:layout_marginTop="@dimen/thirty"
            android:text="Add New Interest"
            android:textColor="@color/colorPrimary"
            android:textSize="@dimen/seventeen_text_size"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/sub_heading_textview" />


        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/specialities_recyclerview"
            android:layout_width="@dimen/zero"
            android:layout_height="250dp"
            android:layout_marginStart="@dimen/thirty"
            android:layout_marginTop="@dimen/five"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/add_your_interest_text_view" />


    </androidx.constraintlayout.widget.ConstraintLayout>


</ScrollView>


<MyButton
    android:id="@+id/done_button"
    android:layout_width="110dp"
    android:layout_height="@dimen/confirm_button_height"
    android:layout_marginStart="@dimen/thirty"
    android:layout_marginBottom="@dimen/thirty"
    android:background="@drawable/draw_body_green_button_circular_corners"
    android:drawableRight="@drawable/vector_icon_arrow_right_white_2"
    android:gravity="left|center_vertical"
    android:paddingStart="@dimen/fifteen"
    android:paddingEnd="@dimen/fifteen"
    android:text="@string/next"
    android:textColor="@color/white"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent" />


<include
    android:id="@+id/central_retry_button_container"
    layout="@layout/layout_central_retry_button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:visibility="gone"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />


<include
    android:id="@+id/central_progress_bar_container"
    layout="@layout/layout_progress_bar"
    android:layout_width="@dimen/fifty"
    android:layout_height="@dimen/fifty"
    android:visibility="gone"

    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

package com.ts.marham_connect.fragments.extendedprofile;
导入android.app.Dialog;
导入android.content.Context;
导入android.os.Bundle;
导入android.view.LayoutInflater;
导入android.view.view;
导入android.view.ViewGroup;
导入android.view.Window;
导入android.widget.EditText;
导入android.widget.TextView;
导入android.widget.Toast;
导入androidx.constraintlayout.widget.constraintlayout;
导入androidx.recyclerview.widget.LinearLayoutManager;
导入androidx.recyclerview.widget.recyclerview;
兴趣片段的公共类AreaOfInterestFragment扩展了BaseFragment实现了View.OnClickListener、ServerConnectListener、AdapterServiceItemClickedListener{
私有约束Layout RecycleServiceContainer;
私有文本视图添加您的兴趣文本视图;
私人回收视图专业软件回收视图;
私有视图中央程序栏;
私有视图中央按钮;
私人MyButton doneButton;
私有警报窗口警报窗口;
私人专业适应性专业适应性;
私有列表specialityList=新的ArrayList();
私有FragmentInteractionListener FragmentInteractionListener;
私人语境;
兴趣片段的公共区域(){
}
兴趣片段newInstance()的公共静态区域{
返回新的AreaOfInterestFragment();
}
@凌驾
创建时的公共void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
@凌驾
创建视图上的公共视图(布局、充气机、视图组容器、,
Bundle savedInstanceState){
视图=充气机。充气(R.layout.fragment\u area\u-of-interest,container,false);
初始视图(视图);
setListeners();
getSpecialities();
返回视图;
}
@凌驾
公共void-onAttach(上下文){
super.onAttach(上下文);
this.context=上下文;
}
@凌驾
公共void onClick(视图){
开关(view.getId()){
案例R.id.retry\u按钮\u容器:
getSpecialities();
打破
案例R.id.添加\您的\兴趣\文本\视图:
如果(选择了列表大小和最小尺寸(4)){
dialog.show();
}否则{
alertWindow=new alertWindow(上下文,getString(当用户尝试选择超出允许范围的内容时,R.string.msg));
alertWindow.show();
}
打破
案例R.id.done_按钮:
如果(被选为列表大小不一致(4)){
提交专业列表();
}否则{
alertWindow=新的alertWindow(上下文,getString(当用户不感兴趣的区域时R.string.msg));
alertWindow.show();
}
打破
}
}
@凌驾
已单击DatViewItem上的公共无效(int位置){
if(specialityList.get(position).getChecked().equals(“1”)){
specialityList.get(位置).setChecked(“0”);
专业适应。通知项目变更(职位);
}否则{
如果(选择了列表大小和最小尺寸(4)){
specialityList.get(位置).setChecked(“1”);
专业适应。通知项目变更(职位);
}否则{
alertWindow=new alertWindow(上下文,getString(当用户尝试选择超出允许范围的内容时,R.string.msg));
alertWindow.show();
}
}
}
@凌驾
已单击DatViewItem上的公共void(int位置,int请求ID){
}
私有void initViews(视图){
recyclerViewContainer=view.findViewById(R.id.RecyclerViewU容器);
addYourInterestTextView=view.findViewById(R.id.add\u your\u interest\u text\u视图);
specialitiesRecyclerView=view.findViewById(R.id.specialities\u recyclerview);
centralProgreeBar=view.findViewById(R.id.central\u progress\u bar\u容器);
centralRetryButton=view.findViewById(R.id.central\u retry\u button\u容器);
doneButton=view.findViewById(R.id.done_按钮);
SetupSpecialisteSRecyclView();
setUpAlertDialog();
}
私有void setListeners(){
centralRetryButton.setOnClickListener(此);
addYourInterestTextView.setOnClickListener(此);
doneButton.setOnClickListener(这个);
}
public void setFragmentInteractionListener(FragmentInteractionListener FragmentInteractionListener){
this.fragmentInteractionListener=fragmentInteractionListener;
}
私有void setupSpecialistesRecyclServiceView(){
LinearLayoutManager LinearLayoutManager=新的LinearLayoutManager(上下文);
linearLayoutManager.setOrientation(linearLayoutManager.VERTICAL);
SpecialitiesRecyclServiceView.setLayoutManager(linearLayoutManager);
SpecialityAdapter=新SpecialityAdapter(specialityList,this);
SpecialitiesRecyclServiceView.setAdapter(specialitiesAdapter);
}
私有void upDateProfileCompletionObject(){
ProfileCompletion ProfileCompletion=(ProfileCompletion)SharedReferenceHelper.getInstance().GetSharedReferenceObject(上下文,AppConstants.PROFILE\u COMPLETION\u对象,ProfileCompletion.class);
profileCompletion.setAreasOfInterest(context.getString(R.string.one));
SharedReferenceHelper.getInstance()。