Skip to content

Commit

Permalink
Comprehensive demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
davemorrissey committed Jun 9, 2014
1 parent 9037a85 commit 00cce30
Show file tree
Hide file tree
Showing 57 changed files with 2,442 additions and 191 deletions.
12 changes: 10 additions & 2 deletions sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@
android:versionName="1.0"
android:hardwareAccelerated="true">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14"/>
<application android:label="Scale View Demo">
<activity android:name=".SampleActivity" android:label="Scale View Demo" android:theme="@android:style/Theme.NoTitleBar">
<application android:label="Scale Image View Demo" android:theme="@style/demoTheme" android:icon="@drawable/launcher">
<activity android:name=".MainActivity" android:label="Scale View Demo">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".basicfeatures.BasicFeaturesActivity"/>
<activity android:name=".imagedisplay.ImageDisplayActivity"/>
<activity android:name=".eventhandling.EventHandlingActivity"/>
<activity android:name=".eventhandlingadvanced.AdvancedEventHandlingActivity"/>
<activity android:name=".viewpager.ViewPagerActivity"/>
<activity android:name=".animation.AnimationActivity"/>
<activity android:name=".extension.ExtensionActivity"/>
<activity android:name=".configuration.ConfigurationActivity"/>
</application>
</manifest>
Binary file removed sample/assets/DSC03250.JPG
Binary file not shown.
Binary file removed sample/assets/DSC04285.JPG
Binary file not shown.
File renamed without changes
Binary file removed sample/assets/card1.png
Binary file not shown.
Binary file removed sample/assets/card2.png
Binary file not shown.
Binary file added sample/assets/squirrel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-hdpi/launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions sample/res/drawable-nodpi/button_standout_inactive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#333333" />
</shape>
4 changes: 4 additions & 0 deletions sample/res/drawable-nodpi/button_standout_pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#0099CC" />
</shape>
4 changes: 4 additions & 0 deletions sample/res/drawable-nodpi/button_transparent_pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#770099cc" />
</shape>
10 changes: 10 additions & 0 deletions sample/res/drawable-nodpi/buttonstate_standout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false"
android:drawable="@drawable/button_standout_pressed" />
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/button_standout_pressed" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/button_standout_pressed" />
<item android:drawable="@drawable/button_standout_inactive"/>
</selector>
10 changes: 10 additions & 0 deletions sample/res/drawable-nodpi/buttonstate_transparent.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false"
android:drawable="@drawable/button_transparent_pressed" />
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/button_transparent_pressed" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/button_transparent_pressed" />
<item android:drawable="@drawable/transparent"/>
</selector>
Binary file added sample/res/drawable-nodpi/pushpin_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions sample/res/drawable-nodpi/transparent.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#00000000" />
</shape>
Binary file added sample/res/drawable-xhdpi/daffy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/reset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xhdpi/rotate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample/res/drawable-xxhdpi/launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions sample/res/layout/animation_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#333">
<ImageView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:visibility="invisible"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/previous"/>

<ImageView
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/next"/>

<ImageView
android:id="@+id/play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/next"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/play"/>

<TextView
android:id="@+id/note"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_toLeftOf="@id/play"
android:layout_toRightOf="@id/previous"
android:layout_centerVertical="true"
android:padding="10dp"
android:textSize="14sp"
android:textColor="#FFFFFF"/>

</RelativeLayout>

<com.davemorrissey.labs.subscaleview.sample.extension.views.PinView
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_above="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
10 changes: 10 additions & 0 deletions sample/res/layout/extension_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<FrameLayout android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
59 changes: 59 additions & 0 deletions sample/res/layout/extension_circle_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#333">
<ImageView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/previous"/>

<ImageView
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/next"/>

<TextView
android:id="@+id/note"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_toLeftOf="@id/next"
android:layout_toRightOf="@id/previous"
android:layout_centerVertical="true"
android:text="A slightly more advanced example, this shows a circle that will move and scale with the image. (Due to a limitation in Android, this circle may disappear when it's larger than 2048px.)"
android:padding="10dp"
android:textSize="14sp"
android:textColor="#FFFFFF"/>

</RelativeLayout>

<com.davemorrissey.labs.subscaleview.sample.extension.views.CircleView
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_above="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
73 changes: 73 additions & 0 deletions sample/res/layout/extension_freehand_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#333">
<ImageView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/previous"/>

<ImageView
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:visibility="invisible"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/next"/>

<ImageView
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/next"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/reset"/>

<TextView
android:id="@+id/note"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_toLeftOf="@id/reset"
android:layout_toRightOf="@id/previous"
android:layout_centerVertical="true"
android:text="This subclass adds event detection. Draw a freehand line; it will move with the image. (Due to a limitation in Android, your drawing may disappear when it's larger than 2048px.)"
android:padding="10dp"
android:textSize="14sp"
android:textColor="#FFFFFF"/>

</RelativeLayout>

<com.davemorrissey.labs.subscaleview.sample.extension.views.FreehandView
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_above="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
60 changes: 60 additions & 0 deletions sample/res/layout/extension_pin_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#333">
<ImageView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:visibility="invisible"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/previous"/>

<ImageView
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/buttonstate_transparent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:src="@drawable/next"/>

<TextView
android:id="@+id/note"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_toLeftOf="@id/next"
android:layout_toRightOf="@id/previous"
android:layout_centerVertical="true"
android:text="This view class extends the image view, and adds a pin anchored to a point on the image."
android:padding="10dp"
android:textSize="14sp"
android:textColor="#FFFFFF"/>

</RelativeLayout>

<com.davemorrissey.labs.subscaleview.sample.extension.views.PinView
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_above="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>
Loading

0 comments on commit 00cce30

Please sign in to comment.