<commit_before>package com.davemorrissey.labs.subscaleview;

import android.app.Activity;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.util.Log;
import com.davemorrissey.labs.subscaleview.R.id;

import java.io.FileDescriptor;
import java.io.IOException;

public class DemoActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        try {
            ((SubsamplingScaleImageView)findViewById(id.imageView)).setImageAsset("DSC00266.JPG");
        } catch (IOException e) {
            Log.e(DemoActivity.class.getSimpleName(), "Could not load asset", e);
        }
    }

}<commit_msg>Demo of restoring scale/center on rotate<commit_after>package com.davemorrissey.labs.subscaleview;

import android.app.Activity;
import android.graphics.PointF;
import android.os.Bundle;
import android.util.Log;
import com.davemorrissey.labs.subscaleview.R.id;

import java.io.IOException;

public class DemoActivity extends Activity {

    private static final String STATE_SCALE = "state-scale";
    private static final String STATE_CENTER = "state-center";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try {
            SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(id.imageView);
            imageView.setImageAsset("DSC00266.JPG");

            if (savedInstanceState != null && savedInstanceState.containsKey(STATE_SCALE) && savedInstanceState.containsKey(STATE_CENTER)) {
                imageView.setScaleAndCenter(savedInstanceState.getFloat(STATE_SCALE), (PointF)savedInstanceState.getParcelable(STATE_CENTER));
            }
        } catch (IOException e) {
            Log.e(DemoActivity.class.getSimpleName(), "Could not load asset", e);
        }
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);

        SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(id.imageView);
        outState.putFloat(STATE_SCALE, imageView.getScale());
        outState.putParcelable(STATE_CENTER, imageView.getCenter());
    }
}
{'fraction_non_alphanumeric': 0.09784900885702236, 'fraction_numerical': 0.004217629692113032, 'mean_word_length': 3.860655737704918, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6984558', 'n_tokens_mistral': 706, 'n_tokens_neox': 653, 'n_words': 118}