From e6e5041d60f55fde175a28a2dfbd4bfa3bdc6661 Mon Sep 17 00:00:00 2001 From: vim Date: Tue, 21 Mar 2017 00:44:02 +0700 Subject: [PATCH] rx --- PDFCreateLib/.gitignore | 1 - PDFCreateLib/build.gradle | 32 ------------------ PDFCreateLib/proguard-rules.pro | 17 ---------- .../pdfcreatelib/ExampleInstrumentedTest.java | 26 --------------- PDFCreateLib/src/main/AndroidManifest.xml | 9 ----- .../com/example/pdfcreatelib/PDFCreb.java | 33 ------------------- PDFCreateLib/src/main/res/values/strings.xml | 3 -- .../example/pdfcreatelib/ExampleUnitTest.java | 17 ---------- .../vigerpdf/adapter/VigerAdapter.java | 5 +-- 9 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 PDFCreateLib/.gitignore delete mode 100644 PDFCreateLib/build.gradle delete mode 100644 PDFCreateLib/proguard-rules.pro delete mode 100644 PDFCreateLib/src/androidTest/java/com/example/pdfcreatelib/ExampleInstrumentedTest.java delete mode 100644 PDFCreateLib/src/main/AndroidManifest.xml delete mode 100644 PDFCreateLib/src/main/java/com/example/pdfcreatelib/PDFCreb.java delete mode 100644 PDFCreateLib/src/main/res/values/strings.xml delete mode 100644 PDFCreateLib/src/test/java/com/example/pdfcreatelib/ExampleUnitTest.java diff --git a/PDFCreateLib/.gitignore b/PDFCreateLib/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/PDFCreateLib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/PDFCreateLib/build.gradle b/PDFCreateLib/build.gradle deleted file mode 100644 index 9bd7616..0000000 --- a/PDFCreateLib/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" - - defaultConfig { - minSdkVersion 15 - targetSdkVersion 25 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - compile 'com.android.support:appcompat-v7:25.1.1' - testCompile 'junit:junit:4.12' - compile group: 'com.itextpdf', name: 'itextpdf', version: '5.0.6' -} diff --git a/PDFCreateLib/proguard-rules.pro b/PDFCreateLib/proguard-rules.pro deleted file mode 100644 index c04b9c0..0000000 --- a/PDFCreateLib/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /home/vim/sdk-linux/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 *; -#} diff --git a/PDFCreateLib/src/androidTest/java/com/example/pdfcreatelib/ExampleInstrumentedTest.java b/PDFCreateLib/src/androidTest/java/com/example/pdfcreatelib/ExampleInstrumentedTest.java deleted file mode 100644 index b83bf74..0000000 --- a/PDFCreateLib/src/androidTest/java/com/example/pdfcreatelib/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.example.pdfcreatelib; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("com.example.pdfcreatelib.test", appContext.getPackageName()); - } -} diff --git a/PDFCreateLib/src/main/AndroidManifest.xml b/PDFCreateLib/src/main/AndroidManifest.xml deleted file mode 100644 index a08b535..0000000 --- a/PDFCreateLib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/PDFCreateLib/src/main/java/com/example/pdfcreatelib/PDFCreb.java b/PDFCreateLib/src/main/java/com/example/pdfcreatelib/PDFCreb.java deleted file mode 100644 index c207f6f..0000000 --- a/PDFCreateLib/src/main/java/com/example/pdfcreatelib/PDFCreb.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.pdfcreatelib; - - -import android.graphics.Bitmap; - -import com.itextpdf.text.Document; -import com.itextpdf.text.Image; -import com.itextpdf.text.pdf.PdfWriter; - -import java.io.ByteArrayOutputStream; -import java.io.FileOutputStream; - -/** - * Created by vim on 20/02/17. - */ - -public class PDFCreb { - - public void create(Bitmap bitmap){ - try { - - Document doc = new Document(); - PdfWriter.getInstance(doc,new FileOutputStream("YourPDFHere.pdf")); - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream); - Image image = Image.getInstance(stream.toByteArray()); - doc.add(image); - doc.close(); - }catch (Exception e){ - - } - } -} diff --git a/PDFCreateLib/src/main/res/values/strings.xml b/PDFCreateLib/src/main/res/values/strings.xml deleted file mode 100644 index e469553..0000000 --- a/PDFCreateLib/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - PDFCreateLib - diff --git a/PDFCreateLib/src/test/java/com/example/pdfcreatelib/ExampleUnitTest.java b/PDFCreateLib/src/test/java/com/example/pdfcreatelib/ExampleUnitTest.java deleted file mode 100644 index 1838c1a..0000000 --- a/PDFCreateLib/src/test/java/com/example/pdfcreatelib/ExampleUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.example.pdfcreatelib; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file diff --git a/PDFVigerLib/src/main/java/com/necistudio/vigerpdf/adapter/VigerAdapter.java b/PDFVigerLib/src/main/java/com/necistudio/vigerpdf/adapter/VigerAdapter.java index 73e6872..2bff8ee 100644 --- a/PDFVigerLib/src/main/java/com/necistudio/vigerpdf/adapter/VigerAdapter.java +++ b/PDFVigerLib/src/main/java/com/necistudio/vigerpdf/adapter/VigerAdapter.java @@ -19,13 +19,10 @@ import java.util.ArrayList; public class VigerAdapter extends PagerAdapter { - private Context context; private ArrayList itemList; private LayoutInflater mLayoutInflater; - private PhotoViewAttacher mAttacher; public VigerAdapter(Context context, ArrayList itemList) { - this.context = context; this.itemList = itemList; mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @@ -47,7 +44,7 @@ public Object instantiateItem(ViewGroup container, int position) { ImageView imageView = (ImageView) itemView.findViewById(R.id.imgData); imageView.setImageBitmap(itemList.get(position)); container.addView(itemView); - mAttacher = new PhotoViewAttacher(imageView); + new PhotoViewAttacher(imageView); return itemView; }