I found the good harism's project that allows a beautiful paging effect like following link https://github.com/harism/android_page_curl. But works only images,My requirement is to use editText through write data and also save So,kindly give me Suggestion or code. I also visit bellow given link: Android page curl by harism , adding TextView caused and exception : But above link use textView not Edit Text.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
it is so simple. Just replace the loadBitmap method in the CurlActivity with the below method,
private Bitmap loadBitmap(int width, int height, int index) {
Bitmap txtBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
String text1 = yourPagesStringArray[index];
Canvas c = new Canvas(txtBitmap);
TextView tv = new TextView(getApplicationContext());
tv.setText(text1);
tv.setTextColor(0xa00050ff);
tv.setTextSize(15);
tv.setLinksClickable(true);
tv.setLineSpacing(2, 2);
tv.layout(0, 0, getResources().getDisplayMetrics().widthPixels, getResources().getDisplayMetrics().heightPixels);
tv.draw(c);
c.drawBitmap(txtBitmap, 0, 0, null);
return txtBitmap;
}