2
Page Curl 애니메이션을 사용하고 있습니다. 저는 Harris가 모든 이미지가 한 번 그려진 후에 이미지를 어떻게 변경해야하는지 묻고 싶습니다. 예를 들어. 나는 10 개의 이미지를 첫 번째 인스턴스에서 10 페이지로 그린다. 이제 다른 활동에서 돌아 왔을 때 (지금) 새로운/수정 된 데이터에 따라 수정 된 10 페이지를 표시하는 동일한 페이지를 가져오고 싶다. 현재는 새로운/수정 된 데이터가 처음 10 페이지에 추가되어 10 페이지가 아닌 20 페이지가 표시됩니다. Curl 애니메이션으로 작업하는 사람이라면 누구든지이 작업에 도움이 될 수 있습니까? 기대에 감사드립니다 !!페이지 Harris의 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);
우리 모두가 코드를 공유하므로 걱정하지 않아도됩니다. 이것은 개인 포럼이 아닙니다. – codeScriber
죄송 합니다만, 실제로 Curl Activity View의이 메소드를 새로 고침해야하지만 새 페이지를 수정하고 추가 할 때마다 PageCount Text보기가 항상 수정하는 대신 계속 두배로 유지됩니다. 그것? –
어디에서이 라이브러리를 가져 옵니까? 아가씨? 소스 포지? 유료? – codeScriber