@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_svg_demo); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mImageView = (ImageView) findViewById(R.id.iv_image); mButton = (Button) findViewById(R.id.bt_button); mSvg = Sharp.loadResource(getResources(), R.raw.cartman); // If you want to load typefaces from assets: // .withAssets(getAssets()); // If you want to load an SVG from assets: // mSvg = Sharp.loadAsset(getAssets(), "cartman.svg"); mButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { reloadSvg(true); } }); mAttacher = new PhotoViewAttacher(mImageView); mAttacher.setMaximumScale(10f); reloadSvg(false); }
@Override @Deprecated public void setMaxScale(float maxScale) { setMaximumScale(maxScale); }
@Override public void setMaximumScale(float maximumScale) { mAttacher.setMaximumScale(maximumScale); }