diff --git a/9781430257851.jpg b/9781430257851.jpg new file mode 100644 index 0000000..b8989d2 Binary files /dev/null and b/9781430257851.jpg differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..6eb3504 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2013 Wallace Jackson + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/ProAndroidGraphics/.classpath b/ProAndroidGraphics/.classpath new file mode 100644 index 0000000..bb0c759 --- /dev/null +++ b/ProAndroidGraphics/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/ProAndroidGraphics/.project b/ProAndroidGraphics/.project new file mode 100644 index 0000000..31b412b --- /dev/null +++ b/ProAndroidGraphics/.project @@ -0,0 +1,33 @@ + + + GraphicsDesign + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/ProAndroidGraphics/AndroidManifest.xml b/ProAndroidGraphics/AndroidManifest.xml new file mode 100644 index 0000000..80e1b48 --- /dev/null +++ b/ProAndroidGraphics/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/ic_launcher-web.png b/ProAndroidGraphics/ic_launcher-web.png new file mode 100644 index 0000000..a18cbb4 Binary files /dev/null and b/ProAndroidGraphics/ic_launcher-web.png differ diff --git a/ProAndroidGraphics/proguard-project.txt b/ProAndroidGraphics/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/ProAndroidGraphics/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/ProAndroidGraphics/project.properties b/ProAndroidGraphics/project.properties new file mode 100644 index 0000000..a3ee5ab --- /dev/null +++ b/ProAndroidGraphics/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-17 diff --git a/ProAndroidGraphics/res/anim/pag_anim.xml b/ProAndroidGraphics/res/anim/pag_anim.xml new file mode 100644 index 0000000..fc4a47f --- /dev/null +++ b/ProAndroidGraphics/res/anim/pag_anim.xml @@ -0,0 +1,32 @@ + + + + + + + diff --git a/ProAndroidGraphics/res/drawable-hdpi/Thumbs.db b/ProAndroidGraphics/res/drawable-hdpi/Thumbs.db new file mode 100644 index 0000000..4c3eadb Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/Thumbs.db differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/bookmark0.png b/ProAndroidGraphics/res/drawable-hdpi/bookmark0.png new file mode 100644 index 0000000..e79c19a Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/bookmark0.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/ic_launcher.png b/ProAndroidGraphics/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..288b665 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/ic_launcher.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/imagebutton_focused.png b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_focused.png new file mode 100644 index 0000000..45e8030 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_focused.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/imagebutton_hovered.png b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_hovered.png new file mode 100644 index 0000000..9f122aa Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_hovered.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/imagebutton_normal.png b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_normal.png new file mode 100644 index 0000000..a13893a Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_normal.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/imagebutton_pressed.png b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_pressed.png new file mode 100644 index 0000000..11d88e0 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/imagebutton_pressed.png differ diff --git a/ProAndroidGraphics/res/drawable-hdpi/pag_icon.png b/ProAndroidGraphics/res/drawable-hdpi/pag_icon.png new file mode 100644 index 0000000..5ad809d Binary files /dev/null and b/ProAndroidGraphics/res/drawable-hdpi/pag_icon.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/Thumbs.db b/ProAndroidGraphics/res/drawable-ldpi/Thumbs.db new file mode 100644 index 0000000..ffd1b2b Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/Thumbs.db differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/bookmark0.png b/ProAndroidGraphics/res/drawable-ldpi/bookmark0.png new file mode 100644 index 0000000..0b120d7 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/bookmark0.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/imagebutton_focused.png b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_focused.png new file mode 100644 index 0000000..6f90563 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_focused.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/imagebutton_hovered.png b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_hovered.png new file mode 100644 index 0000000..149fcb1 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_hovered.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/imagebutton_normal.png b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_normal.png new file mode 100644 index 0000000..15fb1d2 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_normal.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/imagebutton_pressed.png b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_pressed.png new file mode 100644 index 0000000..04f38dd Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/imagebutton_pressed.png differ diff --git a/ProAndroidGraphics/res/drawable-ldpi/pag_icon.png b/ProAndroidGraphics/res/drawable-ldpi/pag_icon.png new file mode 100644 index 0000000..2c35511 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-ldpi/pag_icon.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/Thumbs.db b/ProAndroidGraphics/res/drawable-mdpi/Thumbs.db new file mode 100644 index 0000000..e89a764 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/Thumbs.db differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/bookmark0.png b/ProAndroidGraphics/res/drawable-mdpi/bookmark0.png new file mode 100644 index 0000000..1711c49 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/bookmark0.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/ic_launcher.png b/ProAndroidGraphics/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..6ae570b Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/ic_launcher.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/imagebutton_focused.png b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_focused.png new file mode 100644 index 0000000..79f5866 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_focused.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/imagebutton_hovered.png b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_hovered.png new file mode 100644 index 0000000..9698232 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_hovered.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/imagebutton_normal.png b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_normal.png new file mode 100644 index 0000000..7b626f8 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_normal.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/imagebutton_pressed.png b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_pressed.png new file mode 100644 index 0000000..e74bcdc Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/imagebutton_pressed.png differ diff --git a/ProAndroidGraphics/res/drawable-mdpi/pag_icon.png b/ProAndroidGraphics/res/drawable-mdpi/pag_icon.png new file mode 100644 index 0000000..0887449 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-mdpi/pag_icon.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/Thumbs.db b/ProAndroidGraphics/res/drawable-xhdpi/Thumbs.db new file mode 100644 index 0000000..b964849 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/Thumbs.db differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/bookmark0.png b/ProAndroidGraphics/res/drawable-xhdpi/bookmark0.png new file mode 100644 index 0000000..cc5838c Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/bookmark0.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/bookmarks0.png b/ProAndroidGraphics/res/drawable-xhdpi/bookmarks0.png new file mode 100644 index 0000000..fd4ea7a Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/bookmarks0.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/cloudsky.jpg b/ProAndroidGraphics/res/drawable-xhdpi/cloudsky.jpg new file mode 100644 index 0000000..a7de8ea Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/cloudsky.jpg differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/ic_launcher.png b/ProAndroidGraphics/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..d4fb7cd Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/ic_launcher.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_focused.png b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_focused.png new file mode 100644 index 0000000..32c87ae Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_focused.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_hovered.png b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_hovered.png new file mode 100644 index 0000000..e29c440 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_hovered.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_normal.png b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_normal.png new file mode 100644 index 0000000..13aab1f Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_normal.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_pressed.png b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_pressed.png new file mode 100644 index 0000000..bafd331 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/imagebutton_pressed.png differ diff --git a/ProAndroidGraphics/res/drawable-xhdpi/pag_icon.png b/ProAndroidGraphics/res/drawable-xhdpi/pag_icon.png new file mode 100644 index 0000000..b81d3c7 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xhdpi/pag_icon.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/Thumbs.db b/ProAndroidGraphics/res/drawable-xxhdpi/Thumbs.db new file mode 100644 index 0000000..727c118 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/Thumbs.db differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/ic_launcher.png b/ProAndroidGraphics/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..85a6081 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag0.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag0.png new file mode 100644 index 0000000..5cc3147 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag0.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag1.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag1.png new file mode 100644 index 0000000..97c8858 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag1.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag2.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag2.png new file mode 100644 index 0000000..f268dd4 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag2.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag3.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag3.png new file mode 100644 index 0000000..fb8a1ff Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag3.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag4.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag4.png new file mode 100644 index 0000000..57f5d7a Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag4.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag5.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag5.png new file mode 100644 index 0000000..12ec9ff Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag5.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag6.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag6.png new file mode 100644 index 0000000..0214968 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag6.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag7.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag7.png new file mode 100644 index 0000000..c55b6fe Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag7.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag8.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag8.png new file mode 100644 index 0000000..99c60b7 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag8.png differ diff --git a/ProAndroidGraphics/res/drawable-xxhdpi/pag_icon.png b/ProAndroidGraphics/res/drawable-xxhdpi/pag_icon.png new file mode 100644 index 0000000..42c60a8 Binary files /dev/null and b/ProAndroidGraphics/res/drawable-xxhdpi/pag_icon.png differ diff --git a/ProAndroidGraphics/res/drawable/anim_intro.xml b/ProAndroidGraphics/res/drawable/anim_intro.xml new file mode 100644 index 0000000..18c7c4e --- /dev/null +++ b/ProAndroidGraphics/res/drawable/anim_intro.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/drawable/bookmark_states.xml b/ProAndroidGraphics/res/drawable/bookmark_states.xml new file mode 100644 index 0000000..0796b06 --- /dev/null +++ b/ProAndroidGraphics/res/drawable/bookmark_states.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/ProAndroidGraphics/res/drawable/contents_layers.xml b/ProAndroidGraphics/res/drawable/contents_layers.xml new file mode 100644 index 0000000..a98a99e --- /dev/null +++ b/ProAndroidGraphics/res/drawable/contents_layers.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/ProAndroidGraphics/res/drawable/contents_shape.xml b/ProAndroidGraphics/res/drawable/contents_shape.xml new file mode 100644 index 0000000..0c622a7 --- /dev/null +++ b/ProAndroidGraphics/res/drawable/contents_shape.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/ProAndroidGraphics/res/drawable/ninepatchframe.9.png b/ProAndroidGraphics/res/drawable/ninepatchframe.9.png new file mode 100644 index 0000000..d2d3c68 Binary files /dev/null and b/ProAndroidGraphics/res/drawable/ninepatchframe.9.png differ diff --git a/ProAndroidGraphics/res/drawable/trans_contents.xml b/ProAndroidGraphics/res/drawable/trans_contents.xml new file mode 100644 index 0000000..c77965b --- /dev/null +++ b/ProAndroidGraphics/res/drawable/trans_contents.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/ProAndroidGraphics/res/layout/activity_bookmark.xml b/ProAndroidGraphics/res/layout/activity_bookmark.xml new file mode 100644 index 0000000..80ec41d --- /dev/null +++ b/ProAndroidGraphics/res/layout/activity_bookmark.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/layout/activity_contents.xml b/ProAndroidGraphics/res/layout/activity_contents.xml new file mode 100644 index 0000000..f942156 --- /dev/null +++ b/ProAndroidGraphics/res/layout/activity_contents.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/layout/activity_main.xml b/ProAndroidGraphics/res/layout/activity_main.xml new file mode 100644 index 0000000..b0faf0a --- /dev/null +++ b/ProAndroidGraphics/res/layout/activity_main.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/menu/main.xml b/ProAndroidGraphics/res/menu/main.xml new file mode 100644 index 0000000..b98b729 --- /dev/null +++ b/ProAndroidGraphics/res/menu/main.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/raw/Thumbs.db b/ProAndroidGraphics/res/raw/Thumbs.db new file mode 100644 index 0000000..3b49fe7 Binary files /dev/null and b/ProAndroidGraphics/res/raw/Thumbs.db differ diff --git a/ProAndroidGraphics/res/raw/pag480x800portrait.mp4 b/ProAndroidGraphics/res/raw/pag480x800portrait.mp4 new file mode 100644 index 0000000..100ba14 Binary files /dev/null and b/ProAndroidGraphics/res/raw/pag480x800portrait.mp4 differ diff --git a/ProAndroidGraphics/res/raw/pag800x480landscape.mp4 b/ProAndroidGraphics/res/raw/pag800x480landscape.mp4 new file mode 100644 index 0000000..99b05cf Binary files /dev/null and b/ProAndroidGraphics/res/raw/pag800x480landscape.mp4 differ diff --git a/ProAndroidGraphics/res/values-sw600dp/dimens.xml b/ProAndroidGraphics/res/values-sw600dp/dimens.xml new file mode 100644 index 0000000..1ba777d --- /dev/null +++ b/ProAndroidGraphics/res/values-sw600dp/dimens.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values-sw720dp-land/dimens.xml b/ProAndroidGraphics/res/values-sw720dp-land/dimens.xml new file mode 100644 index 0000000..eee741a --- /dev/null +++ b/ProAndroidGraphics/res/values-sw720dp-land/dimens.xml @@ -0,0 +1,9 @@ + + + + 128dp + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values-v11/styles.xml b/ProAndroidGraphics/res/values-v11/styles.xml new file mode 100644 index 0000000..541752f --- /dev/null +++ b/ProAndroidGraphics/res/values-v11/styles.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values-v14/styles.xml b/ProAndroidGraphics/res/values-v14/styles.xml new file mode 100644 index 0000000..f20e015 --- /dev/null +++ b/ProAndroidGraphics/res/values-v14/styles.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values/dimens.xml b/ProAndroidGraphics/res/values/dimens.xml new file mode 100644 index 0000000..a6dd140 --- /dev/null +++ b/ProAndroidGraphics/res/values/dimens.xml @@ -0,0 +1,7 @@ + + + + 16dp + 16dp + + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values/strings.xml b/ProAndroidGraphics/res/values/strings.xml new file mode 100644 index 0000000..6179cb1 --- /dev/null +++ b/ProAndroidGraphics/res/values/strings.xml @@ -0,0 +1,21 @@ + + + Graphics Design + TABLE OF CONTENTS + Table of Contents + Bookmark Utility + The PAG SketchPad + Hello world! + Splash Screen Animation + Chapter One: Digital Imagery + Chapter Two: Digital Video + Chapter Three: Frame Animation + Chapter Four: Vector Animation + Page 10 + Page 47 + Page 89 + Page 114 + BOOKMARKING UTILITY + Current Bookmark Page + Image of Currently Bookmarked Page + \ No newline at end of file diff --git a/ProAndroidGraphics/res/values/styles.xml b/ProAndroidGraphics/res/values/styles.xml new file mode 100644 index 0000000..4a10ca4 --- /dev/null +++ b/ProAndroidGraphics/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/ProAndroidGraphics/src/pro/android/graphics/BookmarkActivity.java b/ProAndroidGraphics/src/pro/android/graphics/BookmarkActivity.java new file mode 100644 index 0000000..966241c --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/BookmarkActivity.java @@ -0,0 +1,22 @@ +package pro.android.graphics; +import java.io.InputStream; +import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Color; +import android.graphics.PorterDuff; +import android.os.Bundle; +import android.widget.ImageView; +public class BookmarkActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_bookmark); + ImageView porterDuffImage = (ImageView)findViewById(R.id.currentBookmarkImage); + porterDuffImage.setColorFilter(Color.rgb(216,192,96), PorterDuff.Mode.MULTIPLY); + ImageView backgroundImage = (ImageView)findViewById(R.id.backgroundImage); + InputStream rawImage = getResources().openRawResource(R.drawable.cloudsky); + Bitmap sourceImage = BitmapFactory.decodeStream(rawImage); + backgroundImage.setBackground(new ImageRoundingDrawable(sourceImage)); + } +} diff --git a/ProAndroidGraphics/src/pro/android/graphics/ContentsActivity.java b/ProAndroidGraphics/src/pro/android/graphics/ContentsActivity.java new file mode 100644 index 0000000..9c60cfe --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/ContentsActivity.java @@ -0,0 +1,47 @@ +package pro.android.graphics; +import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; +import android.graphics.drawable.TransitionDrawable; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageButton; +import android.widget.ImageView; +public class ContentsActivity extends Activity { + Paint paintObject = new Paint(); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_contents); + final TransitionDrawable transition = (TransitionDrawable)getResources().getDrawable(R.drawable.trans_contents); + ImageView porterDuffImageComposite = (ImageView)findViewById(R.id.porterDuffImageView); + porterDuffImageComposite.setBackground(transition); + ImageButton transitionButton = (ImageButton)findViewById(R.id.bookmarkImageButton); + transitionButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View arg0) { + transition.reverseTransition(5000); + } + }); + LayerDrawable layerComposite = (LayerDrawable)getResources().getDrawable(R.drawable.contents_layers); +// Bitmap backgroundImage = BitmapFactory.decodeResource(getResources(), R.drawable.cloudsky); +// Bitmap mutableBackgroundImage = backgroundImage.copy(Bitmap.Config.ARGB_8888, true); + Bitmap foregroundImage = BitmapFactory.decodeResource(getResources(), R.drawable.bookmark0); + Bitmap mutableForegroundImage = foregroundImage.copy(Bitmap.Config.ARGB_8888, true); + paintObject.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.XOR)); + Drawable layerOne = ((LayerDrawable)layerComposite).findDrawableByLayerId(R.id.layerThree); + Bitmap composite = ((BitmapDrawable)layerOne).getBitmap(); + Bitmap mutableComposite = composite.copy(Bitmap.Config.ARGB_8888, true); + Bitmap compositeImage = Bitmap.createBitmap(mutableForegroundImage); + Canvas imageCanvas = new Canvas(compositeImage); + imageCanvas.drawBitmap(mutableComposite, null, new Rect(0, 0, 1000, 1000), paintObject); + } +} diff --git a/ProAndroidGraphics/src/pro/android/graphics/ImageRoundingDrawable.java b/ProAndroidGraphics/src/pro/android/graphics/ImageRoundingDrawable.java new file mode 100644 index 0000000..a9f0dd5 --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/ImageRoundingDrawable.java @@ -0,0 +1,39 @@ +package pro.android.graphics; +import android.graphics.Bitmap; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.ColorFilter; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Shader; +import android.graphics.drawable.Drawable; +public class ImageRoundingDrawable extends Drawable { + private Paint paintObject; + public ImageRoundingDrawable(Bitmap sourceImage){ + BitmapShader imageShader; + imageShader = new BitmapShader(sourceImage, + Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); + paintObject = new Paint(); + paintObject.setAntiAlias(true); + paintObject.setShader(imageShader); + } + @Override + public void draw(Canvas arg0) { + int canvasH = getBounds().height(); + int canvasW = getBounds().width(); + RectF drawRect = new RectF(0.0f,0.0f,canvasW,canvasH); + arg0.drawRoundRect(drawRect, 50, 50, paintObject); + } + @Override + public int getOpacity() { + return 0; + } + @Override + public void setAlpha(int arg0) { + // TODO Auto-generated method stub + } + @Override + public void setColorFilter(ColorFilter arg0) { + // TODO Auto-generated method stub + } +} diff --git a/ProAndroidGraphics/src/pro/android/graphics/MainActivity.java b/ProAndroidGraphics/src/pro/android/graphics/MainActivity.java new file mode 100644 index 0000000..32107ff --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/MainActivity.java @@ -0,0 +1,136 @@ +package pro.android.graphics; +import android.media.MediaPlayer; +import android.net.Uri; +import android.os.Bundle; +import android.app.Activity; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.graphics.drawable.AnimationDrawable; +import android.view.Display; +import android.view.Menu; +import android.view.MenuItem; +import android.view.Surface; +import android.view.View; +import android.view.animation.AccelerateInterpolator; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.RotateAnimation; +import android.view.animation.ScaleAnimation; +import android.widget.ImageView; +import android.widget.VideoView; +import android.view.WindowManager; +public class MainActivity extends Activity { + AnimationDrawable frameAnimation; + AnimationSet pagAnimationSet = new AnimationSet(true); + Animation scaleZeroToFullAnimation; + Animation alphaZeroToFullAnimation; + Animation rotateZeroToFullAnimation; + ProgressDialog downloadProgress; + VideoView splashScreen; + Uri splashScreenUri; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + splashScreen = (VideoView)findViewById(R.id.splashScreenVideoView); + setUpAnimation(); + downloadProgress = new ProgressDialog(this); + downloadProgress.setTitle("Terragen 3 Virtual World Fly-Through Video"); + downloadProgress.setMessage("Downloading Video from Media Server..."); + downloadProgress.setCancelable(false); + downloadProgress.setIndeterminate(false); + downloadProgress.show(); + Display rotationDegrees = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); + switch(rotationDegrees.getRotation()){ + case(Surface.ROTATION_0): + splashScreenUri = Uri.parse("HTTP://www.e-bookclub.com/pag480x800portrait.mp4"); + break; + case(Surface.ROTATION_90): + splashScreenUri = Uri.parse("HTTP://www.e-bookclub.com/pag800x480landscape.mp4"); + break; + case(Surface.ROTATION_180): + splashScreenUri = Uri.parse("HTTP://www.e-bookclub.com/pag480x800portrait.mp4"); + break; + case(Surface.ROTATION_270): + splashScreenUri = Uri.parse("HTTP://www.e-bookclub.com/pag800x480landscape.mp4"); + break; + } + splashScreen.setVideoURI(splashScreenUri); + splashScreen.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { + @Override + public void onPrepared(MediaPlayer splashScreenMediaPlayer) { + splashScreenMediaPlayer.setLooping(true); + downloadProgress.dismiss(); + splashScreen.start(); + } }); + } + private void setUpAnimation() { + final ImageView pag = (ImageView) findViewById(R.id.pagImageView); + pag.setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View arg0) { + pag.setImageDrawable(frameAnimation); + pag.startAnimation(pagAnimationSet); + frameAnimation.start(); + }}); + pag.setOnLongClickListener(new View.OnLongClickListener(){ + @Override + public boolean onLongClick(View arg0) { + frameAnimation.stop(); + pag.setImageDrawable(getResources().getDrawable(R.drawable.pag0)); + return true; + }}); + alphaZeroToFullAnimation = new AlphaAnimation(0, 1); + alphaZeroToFullAnimation.setDuration(5000); + scaleZeroToFullAnimation = new ScaleAnimation(0, 1, 0, 1, + Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); + scaleZeroToFullAnimation.setDuration(5000); + rotateZeroToFullAnimation = new RotateAnimation(0, 360, + Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); + rotateZeroToFullAnimation.setDuration(5000); + pagAnimationSet.addAnimation(scaleZeroToFullAnimation); + pagAnimationSet.addAnimation(alphaZeroToFullAnimation); + pagAnimationSet.addAnimation(rotateZeroToFullAnimation); + pagAnimationSet.setStartOffset(250); + pagAnimationSet.setInterpolator(new AccelerateInterpolator()); + frameAnimation = new AnimationDrawable(); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag0), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag1), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag2), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag3), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag4), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag5), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag6), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag7), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag8), 111); + frameAnimation.addFrame(getResources().getDrawable(R.drawable.pag0), 1); + frameAnimation.setOneShot(false); + } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.main, menu); + return true; + } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.table_of_contents: + Intent intent_toc = new Intent(this, ContentsActivity.class); + this.startActivity(intent_toc); + break; + case R.id.bookmark_utility: + Intent intent_bmu = new Intent(this, BookmarkActivity.class); + this.startActivity(intent_bmu); + break; + case R.id.sketchPad: + Intent intent_spu = new Intent(this, SketchPad.class); + this.startActivity(intent_spu); + break; + default: + return super.onOptionsItemSelected(item); + } + return true; + } +} diff --git a/ProAndroidGraphics/src/pro/android/graphics/SketchPad.java b/ProAndroidGraphics/src/pro/android/graphics/SketchPad.java new file mode 100644 index 0000000..95f52f5 --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/SketchPad.java @@ -0,0 +1,13 @@ +package pro.android.graphics; +import android.app.Activity; +import android.os.Bundle; +public class SketchPad extends Activity { + SketchPadView sketchPadView; + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + sketchPadView = new SketchPadView(this); + setContentView(sketchPadView); + sketchPadView.requestFocus(); + } +} \ No newline at end of file diff --git a/ProAndroidGraphics/src/pro/android/graphics/SketchPadView.java b/ProAndroidGraphics/src/pro/android/graphics/SketchPadView.java new file mode 100644 index 0000000..d70fc37 --- /dev/null +++ b/ProAndroidGraphics/src/pro/android/graphics/SketchPadView.java @@ -0,0 +1,43 @@ +package pro.android.graphics; +import java.util.ArrayList; +import java.util.List; +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Shader; +import android.view.MotionEvent; +import android.view.View; +import android.view.View.OnTouchListener; +public class SketchPadView extends View implements OnTouchListener { + Paint paintScreen = new Paint(); + Bitmap paintImage = BitmapFactory.decodeResource(getResources(), R.drawable.cloudsky); + BitmapShader inkShader = new BitmapShader(paintImage,Shader.TileMode.CLAMP,Shader.TileMode.CLAMP); + List coordinates = new ArrayList(); + public SketchPadView(Context context) { + super(context); + this.setOnTouchListener(this); + paintScreen.setAntiAlias(true); + paintScreen.setShader(inkShader); + setFocusableInTouchMode(true); + setFocusable(true); + } + @Override + public void onDraw(Canvas canvas) { + for (Coordinate point : coordinates) { + canvas.drawCircle(point.x, point.y, 25, paintScreen); + } + } + @Override + public boolean onTouch(View arg0, MotionEvent arg1) { + Coordinate point = new Coordinate(); + point.x = arg1.getX(); + point.y = arg1.getY(); + coordinates.add(point); + invalidate(); + return true; + } +} +class Coordinate { float x, y; } \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1fce930 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*Pro Android Graphics*](http://www.apress.com/9781430257851) by Wallace Jackson (Apress, 2013). + +![Cover image](9781430257851.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file