ebook 源码

时间:2016-10-17 03:44:39
【文件属性】:

文件名称:ebook 源码

文件大小:1.6MB

文件格式:ZIP

更新时间:2016-10-17 03:44:39

ebook 源码

ebook 源码 public class AndroidUtils { public static DisplayMetrics getDisplayMetrics(Context cx) { DisplayMetrics dm = cx.getApplicationContext().getResources().getDisplayMetrics(); return dm; } public static ArrayList> getPageContentStringInfo(Paint m_paint,String content,int pageLines,float pageWidth) { char ch; int w = 0; int istart = 0; int lineNum = 0; ArrayList> contentList = new ArrayList>(); ArrayList cl = null; for (int i = 0; i < content.length(); i++) { if(cl == null) cl = new ArrayList(); ch = content.charAt(i); float[] widths = new float[1]; String srt = String.valueOf(ch); m_paint.getTextWidths(srt, widths); if (ch == '\n') { lineNum++; cl.add(content.substring(istart, i)); istart = i + 1; w = 0; } else { w += (int) (Math.ceil(widths[0])); if (w > pageWidth) { lineNum++; cl.add(content.substring(istart, i)); istart = i; i--; w = 0; } else { if (i == (content.length() - 1)) { lineNum++; cl.add(content.substring(istart, content.length())); } } } if(lineNum==pageLines||i==(content.length()-1)){ contentList.add(cl); cl = null; lineNum = 0; } } return contentList; } public static void setFullNoTitleScreen(Activity context){ context.setTheme(R.style.Theme_Black_NoTitleBar_Fullscreen); context.requestWindowFeature(Window.FEATURE_NO_TITLE); context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } }


【文件预览】:
移动开发者电子报第13期.url
ebook
----ebook()
--------AndroidManifest.xml(618B)
--------res()
--------src()
--------bin()
--------.classpath(280B)
--------assets()
--------default.properties(364B)
--------.settings()
--------.project(841B)
--------gen()
Android开发者必看资料大全.xlsx

网友评论