From: drizea Date: Sun, 8 Jul 2012 16:13:02 +0000 (+0300) Subject: search record details with slider and fragments (honeycomb ui like) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=36dae12c093c7e783ac08a27ad7a5203b785076c;p=working%2FEvergreen.git search record details with slider and fragments (honeycomb ui like) --- diff --git a/Open-ILS/src/Android/.classpath b/Open-ILS/src/Android/.classpath index 51d7d3a6b8..1b0ce02fe4 100644 --- a/Open-ILS/src/Android/.classpath +++ b/Open-ILS/src/Android/.classpath @@ -4,8 +4,9 @@ - - - + + + + diff --git a/Open-ILS/src/Android/AndroidManifest.xml b/Open-ILS/src/Android/AndroidManifest.xml index 10fe06fef7..a22d27079a 100644 --- a/Open-ILS/src/Android/AndroidManifest.xml +++ b/Open-ILS/src/Android/AndroidManifest.xml @@ -33,11 +33,15 @@ android:theme="@android:style/Theme.Light.NoTitleBar" > - + + - + + + diff --git a/Open-ILS/src/Android/bin/EvergreenApp.apk b/Open-ILS/src/Android/bin/EvergreenApp.apk index 58cfa1e8f8..6f46326e53 100644 Binary files a/Open-ILS/src/Android/bin/EvergreenApp.apk and b/Open-ILS/src/Android/bin/EvergreenApp.apk differ diff --git a/Open-ILS/src/Android/bin/classes.dex b/Open-ILS/src/Android/bin/classes.dex index 0f3dfb8f5c..4db0265fb7 100644 Binary files a/Open-ILS/src/Android/bin/classes.dex and b/Open-ILS/src/Android/bin/classes.dex differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$attr.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$attr.class index 3f6ee62545..cfeec9c2cb 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$attr.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$attr.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class index 76e0d56532..f0aca1c069 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$color.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class index 20049134a1..b2ba096655 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$dimen.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class index 02e1ab4179..e3f0e4cce1 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$drawable.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class index 5ddab9543a..a535cc6782 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$id.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class index f35efbb0ab..a9625dd4af 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$layout.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class index 3db9cbf228..4b4cbdae44 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$string.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class index 45fa5b8c2e..ec38d22611 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R$style.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R.class index de17b903d5..8099aa4cf3 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/R.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/R.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails.class index 5ec0143afe..7ffa9842c9 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class index 3da2f1c4d2..67a98f3214 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Info.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class index 54144a67cb..4e26a7cd8f 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/RecordDetails_Simple.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class index fb9a24f09b..5db7a1d993 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalog.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class index 8410c3740b..c47f25e493 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$1.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class index 6d038e8af9..7b6b75a7cf 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView$SearchArrayAdapter.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class index e83d611643..a29bc593ad 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/searchCatalog/SearchCatalogListView.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class index de374778f3..bd3d8212d4 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/AccountScreenDashboard.class differ diff --git a/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/MainScreenDashboard.class b/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/MainScreenDashboard.class index 81e65b2c7d..86ffbca3e3 100644 Binary files a/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/MainScreenDashboard.class and b/Open-ILS/src/Android/bin/classes/org/evergreen/android/views/MainScreenDashboard.class differ diff --git a/Open-ILS/src/Android/bin/resources.ap_ b/Open-ILS/src/Android/bin/resources.ap_ index f828339e92..3ed978ffe6 100644 Binary files a/Open-ILS/src/Android/bin/resources.ap_ and b/Open-ILS/src/Android/bin/resources.ap_ differ diff --git a/Open-ILS/src/Android/gen/org/evergreen/android/R.java b/Open-ILS/src/Android/gen/org/evergreen/android/R.java index 62d223c308..5021ed72a8 100644 --- a/Open-ILS/src/Android/gen/org/evergreen/android/R.java +++ b/Open-ILS/src/Android/gen/org/evergreen/android/R.java @@ -9,6 +9,282 @@ package org.evergreen.android; public final class R { public static final class attr { + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int centered=0x7f010005; + /** Screen edge padding. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int clipPadding=0x7f010010; + /** Length of the delay to fade the indicator. +

Must be an integer value, such as "100". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int fadeDelay=0x7f01001b; + /** Length of the indicator fade to transparent. +

Must be an integer value, such as "100". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int fadeLength=0x7f01001c; + /** Whether or not the selected indicator fades. +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int fades=0x7f01001a; + /** Color of the filled circle that represents the current page. +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int fillColor=0x7f010009; + /** Color of the footer line and indicator. +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int footerColor=0x7f010011; + /** Height of the indicator above the footer line. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int footerIndicatorHeight=0x7f010014; + /** Style of the indicator. Default is triangle. +

Must be one of the following constant values.

+ ++++ + + + +
ConstantValueDescription
none0
triangle1
underline2
+ */ + public static final int footerIndicatorStyle=0x7f010013; + /** Left and right padding of the underline indicator. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int footerIndicatorUnderlinePadding=0x7f010015; + /** Height of the footer line. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int footerLineHeight=0x7f010012; + /** Padding between the bottom of the title and the footer. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int footerPadding=0x7f010016; + /** Width of the gap between each indicator line. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int gapWidth=0x7f01000f; + /** Width of each indicator line. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int lineWidth=0x7f01000e; + /** Color of the filled circles that represents pages. +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int pageColor=0x7f01000a; + /** Radius of the circles. This is also the spacing between circles. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int radius=0x7f01000b; + /** Whether or not the selected item is displayed as bold. +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int selectedBold=0x7f010017; + /**

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int selectedColor=0x7f010006; + /** Whether or not the selected indicator snaps to the circles. +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int snap=0x7f01000c; + /** Color of the open circles. +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int strokeColor=0x7f01000d; + /**

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int strokeWidth=0x7f010007; + /** Padding between titles when bumping into each other. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int titlePadding=0x7f010018; + /** Padding between titles and the top of the View. +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int topPadding=0x7f010019; + /**

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int unselectedColor=0x7f010008; + /** Style of the circle indicator. +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". + */ + public static final int vpiCirclePageIndicatorStyle=0x7f010000; + /** Style of the line indicator. +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". + */ + public static final int vpiLinePageIndicatorStyle=0x7f010001; + /** Style of the tab indicator's tabs. +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". + */ + public static final int vpiTabPageIndicatorStyle=0x7f010003; + /** Style of the title indicator. +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". + */ + public static final int vpiTitlePageIndicatorStyle=0x7f010002; + /** Style of the underline indicator. +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". + */ + public static final int vpiUnderlinePageIndicatorStyle=0x7f010004; + } + public static final class bool { + public static final int default_circle_indicator_centered=0x7f0a0000; + public static final int default_circle_indicator_snap=0x7f0a0001; + public static final int default_line_indicator_centered=0x7f0a0002; + public static final int default_title_indicator_selected_bold=0x7f0a0003; + public static final int default_underline_indicator_fades=0x7f0a0004; } public static final class color { public static final int background1=0x7f050005; @@ -16,6 +292,15 @@ public final class R { public static final int background3=0x7f050007; public static final int bg_gray=0x7f05000b; public static final int blue=0x7f05000d; + public static final int default_circle_indicator_fill_color=0x7f050017; + public static final int default_circle_indicator_page_color=0x7f050018; + public static final int default_circle_indicator_stroke_color=0x7f050019; + public static final int default_line_indicator_selected_color=0x7f05001a; + public static final int default_line_indicator_unselected_color=0x7f05001b; + public static final int default_title_indicator_footer_color=0x7f05001c; + public static final int default_title_indicator_selected_color=0x7f05001d; + public static final int default_title_indicator_text_color=0x7f05001e; + public static final int default_underline_indicator_selected_color=0x7f05001f; public static final int emphasis=0x7f05000a; public static final int foreground1=0x7f050003; public static final int foreground2=0x7f050004; @@ -27,9 +312,30 @@ public final class R { public static final int title_separator=0x7f050008; public static final int title_text=0x7f050001; public static final int title_text_alt=0x7f050002; + public static final int vpi__background_holo_dark=0x7f05000f; + public static final int vpi__background_holo_light=0x7f050010; + public static final int vpi__bright_foreground_disabled_holo_dark=0x7f050013; + public static final int vpi__bright_foreground_disabled_holo_light=0x7f050014; + public static final int vpi__bright_foreground_holo_dark=0x7f050011; + public static final int vpi__bright_foreground_holo_light=0x7f050012; + public static final int vpi__bright_foreground_inverse_holo_dark=0x7f050015; + public static final int vpi__bright_foreground_inverse_holo_light=0x7f050016; public static final int white=0x7f05000c; } public static final class dimen { + public static final int default_circle_indicator_radius=0x7f060004; + public static final int default_circle_indicator_stroke_width=0x7f060005; + public static final int default_line_indicator_gap_width=0x7f060007; + public static final int default_line_indicator_line_width=0x7f060006; + public static final int default_line_indicator_stroke_width=0x7f060008; + public static final int default_title_indicator_clip_padding=0x7f060009; + public static final int default_title_indicator_footer_indicator_height=0x7f06000b; + public static final int default_title_indicator_footer_indicator_underline_padding=0x7f06000c; + public static final int default_title_indicator_footer_line_height=0x7f06000a; + public static final int default_title_indicator_footer_padding=0x7f06000d; + public static final int default_title_indicator_text_size=0x7f06000e; + public static final int default_title_indicator_title_padding=0x7f06000f; + public static final int default_title_indicator_top_padding=0x7f060010; public static final int text_size_large=0x7f060003; public static final int text_size_medium=0x7f060002; public static final int text_size_small=0x7f060001; @@ -41,77 +347,108 @@ public final class R { public static final int address_book=0x7f020002; public static final int book_bag=0x7f020003; public static final int check_out=0x7f020004; - public static final int expander_ic_maximized=0x7f020005; - public static final int find_96=0x7f020006; - public static final int fines=0x7f020007; - public static final int holds=0x7f020008; - public static final int ic_launcher=0x7f020009; - public static final int settings=0x7f02000a; + public static final int custom_tab_indicator=0x7f020005; + public static final int custom_tab_indicator_focused=0x7f020006; + public static final int custom_tab_indicator_selected=0x7f020007; + public static final int custom_tab_indicator_selected_focused=0x7f020008; + public static final int custom_tab_indicator_selected_pressed=0x7f020009; + public static final int custom_tab_indicator_unselected=0x7f02000a; + public static final int custom_tab_indicator_unselected_focused=0x7f02000b; + public static final int custom_tab_indicator_unselected_pressed=0x7f02000c; + public static final int expander_ic_maximized=0x7f02000d; + public static final int find_96=0x7f02000e; + public static final int fines=0x7f02000f; + public static final int holds=0x7f020010; + public static final int ic_launcher=0x7f020011; + public static final int settings=0x7f020012; + public static final int vpi__tab_indicator=0x7f020013; + public static final int vpi__tab_selected_focused_holo=0x7f020014; + public static final int vpi__tab_selected_holo=0x7f020015; + public static final int vpi__tab_selected_pressed_holo=0x7f020016; + public static final int vpi__tab_unselected_focused_holo=0x7f020017; + public static final int vpi__tab_unselected_holo=0x7f020018; + public static final int vpi__tab_unselected_pressed_holo=0x7f020019; } public static final class id { - public static final int account_btn_book_bags=0x7f09000a; - public static final int account_btn_check_out=0x7f090007; - public static final int account_btn_fines=0x7f090009; - public static final int account_btn_holds=0x7f090008; - public static final int action_bar=0x7f090018; - public static final int back_button=0x7f090019; - public static final int cancel_hold=0x7f09002a; - public static final int cancel_hold_button=0x7f09001a; - public static final int checkout_due_date=0x7f090005; - public static final int checkout_items_list=0x7f090001; - public static final int checkout_record_author=0x7f090003; - public static final int checkout_record_title=0x7f090002; - public static final int checkout_renewals_remaining=0x7f090004; - public static final int chose_organisation=0x7f09003e; - public static final int fined_balance_owed=0x7f090010; - public static final int fines_author=0x7f090014; - public static final int fines_balance_owed=0x7f090013; - public static final int fines_overdue_materials_list=0x7f090011; - public static final int fines_status=0x7f090015; - public static final int fines_title=0x7f090012; - public static final int fines_total_owned=0x7f09000e; - public static final int fines_total_paid=0x7f09000f; - public static final int header=0x7f090016; - public static final int header_title=0x7f090017; - public static final int hold_author=0x7f09001e; - public static final int hold_contact_telephone=0x7f090020; - public static final int hold_enable_email_notification=0x7f090022; - public static final int hold_enable_phone_notification=0x7f090021; - public static final int hold_expiration_date=0x7f090024; - public static final int hold_physical_description=0x7f09001f; - public static final int hold_pickup_location=0x7f090023; - public static final int hold_recipient=0x7f09001c; - public static final int hold_status=0x7f090029; - public static final int hold_suspend_hold=0x7f090025; - public static final int hold_thaw_date=0x7f090026; - public static final int hold_title=0x7f09001d; - public static final int holds_item_list=0x7f090028; - public static final int holds_number=0x7f090027; - public static final int main_btn_account=0x7f09000c; - public static final int main_btn_app_settings=0x7f09000d; - public static final int main_btn_search=0x7f09000b; - public static final int place_hold=0x7f09002b; - public static final int record_details_info_author=0x7f09002d; - public static final int record_details_info_publisher=0x7f09002e; - public static final int record_details_info_title=0x7f09002c; - public static final int record_details_simple_author=0x7f090030; - public static final int record_details_simple_isbn=0x7f090035; - public static final int record_details_simple_publisher=0x7f090031; - public static final int record_details_simple_series=0x7f090033; - public static final int record_details_simple_subject=0x7f090032; - public static final int record_details_simple_synopsis=0x7f090034; - public static final int record_details_simple_title=0x7f09002f; - public static final int renew_button=0x7f090006; - public static final int searchButton=0x7f09003c; - public static final int searchText=0x7f09003b; - public static final int search_more_items_button=0x7f090036; - public static final int search_record_author=0x7f090039; - public static final int search_record_img=0x7f090037; - public static final int search_record_publishing=0x7f09003a; - public static final int search_record_title=0x7f090038; - public static final int search_result_number=0x7f090000; - public static final int search_results_list=0x7f09003d; - public static final int update_hold_button=0x7f09001b; + public static final int account_btn_book_bags=0x7f09000d; + public static final int account_btn_check_out=0x7f09000a; + public static final int account_btn_fines=0x7f09000c; + public static final int account_btn_holds=0x7f09000b; + public static final int action_bar=0x7f09001b; + public static final int add_page=0x7f090047; + public static final int back_button=0x7f09001c; + public static final int cancel_hold=0x7f09002d; + public static final int cancel_hold_button=0x7f09001d; + public static final int checkout_due_date=0x7f090008; + public static final int checkout_items_list=0x7f090004; + public static final int checkout_record_author=0x7f090006; + public static final int checkout_record_title=0x7f090005; + public static final int checkout_renewals_remaining=0x7f090007; + public static final int chose_organisation=0x7f090043; + public static final int fined_balance_owed=0x7f090013; + public static final int fines_author=0x7f090017; + public static final int fines_balance_owed=0x7f090016; + public static final int fines_overdue_materials_list=0x7f090014; + public static final int fines_status=0x7f090018; + public static final int fines_title=0x7f090015; + public static final int fines_total_owned=0x7f090011; + public static final int fines_total_paid=0x7f090012; + public static final int header=0x7f090019; + public static final int header_title=0x7f09001a; + public static final int hold_author=0x7f090021; + public static final int hold_contact_telephone=0x7f090023; + public static final int hold_enable_email_notification=0x7f090025; + public static final int hold_enable_phone_notification=0x7f090024; + public static final int hold_expiration_date=0x7f090027; + public static final int hold_physical_description=0x7f090022; + public static final int hold_pickup_location=0x7f090026; + public static final int hold_recipient=0x7f09001f; + public static final int hold_status=0x7f09002c; + public static final int hold_suspend_hold=0x7f090028; + public static final int hold_thaw_date=0x7f090029; + public static final int hold_title=0x7f090020; + public static final int holds_item_list=0x7f09002b; + public static final int holds_number=0x7f09002a; + public static final int indicator=0x7f090044; + public static final int main_btn_account=0x7f09000f; + public static final int main_btn_app_settings=0x7f090010; + public static final int main_btn_search=0x7f09000e; + public static final int none=0x7f090000; + public static final int pager=0x7f090045; + public static final int place_hold=0x7f09002e; + public static final int random=0x7f090046; + public static final int record_details_info_author=0x7f090035; + public static final int record_details_info_publisher=0x7f090036; + public static final int record_details_info_title=0x7f090034; + public static final int record_details_info_view=0x7f090033; + public static final int record_details_simple_author=0x7f090031; + public static final int record_details_simple_isbn=0x7f09003a; + public static final int record_details_simple_publisher=0x7f090032; + public static final int record_details_simple_series=0x7f090038; + public static final int record_details_simple_subject=0x7f090037; + public static final int record_details_simple_synopsis=0x7f090039; + public static final int record_details_simple_title=0x7f090030; + public static final int record_details_simple_view=0x7f09002f; + public static final int remove_page=0x7f090048; + public static final int renew_button=0x7f090009; + public static final int searchButton=0x7f090041; + public static final int searchText=0x7f090040; + public static final int search_more_items_button=0x7f09003b; + public static final int search_record_author=0x7f09003e; + public static final int search_record_img=0x7f09003c; + public static final int search_record_publishing=0x7f09003f; + public static final int search_record_title=0x7f09003d; + public static final int search_result_number=0x7f090003; + public static final int search_results_list=0x7f090042; + public static final int triangle=0x7f090001; + public static final int underline=0x7f090002; + public static final int update_hold_button=0x7f09001e; + } + public static final class integer { + public static final int default_circle_indicator_orientation=0x7f0b0000; + public static final int default_title_indicator_footer_indicator_style=0x7f0b0001; + public static final int default_underline_indicator_fade_delay=0x7f0b0002; + public static final int default_underline_indicator_fade_length=0x7f0b0003; } public static final class layout { public static final int checkout_list=0x7f030000; @@ -125,11 +462,17 @@ public final class R { public static final int holds_list_item=0x7f030008; public static final int main=0x7f030009; public static final int place_hold=0x7f03000a; - public static final int record_details_info=0x7f03000b; - public static final int record_details_simple=0x7f03000c; - public static final int search_result_footer_view=0x7f03000d; - public static final int search_result_item=0x7f03000e; - public static final int search_result_list=0x7f03000f; + public static final int record_details_basic_fragment=0x7f03000b; + public static final int record_details_info=0x7f03000c; + public static final int record_details_more_fragment=0x7f03000d; + public static final int record_details_simple=0x7f03000e; + public static final int search_result_footer_view=0x7f03000f; + public static final int search_result_item=0x7f030010; + public static final int search_result_list=0x7f030011; + public static final int simple_tabs=0x7f030012; + } + public static final class menu { + public static final int menu=0x7f0c0000; } public static final class string { public static final int app_name=0x7f070001; @@ -175,10 +518,22 @@ public final class R { } public static final class style { public static final int AuthorSearchStyleList=0x7f080007; + public static final int CustomCirclePageIndicator=0x7f08000c; + public static final int CustomLinePageIndicator=0x7f08000b; + public static final int CustomTabPageIndicator=0x7f08000d; + public static final int CustomTitlePageIndicator=0x7f08000a; + public static final int CustomUnderlinePageIndicator=0x7f08000e; public static final int EvergreenTheme=0x7f080004; public static final int HomeButton=0x7f080005; public static final int PubSearchStyleList=0x7f080008; + /** Tabs + */ + public static final int StyledIndicators=0x7f080009; + public static final int TextAppearance_TabPageIndicator=0x7f080012; + public static final int Theme_PageIndicatorDefaults=0x7f08000f; public static final int TitleSearchStyleList=0x7f080006; + public static final int Widget=0x7f080010; + public static final int Widget_TabPageIndicator=0x7f080011; public static final int sectionHeader=0x7f080000; public static final int spacer=0x7f080003; public static final int textLarge=0x7f080002; @@ -186,5 +541,710 @@ public final class R { } public static final class xml { public static final int application_preference_screen=0x7f040000; + public static final int vpi__dark_theme=0x7f040001; + public static final int vpi__light_theme=0x7f040002; } + public static final class styleable { + /** Attributes that can be used with a CirclePageIndicator. +

Includes the following attributes:

+ + + + + + + + + + + + +
AttributeDescription
{@link #CirclePageIndicator_android_orientation org.evergreen.android:android_orientation} Orientation of the indicator.
{@link #CirclePageIndicator_centered org.evergreen.android:centered} Whether or not the indicators should be centered.
{@link #CirclePageIndicator_fillColor org.evergreen.android:fillColor} Color of the filled circle that represents the current page.
{@link #CirclePageIndicator_pageColor org.evergreen.android:pageColor} Color of the filled circles that represents pages.
{@link #CirclePageIndicator_radius org.evergreen.android:radius} Radius of the circles.
{@link #CirclePageIndicator_snap org.evergreen.android:snap} Whether or not the selected indicator snaps to the circles.
{@link #CirclePageIndicator_strokeColor org.evergreen.android:strokeColor} Color of the open circles.
{@link #CirclePageIndicator_strokeWidth org.evergreen.android:strokeWidth} Width of the stroke used to draw the circles.
+ @see #CirclePageIndicator_android_orientation + @see #CirclePageIndicator_centered + @see #CirclePageIndicator_fillColor + @see #CirclePageIndicator_pageColor + @see #CirclePageIndicator_radius + @see #CirclePageIndicator_snap + @see #CirclePageIndicator_strokeColor + @see #CirclePageIndicator_strokeWidth + */ + public static final int[] CirclePageIndicator = { + 0x010100c4, 0x7f010005, 0x7f010007, 0x7f010009, + 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d + }; + /** +

+ @attr description + Orientation of the indicator. +

This corresponds to the global attribute resource symbol {@link org.evergreen.android.R.attr#android_orientation}. + @attr name android:android_orientation + */ + public static final int CirclePageIndicator_android_orientation = 0; + /** +

+ @attr description + Whether or not the indicators should be centered. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:centered + */ + public static final int CirclePageIndicator_centered = 1; + /** +

+ @attr description + Color of the filled circle that represents the current page. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:fillColor + */ + public static final int CirclePageIndicator_fillColor = 3; + /** +

+ @attr description + Color of the filled circles that represents pages. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:pageColor + */ + public static final int CirclePageIndicator_pageColor = 4; + /** +

+ @attr description + Radius of the circles. This is also the spacing between circles. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:radius + */ + public static final int CirclePageIndicator_radius = 5; + /** +

+ @attr description + Whether or not the selected indicator snaps to the circles. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:snap + */ + public static final int CirclePageIndicator_snap = 6; + /** +

+ @attr description + Color of the open circles. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:strokeColor + */ + public static final int CirclePageIndicator_strokeColor = 7; + /** +

+ @attr description + Width of the stroke used to draw the circles. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:strokeWidth + */ + public static final int CirclePageIndicator_strokeWidth = 2; + /** Attributes that can be used with a LinePageIndicator. +

Includes the following attributes:

+ + + + + + + + + + +
AttributeDescription
{@link #LinePageIndicator_centered org.evergreen.android:centered} Whether or not the indicators should be centered.
{@link #LinePageIndicator_gapWidth org.evergreen.android:gapWidth} Width of the gap between each indicator line.
{@link #LinePageIndicator_lineWidth org.evergreen.android:lineWidth} Width of each indicator line.
{@link #LinePageIndicator_selectedColor org.evergreen.android:selectedColor} Color of the selected line that represents the current page.
{@link #LinePageIndicator_strokeWidth org.evergreen.android:strokeWidth} Width of each indicator line's stroke.
{@link #LinePageIndicator_unselectedColor org.evergreen.android:unselectedColor} Color of the unselected lines that represent the pages.
+ @see #LinePageIndicator_centered + @see #LinePageIndicator_gapWidth + @see #LinePageIndicator_lineWidth + @see #LinePageIndicator_selectedColor + @see #LinePageIndicator_strokeWidth + @see #LinePageIndicator_unselectedColor + */ + public static final int[] LinePageIndicator = { + 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, + 0x7f01000e, 0x7f01000f + }; + /** +

+ @attr description + Whether or not the indicators should be centered. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:centered + */ + public static final int LinePageIndicator_centered = 0; + /** +

+ @attr description + Width of the gap between each indicator line. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:gapWidth + */ + public static final int LinePageIndicator_gapWidth = 5; + /** +

+ @attr description + Width of each indicator line. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:lineWidth + */ + public static final int LinePageIndicator_lineWidth = 4; + /** +

+ @attr description + Color of the selected line that represents the current page. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:selectedColor + */ + public static final int LinePageIndicator_selectedColor = 1; + /** +

+ @attr description + Width of each indicator line's stroke. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:strokeWidth + */ + public static final int LinePageIndicator_strokeWidth = 2; + /** +

+ @attr description + Color of the unselected lines that represent the pages. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:unselectedColor + */ + public static final int LinePageIndicator_unselectedColor = 3; + /** Attributes that can be used with a TitlePageIndicator. +

Includes the following attributes:

+ + + + + + + + + + + + + + + + + +
AttributeDescription
{@link #TitlePageIndicator_android_textColor org.evergreen.android:android_textColor} Color of regular titles.
{@link #TitlePageIndicator_android_textSize org.evergreen.android:android_textSize} Size of title text.
{@link #TitlePageIndicator_clipPadding org.evergreen.android:clipPadding} Screen edge padding.
{@link #TitlePageIndicator_footerColor org.evergreen.android:footerColor} Color of the footer line and indicator.
{@link #TitlePageIndicator_footerIndicatorHeight org.evergreen.android:footerIndicatorHeight} Height of the indicator above the footer line.
{@link #TitlePageIndicator_footerIndicatorStyle org.evergreen.android:footerIndicatorStyle} Style of the indicator.
{@link #TitlePageIndicator_footerIndicatorUnderlinePadding org.evergreen.android:footerIndicatorUnderlinePadding} Left and right padding of the underline indicator.
{@link #TitlePageIndicator_footerLineHeight org.evergreen.android:footerLineHeight} Height of the footer line.
{@link #TitlePageIndicator_footerPadding org.evergreen.android:footerPadding} Padding between the bottom of the title and the footer.
{@link #TitlePageIndicator_selectedBold org.evergreen.android:selectedBold} Whether or not the selected item is displayed as bold.
{@link #TitlePageIndicator_selectedColor org.evergreen.android:selectedColor} Color of the selected title.
{@link #TitlePageIndicator_titlePadding org.evergreen.android:titlePadding} Padding between titles when bumping into each other.
{@link #TitlePageIndicator_topPadding org.evergreen.android:topPadding} Padding between titles and the top of the View.
+ @see #TitlePageIndicator_android_textColor + @see #TitlePageIndicator_android_textSize + @see #TitlePageIndicator_clipPadding + @see #TitlePageIndicator_footerColor + @see #TitlePageIndicator_footerIndicatorHeight + @see #TitlePageIndicator_footerIndicatorStyle + @see #TitlePageIndicator_footerIndicatorUnderlinePadding + @see #TitlePageIndicator_footerLineHeight + @see #TitlePageIndicator_footerPadding + @see #TitlePageIndicator_selectedBold + @see #TitlePageIndicator_selectedColor + @see #TitlePageIndicator_titlePadding + @see #TitlePageIndicator_topPadding + */ + public static final int[] TitlePageIndicator = { + 0x01010095, 0x01010098, 0x7f010006, 0x7f010010, + 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, + 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, + 0x7f010019 + }; + /** +

+ @attr description + Color of regular titles. +

This corresponds to the global attribute resource symbol {@link org.evergreen.android.R.attr#android_textColor}. + @attr name android:android_textColor + */ + public static final int TitlePageIndicator_android_textColor = 1; + /** +

+ @attr description + Size of title text. +

This corresponds to the global attribute resource symbol {@link org.evergreen.android.R.attr#android_textSize}. + @attr name android:android_textSize + */ + public static final int TitlePageIndicator_android_textSize = 0; + /** +

+ @attr description + Screen edge padding. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:clipPadding + */ + public static final int TitlePageIndicator_clipPadding = 3; + /** +

+ @attr description + Color of the footer line and indicator. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:footerColor + */ + public static final int TitlePageIndicator_footerColor = 4; + /** +

+ @attr description + Height of the indicator above the footer line. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:footerIndicatorHeight + */ + public static final int TitlePageIndicator_footerIndicatorHeight = 7; + /** +

+ @attr description + Style of the indicator. Default is triangle. + + +

Must be one of the following constant values.

+ ++++ + + + +
ConstantValueDescription
none0
triangle1
underline2
+

This is a private symbol. + @attr name android:footerIndicatorStyle + */ + public static final int TitlePageIndicator_footerIndicatorStyle = 6; + /** +

+ @attr description + Left and right padding of the underline indicator. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:footerIndicatorUnderlinePadding + */ + public static final int TitlePageIndicator_footerIndicatorUnderlinePadding = 8; + /** +

+ @attr description + Height of the footer line. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:footerLineHeight + */ + public static final int TitlePageIndicator_footerLineHeight = 5; + /** +

+ @attr description + Padding between the bottom of the title and the footer. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:footerPadding + */ + public static final int TitlePageIndicator_footerPadding = 9; + /** +

+ @attr description + Whether or not the selected item is displayed as bold. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:selectedBold + */ + public static final int TitlePageIndicator_selectedBold = 10; + /** +

+ @attr description + Color of the selected title. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:selectedColor + */ + public static final int TitlePageIndicator_selectedColor = 2; + /** +

+ @attr description + Padding between titles when bumping into each other. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:titlePadding + */ + public static final int TitlePageIndicator_titlePadding = 11; + /** +

+ @attr description + Padding between titles and the top of the View. + + +

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". +Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), +in (inches), mm (millimeters). +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:topPadding + */ + public static final int TitlePageIndicator_topPadding = 12; + /** Attributes that can be used with a UnderlinePageIndicator. +

Includes the following attributes:

+ + + + + + + + +
AttributeDescription
{@link #UnderlinePageIndicator_fadeDelay org.evergreen.android:fadeDelay} Length of the delay to fade the indicator.
{@link #UnderlinePageIndicator_fadeLength org.evergreen.android:fadeLength} Length of the indicator fade to transparent.
{@link #UnderlinePageIndicator_fades org.evergreen.android:fades} Whether or not the selected indicator fades.
{@link #UnderlinePageIndicator_selectedColor org.evergreen.android:selectedColor} Color of the selected line that represents the current page.
+ @see #UnderlinePageIndicator_fadeDelay + @see #UnderlinePageIndicator_fadeLength + @see #UnderlinePageIndicator_fades + @see #UnderlinePageIndicator_selectedColor + */ + public static final int[] UnderlinePageIndicator = { + 0x7f010006, 0x7f01001a, 0x7f01001b, 0x7f01001c + }; + /** +

+ @attr description + Length of the delay to fade the indicator. + + +

Must be an integer value, such as "100". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:fadeDelay + */ + public static final int UnderlinePageIndicator_fadeDelay = 2; + /** +

+ @attr description + Length of the indicator fade to transparent. + + +

Must be an integer value, such as "100". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:fadeLength + */ + public static final int UnderlinePageIndicator_fadeLength = 3; + /** +

+ @attr description + Whether or not the selected indicator fades. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:fades + */ + public static final int UnderlinePageIndicator_fades = 1; + /** +

+ @attr description + Color of the selected line that represents the current page. + + +

Must be a color value, in the form of "#rgb", "#argb", +"#rrggbb", or "#aarrggbb". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name android:selectedColor + */ + public static final int UnderlinePageIndicator_selectedColor = 0; + /** Attributes that can be used with a ViewPagerIndicator. +

Includes the following attributes:

+ + + + + + + + + +
AttributeDescription
{@link #ViewPagerIndicator_vpiCirclePageIndicatorStyle org.evergreen.android:vpiCirclePageIndicatorStyle} Style of the circle indicator.
{@link #ViewPagerIndicator_vpiLinePageIndicatorStyle org.evergreen.android:vpiLinePageIndicatorStyle} Style of the line indicator.
{@link #ViewPagerIndicator_vpiTabPageIndicatorStyle org.evergreen.android:vpiTabPageIndicatorStyle} Style of the tab indicator's tabs.
{@link #ViewPagerIndicator_vpiTitlePageIndicatorStyle org.evergreen.android:vpiTitlePageIndicatorStyle} Style of the title indicator.
{@link #ViewPagerIndicator_vpiUnderlinePageIndicatorStyle org.evergreen.android:vpiUnderlinePageIndicatorStyle} Style of the underline indicator.
+ @see #ViewPagerIndicator_vpiCirclePageIndicatorStyle + @see #ViewPagerIndicator_vpiLinePageIndicatorStyle + @see #ViewPagerIndicator_vpiTabPageIndicatorStyle + @see #ViewPagerIndicator_vpiTitlePageIndicatorStyle + @see #ViewPagerIndicator_vpiUnderlinePageIndicatorStyle + */ + public static final int[] ViewPagerIndicator = { + 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, + 0x7f010004 + }; + /** +

+ @attr description + Style of the circle indicator. + + +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". +

This is a private symbol. + @attr name android:vpiCirclePageIndicatorStyle + */ + public static final int ViewPagerIndicator_vpiCirclePageIndicatorStyle = 0; + /** +

+ @attr description + Style of the line indicator. + + +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". +

This is a private symbol. + @attr name android:vpiLinePageIndicatorStyle + */ + public static final int ViewPagerIndicator_vpiLinePageIndicatorStyle = 1; + /** +

+ @attr description + Style of the tab indicator's tabs. + + +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". +

This is a private symbol. + @attr name android:vpiTabPageIndicatorStyle + */ + public static final int ViewPagerIndicator_vpiTabPageIndicatorStyle = 3; + /** +

+ @attr description + Style of the title indicator. + + +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". +

This is a private symbol. + @attr name android:vpiTitlePageIndicatorStyle + */ + public static final int ViewPagerIndicator_vpiTitlePageIndicatorStyle = 2; + /** +

+ @attr description + Style of the underline indicator. + + +

Must be a reference to another resource, in the form "@[+][package:]type:name" +or to a theme attribute in the form "?[package:][type:]name". +

This is a private symbol. + @attr name android:vpiUnderlinePageIndicatorStyle + */ + public static final int ViewPagerIndicator_vpiUnderlinePageIndicatorStyle = 4; + }; } diff --git a/Open-ILS/src/Android/lib/org.openils_idl.jar b/Open-ILS/src/Android/lib/org.openils_idl.jar deleted file mode 100644 index f3f0d6b822..0000000000 Binary files a/Open-ILS/src/Android/lib/org.openils_idl.jar and /dev/null differ diff --git a/Open-ILS/src/Android/lib/org.opensrf2_serialized_reg.jar b/Open-ILS/src/Android/lib/org.opensrf2_serialized_reg.jar deleted file mode 100644 index 84c9b94883..0000000000 Binary files a/Open-ILS/src/Android/lib/org.opensrf2_serialized_reg.jar and /dev/null differ diff --git a/Open-ILS/src/Android/lib/simple-xml-2.6.4.jar b/Open-ILS/src/Android/lib/simple-xml-2.6.4.jar deleted file mode 100644 index be60eaeaa6..0000000000 Binary files a/Open-ILS/src/Android/lib/simple-xml-2.6.4.jar and /dev/null differ diff --git a/Open-ILS/src/Android/libs/android-support-v4.jar b/Open-ILS/src/Android/libs/android-support-v4.jar new file mode 100644 index 0000000000..99e063b33a Binary files /dev/null and b/Open-ILS/src/Android/libs/android-support-v4.jar differ diff --git a/Open-ILS/src/Android/libs/org.openils_idl.jar b/Open-ILS/src/Android/libs/org.openils_idl.jar new file mode 100644 index 0000000000..f3f0d6b822 Binary files /dev/null and b/Open-ILS/src/Android/libs/org.openils_idl.jar differ diff --git a/Open-ILS/src/Android/libs/org.opensrf2_serialized_reg.jar b/Open-ILS/src/Android/libs/org.opensrf2_serialized_reg.jar new file mode 100644 index 0000000000..84c9b94883 Binary files /dev/null and b/Open-ILS/src/Android/libs/org.opensrf2_serialized_reg.jar differ diff --git a/Open-ILS/src/Android/libs/simple-xml-2.6.4.jar b/Open-ILS/src/Android/libs/simple-xml-2.6.4.jar new file mode 100644 index 0000000000..be60eaeaa6 Binary files /dev/null and b/Open-ILS/src/Android/libs/simple-xml-2.6.4.jar differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_focused.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_focused.9.png new file mode 100644 index 0000000000..8d36d7de76 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_focused.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected.9.png new file mode 100644 index 0000000000..db329b874c Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected_pressed.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected_pressed.9.png new file mode 100644 index 0000000000..7ea68250b0 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_selected_pressed.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected.9.png new file mode 100644 index 0000000000..43ec872c54 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_focused.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_focused.9.png new file mode 100644 index 0000000000..2162b8ba58 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_focused.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_pressed.9.png b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_pressed.9.png new file mode 100644 index 0000000000..38917bbb1c Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/custom_tab_indicator_unselected_pressed.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png new file mode 100644 index 0000000000..673e3bf10d Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_holo.9.png new file mode 100644 index 0000000000..d57df98b50 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png new file mode 100644 index 0000000000..6278eef472 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png new file mode 100644 index 0000000000..294991d793 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_holo.9.png new file mode 100644 index 0000000000..19532ab10d Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png new file mode 100644 index 0000000000..aadc6f87b2 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_focused_holo.9.png new file mode 100644 index 0000000000..c9972e74bb Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_holo.9.png new file mode 100644 index 0000000000..587337caf7 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_pressed_holo.9.png new file mode 100644 index 0000000000..155c4fc753 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_selected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_focused_holo.9.png new file mode 100644 index 0000000000..f0cecd183a Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_holo.9.png new file mode 100644 index 0000000000..a2dbf42b74 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_pressed_holo.9.png new file mode 100644 index 0000000000..b1223fe3c4 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-ldpi/vpi__tab_unselected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected.9.png new file mode 100644 index 0000000000..3f6aaa34e8 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_focused.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_focused.9.png new file mode 100644 index 0000000000..569d1640ad Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_focused.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_pressed.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_pressed.9.png new file mode 100644 index 0000000000..7f3a8f2137 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_selected_pressed.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected.9.png new file mode 100644 index 0000000000..9689ea1b5b Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_focused.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_focused.9.png new file mode 100644 index 0000000000..88759badd8 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_focused.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_pressed.9.png b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_pressed.9.png new file mode 100644 index 0000000000..defa52ff64 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/custom_tab_indicator_unselected_pressed.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png new file mode 100644 index 0000000000..c9972e74bb Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_holo.9.png new file mode 100644 index 0000000000..587337caf7 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png new file mode 100644 index 0000000000..155c4fc753 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png new file mode 100644 index 0000000000..f0cecd183a Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_holo.9.png new file mode 100644 index 0000000000..a2dbf42b74 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png new file mode 100644 index 0000000000..b1223fe3c4 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png new file mode 100644 index 0000000000..c9972e74bb Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_holo.9.png new file mode 100644 index 0000000000..587337caf7 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png new file mode 100644 index 0000000000..155c4fc753 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png new file mode 100644 index 0000000000..f0cecd183a Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png new file mode 100644 index 0000000000..a2dbf42b74 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png new file mode 100644 index 0000000000..b1223fe3c4 Binary files /dev/null and b/Open-ILS/src/Android/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png differ diff --git a/Open-ILS/src/Android/res/drawable/custom_tab_indicator.xml b/Open-ILS/src/Android/res/drawable/custom_tab_indicator.xml new file mode 100644 index 0000000000..e7f4cf37a0 --- /dev/null +++ b/Open-ILS/src/Android/res/drawable/custom_tab_indicator.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/drawable/vpi__tab_indicator.xml b/Open-ILS/src/Android/res/drawable/vpi__tab_indicator.xml new file mode 100644 index 0000000000..520d08c252 --- /dev/null +++ b/Open-ILS/src/Android/res/drawable/vpi__tab_indicator.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/layout/record_details_basic_fragment.xml b/Open-ILS/src/Android/res/layout/record_details_basic_fragment.xml new file mode 100644 index 0000000000..b12fd552b6 --- /dev/null +++ b/Open-ILS/src/Android/res/layout/record_details_basic_fragment.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Open-ILS/src/Android/res/layout/record_details_info.xml b/Open-ILS/src/Android/res/layout/record_details_info.xml index a806b6b412..f324a31d6b 100644 --- a/Open-ILS/src/Android/res/layout/record_details_info.xml +++ b/Open-ILS/src/Android/res/layout/record_details_info.xml @@ -2,7 +2,9 @@ + android:orientation="vertical" + android:id="@+id/record_details_info_view" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Open-ILS/src/Android/res/layout/record_details_simple.xml b/Open-ILS/src/Android/res/layout/record_details_simple.xml index 71f6c937b2..92fc9b7193 100644 --- a/Open-ILS/src/Android/res/layout/record_details_simple.xml +++ b/Open-ILS/src/Android/res/layout/record_details_simple.xml @@ -2,8 +2,8 @@ + android:id="@+id/record_details_simple_view"> + + + + + + + + + \ No newline at end of file diff --git a/Open-ILS/src/Android/res/menu/menu.xml b/Open-ILS/src/Android/res/menu/menu.xml new file mode 100644 index 0000000000..3f3db597e5 --- /dev/null +++ b/Open-ILS/src/Android/res/menu/menu.xml @@ -0,0 +1,7 @@ + + +

+ + + + diff --git a/Open-ILS/src/Android/res/values/styles.xml b/Open-ILS/src/Android/res/values/styles.xml index 376cc04edd..62ba8d7df2 100644 --- a/Open-ILS/src/Android/res/values/styles.xml +++ b/Open-ILS/src/Android/res/values/styles.xml @@ -26,7 +26,7 @@ 18sp 10dip 5dip - @color/white + wrap_content wrap_content @@ -76,4 +76,53 @@ end + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/values/vpi__attrs.xml b/Open-ILS/src/Android/res/values/vpi__attrs.xml new file mode 100644 index 0000000000..8ff0893e6c --- /dev/null +++ b/Open-ILS/src/Android/res/values/vpi__attrs.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/values/vpi__colors.xml b/Open-ILS/src/Android/res/values/vpi__colors.xml new file mode 100644 index 0000000000..62ca60704a --- /dev/null +++ b/Open-ILS/src/Android/res/values/vpi__colors.xml @@ -0,0 +1,26 @@ + + + + + #ff000000 + #fff3f3f3 + @color/vpi__background_holo_light + @color/vpi__background_holo_dark + #ff4c4c4c + #ffb2b2b2 + @color/vpi__bright_foreground_holo_light + @color/vpi__bright_foreground_holo_dark + diff --git a/Open-ILS/src/Android/res/values/vpi__defaults.xml b/Open-ILS/src/Android/res/values/vpi__defaults.xml new file mode 100644 index 0000000000..245ae9263f --- /dev/null +++ b/Open-ILS/src/Android/res/values/vpi__defaults.xml @@ -0,0 +1,52 @@ + + + + + true + #FFFFFFFF + #00000000 + 0 + 3dp + false + #FFDDDDDD + 1dp + + 12dp + 4dp + 1dp + #FF33B5E5 + #FFBBBBBB + true + + 4dp + #FF33B5E5 + 2dp + 2 + 4dp + 20dp + 7dp + #FFFFFFFF + true + #BBFFFFFF + 15dp + 5dp + 7dp + + true + 300 + 400 + #FF33B5E5 + \ No newline at end of file diff --git a/Open-ILS/src/Android/res/values/vpi__styles.xml b/Open-ILS/src/Android/res/values/vpi__styles.xml new file mode 100644 index 0000000000..c2d5d8c2e9 --- /dev/null +++ b/Open-ILS/src/Android/res/values/vpi__styles.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/xml/vpi__dark_theme.xml b/Open-ILS/src/Android/res/xml/vpi__dark_theme.xml new file mode 100644 index 0000000000..3e7a08f85c --- /dev/null +++ b/Open-ILS/src/Android/res/xml/vpi__dark_theme.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/Open-ILS/src/Android/res/xml/vpi__light_theme.xml b/Open-ILS/src/Android/res/xml/vpi__light_theme.xml new file mode 100644 index 0000000000..f955db7205 --- /dev/null +++ b/Open-ILS/src/Android/res/xml/vpi__light_theme.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordDetails.java b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordDetails.java index a1eb4b9a7a..c2cee37915 100644 --- a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordDetails.java +++ b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/RecordDetails.java @@ -1,47 +1,86 @@ package org.evergreen.android.searchCatalog; -import android.app.TabActivity; -import android.content.Intent; +import org.evergreen.android.R; +import org.evergreen.android.utils.ui.RealViewSwitcher; + +import android.app.Activity; +import android.graphics.Color; import android.os.Bundle; -import android.widget.TabHost; -import android.widget.TabHost.TabSpec; +import android.util.Log; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; -public class RecordDetails extends TabActivity{ +public class RecordDetails extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - TabHost tabHost = getTabHost(); - - - RecordInfo record = (RecordInfo) getIntent().getSerializableExtra("recordInfo"); - - // Tab for Photos - TabSpec photospec = tabHost.newTabSpec("Info"); - // setting Title and Icon for the Tab - photospec.setIndicator("Info"); - Intent photosIntent = new Intent(this, RecordDetails_Info.class); - photospec.setContent(photosIntent); - photosIntent.putExtra("recordInfo", record); - - // Tab for Songs - TabSpec songspec = tabHost.newTabSpec("Content"); - songspec.setIndicator("Content"); - Intent songsIntent = new Intent(this, RecordDetails_Content.class); - songspec.setContent(songsIntent); - songsIntent.putExtra("recordInfo", record); - // Tab for Videos - TabSpec videospec = tabHost.newTabSpec("Other"); - videospec.setIndicator("Other"); - Intent videosIntent = new Intent(this, RecordDetails_Details.class); - videospec.setContent(videosIntent); - videosIntent.putExtra("recordInfo",record); - - // Adding all TabSpec to TabHost - tabHost.addTab(photospec); // Adding photos tab - tabHost.addTab(songspec); // Adding songs tab - tabHost.addTab(videospec); // Adding videos tab + + // create the view switcher + RealViewSwitcher realViewSwitcher = new RealViewSwitcher(getApplicationContext()); + + // add some views to it + final int[] backgroundColors = { Color.RED, Color.BLUE, Color.CYAN, Color.GREEN, Color.YELLOW }; + for (int i = 0; i < 5; i++) { + + + + TextView textView = new TextView(getApplicationContext()); + textView.setText(Integer.toString(i + 1)); + textView.setTextSize(100); + textView.setTextColor(Color.BLACK); + textView.setGravity(Gravity.CENTER); + textView.setBackgroundColor(backgroundColors[i]); + realViewSwitcher.addView(textView); + } + + LayoutInflater factory = getLayoutInflater(); + + + LinearLayout layout = (LinearLayout) factory.inflate(R.layout.record_details_info, null); + + + ScrollView scroll = (ScrollView) factory.inflate(R.layout.record_details_simple, null); + + + System.out.println( layout + " scrol" + scroll); + + realViewSwitcher.addView(layout); + realViewSwitcher.addView(scroll); + + // set as content view + setContentView(realViewSwitcher); + + + + // yeah, it really is as simple as this :-) + + // note that you can also define your own views directly in a resource XML, too by using: + // + // + // + + + + // OPTIONAL: listen for screen changes + realViewSwitcher.setOnScreenSwitchListener(onScreenSwitchListener); } + private final RealViewSwitcher.OnScreenSwitchListener onScreenSwitchListener = new RealViewSwitcher.OnScreenSwitchListener() { + + @Override + public void onScreenSwitched(int screen) { + // this method is executed if a screen has been activated, i.e. the screen is completely visible + // and the animation has stopped (might be useful for removing / adding new views) + Log.d("RealViewSwitcher", "switched to screen: " + screen); + } + + }; } diff --git a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java index ea490a38f8..3d613b4585 100644 --- a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java +++ b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalog.java @@ -34,6 +34,23 @@ public class SearchCatalog { /** The METHO d_ sli m_ retrive. */ public static String METHOD_SLIM_RETRIVE = "open-ils.search.biblio.record.mods_slim.retrieve"; + /** Method + * @param : no parameters + * @returns : returns array of ccs objects + */ + + public static String METHOD_COPY_STATUS_ALL ="open-ils.search.config.copy_status.retrieve.all"; + + /** + * Method that returns library where record with id is + * @param : record ID to get all libraries, or just book ID, Current Library ID, User ID + * @returns : [[["4","","CONCERTO 27","","Stacks",{"0":5}],["4","","PERFORM 27","","Stacks",{"0":2}]]] + * "0":% is the available books + * [org_id, call_number_sufix, copy_location, status1:count, status2:count ..] + */ + public static String METHOD_COPY_LOCATION_COUNTS = "open-ils.search.biblio.copy_location_counts.summary.retrieve"; + + /** The conn. */ public HttpConnection conn; diff --git a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java index 5ded2c3e37..42127c6877 100644 --- a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java +++ b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/SearchCatalogListView.java @@ -176,7 +176,7 @@ public class SearchCatalogListView extends Activity{ else{ //start activity with book details - Intent intent = new Intent(getBaseContext(),RecordDetails_Simple.class); + Intent intent = new Intent(getBaseContext(),TabsView.class); //serialize object and pass it to next activity intent.putExtra("recordInfo", info); diff --git a/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/TabsView.java b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/TabsView.java new file mode 100644 index 0000000000..37f06f162d --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/searchCatalog/TabsView.java @@ -0,0 +1,68 @@ +package org.evergreen.android.searchCatalog; + +import org.evergreen.android.R; +import org.evergreen.android.utils.ui.AdvancedDetailsFragment; +import org.evergreen.android.utils.ui.BaseSampleActivity; +import org.evergreen.android.utils.ui.BasicDetailsFragment; +import org.evergreen.android.utils.ui.TabPageIndicator; +import org.evergreen.android.utils.ui.TestFragment; +import org.evergreen.android.utils.ui.TestFragmentAdapter; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.view.ViewPager; + +public class TabsView extends BaseSampleActivity { + private static final String[] CONTENT = new String[] { "Details", "Advanced"}; + + + private RecordInfo record; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.simple_tabs); + + record = (RecordInfo) getIntent().getSerializableExtra("recordInfo"); + + + mAdapter = new SearchFragmentAdapter(getSupportFragmentManager()); + + + //mAdapter.getItem(0). + + mPager = (ViewPager)findViewById(R.id.pager); + mPager.setAdapter(mAdapter); + + mIndicator = (TabPageIndicator)findViewById(R.id.indicator); + mIndicator.setViewPager(mPager); + } + + class SearchFragmentAdapter extends TestFragmentAdapter { + public SearchFragmentAdapter(FragmentManager fm) { + super(fm); + } + + @Override + public Fragment getItem(int position) { + + if(position == 1) + return AdvancedDetailsFragment.newInstance(record); + if(position == 0) + return BasicDetailsFragment.newInstance(record); + + return TestFragment.newInstance(TabsView.CONTENT[position % TabsView.CONTENT.length]); + } + + @Override + public int getCount() { + return 2; + //return TabsView.CONTENT.length; + } + + @Override + public CharSequence getPageTitle(int position) { + return TabsView.CONTENT[position % TabsView.CONTENT.length].toUpperCase(); + } + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/AdvancedDetailsFragment.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/AdvancedDetailsFragment.java new file mode 100644 index 0000000000..1f2669780f --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/AdvancedDetailsFragment.java @@ -0,0 +1,69 @@ +package org.evergreen.android.utils.ui; + +import org.evergreen.android.R; +import org.evergreen.android.searchCatalog.RecordInfo; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import android.widget.LinearLayout.LayoutParams; + +public class AdvancedDetailsFragment extends Fragment{ + + private RecordInfo record; + + private TextView seriesTextView; + private TextView subjectTextView; + private TextView synopsisTextView; + private TextView isbnTextView; + + + + public static AdvancedDetailsFragment newInstance(RecordInfo record) { + AdvancedDetailsFragment fragment = new AdvancedDetailsFragment(record); + + + return fragment; + } + + public AdvancedDetailsFragment(RecordInfo record){ + this.record = record; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + ScrollView layout = (ScrollView) inflater.inflate(R.layout.record_details_more_fragment, null); + + seriesTextView = (TextView) layout.findViewById(R.id.record_details_simple_series); + subjectTextView = (TextView) layout.findViewById(R.id.record_details_simple_subject); + synopsisTextView = (TextView) layout.findViewById(R.id.record_details_simple_synopsis); + isbnTextView = (TextView) layout.findViewById(R.id.record_details_simple_isbn); + + + seriesTextView.setText(record.series); + subjectTextView.setText(record.subject); + synopsisTextView.setText(record.synopsis); + + isbnTextView.setText(record.isbn); + + return layout; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BaseSampleActivity.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BaseSampleActivity.java new file mode 100644 index 0000000000..92c304bbe1 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BaseSampleActivity.java @@ -0,0 +1,53 @@ + +package org.evergreen.android.utils.ui; + + +import java.util.Random; + +import org.evergreen.android.R; + +import android.support.v4.app.FragmentActivity; +import android.support.v4.view.ViewPager; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.Toast; + +public abstract class BaseSampleActivity extends FragmentActivity { + private static final Random RANDOM = new Random(); + + public TestFragmentAdapter mAdapter; + public ViewPager mPager; + public PageIndicator mIndicator; + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.random: + final int page = RANDOM.nextInt(mAdapter.getCount()); + Toast.makeText(this, "Changing to page " + page, Toast.LENGTH_SHORT); + mPager.setCurrentItem(page); + return true; + + case R.id.add_page: + if (mAdapter.getCount() < 10) { + mAdapter.setCount(mAdapter.getCount() + 1); + mIndicator.notifyDataSetChanged(); + } + return true; + + case R.id.remove_page: + if (mAdapter.getCount() > 1) { + mAdapter.setCount(mAdapter.getCount() - 1); + mIndicator.notifyDataSetChanged(); + } + return true; + } + return super.onOptionsItemSelected(item); + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BasicDetailsFragment.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BasicDetailsFragment.java new file mode 100644 index 0000000000..a9544254d8 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/BasicDetailsFragment.java @@ -0,0 +1,65 @@ +package org.evergreen.android.utils.ui; + +import org.evergreen.android.R; +import org.evergreen.android.searchCatalog.RecordInfo; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ScrollView; +import android.widget.TextView; +import android.widget.LinearLayout.LayoutParams; + +public class BasicDetailsFragment extends Fragment{ + + + private RecordInfo record; + + private TextView titleTextView; + private TextView authorTextView; + private TextView publisherTextView; + + public static BasicDetailsFragment newInstance(RecordInfo record) { + BasicDetailsFragment fragment = new BasicDetailsFragment(record); + + return fragment; + } + + public BasicDetailsFragment(RecordInfo record){ + + this.record = record; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + ScrollView layout = (ScrollView) inflater.inflate(R.layout.record_details_basic_fragment, null); + + titleTextView = (TextView) layout.findViewById(R.id.record_details_simple_title); + authorTextView = (TextView) layout.findViewById(R.id.record_details_simple_author); + publisherTextView = (TextView) layout.findViewById(R.id.record_details_simple_publisher); + + + titleTextView.setText(record.title); + authorTextView.setText(record.author); + publisherTextView.setText(record.pubdate + " " + record.publisher); + + + return layout; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/PageIndicator.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/PageIndicator.java new file mode 100644 index 0000000000..2622564f94 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/PageIndicator.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 Patrik Akerfeldt + * Copyright (C) 2011 Jake Wharton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.evergreen.android.utils.ui; + + +import android.support.v4.view.ViewPager; + +/** + * A PageIndicator is responsible to show an visual indicator on the total views + * number and the current visible view. + */ +public interface PageIndicator extends ViewPager.OnPageChangeListener { + /** + * Bind the indicator to a ViewPager. + * + * @param view + */ + void setViewPager(ViewPager view); + + /** + * Bind the indicator to a ViewPager. + * + * @param view + * @param initialPosition + */ + void setViewPager(ViewPager view, int initialPosition); + + /** + *

Set the current page of both the ViewPager and indicator.

+ * + *

This must be used if you need to set the page before + * the views are drawn on screen (e.g., default start page).

+ * + * @param item + */ + void setCurrentItem(int item); + + /** + * Set a page change listener which will receive forwarded events. + * + * @param listener + */ + void setOnPageChangeListener(ViewPager.OnPageChangeListener listener); + + /** + * Notify the indicator that the fragment list has changed. + */ + void notifyDataSetChanged(); +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/RealViewSwitcher.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/RealViewSwitcher.java new file mode 100644 index 0000000000..16f5e52016 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/RealViewSwitcher.java @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2010 Marc Reichelt + * + * Work derived from Workspace.java of the Launcher application + * see http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.evergreen.android.utils.ui; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.VelocityTracker; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.ViewGroup; +import android.widget.Scroller; + +/** + * RealViewSwitcher allows users to switch between multiple screens (layouts) in the same way as the Android home screen (Launcher application). + *

+ * You can add and remove views using the normal methods {@link ViewGroup#addView(View)}, {@link ViewGroup#removeView(View)} etc. You may want to listen for updates by calling {@link RealViewSwitcher#setOnScreenSwitchListener(OnScreenSwitchListener)} + * in order to perform operations once a new screen has been selected. + * + * @author Marc Reichelt, http://www.marcreichelt.de/ + * @version 0.1.0 + */ +public class RealViewSwitcher extends ViewGroup { + + // TODO: This class does the basic stuff right now, but it would be cool to have certain things implemented, + // e.g. using an adapter for getting views instead of setting them directly, memory management and the + // possibility of scrolling vertically instead of horizontally. If you have ideas or patches, please visit + // my website and drop me a mail. :-) + + /** + * Listener for the event that the RealViewSwitcher switches to a new view. + */ + public static interface OnScreenSwitchListener { + + /** + * Notifies listeners about the new screen. Runs after the animation completed. + * + * @param screen The new screen index. + */ + void onScreenSwitched(int screen); + + } + + private static final int SNAP_VELOCITY = 1000; + private static final int INVALID_SCREEN = -1; + + private Scroller mScroller; + private VelocityTracker mVelocityTracker; + + private final static int TOUCH_STATE_REST = 0; + private final static int TOUCH_STATE_SCROLLING = 1; + + private int mTouchState = TOUCH_STATE_REST; + + private float mLastMotionX; + private int mTouchSlop; + private int mMaximumVelocity; + private int mCurrentScreen; + private int mNextScreen = INVALID_SCREEN; + + private boolean mFirstLayout = true; + + private OnScreenSwitchListener mOnScreenSwitchListener; + + public RealViewSwitcher(Context context) { + super(context); + init(); + } + + public RealViewSwitcher(Context context, AttributeSet attrs) { + super(context, attrs); + init(); + } + + private void init() { + mScroller = new Scroller(getContext()); + + final ViewConfiguration configuration = ViewConfiguration.get(getContext()); + mTouchSlop = configuration.getScaledTouchSlop(); + mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + + final int width = MeasureSpec.getSize(widthMeasureSpec); + final int widthMode = MeasureSpec.getMode(widthMeasureSpec); + if (widthMode != MeasureSpec.EXACTLY) { + throw new IllegalStateException("ViewSwitcher can only be used in EXACTLY mode."); + } + + final int heightMode = MeasureSpec.getMode(heightMeasureSpec); + if (heightMode != MeasureSpec.EXACTLY) { + throw new IllegalStateException("ViewSwitcher can only be used in EXACTLY mode."); + } + + // The children are given the same width and height as the workspace + final int count = getChildCount(); + for (int i = 0; i < count; i++) { + getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec); + } + + if (mFirstLayout) { + scrollTo(mCurrentScreen * width, 0); + mFirstLayout = false; + } + } + + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + int childLeft = 0; + + final int count = getChildCount(); + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + if (child.getVisibility() != View.GONE) { + final int childWidth = child.getMeasuredWidth(); + child.layout(childLeft, 0, childLeft + childWidth, child.getMeasuredHeight()); + childLeft += childWidth; + } + } + } + + @Override + public boolean onTouchEvent(MotionEvent ev) { + if (mVelocityTracker == null) { + mVelocityTracker = VelocityTracker.obtain(); + } + mVelocityTracker.addMovement(ev); + + final int action = ev.getAction(); + final float x = ev.getX(); + + switch (action) { + case MotionEvent.ACTION_DOWN: + /* + * If being flinged and user touches, stop the fling. isFinished will be false if being flinged. + */ + if (!mScroller.isFinished()) { + mScroller.abortAnimation(); + } + + // Remember where the motion event started + mLastMotionX = x; + + mTouchState = mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING; + + break; + + case MotionEvent.ACTION_MOVE: + final int xDiff = (int) Math.abs(x - mLastMotionX); + + boolean xMoved = xDiff > mTouchSlop; + + if (xMoved) { + // Scroll if the user moved far enough along the X axis + mTouchState = TOUCH_STATE_SCROLLING; + } + + if (mTouchState == TOUCH_STATE_SCROLLING) { + // Scroll to follow the motion event + final int deltaX = (int) (mLastMotionX - x); + mLastMotionX = x; + + final int scrollX = getScrollX(); + if (deltaX < 0) { + if (scrollX > 0) { + scrollBy(Math.max(-scrollX, deltaX), 0); + } + } else if (deltaX > 0) { + final int availableToScroll = getChildAt(getChildCount() - 1).getRight() - scrollX - getWidth(); + if (availableToScroll > 0) { + scrollBy(Math.min(availableToScroll, deltaX), 0); + } + } + } + break; + + case MotionEvent.ACTION_UP: + if (mTouchState == TOUCH_STATE_SCROLLING) { + final VelocityTracker velocityTracker = mVelocityTracker; + velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); + int velocityX = (int) velocityTracker.getXVelocity(); + + if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) { + // Fling hard enough to move left + snapToScreen(mCurrentScreen - 1); + } else if (velocityX < -SNAP_VELOCITY && mCurrentScreen < getChildCount() - 1) { + // Fling hard enough to move right + snapToScreen(mCurrentScreen + 1); + } else { + snapToDestination(); + } + + if (mVelocityTracker != null) { + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + } + + mTouchState = TOUCH_STATE_REST; + + break; + case MotionEvent.ACTION_CANCEL: + mTouchState = TOUCH_STATE_REST; + } + + return true; + } + + private void snapToDestination() { + final int screenWidth = getWidth(); + final int whichScreen = (getScrollX() + (screenWidth / 2)) / screenWidth; + + snapToScreen(whichScreen); + } + + private void snapToScreen(int whichScreen) { + if (!mScroller.isFinished()) + return; + + whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1)); + + mNextScreen = whichScreen; + + final int newX = whichScreen * getWidth(); + final int delta = newX - getScrollX(); + mScroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta) * 2); + invalidate(); + } + + @Override + public void computeScroll() { + if (mScroller.computeScrollOffset()) { + scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); + postInvalidate(); + } else if (mNextScreen != INVALID_SCREEN) { + mCurrentScreen = Math.max(0, Math.min(mNextScreen, getChildCount() - 1)); + + // notify observer about screen change + if (mOnScreenSwitchListener != null) + mOnScreenSwitchListener.onScreenSwitched(mCurrentScreen); + + mNextScreen = INVALID_SCREEN; + } + } + + /** + * Returns the index of the currently displayed screen. + * + * @return The index of the currently displayed screen. + */ + public int getCurrentScreen() { + return mCurrentScreen; + } + + /** + * Sets the current screen. + * + * @param currentScreen The new screen. + */ + public void setCurrentScreen(int currentScreen) { + mCurrentScreen = Math.max(0, Math.min(currentScreen, getChildCount() - 1)); + scrollTo(mCurrentScreen * getWidth(), 0); + invalidate(); + } + + /** + * Sets the {@link ViewSwitcher.OnScreenSwitchListener}. + * + * @param onScreenSwitchListener The listener for switch events. + */ + public void setOnScreenSwitchListener(OnScreenSwitchListener onScreenSwitchListener) { + mOnScreenSwitchListener = onScreenSwitchListener; + } + +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TabPageIndicator.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TabPageIndicator.java new file mode 100644 index 0000000000..a6dcc18048 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TabPageIndicator.java @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * Copyright (C) 2011 Jake Wharton + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.evergreen.android.utils.ui; + +import static android.view.ViewGroup.LayoutParams.FILL_PARENT; +import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; + +import org.evergreen.android.R; + +import android.content.Context; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v4.view.ViewPager.OnPageChangeListener; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.HorizontalScrollView; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** + * This widget implements the dynamic action bar tab behavior that can change + * across different configurations or circumstances. + */ +public class TabPageIndicator extends HorizontalScrollView implements PageIndicator { + /** Title text used when no title is provided by the adapter. */ + private static final CharSequence EMPTY_TITLE = ""; + + /** + * Interface for a callback when the selected tab has been reselected. + */ + public interface OnTabReselectedListener { + /** + * Callback when the selected tab has been reselected. + * + * @param position Position of the current center item. + */ + void onTabReselected(int position); + } + + private Runnable mTabSelector; + + private final OnClickListener mTabClickListener = new OnClickListener() { + public void onClick(View view) { + TabView tabView = (TabView)view; + final int oldSelected = mViewPager.getCurrentItem(); + final int newSelected = tabView.getIndex(); + mViewPager.setCurrentItem(newSelected); + if (oldSelected == newSelected && mTabReselectedListener != null) { + mTabReselectedListener.onTabReselected(newSelected); + } + } + }; + + private final LinearLayout mTabLayout; + private ViewPager mViewPager; + private ViewPager.OnPageChangeListener mListener; + + private int mMaxTabWidth; + private int mSelectedTabIndex; + + private OnTabReselectedListener mTabReselectedListener; + + public TabPageIndicator(Context context) { + this(context, null); + } + + public TabPageIndicator(Context context, AttributeSet attrs) { + super(context, attrs); + setHorizontalScrollBarEnabled(false); + + mTabLayout = new LinearLayout(getContext()); + addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, FILL_PARENT)); + } + + public void setOnTabReselectedListener(OnTabReselectedListener listener) { + mTabReselectedListener = listener; + } + + @Override + public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + final int widthMode = MeasureSpec.getMode(widthMeasureSpec); + final boolean lockedExpanded = widthMode == MeasureSpec.EXACTLY; + setFillViewport(lockedExpanded); + + final int childCount = mTabLayout.getChildCount(); + if (childCount > 1 && (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST)) { + if (childCount > 2) { + mMaxTabWidth = (int)(MeasureSpec.getSize(widthMeasureSpec) * 0.4f); + } else { + mMaxTabWidth = MeasureSpec.getSize(widthMeasureSpec) / 2; + } + } else { + mMaxTabWidth = -1; + } + + final int oldWidth = getMeasuredWidth(); + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + final int newWidth = getMeasuredWidth(); + + if (lockedExpanded && oldWidth != newWidth) { + // Recenter the tab display if we're at a new (scrollable) size. + setCurrentItem(mSelectedTabIndex); + } + } + + private void animateToTab(final int position) { + final View tabView = mTabLayout.getChildAt(position); + if (mTabSelector != null) { + removeCallbacks(mTabSelector); + } + mTabSelector = new Runnable() { + public void run() { + final int scrollPos = tabView.getLeft() - (getWidth() - tabView.getWidth()) / 2; + smoothScrollTo(scrollPos, 0); + mTabSelector = null; + } + }; + post(mTabSelector); + } + + @Override + public void onAttachedToWindow() { + super.onAttachedToWindow(); + if (mTabSelector != null) { + // Re-post the selector we saved + post(mTabSelector); + } + } + + @Override + public void onDetachedFromWindow() { + super.onDetachedFromWindow(); + if (mTabSelector != null) { + removeCallbacks(mTabSelector); + } + } + + private void addTab(CharSequence text, int index) { + final TabView tabView = new TabView(getContext()); + tabView.mIndex = index; + tabView.setFocusable(true); + tabView.setOnClickListener(mTabClickListener); + tabView.setText(text); + + mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, FILL_PARENT, 1)); + } + + @Override + public void onPageScrollStateChanged(int arg0) { + if (mListener != null) { + mListener.onPageScrollStateChanged(arg0); + } + } + + @Override + public void onPageScrolled(int arg0, float arg1, int arg2) { + if (mListener != null) { + mListener.onPageScrolled(arg0, arg1, arg2); + } + } + + @Override + public void onPageSelected(int arg0) { + setCurrentItem(arg0); + if (mListener != null) { + mListener.onPageSelected(arg0); + } + } + + @Override + public void setViewPager(ViewPager view) { + if (mViewPager == view) { + return; + } + if (mViewPager != null) { + mViewPager.setOnPageChangeListener(null); + } + final PagerAdapter adapter = view.getAdapter(); + if (adapter == null) { + throw new IllegalStateException("ViewPager does not have adapter instance."); + } + mViewPager = view; + view.setOnPageChangeListener(this); + notifyDataSetChanged(); + } + + public void notifyDataSetChanged() { + mTabLayout.removeAllViews(); + PagerAdapter adapter = mViewPager.getAdapter(); + final int count = adapter.getCount(); + for (int i = 0; i < count; i++) { + CharSequence title = adapter.getPageTitle(i); + if (title == null) { + title = EMPTY_TITLE; + } + addTab(title, i); + } + if (mSelectedTabIndex > count) { + mSelectedTabIndex = count - 1; + } + setCurrentItem(mSelectedTabIndex); + requestLayout(); + } + + @Override + public void setViewPager(ViewPager view, int initialPosition) { + setViewPager(view); + setCurrentItem(initialPosition); + } + + @Override + public void setCurrentItem(int item) { + if (mViewPager == null) { + throw new IllegalStateException("ViewPager has not been bound."); + } + mSelectedTabIndex = item; + mViewPager.setCurrentItem(item); + + final int tabCount = mTabLayout.getChildCount(); + for (int i = 0; i < tabCount; i++) { + final View child = mTabLayout.getChildAt(i); + final boolean isSelected = (i == item); + child.setSelected(isSelected); + if (isSelected) { + animateToTab(item); + } + } + } + + @Override + public void setOnPageChangeListener(OnPageChangeListener listener) { + mListener = listener; + } + + private class TabView extends TextView { + private int mIndex; + + public TabView(Context context) { + super(context, null, R.attr.vpiTabPageIndicatorStyle); + } + + @Override + public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + + // Re-measure if we went beyond our maximum size. + if (mMaxTabWidth > 0 && getMeasuredWidth() > mMaxTabWidth) { + super.onMeasure(MeasureSpec.makeMeasureSpec(mMaxTabWidth, MeasureSpec.EXACTLY), + heightMeasureSpec); + } + } + + public int getIndex() { + return mIndex; + } + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragment.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragment.java new file mode 100644 index 0000000000..f5d4f0a6a9 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragment.java @@ -0,0 +1,61 @@ +package org.evergreen.android.utils.ui; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.LinearLayout.LayoutParams; +import android.widget.TextView; + +public final class TestFragment extends Fragment { + private static final String KEY_CONTENT = "TestFragment:Content"; + + public static TestFragment newInstance(String content) { + TestFragment fragment = new TestFragment(); + + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < 20; i++) { + builder.append(content).append(" "); + } + builder.deleteCharAt(builder.length() - 1); + fragment.mContent = builder.toString(); + + return fragment; + } + + private String mContent = "???"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + if ((savedInstanceState != null) && savedInstanceState.containsKey(KEY_CONTENT)) { + mContent = savedInstanceState.getString(KEY_CONTENT); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + TextView text = new TextView(getActivity()); + text.setGravity(Gravity.CENTER); + text.setText(mContent); + text.setTextSize(20 * getResources().getDisplayMetrics().density); + text.setPadding(20, 20, 20, 20); + + LinearLayout layout = new LinearLayout(getActivity()); + layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); + layout.setGravity(Gravity.CENTER); + layout.addView(text); + + return layout; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(KEY_CONTENT, mContent); + } +} diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragmentAdapter.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragmentAdapter.java new file mode 100644 index 0000000000..c898752781 --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TestFragmentAdapter.java @@ -0,0 +1,32 @@ +package org.evergreen.android.utils.ui; + +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentPagerAdapter; + +public class TestFragmentAdapter extends FragmentPagerAdapter { + protected static final String[] CONTENT = new String[] { "This", "Is", "A", "Test", }; + + private int mCount = CONTENT.length; + + public TestFragmentAdapter(FragmentManager fm) { + super(fm); + } + + @Override + public Fragment getItem(int position) { + return TestFragment.newInstance(CONTENT[position % CONTENT.length]); + } + + @Override + public int getCount() { + return mCount; + } + + public void setCount(int count) { + if (count > 0 && count <= 10) { + mCount = count; + notifyDataSetChanged(); + } + } +} \ No newline at end of file diff --git a/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TitlePageIndicator.java b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TitlePageIndicator.java new file mode 100644 index 0000000000..5a0f7f69ab --- /dev/null +++ b/Open-ILS/src/Android/src/org/evergreen/android/utils/ui/TitlePageIndicator.java @@ -0,0 +1,808 @@ +/* + * Copyright (C) 2011 Jake Wharton + * Copyright (C) 2011 Patrik Akerfeldt + * Copyright (C) 2011 Francisco Figueiredo Jr. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.evergreen.android.utils.ui; + +import java.util.ArrayList; + +import org.evergreen.android.R; + +import android.content.Context; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.Rect; +import android.graphics.Typeface; +import android.os.Parcel; +import android.os.Parcelable; +import android.support.v4.view.MotionEventCompat; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewConfigurationCompat; +import android.support.v4.view.ViewPager; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; + +/** + * A TitlePageIndicator is a PageIndicator which displays the title of left view + * (if exist), the title of the current select view (centered) and the title of + * the right view (if exist). When the user scrolls the ViewPager then titles are + * also scrolled. + */ +public class TitlePageIndicator extends View implements PageIndicator { + /** + * Percentage indicating what percentage of the screen width away from + * center should the underline be fully faded. A value of 0.25 means that + * halfway between the center of the screen and an edge. + */ + private static final float SELECTION_FADE_PERCENTAGE = 0.25f; + + /** + * Percentage indicating what percentage of the screen width away from + * center should the selected text bold turn off. A value of 0.05 means + * that 10% between the center and an edge. + */ + private static final float BOLD_FADE_PERCENTAGE = 0.05f; + + /** + * Title text used when no title is provided by the adapter. + */ + private static final String EMPTY_TITLE = ""; + + /** + * Interface for a callback when the center item has been clicked. + */ + public interface OnCenterItemClickListener { + /** + * Callback when the center item has been clicked. + * + * @param position Position of the current center item. + */ + void onCenterItemClick(int position); + } + + public enum IndicatorStyle { + None(0), Triangle(1), Underline(2); + + public final int value; + + private IndicatorStyle(int value) { + this.value = value; + } + + public static IndicatorStyle fromValue(int value) { + for (IndicatorStyle style : IndicatorStyle.values()) { + if (style.value == value) { + return style; + } + } + return null; + } + } + + private ViewPager mViewPager; + private ViewPager.OnPageChangeListener mListener; + private PagerAdapter mPagerAdapter; + private int mCurrentPage = -1; + private float mPageOffset; + private int mScrollState; + private final Paint mPaintText = new Paint(); + private boolean mBoldText; + private int mColorText; + private int mColorSelected; + private Path mPath = new Path(); + private final Rect mBounds = new Rect(); + private final Paint mPaintFooterLine = new Paint(); + private IndicatorStyle mFooterIndicatorStyle; + private final Paint mPaintFooterIndicator = new Paint(); + private float mFooterIndicatorHeight; + private float mFooterIndicatorUnderlinePadding; + private float mFooterPadding; + private float mTitlePadding; + private float mTopPadding; + /** Left and right side padding for not active view titles. */ + private float mClipPadding; + private float mFooterLineHeight; + + private static final int INVALID_POINTER = -1; + + private int mTouchSlop; + private float mLastMotionX = -1; + private int mActivePointerId = INVALID_POINTER; + private boolean mIsDragging; + + private OnCenterItemClickListener mCenterItemClickListener; + + + public TitlePageIndicator(Context context) { + this(context, null); + } + + public TitlePageIndicator(Context context, AttributeSet attrs) { + this(context, attrs, R.attr.vpiTitlePageIndicatorStyle); + } + + public TitlePageIndicator(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + if (isInEditMode()) return; + + //Load defaults from resources + final Resources res = getResources(); + final int defaultFooterColor = res.getColor(R.color.default_title_indicator_footer_color); + final float defaultFooterLineHeight = res.getDimension(R.dimen.default_title_indicator_footer_line_height); + final int defaultFooterIndicatorStyle = res.getInteger(R.integer.default_title_indicator_footer_indicator_style); + final float defaultFooterIndicatorHeight = res.getDimension(R.dimen.default_title_indicator_footer_indicator_height); + final float defaultFooterIndicatorUnderlinePadding = res.getDimension(R.dimen.default_title_indicator_footer_indicator_underline_padding); + final float defaultFooterPadding = res.getDimension(R.dimen.default_title_indicator_footer_padding); + final int defaultSelectedColor = res.getColor(R.color.default_title_indicator_selected_color); + final boolean defaultSelectedBold = res.getBoolean(R.bool.default_title_indicator_selected_bold); + final int defaultTextColor = res.getColor(R.color.default_title_indicator_text_color); + final float defaultTextSize = res.getDimension(R.dimen.default_title_indicator_text_size); + final float defaultTitlePadding = res.getDimension(R.dimen.default_title_indicator_title_padding); + final float defaultClipPadding = res.getDimension(R.dimen.default_title_indicator_clip_padding); + final float defaultTopPadding = res.getDimension(R.dimen.default_title_indicator_top_padding); + + //Retrieve styles attributes + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TitlePageIndicator, defStyle, 0); + + //Retrieve the colors to be used for this view and apply them. + mFooterLineHeight = a.getDimension(R.styleable.TitlePageIndicator_footerLineHeight, defaultFooterLineHeight); + mFooterIndicatorStyle = IndicatorStyle.fromValue(a.getInteger(R.styleable.TitlePageIndicator_footerIndicatorStyle, defaultFooterIndicatorStyle)); + mFooterIndicatorHeight = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorHeight, defaultFooterIndicatorHeight); + mFooterIndicatorUnderlinePadding = a.getDimension(R.styleable.TitlePageIndicator_footerIndicatorUnderlinePadding, defaultFooterIndicatorUnderlinePadding); + mFooterPadding = a.getDimension(R.styleable.TitlePageIndicator_footerPadding, defaultFooterPadding); + mTopPadding = a.getDimension(R.styleable.TitlePageIndicator_topPadding, defaultTopPadding); + mTitlePadding = a.getDimension(R.styleable.TitlePageIndicator_titlePadding, defaultTitlePadding); + mClipPadding = a.getDimension(R.styleable.TitlePageIndicator_clipPadding, defaultClipPadding); + mColorSelected = a.getColor(R.styleable.TitlePageIndicator_selectedColor, defaultSelectedColor); + mColorText = a.getColor(R.styleable.TitlePageIndicator_android_textColor, defaultTextColor); + mBoldText = a.getBoolean(R.styleable.TitlePageIndicator_selectedBold, defaultSelectedBold); + + final float textSize = a.getDimension(R.styleable.TitlePageIndicator_android_textSize, defaultTextSize); + final int footerColor = a.getColor(R.styleable.TitlePageIndicator_footerColor, defaultFooterColor); + mPaintText.setTextSize(textSize); + mPaintText.setAntiAlias(true); + mPaintFooterLine.setStyle(Paint.Style.FILL_AND_STROKE); + mPaintFooterLine.setStrokeWidth(mFooterLineHeight); + mPaintFooterLine.setColor(footerColor); + mPaintFooterIndicator.setStyle(Paint.Style.FILL_AND_STROKE); + mPaintFooterIndicator.setColor(footerColor); + + a.recycle(); + + final ViewConfiguration configuration = ViewConfiguration.get(context); + mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration); + } + + + public int getFooterColor() { + return mPaintFooterLine.getColor(); + } + + public void setFooterColor(int footerColor) { + mPaintFooterLine.setColor(footerColor); + mPaintFooterIndicator.setColor(footerColor); + invalidate(); + } + + public float getFooterLineHeight() { + return mFooterLineHeight; + } + + public void setFooterLineHeight(float footerLineHeight) { + mFooterLineHeight = footerLineHeight; + mPaintFooterLine.setStrokeWidth(mFooterLineHeight); + invalidate(); + } + + public float getFooterIndicatorHeight() { + return mFooterIndicatorHeight; + } + + public void setFooterIndicatorHeight(float footerTriangleHeight) { + mFooterIndicatorHeight = footerTriangleHeight; + invalidate(); + } + + public float getFooterIndicatorPadding() { + return mFooterPadding; + } + + public void setFooterIndicatorPadding(float footerIndicatorPadding) { + mFooterPadding = footerIndicatorPadding; + invalidate(); + } + + public IndicatorStyle getFooterIndicatorStyle() { + return mFooterIndicatorStyle; + } + + public void setFooterIndicatorStyle(IndicatorStyle indicatorStyle) { + mFooterIndicatorStyle = indicatorStyle; + invalidate(); + } + + public int getSelectedColor() { + return mColorSelected; + } + + public void setSelectedColor(int selectedColor) { + mColorSelected = selectedColor; + invalidate(); + } + + public boolean isSelectedBold() { + return mBoldText; + } + + public void setSelectedBold(boolean selectedBold) { + mBoldText = selectedBold; + invalidate(); + } + + public int getTextColor() { + return mColorText; + } + + public void setTextColor(int textColor) { + mPaintText.setColor(textColor); + mColorText = textColor; + invalidate(); + } + + public float getTextSize() { + return mPaintText.getTextSize(); + } + + public void setTextSize(float textSize) { + mPaintText.setTextSize(textSize); + invalidate(); + } + + public float getTitlePadding() { + return this.mTitlePadding; + } + + public void setTitlePadding(float titlePadding) { + mTitlePadding = titlePadding; + invalidate(); + } + + public float getTopPadding() { + return this.mTopPadding; + } + + public void setTopPadding(float topPadding) { + mTopPadding = topPadding; + invalidate(); + } + + public float getClipPadding() { + return this.mClipPadding; + } + + public void setClipPadding(float clipPadding) { + mClipPadding = clipPadding; + invalidate(); + } + + public void setTypeface(Typeface typeface) { + mPaintText.setTypeface(typeface); + invalidate(); + } + + public Typeface getTypeface() { + return mPaintText.getTypeface(); + } + + /* + * (non-Javadoc) + * + * @see android.view.View#onDraw(android.graphics.Canvas) + */ + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + + if (mViewPager == null) { + return; + } + final int count = mViewPager.getAdapter().getCount(); + if (count == 0) { + return; + } + + // mCurrentPage is -1 on first start and after orientation changed. If so, retrieve the correct index from viewpager. + if(mCurrentPage == -1 && mViewPager != null) mCurrentPage = mViewPager.getCurrentItem(); + + //Calculate views bounds + ArrayList bounds = calculateAllBounds(mPaintText); + final int boundsSize = bounds.size(); + + //Make sure we're on a page that still exists + if (mCurrentPage >= boundsSize) { + setCurrentItem(boundsSize - 1); + return; + } + + final int countMinusOne = count - 1; + final float halfWidth = getWidth() / 2f; + final int left = getLeft(); + final float leftClip = left + mClipPadding; + final int width = getWidth(); + final int height = getHeight(); + final int right = left + width; + final float rightClip = right - mClipPadding; + + int page = mCurrentPage; + float offsetPercent; + if (mPageOffset <= 0.5) { + offsetPercent = mPageOffset; + } else { + page += 1; + offsetPercent = 1 - mPageOffset; + } + final boolean currentSelected = (offsetPercent <= SELECTION_FADE_PERCENTAGE); + final boolean currentBold = (offsetPercent <= BOLD_FADE_PERCENTAGE); + final float selectedPercent = (SELECTION_FADE_PERCENTAGE - offsetPercent) / SELECTION_FADE_PERCENTAGE; + + //Verify if the current view must be clipped to the screen + Rect curPageBound = bounds.get(mCurrentPage); + float curPageWidth = curPageBound.right - curPageBound.left; + if (curPageBound.left < leftClip) { + //Try to clip to the screen (left side) + clipViewOnTheLeft(curPageBound, curPageWidth, left); + } + if (curPageBound.right > rightClip) { + //Try to clip to the screen (right side) + clipViewOnTheRight(curPageBound, curPageWidth, right); + } + + //Left views starting from the current position + if (mCurrentPage > 0) { + for (int i = mCurrentPage - 1; i >= 0; i--) { + Rect bound = bounds.get(i); + //Is left side is outside the screen + if (bound.left < leftClip) { + int w = bound.right - bound.left; + //Try to clip to the screen (left side) + clipViewOnTheLeft(bound, w, left); + //Except if there's an intersection with the right view + Rect rightBound = bounds.get(i + 1); + //Intersection + if (bound.right + mTitlePadding > rightBound.left) { + bound.left = (int) (rightBound.left - w - mTitlePadding); + bound.right = bound.left + w; + } + } + } + } + //Right views starting from the current position + if (mCurrentPage < countMinusOne) { + for (int i = mCurrentPage + 1 ; i < count; i++) { + Rect bound = bounds.get(i); + //If right side is outside the screen + if (bound.right > rightClip) { + int w = bound.right - bound.left; + //Try to clip to the screen (right side) + clipViewOnTheRight(bound, w, right); + //Except if there's an intersection with the left view + Rect leftBound = bounds.get(i - 1); + //Intersection + if (bound.left - mTitlePadding < leftBound.right) { + bound.left = (int) (leftBound.right + mTitlePadding); + bound.right = bound.left + w; + } + } + } + } + + //Now draw views + int colorTextAlpha = mColorText >>> 24; + for (int i = 0; i < count; i++) { + //Get the title + Rect bound = bounds.get(i); + //Only if one side is visible + if ((bound.left > left && bound.left < right) || (bound.right > left && bound.right < right)) { + final boolean currentPage = (i == page); + final CharSequence pageTitle = getTitle(i); + + //Only set bold if we are within bounds + mPaintText.setFakeBoldText(currentPage && currentBold && mBoldText); + + //Draw text as unselected + mPaintText.setColor(mColorText); + if(currentPage && currentSelected) { + //Fade out/in unselected text as the selected text fades in/out + mPaintText.setAlpha(colorTextAlpha - (int)(colorTextAlpha * selectedPercent)); + } + canvas.drawText(pageTitle, 0, pageTitle.length(), bound.left, bound.bottom + mTopPadding, mPaintText); + + //If we are within the selected bounds draw the selected text + if (currentPage && currentSelected) { + mPaintText.setColor(mColorSelected); + mPaintText.setAlpha((int)((mColorSelected >>> 24) * selectedPercent)); + canvas.drawText(pageTitle, 0, pageTitle.length(), bound.left, bound.bottom + mTopPadding, mPaintText); + } + } + } + + //Draw the footer line + mPath.reset(); + mPath.moveTo(0, height - mFooterLineHeight / 2f); + mPath.lineTo(width, height - mFooterLineHeight / 2f); + mPath.close(); + canvas.drawPath(mPath, mPaintFooterLine); + + switch (mFooterIndicatorStyle) { + case Triangle: + mPath.reset(); + mPath.moveTo(halfWidth, height - mFooterLineHeight - mFooterIndicatorHeight); + mPath.lineTo(halfWidth + mFooterIndicatorHeight, height - mFooterLineHeight); + mPath.lineTo(halfWidth - mFooterIndicatorHeight, height - mFooterLineHeight); + mPath.close(); + canvas.drawPath(mPath, mPaintFooterIndicator); + break; + + case Underline: + if (!currentSelected || page >= boundsSize) { + break; + } + + Rect underlineBounds = bounds.get(page); + mPath.reset(); + mPath.moveTo(underlineBounds.left - mFooterIndicatorUnderlinePadding, height - mFooterLineHeight); + mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight); + mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight - mFooterIndicatorHeight); + mPath.lineTo(underlineBounds.left - mFooterIndicatorUnderlinePadding, height - mFooterLineHeight - mFooterIndicatorHeight); + mPath.close(); + + mPaintFooterIndicator.setAlpha((int)(0xFF * selectedPercent)); + canvas.drawPath(mPath, mPaintFooterIndicator); + mPaintFooterIndicator.setAlpha(0xFF); + break; + } + } + + public boolean onTouchEvent(android.view.MotionEvent ev) { + if (super.onTouchEvent(ev)) { + return true; + } + if ((mViewPager == null) || (mViewPager.getAdapter().getCount() == 0)) { + return false; + } + + final int action = ev.getAction(); + + switch (action & MotionEventCompat.ACTION_MASK) { + case MotionEvent.ACTION_DOWN: + mActivePointerId = MotionEventCompat.getPointerId(ev, 0); + mLastMotionX = ev.getX(); + break; + + case MotionEvent.ACTION_MOVE: { + final int activePointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId); + final float x = MotionEventCompat.getX(ev, activePointerIndex); + final float deltaX = x - mLastMotionX; + + if (!mIsDragging) { + if (Math.abs(deltaX) > mTouchSlop) { + mIsDragging = true; + } + } + + if (mIsDragging) { + mLastMotionX = x; + if (mViewPager.isFakeDragging() || mViewPager.beginFakeDrag()) { + mViewPager.fakeDragBy(deltaX); + } + } + + break; + } + + case MotionEvent.ACTION_CANCEL: + case MotionEvent.ACTION_UP: + if (!mIsDragging) { + final int count = mViewPager.getAdapter().getCount(); + final int width = getWidth(); + final float halfWidth = width / 2f; + final float sixthWidth = width / 6f; + final float leftThird = halfWidth - sixthWidth; + final float rightThird = halfWidth + sixthWidth; + final float eventX = ev.getX(); + + if (eventX < leftThird) { + if (mCurrentPage > 0) { + mViewPager.setCurrentItem(mCurrentPage - 1); + return true; + } + } else if (eventX > rightThird) { + if (mCurrentPage < count - 1) { + mViewPager.setCurrentItem(mCurrentPage + 1); + return true; + } + } else { + //Middle third + if (mCenterItemClickListener != null) { + mCenterItemClickListener.onCenterItemClick(mCurrentPage); + } + } + } + + mIsDragging = false; + mActivePointerId = INVALID_POINTER; + if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag(); + break; + + case MotionEventCompat.ACTION_POINTER_DOWN: { + final int index = MotionEventCompat.getActionIndex(ev); + final float x = MotionEventCompat.getX(ev, index); + mLastMotionX = x; + mActivePointerId = MotionEventCompat.getPointerId(ev, index); + break; + } + + case MotionEventCompat.ACTION_POINTER_UP: + final int pointerIndex = MotionEventCompat.getActionIndex(ev); + final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex); + if (pointerId == mActivePointerId) { + final int newPointerIndex = pointerIndex == 0 ? 1 : 0; + mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex); + } + mLastMotionX = MotionEventCompat.getX(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId)); + break; + } + + return true; + }; + + /** + * Set bounds for the right textView including clip padding. + * + * @param curViewBound + * current bounds. + * @param curViewWidth + * width of the view. + */ + private void clipViewOnTheRight(Rect curViewBound, float curViewWidth, int right) { + curViewBound.right = (int) (right - mClipPadding); + curViewBound.left = (int) (curViewBound.right - curViewWidth); + } + + /** + * Set bounds for the left textView including clip padding. + * + * @param curViewBound + * current bounds. + * @param curViewWidth + * width of the view. + */ + private void clipViewOnTheLeft(Rect curViewBound, float curViewWidth, int left) { + curViewBound.left = (int) (left + mClipPadding); + curViewBound.right = (int) (mClipPadding + curViewWidth); + } + + /** + * Calculate views bounds and scroll them according to the current index + * + * @param paint + * @return + */ + private ArrayList calculateAllBounds(Paint paint) { + ArrayList list = new ArrayList(); + //For each views (If no values then add a fake one) + final int count = mViewPager.getAdapter().getCount(); + final int width = getWidth(); + final int halfWidth = width / 2; + for (int i = 0; i < count; i++) { + Rect bounds = calcBounds(i, paint); + int w = bounds.right - bounds.left; + int h = bounds.bottom - bounds.top; + bounds.left = (int)(halfWidth - (w / 2f) + ((i - mCurrentPage - mPageOffset) * width)); + bounds.right = bounds.left + w; + bounds.top = 0; + bounds.bottom = h; + list.add(bounds); + } + + return list; + } + + /** + * Calculate the bounds for a view's title + * + * @param index + * @param paint + * @return + */ + private Rect calcBounds(int index, Paint paint) { + //Calculate the text bounds + Rect bounds = new Rect(); + CharSequence title = getTitle(index); + bounds.right = (int) paint.measureText(title, 0, title.length()); + bounds.bottom = (int) (paint.descent() - paint.ascent()); + return bounds; + } + + @Override + public void setViewPager(ViewPager view) { + if (mViewPager == view) { + return; + } + if (mViewPager != null) { + mViewPager.setOnPageChangeListener(null); + } + mPagerAdapter = view.getAdapter(); + if (mPagerAdapter == null) { + throw new IllegalStateException("ViewPager does not have adapter instance."); + } + mViewPager = view; + mViewPager.setOnPageChangeListener(this); + invalidate(); + } + + @Override + public void setViewPager(ViewPager view, int initialPosition) { + setViewPager(view); + setCurrentItem(initialPosition); + } + + @Override + public void notifyDataSetChanged() { + invalidate(); + } + + /** + * Set a callback listener for the center item click. + * + * @param listener Callback instance. + */ + public void setOnCenterItemClickListener(OnCenterItemClickListener listener) { + mCenterItemClickListener = listener; + } + + @Override + public void setCurrentItem(int item) { + if (mViewPager == null) { + throw new IllegalStateException("ViewPager has not been bound."); + } + mViewPager.setCurrentItem(item); + mCurrentPage = item; + invalidate(); + } + + @Override + public void onPageScrollStateChanged(int state) { + mScrollState = state; + + if (mListener != null) { + mListener.onPageScrollStateChanged(state); + } + } + + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + mCurrentPage = position; + mPageOffset = positionOffset; + invalidate(); + + if (mListener != null) { + mListener.onPageScrolled(position, positionOffset, positionOffsetPixels); + } + } + + @Override + public void onPageSelected(int position) { + if (mScrollState == ViewPager.SCROLL_STATE_IDLE) { + mCurrentPage = position; + invalidate(); + } + + if (mListener != null) { + mListener.onPageSelected(position); + } + } + + @Override + public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) { + mListener = listener; + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + //Measure our width in whatever mode specified + final int measuredWidth = MeasureSpec.getSize(widthMeasureSpec); + + //Determine our height + float height = 0; + final int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec); + if (heightSpecMode == MeasureSpec.EXACTLY) { + //We were told how big to be + height = MeasureSpec.getSize(heightMeasureSpec); + } else { + //Calculate the text bounds + mBounds.setEmpty(); + mBounds.bottom = (int) (mPaintText.descent() - mPaintText.ascent()); + height = mBounds.bottom - mBounds.top + mFooterLineHeight + mFooterPadding + mTopPadding; + if (mFooterIndicatorStyle != IndicatorStyle.None) { + height += mFooterIndicatorHeight; + } + } + final int measuredHeight = (int)height; + + setMeasuredDimension(measuredWidth, measuredHeight); + } + + @Override + public void onRestoreInstanceState(Parcelable state) { + SavedState savedState = (SavedState)state; + super.onRestoreInstanceState(savedState.getSuperState()); + mCurrentPage = savedState.currentPage; + requestLayout(); + } + + @Override + public Parcelable onSaveInstanceState() { + Parcelable superState = super.onSaveInstanceState(); + SavedState savedState = new SavedState(superState); + savedState.currentPage = mCurrentPage; + return savedState; + } + + static class SavedState extends BaseSavedState { + int currentPage; + + public SavedState(Parcelable superState) { + super(superState); + } + + private SavedState(Parcel in) { + super(in); + currentPage = in.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + dest.writeInt(currentPage); + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public SavedState createFromParcel(Parcel in) { + return new SavedState(in); + } + + @Override + public SavedState[] newArray(int size) { + return new SavedState[size]; + } + }; + } + + private CharSequence getTitle(int i) { + CharSequence title = mPagerAdapter.getPageTitle(i); + if (title == null) { + title = EMPTY_TITLE; + } + return title.toString(); + } +}