├── .gitattributes
├── .gitignore
├── IKNinePhotoViewDemo.iml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── idtk
│ │ └── ikninephotoviewdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── idtk
│ │ │ └── ikninephotoviewdemo
│ │ │ ├── MainActivity.java
│ │ │ ├── MyAdapter.java
│ │ │ └── RVAdapter.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── item_rv.xml
│ │ └── view_rv_item.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── idtk
│ └── ikninephotoviewdemo
│ └── ExampleUnitTest.java
├── build.gradle
├── build
├── android-profile
│ ├── profile-2017-03-13-22-19-50-181.rawproto
│ ├── profile-2017-03-13-22-20-02-493.rawproto
│ ├── profile-2017-03-13-22-20-32-941.rawproto
│ ├── profile-2017-03-13-22-20-56-256.rawproto
│ ├── profile-2017-03-13-22-21-29-653.rawproto
│ ├── profile-2017-03-13-22-21-32-249.rawproto
│ ├── profile-2017-03-13-22-21-51-582.rawproto
│ ├── profile-2017-03-13-22-21-53-096.rawproto
│ ├── profile-2017-03-13-22-22-22-612.rawproto
│ ├── profile-2017-03-13-22-23-50-779.rawproto
│ ├── profile-2017-03-13-22-24-03-731.rawproto
│ ├── profile-2017-03-13-22-24-04-440.rawproto
│ ├── profile-2017-03-13-22-24-12-012.rawproto
│ ├── profile-2017-03-13-22-25-03-235.rawproto
│ ├── profile-2017-03-13-22-26-05-547.rawproto
│ ├── profile-2017-03-13-22-26-11-139.rawproto
│ ├── profile-2017-03-13-22-26-18-846.rawproto
│ ├── profile-2017-03-13-22-27-31-376.rawproto
│ ├── profile-2017-03-13-22-27-32-560.rawproto
│ ├── profile-2017-03-13-22-27-40-652.rawproto
│ ├── profile-2017-03-13-22-33-20-658.rawproto
│ ├── profile-2017-03-13-22-33-21-623.rawproto
│ ├── profile-2017-03-13-22-33-51-727.rawproto
│ ├── profile-2017-03-13-22-34-29-715.rawproto
│ ├── profile-2017-03-13-22-34-42-686.rawproto
│ ├── profile-2017-03-13-22-35-14-574.rawproto
│ ├── profile-2017-03-13-22-36-41-348.rawproto
│ ├── profile-2017-03-13-22-37-39-838.rawproto
│ ├── profile-2017-03-13-22-39-36-440.rawproto
│ ├── profile-2017-03-13-22-39-55-744.rawproto
│ ├── profile-2017-03-13-22-40-39-957.rawproto
│ ├── profile-2017-03-13-22-44-04-538.rawproto
│ ├── profile-2017-03-13-22-44-23-909.rawproto
│ ├── profile-2017-03-13-22-45-13-138.rawproto
│ ├── profile-2017-03-13-22-45-31-582.rawproto
│ ├── profile-2017-03-13-22-46-12-425.rawproto
│ └── profile-2017-03-13-22-46-37-940.rawproto
├── generated
│ ├── mockable-android-24.jar
│ └── mockable-android-25.jar
└── intermediates
│ └── dex-cache
│ └── cache.xml
├── gif
└── IKNinePhotoView.gif
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ikninephotoview
├── .gitignore
├── build.gradle
├── ikninephotoview.iml
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── idtk
│ │ └── ikninephotoview
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── idtk
│ │ │ └── ikninephotoview
│ │ │ ├── IKNinePhotoView.java
│ │ │ ├── IKNinePhotoViewAdapter.java
│ │ │ └── IKNinePhotoViewHolder.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── idtk
│ └── ikninephotoview
│ └── ExampleUnitTest.java
├── local.properties
└── settings.gradle
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear in the root of a volume
35 | .DocumentRevisions-V100
36 | .fseventsd
37 | .Spotlight-V100
38 | .TemporaryItems
39 | .Trashes
40 | .VolumeIcon.icns
41 |
42 | # Directories potentially created on remote AFP share
43 | .AppleDB
44 | .AppleDesktop
45 | Network Trash Folder
46 | Temporary Items
47 | .apdisk
48 |
--------------------------------------------------------------------------------
/IKNinePhotoViewDemo.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IKNinePhotoView
2 |
3 | ## Introduction
4 | IKNinePhotoView是一个开源的Android九宫格控件,可以自适应宽高主要用于满足九宫格图片展示器及选择器的需求。
5 |
6 | ## IKNinePhotoViewDemo
7 |
8 | 
9 |
10 | ## Usage
11 |
12 | ### Step 1
13 |
14 | **IKNinePhotoView**
15 |
16 | ```XML
17 |
21 | ```
22 |
23 | ### step 2
24 |
25 | **IKNinePhotoViewAdapter**
26 | ```Java
27 | public class MyAdapter extends IKNinePhotoViewAdapter {
28 |
29 | private Context mContext;
30 | private int count;
31 |
32 | public MyAdapter(Context context) {
33 | super();
34 | mContext = context;
35 | count = new Random().nextInt(9);
36 | }
37 |
38 | @Override
39 | public MyHolder createView(ViewGroup parent) {
40 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rv_item, parent, false);
41 | MyHolder viewHolder = new MyHolder(view);
42 | return viewHolder;
43 | }
44 |
45 | @Override
46 | public void displayView(final MyHolder holder, final int position) {
47 | Glide
48 | .with(mContext)
49 | .load("http://ompb0h8qq.bkt.clouddn.com/header/header.jpg")
50 | .placeholder(R.mipmap.ic_launcher)
51 | .into(holder.mImageView);
52 | }
53 |
54 | }
55 | ```
56 |
57 | ### step 3
58 |
59 | **IKNinePhotoViewHolder**
60 | ```Java
61 | class MyHolder extends IKNinePhotoViewHolder {
62 |
63 | @BindView(R.id.nine_pic)
64 | ImageView mImageView;
65 |
66 | public MyHolder(View itemView) {
67 | super(itemView);
68 | ButterKnife.bind(this,itemView);
69 | }
70 | }
71 | ```
72 |
73 | ### step 4
74 |
75 | **Binding**
76 |
77 | ```Java
78 | MyAdapter adapter = new MyAdapter(context);
79 | holder.mNinePhoto.setAdapter(adapter);
80 | ```
81 |
82 |
83 | ## License
84 | ```
85 | Copyright (C) 2017 Idtk
86 |
87 | Licensed under the Apache License, Version 2.0 (the "License");
88 | you may not use this file except in compliance with the License.
89 | You may obtain a copy of the License at
90 |
91 | http://www.apache.org/licenses/LICENSE-2.0
92 |
93 | Unless required by applicable law or agreed to in writing, software
94 | distributed under the License is distributed on an "AS IS" BASIS,
95 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96 | See the License for the specific language governing permissions and
97 | limitations under the License.
98 | ```
99 | ******
100 |
101 | ## About Me
102 |
103 | **博客: www.idtkm.com**
104 | **GitHub: https://github.com/Idtk**
105 | **微博: http://weibo.com/Idtk**
106 | **邮箱: IdtkMa@gmail.com**
107 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.0"
6 | defaultConfig {
7 | applicationId "com.idtk.ikninephotoviewdemo"
8 | minSdkVersion 14
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.2.0'
28 | testCompile 'junit:junit:4.12'
29 | compile project(path: ':ikninephotoview')
30 | compile 'com.android.support:design:25.2.0'
31 | compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
32 | compile 'com.github.bumptech.glide:glide:3.7.0'
33 | compile 'com.jakewharton:butterknife:8.5.1'
34 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
35 | }
36 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/idtk/ikninephotoviewdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoviewdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.idtk.ikninephotoviewdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/idtk/ikninephotoviewdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoviewdemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.support.v7.widget.DividerItemDecoration;
6 | import android.support.v7.widget.LinearLayoutManager;
7 | import android.support.v7.widget.RecyclerView;
8 |
9 | import butterknife.BindView;
10 | import butterknife.ButterKnife;
11 |
12 | public class MainActivity extends AppCompatActivity {
13 |
14 | @BindView(R.id.recycler_view)
15 | RecyclerView mRecyclerView;
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_main);
21 | ButterKnife.bind(this);
22 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
23 | mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
24 | mRecyclerView.setAdapter(new RVAdapter(this));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/idtk/ikninephotoviewdemo/MyAdapter.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoviewdemo;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 |
10 | import com.bumptech.glide.Glide;
11 | import com.idtk.ikninephotoview.IKNinePhotoViewAdapter;
12 | import com.idtk.ikninephotoview.IKNinePhotoViewHolder;
13 |
14 | import java.util.Random;
15 |
16 | import butterknife.BindView;
17 | import butterknife.ButterKnife;
18 |
19 | /**
20 | * Created by Idtk on 2017/3/9.
21 | * Blog : http://www.idtkm.com
22 | * GitHub : https://github.com/Idtk
23 | * 描述 :
24 | */
25 |
26 | public class MyAdapter extends IKNinePhotoViewAdapter {
27 |
28 | private Context mContext;
29 | private int count;
30 |
31 | public MyAdapter(Context context) {
32 | super();
33 | mContext = context;
34 | count = new Random().nextInt(9);
35 | }
36 |
37 | @Override
38 | public MyHolder createView(ViewGroup parent) {
39 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rv_item, parent, false);
40 | MyHolder viewHolder = new MyHolder(view);
41 | return viewHolder;
42 | }
43 |
44 | @Override
45 | public void displayView(final MyHolder holder, final int position) {
46 | Glide
47 | .with(mContext)
48 | .load("http://ompb0h8qq.bkt.clouddn.com/header/header.jpg")
49 | .placeholder(R.mipmap.ic_launcher)
50 | .into(holder.mImageView);
51 |
52 | holder.getItemView().setOnClickListener(new View.OnClickListener() {
53 | @Override
54 | public void onClick(View v) {
55 | Log.d("click", position + "");
56 | }
57 | });
58 | }
59 |
60 | @Override
61 | public int getItemCount() {
62 | return count;
63 | }
64 |
65 | class MyHolder extends IKNinePhotoViewHolder {
66 |
67 | @BindView(R.id.nine_pic)
68 | ImageView mImageView;
69 |
70 | public MyHolder(View itemView) {
71 | super(itemView);
72 | ButterKnife.bind(this,itemView);
73 | }
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/java/com/idtk/ikninephotoviewdemo/RVAdapter.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoviewdemo;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.idtk.ikninephotoview.IKNinePhotoView;
10 |
11 | import butterknife.BindView;
12 |
13 | /**
14 | * Created by Idtk on 2017/3/9.
15 | * Blog : http://www.idtkm.com
16 | * GitHub : https://github.com/Idtk
17 | * 描述 :
18 | */
19 |
20 | public class RVAdapter extends RecyclerView.Adapter {
21 |
22 | private Context context;
23 |
24 | public RVAdapter(Context context) {
25 | super();
26 | this.context = context;
27 | }
28 |
29 | @Override
30 | public RVHolder onCreateViewHolder(ViewGroup parent, int viewType) {
31 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_rv,parent,false);
32 | RVHolder rvHolder = new RVHolder(view);
33 | return rvHolder;
34 | }
35 |
36 | @Override
37 | public void onBindViewHolder(RVHolder holder, int position) {
38 | MyAdapter adapter = new MyAdapter(context);
39 | holder.mNinePhoto.setAdapter(adapter);
40 |
41 | }
42 |
43 | @Override
44 | public int getItemCount() {
45 | return 9;
46 | }
47 |
48 | class RVHolder extends RecyclerView.ViewHolder{
49 |
50 | @BindView(R.id.nine_photo)
51 | IKNinePhotoView mNinePhoto;
52 | public RVHolder(View itemView) {
53 | super(itemView);
54 | mNinePhoto = (IKNinePhotoView) itemView.findViewById(R.id.nine_photo);
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
14 |
18 |
19 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_rv_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | IKNinePhotoViewDemo
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/idtk/ikninephotoviewdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoviewdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.0'
9 | // NOTE: Do not place your application dependencies here; they belong
10 | // in the individual module build.gradle files
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | jcenter()
17 | }
18 | }
19 |
20 | task clean(type: Delete) {
21 | delete rootProject.buildDir
22 | }
23 |
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-19-50-181.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-19-50-181.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-20-02-493.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-20-02-493.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-20-32-941.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-20-32-941.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-20-56-256.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-20-56-256.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-21-29-653.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-21-29-653.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-21-32-249.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-21-32-249.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-21-51-582.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-21-51-582.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-21-53-096.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-21-53-096.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-22-22-612.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-22-22-612.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-23-50-779.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-23-50-779.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-24-03-731.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-24-03-731.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-24-04-440.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-24-04-440.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-24-12-012.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-24-12-012.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-25-03-235.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-25-03-235.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-26-05-547.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-26-05-547.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-26-11-139.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-26-11-139.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-26-18-846.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-26-18-846.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-27-31-376.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-27-31-376.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-27-32-560.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-27-32-560.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-27-40-652.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-27-40-652.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-33-20-658.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-33-20-658.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-33-21-623.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-33-21-623.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-33-51-727.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-33-51-727.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-34-29-715.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-34-29-715.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-34-42-686.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-34-42-686.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-35-14-574.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-35-14-574.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-36-41-348.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-36-41-348.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-37-39-838.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-37-39-838.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-39-36-440.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-39-36-440.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-39-55-744.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-39-55-744.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-40-39-957.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-40-39-957.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-44-04-538.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-44-04-538.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-44-23-909.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-44-23-909.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-45-13-138.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-45-13-138.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-45-31-582.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-45-31-582.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-46-12-425.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-46-12-425.rawproto
--------------------------------------------------------------------------------
/build/android-profile/profile-2017-03-13-22-46-37-940.rawproto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/android-profile/profile-2017-03-13-22-46-37-940.rawproto
--------------------------------------------------------------------------------
/build/generated/mockable-android-24.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/generated/mockable-android-24.jar
--------------------------------------------------------------------------------
/build/generated/mockable-android-25.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/build/generated/mockable-android-25.jar
--------------------------------------------------------------------------------
/build/intermediates/dex-cache/cache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/gif/IKNinePhotoView.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/gif/IKNinePhotoView.gif
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Idtk/IKNinePhotoView/adce5af2e75bf934c25862a97d9eea3600205600/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Mar 13 21:45:11 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/ikninephotoview/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ikninephotoview/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "25.0.0"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 24
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile 'com.android.support:appcompat-v7:24.2.1'
30 | testCompile 'junit:junit:4.12'
31 | }
32 |
--------------------------------------------------------------------------------
/ikninephotoview/ikninephotoview.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | generateDebugSources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/ikninephotoview/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/ikninephotoview/src/androidTest/java/com/idtk/ikninephotoview/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoview;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.idtk.ikninephotoview.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ikninephotoview/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ikninephotoview/src/main/java/com/idtk/ikninephotoview/IKNinePhotoView.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoview;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.AttrRes;
5 | import android.support.annotation.NonNull;
6 | import android.support.annotation.Nullable;
7 | import android.support.annotation.StyleRes;
8 | import android.util.AttributeSet;
9 | import android.view.View;
10 | import android.widget.FrameLayout;
11 |
12 | import java.util.ArrayList;
13 | import java.util.Observable;
14 | import java.util.Observer;
15 |
16 | /**
17 | * Created by Idtk on 2017/3/8.
18 | * Blog : http://www.idtkm.com
19 | * GitHub : https://github.com/Idtk
20 | * des : 九宫格View
21 | */
22 |
23 | public class IKNinePhotoView extends FrameLayout implements Observer{
24 |
25 | private IKNinePhotoViewAdapter adapter;
26 | private int border = 5;
27 | private int childSize;
28 | private ArrayList mRecyclerList = new ArrayList<>();
29 |
30 |
31 | public IKNinePhotoView(@NonNull Context context) {
32 | super(context);
33 | }
34 |
35 | public IKNinePhotoView(@NonNull Context context, @Nullable AttributeSet attrs) {
36 | super(context, attrs);
37 | }
38 |
39 | public IKNinePhotoView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
40 | super(context, attrs, defStyleAttr);
41 | }
42 |
43 | public IKNinePhotoView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) {
44 | super(context, attrs, defStyleAttr, defStyleRes);
45 | generateDefaultLayoutParams();
46 | }
47 |
48 | @Override
49 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
50 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
51 | ninePhotoMeasure(widthMeasureSpec,heightMeasureSpec);
52 | }
53 |
54 | @Override
55 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
56 | super.onLayout(changed, left, top, right, bottom);
57 | childLayout(left, top, right, bottom);
58 | }
59 |
60 | private void ninePhotoCreateView(){
61 | removeAllViews();
62 | for (int i = 0; i < adapter.getItemCount(); i++) {
63 | // removeView(getChildAt(i));
64 | addView(generateViewHolder(i).getItemView(),generateDefaultLayoutParams());
65 | }
66 | }
67 |
68 | private void ninePhotoMeasure(int widthMeasureSpec, int heightMeasureSpec) {
69 | int width = MeasureSpec.getSize(widthMeasureSpec)-getPaddingLeft()-getPaddingRight();
70 | int height;
71 |
72 | if (adapter == null) return;
73 |
74 | if (adapter.getItemCount() < 0 || adapter.getItemCount() > 9) {
75 | throw new IllegalStateException("itemCount may not be more than 9 or less than 0");
76 | }
77 |
78 | if (adapter.getItemCount() == 0) {
79 | setMeasuredDimension(0, 0);
80 | return;
81 | }
82 |
83 | if (adapter.getItemCount() > 1) {
84 | childSize = (width - border * 2) / 3;
85 | height = (int) (childSize * (int) Math.ceil(adapter.getItemCount() / 3.0) + border * (int) Math.ceil(adapter.getItemCount() / 3.0 - 1));
86 | if (adapter.getItemCount() == 4 || adapter.getItemCount() == 2) {
87 | int currentWidth = childSize*2 + border;
88 | setMeasuredDimension(currentWidth + getPaddingLeft() + getPaddingRight(), height + getPaddingTop() + getPaddingBottom());
89 | }else {
90 | int currentWidth = childSize*3 + border*2;
91 | setMeasuredDimension(currentWidth + getPaddingLeft() + getPaddingRight(), height + getPaddingTop() + getPaddingBottom());
92 | }
93 | } else {
94 | childSize = width/3;
95 | height = width/3;
96 | setMeasuredDimension(width + getPaddingLeft() + getPaddingRight(), height + getPaddingTop() + getPaddingBottom());
97 | }
98 | ninePhotoCreateView();
99 | }
100 |
101 | private void childLayout(int left, int top, int right, int bottom) {
102 |
103 | if (adapter == null) return;
104 |
105 | if (adapter.getItemCount() < 0 || adapter.getItemCount() > 9) {
106 | throw new IllegalStateException("itemCount may not be more than 9 or less than 0");
107 | }
108 |
109 | int count = adapter.getItemCount();
110 | int colNum = 3;
111 | if (count == 4){
112 | colNum = 2;
113 | }
114 |
115 | for (int i = 0; i < count; i++) {
116 | View childView = getChildAt(i);
117 |
118 | if (childView == null){
119 | return;
120 | }
121 |
122 | if (adapter != null && mRecyclerList.get(i) != null &&!mRecyclerList.get(i).getFlag()) {
123 | adapter.displayView(generateViewHolder(i), i);
124 | mRecyclerList.get(i).setFlag(true);
125 | }
126 |
127 | int rows = i / colNum;
128 | int cols = i % colNum;
129 |
130 | int childLeft = getPaddingLeft() + (childSize + border) * (cols);
131 | int childTop = getPaddingTop() + (childSize + border) * (rows);
132 | int childRight = childLeft + childSize;
133 | int childBottom = childTop + childSize;
134 | childView.layout(childLeft, childTop, childRight, childBottom);
135 | }
136 | }
137 |
138 |
139 |
140 | public void setAdapter(IKNinePhotoViewAdapter adapter){
141 | this.adapter = adapter;
142 | adapter.addObserver(this);
143 | // mRecyclerList.clear();
144 | for(IKNinePhotoViewHolder holder: mRecyclerList){
145 | holder.setFlag(false);
146 | }
147 | }
148 |
149 | public void setBorder(int border){
150 | this.border = border;
151 | }
152 |
153 | @Override
154 | public void update(Observable o, Object arg) {
155 | if (o instanceof IKNinePhotoViewAdapter){
156 | this.adapter = (IKNinePhotoViewAdapter) o;
157 | adapter.addObserver(this);
158 | // mRecyclerList.clear();
159 | for(IKNinePhotoViewHolder holder: mRecyclerList){
160 | holder.setFlag(false);
161 | }
162 | requestLayout();
163 | invalidate();
164 | }
165 | }
166 |
167 | private IKNinePhotoViewHolder generateViewHolder(int position){
168 | if (position < mRecyclerList.size()) {
169 | return mRecyclerList.get(position);
170 | } else {
171 | if (adapter != null){
172 | IKNinePhotoViewHolder holder = adapter.createView(IKNinePhotoView.this);
173 | if (holder == null){
174 | return null;
175 | }
176 | mRecyclerList.add(holder);
177 | return holder;
178 | } else
179 | return null;
180 | }
181 | }
182 |
183 | public void clearRecycler(){
184 | mRecyclerList.clear();
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/ikninephotoview/src/main/java/com/idtk/ikninephotoview/IKNinePhotoViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoview;
2 |
3 | import android.view.ViewGroup;
4 |
5 | import java.util.Observable;
6 |
7 | /**
8 | * Created by Idtk on 2017/3/8.
9 | * Blog : http://www.idtkm.com
10 | * GitHub : https://github.com/Idtk
11 | * des : 九宫格Adapter
12 | */
13 |
14 | public abstract class IKNinePhotoViewAdapter extends Observable {
15 |
16 | public IKNinePhotoViewAdapter() {
17 | super();
18 | }
19 |
20 | public int getItemCount(){
21 | return 0;
22 | }
23 |
24 | public abstract T createView(ViewGroup parent);
25 |
26 | public abstract void displayView(T holder, int position);
27 |
28 |
29 | public void notifyChanged(){
30 | setChanged();
31 | notifyObservers();
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/ikninephotoview/src/main/java/com/idtk/ikninephotoview/IKNinePhotoViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoview;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * Created by Idtk on 2017/3/8.
7 | * Blog : http://www.idtkm.com
8 | * GitHub : https://github.com/Idtk
9 | * des : 九宫格ViewHolder
10 | */
11 |
12 | public abstract class IKNinePhotoViewHolder {
13 | private boolean flag = false;
14 | private View itemView;
15 |
16 | public IKNinePhotoViewHolder(View itemView) {
17 | if (itemView == null) {
18 | throw new IllegalArgumentException("itemView may not be null");
19 | }
20 | this.itemView = itemView;
21 | }
22 |
23 | public boolean getFlag() {
24 | return flag;
25 | }
26 |
27 | public void setFlag(boolean flag) {
28 | this.flag = flag;
29 | }
30 |
31 | public View getItemView() {
32 | return itemView;
33 | }
34 |
35 | public void setItemView(View itemView) {
36 | this.itemView = itemView;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ikninephotoview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | IKNinePhotoView
3 |
4 |
--------------------------------------------------------------------------------
/ikninephotoview/src/test/java/com/idtk/ikninephotoview/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.idtk.ikninephotoview;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Mon Mar 13 21:45:11 CST 2017
11 | ndk.dir=D\:\\Android\\sdk\\ndk-bundle
12 | sdk.dir=D\:\\Android\\sdk
13 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':ikninephotoview'
2 |
--------------------------------------------------------------------------------