基于Android平台的手机电子书阅读器代码
package com.lrc.view;
/**
* 书籍阅读
*/
import java.io.IOException;
import flect.Array;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import Matcher;
import Pattern;
import com.lrc.R;
import com.lrc.bll.BookPageFactory;
import com.lrc.bll.DbDataOperation;
import com.lrc.bll.DbTags;
import com.lrc.bll.PageWidget;
import com.lrc.util.ArrayUtil;
import com.lrc.util.BgUtil;
import com.lrc.util.MathUtil;
import com.lrc.util.TimeUtil;
import android.app.Activity;
import android.app.AlertDialog;
t.ContentResolver;
t.ContentValues;
t.DialogInterface;
t.Intent;
aphics.Bitmap;
aphics.Canvas;
aphics.Color;
import android.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Toast;
public class BookReadActivity extends Activity
{
private PageWidget mPageWidget;
Bitmap mCurPageBitmap, mNextPageBitmap;
Canvas mCurPageCanvas, mNextPageCanvas;
public static BookPageFactory pagefactory;
int screenWidth ,screenHeight;
如何阅读java源码 int bookId;
String bookPath,bookName,bookProgress;
private int bookBeginPosition;
//db
private ContentResolver resolver;
//tabMenu
public final static int TITLE_USING_OFTEN = 0;
public final static int TITLE_TOOLS = 1;
public final static int MENU_FONT_SIZE = 0;
public final static int MENU_READ_THEME = 1;
public final static int MENU_BRIGHTNESS_CONTROL = 2;
public final static int MENU_FLIP_OVER = 3;
public final static int MENU_JUMP = 4;
public final static int MENU_SEARCH = 5;
public final static int MENU_PRE_CHAPTER = 6;
public final static int MENU_NEXT_CHAPTER= 7;
public final static int MENU_CUSTOM_THEME = 0;
public final static int MENU_AUDIO_BOOK = 1;
public final static int MENU_BOOK_CHAPTER = 2;
public final static int MENU_BOOK_CODE = 3;
public final static int MENU_BOOK_MARK = 4;
public final static int MENU_SETTING = 5;
public final static int MENU_SHARE = 6;
public final static int MENU_BACK = 7;
TabMenu.MenuBodyAdapter []bodyAdapter=new TabMenu.MenuBodyAdapter[2];
TabMenu.MenuTitleAdapter titleAdapter;
TabMenu tabMenu;
int selTitle=0;
PopupWindow popupWindow;
//定义每项分页栏的内容
String[] title1BodyName , title2BodyName;
int[] title1BodyIcon , title2BodyIcon;
private SeekBar sbFontSize,sbBrightnessControl,sbJump;
//menu jump
private TextView tvCurrentProgress ;
private ImageButton ibtnJumpUp,ibtnJumpDown;
//flip over
private Handler readHandler = new Handler();
private FlipOverRunnable flipOverRunnable = new FlipOverRunnable();
private boolean isRead = true;
//menu custom theme
private SeekBar redForegroundSeekBar,greenForegroundSeekBar,blueForegroundSeekBar,
redBackgroundSeekBar,greenBackgroundSeekBar,blueBackgroundSeekBar;
int currentProgress;
private TextView fontColorTxt,backgroundColorTxt,themeStyleTxt ;
private int redForegoundProgress,greenForegroundProgress,blueForegroundProgress,
redBackgoundProgress,greenBackgroundProgress,blueBackgroundProgress;
private String foreColor,foreR="00",foreG="00",foreB="00",backColor,backR="00",backG="00",backB="00";
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论