Remove svg-android

This commit is contained in:
seven332 committed 2015-06-08 23:21:15 +08:00
1 parent 683a3d7cb9
commit e4365f7a0e
5 files changed
+15 -96

No files matched your search

@@ -1,61 +0,0 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import com.hippo.app.StatsActivity;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.util.Config;
import com.hippo.util.ViewUtils;
import com.larvalabs.svgandroid.SVG;
import com.larvalabs.svgandroid.SVGBuilder;
import com.larvalabs.svgandroid.SVGParseException;
public class StartActivity extends StatsActivity {
private static final String TAG = StartActivity.class.getSimpleName();
@Override
protected boolean isShowStats() {
return Config.getShowApplicationStats();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
TextView text = (TextView) findViewById(R.id.text_welcome);
try {
SVG svg = new SVGBuilder().readFromResource(getResources(), R.raw.sad_pandroid).build();
ImageView image = (ImageView) findViewById(R.id.image_mascot);
ViewUtils.removeHardwareAccelerationSupport(image);
image.setImageDrawable(svg.getDrawable());
} catch (SVGParseException e) {
// Empty, I think this exception will never be caught.
}
finish();
Intent intent = new Intent(StartActivity.this, ContentActivity.class);
startActivity(intent);
}
}
@@ -34,8 +34,6 @@ import android.widget.TextView;
import com.hippo.effect.ripple.RippleSalon;
import com.hippo.ehviewer.R;
import com.hippo.util.ViewUtils;
import com.larvalabs.svgandroid.SVG;
import com.larvalabs.svgandroid.SVGBuilder;
public class SelectSearchImageLayout extends LinearLayout implements View.OnClickListener{
@@ -93,9 +91,9 @@ public class SelectSearchImageLayout extends LinearLayout implements View.OnClic
RippleSalon.addRipple(mButtonSelect, false);
mButtonSelect.setOnClickListener(this);
ViewUtils.removeHardwareAccelerationSupport(mImagePreview);
SVG svg = new SVGBuilder().readFromResource(getResources(), R.raw.file_image).build();
mImagePreview.setImageDrawable(svg.getDrawable());
//ViewUtils.removeHardwareAccelerationSupport(mImagePreview);
//SVG svg = new SVGBuilder().readFromResource(getResources(), R.raw.file_image).build();
//mImagePreview.setImageDrawable(svg.getDrawable());
}
public void setHelper(SelectSearchImageLayoutHelper helper) {
@@ -110,8 +108,8 @@ public class SelectSearchImageLayout extends LinearLayout implements View.OnClic
if (mSelectedImage != null) {
mImagePreview.setImageBitmap(mSelectedImage);
} else {
SVG svg = new SVGBuilder().readFromResource(getResources(), R.raw.file_image_off).build();
mImagePreview.setImageDrawable(svg.getDrawable());
//SVG svg = new SVGBuilder().readFromResource(getResources(), R.raw.file_image_off).build();
//mImagePreview.setImageDrawable(svg.getDrawable());
}
}
@@ -130,6 +128,8 @@ public class SelectSearchImageLayout extends LinearLayout implements View.OnClic
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (mSelectedPath != null) {
setImagePreview(mSelectedPath);
}
@@ -137,6 +137,8 @@ public class SelectSearchImageLayout extends LinearLayout implements View.OnClic
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (mSelectedImage != null && !mSelectedImage.isRecycled()) {
mSelectedImage.isRecycled();
}