简体   繁体   中英

Stop Android Studio from hiding/shortening code?

This is what I see in Android Studio: 在此处输入图像描述

While this is actually the real code :

public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    if (requestCode != RequestCodes.CRED_HINT || resultCode != Activity.RESULT_OK) { return; }

    setResult(Resource.<User>forLoading());
    final Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);
    final String email = credential.getId();
    ProviderUtils.fetchTopProvider(getAuth(), getArguments(), email)
            .addOnCompleteListener(new OnCompleteListener<String>() {
                @Override
                public void onComplete(@NonNull Task<String> task) {
                    if (task.isSuccessful()) {
                        setResult(Resource.forSuccess(new User.Builder(task.getResult(), email)
                                .setName(credential.getName())
                                .setPhotoUri(credential.getProfilePictureUri())
                                .build()));
                    } else {
                        setResult(Resource.<User>forFailure(task.getException()));
                    }
                }
            });
}

How can I stop Anroid Studio from doing this? And by which rules at all does Android Studio this shortening?

Cant close this as a duplicate of this so I'll just put the answer here (edited) for future reference:

You can disable code folding in the Settings menu of Android Studio, un-tick the "Closures" and "Generic constructor and method parameters" boxes under Editor → General → Code Folding :

在此处输入图像描述

As for the reason the screenshot has the answer, but its set to fold "Closures" which are anonymous inner classes with 1 method as well as "Generic constructor and method parameters" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM