Skip to content

Commit

Permalink
Refactors project into demo project and library
Browse files Browse the repository at this point in the history
  • Loading branch information
JVillella authored and Hannes Achleitner committed Aug 6, 2015
1 parent 215c523 commit 4dd135a
Show file tree
Hide file tree
Showing 26 changed files with 217 additions and 61 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
<orderEntry type="module" module-name="touchview" exported="" />
</component>
</module>

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.example.touch"
applicationId "com.ortiz.touchdemo"
minSdkVersion 8
targetSdkVersion 22
}
Expand All @@ -20,4 +20,5 @@ android {

dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile project(':touchview')
}
15 changes: 6 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
package="com.example.touch"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18"/>

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="com.ortiz.touch.MainActivity"
<activity android:name="com.ortiz.touchdemo.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.ortiz.touch.SingleTouchImageViewActivity" />
<activity android:name="com.ortiz.touch.MirroringExampleActivity" />
<activity android:name="com.ortiz.touch.ViewPagerExampleActivity" />
<activity android:name="com.ortiz.touch.SwitchImageExampleActivity" />
<activity android:name="com.ortiz.touch.SwitchScaleTypeExampleActivity" />
<activity android:name="com.ortiz.touchdemo.SingleTouchImageViewActivity" />
<activity android:name="com.ortiz.touchdemo.MirroringExampleActivity" />
<activity android:name="com.ortiz.touchdemo.ViewPagerExampleActivity" />
<activity android:name="com.ortiz.touchdemo.SwitchImageExampleActivity" />
<activity android:name="com.ortiz.touchdemo.SwitchScaleTypeExampleActivity" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.ortiz.touch;
package com.ortiz.touchdemo;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;

import com.ortiz.touchview.TouchImageView;


public class ExtendedViewPager extends ViewPager {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.ortiz.touch;

import com.example.touch.R;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.example.touch.R;


public class MainActivity extends Activity {
/** Called when the activity is first created. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.ortiz.touch;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.os.Bundle;

import com.example.touch.R;
import com.ortiz.touch.TouchImageView.OnTouchImageViewListener;
import com.ortiz.touchview.TouchImageView;

public class MirroringExampleActivity extends Activity {

Expand All @@ -22,15 +22,15 @@ protected void onCreate(Bundle savedInstanceState) {
// Each image has an OnTouchImageViewListener which uses its own TouchImageView
// to set the other TIV with the same zoom variables.
//
topImage.setOnTouchImageViewListener(new OnTouchImageViewListener() {
topImage.setOnTouchImageViewListener(new TouchImageView.OnTouchImageViewListener() {

@Override
public void onMove() {
bottomImage.setZoom(topImage);
}
});

bottomImage.setOnTouchImageViewListener(new OnTouchImageViewListener() {
bottomImage.setOnTouchImageViewListener(new TouchImageView.OnTouchImageViewListener() {

@Override
public void onMove() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package com.ortiz.touch;
import java.text.DecimalFormat;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.graphics.PointF;
Expand All @@ -8,7 +7,9 @@
import android.widget.TextView;

import com.example.touch.R;
import com.ortiz.touch.TouchImageView.OnTouchImageViewListener;
import com.ortiz.touchview.TouchImageView;

import java.text.DecimalFormat;


public class SingleTouchImageViewActivity extends Activity {
Expand Down Expand Up @@ -36,7 +37,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Set the OnTouchImageViewListener which updates edit texts
// with zoom and scroll diagnostics.
//
image.setOnTouchImageViewListener(new OnTouchImageViewListener() {
image.setOnTouchImageViewListener(new TouchImageView.OnTouchImageViewListener() {

@Override
public void onMove() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.ortiz.touch;

import com.example.touch.R;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.example.touch.R;
import com.ortiz.touchview.TouchImageView;

public class SwitchImageExampleActivity extends Activity {

private TouchImageView image;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.ortiz.touch;

import com.example.touch.R;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import android.widget.ImageView.ScaleType;
import android.widget.Toast;

import com.example.touch.R;
import com.ortiz.touchview.TouchImageView;

public class SwitchScaleTypeExampleActivity extends Activity {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package com.ortiz.touch;

import com.example.touch.R;
package com.ortiz.touchdemo;

import android.app.Activity;
import android.os.Bundle;
Expand All @@ -9,6 +7,9 @@
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.example.touch.R;
import com.ortiz.touchview.TouchImageView;

public class ViewPagerExampleActivity extends Activity {

/**
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_mirroring_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical" >

<com.ortiz.touch.TouchImageView
<com.ortiz.touchview.TouchImageView
android:id="@+id/topImage"
android:src="@drawable/nature_1"
android:layout_width="wrap_content"
Expand All @@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="1dp" />

<com.ortiz.touch.TouchImageView
<com.ortiz.touchview.TouchImageView
android:id="@+id/bottomImage"
android:src="@drawable/nature_2"
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_single_touchimageview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >

<com.ortiz.touch.TouchImageView
<com.ortiz.touchview.TouchImageView
android:id="@+id/img"
android:src="@drawable/nature_1"
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_switch_image_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >

<com.ortiz.touch.TouchImageView
<com.ortiz.touchview.TouchImageView
android:id="@+id/img"
android:scaleType="centerCrop"
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >

<com.ortiz.touch.TouchImageView
<com.ortiz.touchview.TouchImageView
android:id="@+id/img"
android:scaleType="center"
android:src="@drawable/nature_1"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_viewpager_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent" >

<!-- ExtendedViewPager is a custom view and must be referred to by its full package name in XML -->
<com.ortiz.touch.ExtendedViewPager
<com.ortiz.touchdemo.ExtendedViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':touchview'
1 change: 1 addition & 0 deletions touchview/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions touchview/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
minSdkVersion 8
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
17 changes: 17 additions & 0 deletions touchview/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/JVillella/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# 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 *;
#}
7 changes: 7 additions & 0 deletions touchview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ortiz.touchview">

<application android:allowBackup="true" android:label="@string/app_name">

</application>

</manifest>
Loading

0 comments on commit 4dd135a

Please sign in to comment.