我正在使用的页面卷曲动画。 我想问Harism,我想如何在所有这些图像被绘制之后更改图像。 例如。我在第一个实例上绘制了10个图像,共10页,现在当我从其他一些活动回来时,我希望根据(现在)新的/修改的数据获得相同的页面以显示修改的10个页面,目前我得到我的新/ modified数据附加到前10页,因此得到20页的结果,而不是10页。 任何使用Curl动画的人都可以帮助我吗? 感谢期待!!
private class BitmapProvider implements CurlView.BitmapProvider {
@Override
public Bitmap getBitmap(int width, int height, int index) {
// LinearLayout linearLayout=(LinearLayout) findViewById(R.id.linearLayout1);
Bitmap b = Bitmap.createBitmap(width,height,
Bitmap.Config.ARGB_8888);
b.eraseColor(Color.BLACK);
Canvas c = new Canvas(b);
TextView textPageCount= new TextView(AllQuotesActivity.this);
textPageCount.setText((index+1) +" of " + (allQuotes.size()));
textPageCount.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM);
textPageCount.setTextColor(Color.WHITE);
textPageCount.setTypeface(Typeface.createFromAsset(getAssets(), "Samba.ttf"));
textPageCount.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
textPageCount.setLayoutParams(new LayoutParams(c.getWidth(),c.getHeight()));
fLayout.addView(textPageCount);
fLayout.setBackgroundColor(Color.BLACK);
fLayout.measure(c.getWidth(), c.getHeight());
fLayout.layout(0, 0, c.getWidth(), c.getHeight());
fLayout.draw(c);
return b;
}
// I actually call all of these instantiating methods while refreshing the CurlView in hopes that it wouldn't Append the Pages and reDraw it.
mCurlView = (CurlView) findViewById(R.id.curl);
mCurlView.sendClassInstance(this);
mCurlView.setBitmapProvider(new BitmapProvider());
mCurlView.setSizeChangedObserver(new SizeChangedObserver());
mCurlView.setCurrentIndex(index);
mCurlView.setAllowLastPageCurl(false);
// mCurlView.setBackgroundColor(0xFF202830);
mCurlView.setBackgroundColor(Color.BLACK);
答案 0 :(得分:0)
您是否尝试将更新的图像直接设置为mBitmapIds int []中的相应索引。