FBReader SDK for Android: API changes in version 1.2.0

Class org.fbreader.text.widget.TextWidget

  • The method pageInText returns null if the book is not loaded yet. Recently, it returned the fake value (1, 1).
  • The method getBackgroundColor has gone. Use ColorProfile.backgroundColor() instead.
  • The new method boolean showsTwoPages(). To change it's value, use the ViewOptions.twoColumnView option.
  • The method int scrollbarType() has been replaced with ViewOptions.ProgressIndicatorType progressIndicatorType().

Class org.fbreader.util.ColorUtil

  • Renamed the method: long getAverageColor(Bitmap) to long averageColor(Bitmap).

Class org.fbreader.view.options.ColorProfile

  • Added the method boolean isLight; it detects if the text colour is darker that the background.
  • Option imageAdjusting is replaced with imageAdjustingMode() method. The value is not configurable anymore. The mode depends on the isLight value.
  • The method getWallpaperFile has gone, use the methods listed below instead.
  • Added the method Bitmap backgroundBitmap.
  • Added the method long backgroundColor. It returns the colour if a solid colour is used for background. If a bitmap is used, the method returns the average colur of the bitmap.
  • Added the method backgroundFillMode.
  • Renamed the option: footerNGBackground to footerBackground.
  • Renamed the option: footerNGForeground to footerForeground.
  • Renamed the option: footerNGForegroundUnread to footerForegroundUnread.
  • Renamed the option: footerFill to footerOldStyleFill.

New class org.fbreader.view.options.EInkOptions

  • The option: BooleanOption screenIsEnk that defines if the screen is eink. That means it does not support animations, etc. Normally, the value is set correctly automatically.

Class org.fbreader.view.options.ImageOptions

  • Renamed the option: FitToScreen to fitToScreen.
  • Renamed the option: MatchBackground to matchBackground.

Class org.fbreader.view.options.ViewOptions

  • Renamed the option: LeftMargin to leftMargin.
  • Renamed the option: RightMargin to rightMargin.
  • Renamed the option: TopMargin to topMargin.
  • Renamed the option: BottomMargin to bottomMargin.
  • Renamed the option: SpaceBetweenColumns to spaceBetweenColumns.
  • Renamed the option: ScreenBrigthnessLevel to screenBrigthnessLevel.
  • Added a new option: minScreenBrightnessLevel; accepts value from 1 to 10, in percents; used in TextWidget.setScreenBrightness method. It can be useful for devices that switch the screen to black too early.
  • Renamed the option: BooleanOption TwoColumnView to EnumOption<ViewOptions.Orientation> twoColumnView. The option defines if the TextWidget splits page into two columns, depending on the screen orientation.
  • The interface
    public interface Scrollbar {
      int HIDE = 0;
      int SHOW = 1;
      int SHOW_AS_PROGRESS = 2;
      int SHOW_AS_FOOTER = 3;
      int SHOW_AS_FOOTER_OLD_STYLE = 4;
    }
    
    has been replaced with
    public enum ProgressIndicatorType {
      none,
      scroller,
      scrollerAsProgress,
      footer,
      footerOldStyle
    }
    
  • Renamed the option: IntegerRangeOption ScrollbarType to EnumOption<ViewOptions.ProgressIndicatorType> indicatorType.

Class org.fbreader.widget.options.PageTurningOptions

  • Renamed the option: Animation to animation.
  • Renamed the option: AnimationSpeed to animationSpeed.
  • Removed the option BooleanOption Horizontal. Use two options below instead.
  • Added the option EnumOption<Direction> animationDirection. Defines the directoin of animation started with no initial position.
  • Added the option EnumOption<Direction> flickPageTurningDirection.
  • Added the option StringOption minForwardFlickDistance.
  • Added the option BooleanOption continuousScrolling.
  • The enum has been renamed and changed:
    public static enum FingerScrollingType {
    	byTap,
    	byFlick,
    	byTapAndFlick
    }
    
    to
    public static enum GestureType {
      tap,
      flick, 
      tapAndFlick,
      none 
    }
    
  • Renamed the option: FingerScrolling to supportedGestures.