<commit_before>package com.navigation.reactnative;

import android.app.Activity;
import android.transition.Transition;
import android.transition.TransitionInflater;
import android.transition.TransitionSet;
import android.view.View;

import java.util.HashMap;
import java.util.HashSet;

public class SharedElementTransitioner {
    private Activity activity;
    private HashSet<String> sharedElements;
    private HashSet<String> loadedSharedElements = new HashSet<>();
    private HashMap<String, Transition> transitions = new HashMap<>();

    public SharedElementTransitioner(Activity activity, HashSet<String> sharedElements) {
        this.activity = activity;
        this.sharedElements = sharedElements;
    }

    public void load(String sharedElement, String transitionKey) {
        if (sharedElements.contains(sharedElement) && !loadedSharedElements.contains(sharedElement)) {
            loadedSharedElements.add(sharedElement);
            if (transitionKey == null)
                transitionKey = "move";
            Transition transition;
            if (transitions.containsKey(transitionKey))
                transition = transitions.get(transitionKey);
            else {
                String packageName = activity.getApplicationContext().getPackageName();
                int transitionId = activity.getResources().getIdentifier(transitionKey, "transition", packageName);
                transition = TransitionInflater.from(activity).inflateTransition(transitionId);
                transitions.put(transitionKey, transition);
            }
            transition.addTarget(sharedElement);
        }
        if(sharedElements.size() == loadedSharedElements.size()) {
            TransitionSet transitionSet = new TransitionSet();
            for(String key : transitions.keySet()) {
                transitionSet.addTransition(transitions.get(key));
            }
            activity.getWindow().setSharedElementEnterTransition(transitionSet  );
            activity.startPostponedEnterTransition();
            View contentView = activity.findViewById(android.R.id.content);
            contentView.getRootView().setTag(R.id.sharedElementTransitioner, null);
        }
    }
}<commit_msg>Tweaked format<commit_after>package com.navigation.reactnative;

import android.app.Activity;
import android.transition.Transition;
import android.transition.TransitionInflater;
import android.transition.TransitionSet;
import android.view.View;

import java.util.HashMap;
import java.util.HashSet;

public class SharedElementTransitioner {
    private Activity activity;
    private HashSet<String> sharedElements;
    private HashSet<String> loadedSharedElements = new HashSet<>();
    private HashMap<String, Transition> transitions = new HashMap<>();

    public SharedElementTransitioner(Activity activity, HashSet<String> sharedElements) {
        this.activity = activity;
        this.sharedElements = sharedElements;
    }

    public void load(String sharedElement, String transitionKey) {
        if (sharedElements.contains(sharedElement) && !loadedSharedElements.contains(sharedElement)) {
            loadedSharedElements.add(sharedElement);
            if (transitionKey == null)
                transitionKey = "move";
            Transition transition;
            if (transitions.containsKey(transitionKey))
                transition = transitions.get(transitionKey);
            else {
                String packageName = activity.getApplicationContext().getPackageName();
                int transitionId = activity.getResources().getIdentifier(transitionKey, "transition", packageName);
                transition = TransitionInflater.from(activity).inflateTransition(transitionId);
                transitions.put(transitionKey, transition);
            }
            transition.addTarget(sharedElement);
        }
        if(sharedElements.size() == loadedSharedElements.size()) {
            TransitionSet transitionSet = new TransitionSet();
            for(String key : transitions.keySet()) {
                transitionSet.addTransition(transitions.get(key));
            }
            activity.getWindow().setSharedElementEnterTransition(transitionSet);
            activity.startPostponedEnterTransition();
            View contentView = activity.findViewById(android.R.id.content);
            contentView.getRootView().setTag(R.id.sharedElementTransitioner, null);
        }
    }
}
{'fraction_non_alphanumeric': 0.09166854820501241, 'fraction_numerical': 0.0, 'mean_word_length': 3.1094619666048238, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '382622', 'n_tokens_mistral': 1033, 'n_tokens_neox': 993, 'n_words': 195}