working on txt import
This commit is contained in:
parent
bca7b2f4bb
commit
d1a7c6346f
|
@ -83,11 +83,16 @@
|
||||||
android:label="@string/title_activity_book"
|
android:label="@string/title_activity_book"
|
||||||
android:parentActivityName=".Main2Activity"
|
android:parentActivityName=".Main2Activity"
|
||||||
android:theme="@style/ToolBarTheme.NoActionBar" />
|
android:theme="@style/ToolBarTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".ReadActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
|
||||||
|
android:theme="@style/ToolBarTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Main2Activity"
|
android:name=".Main2Activity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/ToolBarTheme.NoActionBar">
|
android:theme="@style/ToolBarTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
@ -105,11 +110,7 @@
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/ToolBarTheme.NoActionBar">
|
android:theme="@style/ToolBarTheme.NoActionBar">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".ReadActivity"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@style/ToolBarTheme.NoActionBar">
|
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MarkActivity"
|
android:name=".MarkActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
|
|
@ -448,7 +448,8 @@ public class PageFactory {
|
||||||
|
|
||||||
//向前翻页
|
//向前翻页
|
||||||
public void prePage(){
|
public void prePage(){
|
||||||
if (currentPage.getBegin() <= 0) {
|
m_isfirstPage = false;
|
||||||
|
if (currentPage.getBegin() <= 1) {
|
||||||
Log.d(TAG,"当前是本章第一页");
|
Log.d(TAG,"当前是本章第一页");
|
||||||
m_isfirstPage =currentChapter ==1;
|
m_isfirstPage =currentChapter ==1;
|
||||||
if ( m_isfirstPage){
|
if ( m_isfirstPage){
|
||||||
|
@ -466,6 +467,7 @@ public class PageFactory {
|
||||||
|
|
||||||
//向后翻页
|
//向后翻页
|
||||||
public void nextPage(){
|
public void nextPage(){
|
||||||
|
m_islastPage = false;
|
||||||
if (currentPage.getEnd() >= mBookUtil.getBookLen()) {
|
if (currentPage.getEnd() >= mBookUtil.getBookLen()) {
|
||||||
Log.d(TAG,"已经是本章最后一页了");
|
Log.d(TAG,"已经是本章最后一页了");
|
||||||
|
|
||||||
|
@ -584,8 +586,10 @@ public class PageFactory {
|
||||||
trPage.setEnd(mBookUtil.getPosition());
|
trPage.setEnd(mBookUtil.getPosition());
|
||||||
return trPage;
|
return trPage;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int nextPageNo =currentPage.getPageNo();
|
int nextPageNo =currentPage.getPageNo();
|
||||||
if(nextPageNo == currentChaptPages.size()){
|
Log.e(TAG,"currentChaptPages.size() is " + currentChaptPages.size() +", currentpage pageno is " + nextPageNo);
|
||||||
|
if(nextPageNo >= currentChaptPages.size()){
|
||||||
preChaptPages =currentChaptPages;
|
preChaptPages =currentChaptPages;
|
||||||
currentChapter++;
|
currentChapter++;
|
||||||
mBookUtil.setChapterNo(currentChapter);
|
mBookUtil.setChapterNo(currentChapter);
|
||||||
|
|
|
@ -147,6 +147,7 @@ public class PageWidget extends View {
|
||||||
isRuning = false;
|
isRuning = false;
|
||||||
mAnimationProvider.setStartPoint(downX,downY);
|
mAnimationProvider.setStartPoint(downX,downY);
|
||||||
abortAnimation();
|
abortAnimation();
|
||||||
|
mAnimationProvider.setCancel(false);
|
||||||
Log.e(TAG,"ACTION_DOWN");
|
Log.e(TAG,"ACTION_DOWN");
|
||||||
}else if (event.getAction() == MotionEvent.ACTION_MOVE){
|
}else if (event.getAction() == MotionEvent.ACTION_MOVE){
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class SimulationAnimation extends AnimationProvider {
|
||||||
float array[] = { 1, 0, 0, 0, 0,
|
float array[] = { 1, 0, 0, 0, 0,
|
||||||
0, 1, 0, 0, 0,
|
0, 1, 0, 0, 0,
|
||||||
0, 0,1, 0, 0,
|
0, 0,1, 0, 0,
|
||||||
0, 0, 0, 1, 0 };
|
0, 0.2f, 0.2f, 1, 0 };
|
||||||
cm.set(array);
|
cm.set(array);
|
||||||
mColorMatrixFilter = new ColorMatrixColorFilter(cm);
|
mColorMatrixFilter = new ColorMatrixColorFilter(cm);
|
||||||
mMatrix = new Matrix();
|
mMatrix = new Matrix();
|
||||||
|
@ -88,7 +88,7 @@ public class SimulationAnimation extends AnimationProvider {
|
||||||
calcPoints();
|
calcPoints();
|
||||||
drawCurrentPageArea(canvas, mCurPageBitmap, mPath0);
|
drawCurrentPageArea(canvas, mCurPageBitmap, mPath0);
|
||||||
drawNextPageAreaAndShadow(canvas, mNextPageBitmap);
|
drawNextPageAreaAndShadow(canvas, mNextPageBitmap);
|
||||||
drawCurrentPageShadow(canvas);
|
// drawCurrentPageShadow(canvas); //去除阴影
|
||||||
drawCurrentBackArea(canvas, mCurPageBitmap);
|
drawCurrentBackArea(canvas, mCurPageBitmap);
|
||||||
}else{
|
}else{
|
||||||
calcPoints();
|
calcPoints();
|
||||||
|
@ -304,13 +304,13 @@ public class SimulationAnimation extends AnimationProvider {
|
||||||
mMatrix.setValues(mMatrixArray);
|
mMatrix.setValues(mMatrixArray);
|
||||||
mMatrix.preTranslate(-mBezierControl1.x, -mBezierControl1.y);
|
mMatrix.preTranslate(-mBezierControl1.x, -mBezierControl1.y);
|
||||||
mMatrix.postTranslate(mBezierControl1.x, mBezierControl1.y);
|
mMatrix.postTranslate(mBezierControl1.x, mBezierControl1.y);
|
||||||
|
// mPaint.setAlpha(0x90);
|
||||||
canvas.drawBitmap(bitmap, mMatrix, mPaint);
|
canvas.drawBitmap(bitmap, mMatrix, mPaint);
|
||||||
// canvas.drawBitmap(bitmap, mMatrix, null);
|
// canvas.drawBitmap(bitmap, mMatrix, null);
|
||||||
mPaint.setColorFilter(null);
|
mPaint.setColorFilter(null);
|
||||||
|
|
||||||
canvas.rotate(mDegrees, mBezierStart1.x, mBezierStart1.y);
|
canvas.rotate(mDegrees, mBezierStart1.x, mBezierStart1.y);
|
||||||
mFolderShadowDrawable.setBounds(left, (int) mBezierStart1.y, right,
|
mFolderShadowDrawable.setBounds(left, (int) mBezierStart1.y, right, (int) (mBezierStart1.y + mMaxLength));
|
||||||
(int) (mBezierStart1.y + mMaxLength));
|
|
||||||
mFolderShadowDrawable.draw(canvas);
|
mFolderShadowDrawable.draw(canvas);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
@ -481,9 +481,9 @@ public class SimulationAnimation extends AnimationProvider {
|
||||||
|
|
||||||
canvas.save();
|
canvas.save();
|
||||||
if(Build.VERSION.SDK_INT >= 26){
|
if(Build.VERSION.SDK_INT >= 26){
|
||||||
canvas.clipPath(path);
|
// canvas.clipPath(path); //将正面变空白了
|
||||||
}else {
|
}else {
|
||||||
canvas.clipPath(path, Region.Op.XOR);
|
// canvas.clipPath(path, Region.Op.XOR); //未试过,低版本手机上效果如何?
|
||||||
}
|
}
|
||||||
canvas.drawBitmap(bitmap, 0, 0, null);
|
canvas.drawBitmap(bitmap, 0, 0, null);
|
||||||
try {
|
try {
|
||||||
|
@ -650,5 +650,4 @@ public class SimulationAnimation extends AnimationProvider {
|
||||||
CrossP.y = a1 * CrossP.x + b1;
|
CrossP.y = a1 * CrossP.x + b1;
|
||||||
return CrossP;
|
return CrossP;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue