Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Progress bar (circle) setVisibility() doesn't exist anymore? (Android Java)

I want to turn my progress bar / circle invisible when the images are loaded on the page, but the setVisibilty() doesn’t exist anymore. What is the subistute, because I couldn’t find anything on the internet.

I wanted to call it after the setAdapter().

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.notes_fragment, container, false);
    BottomNavigationView bottomNav = view.findViewById(R.id.bottomAppBar);
    MaterialToolbar topAppBar = view.findViewById(R.id.topAppBar);
    bottomNav.setSelectedItemId(R.id.notes);
    mProgressCircle = (ProgressBar) view.findViewById(R.id.progress_circle);

    imageList = new ArrayList<>();

    currentUser = mAuth.getCurrentUser();
    mUserRef = storage.getReference().child(currentUser.getEmail());
    gridView = view.findViewById(R.id.gridview);
    mUserRef.listAll().addOnSuccessListener(new OnSuccessListener<ListResult>() {
        @Override
        public void onSuccess(ListResult listResult) {
            for(StorageReference file:listResult.getItems()){
                Log.w(TAG, file.toString());
                file.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                    @Override
                    public void onSuccess(Uri uri) {
                        imageList.add(uri.toString());
                        Log.w(TAG,"URI: " + uri.toString());
                    }
                }).addOnSuccessListener(new OnSuccessListener<Uri>() {
                    @Override
                    public void onSuccess(Uri uri) {
                        adpter = new GridAdapter(getActivity(), imageList);
                        gridView.setAdapter(adpter);
                    }
                });
            }
        }
    });
        android:id="@+id/progress_circle"
        style="@style/Widget.AppCompat.ProgressBar"
        android:layout_width="78dp"
        android:layout_height="83dp"
        android:layout_gravity="center"/>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Can you please post the line with which you try to change the visibility, or do I not see it?
Try to use:

setVisibility(View.INVISIBLE);

Reference:
Android: why setVisibility(View.GONE); or setVisibility(View.INVISIBLE); do not work
Visibility of ProgressBar

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading