hsiao 7 년 전
부모
커밋
6c62285b8e
36개의 변경된 파일792개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    0
      .idea/gradle.xml
  2. 1
    0
      .idea/modules.xml
  3. 0
    1
      build.gradle
  4. 1
    0
      lesson03/.gitignore
  5. 35
    0
      lesson03/build.gradle
  6. BIN
      lesson03/libs/panowidget.aar
  7. 21
    0
      lesson03/proguard-rules.pro
  8. 26
    0
      lesson03/src/androidTest/java/io/hsiao/lesson03/ExampleInstrumentedTest.java
  9. 25
    0
      lesson03/src/main/AndroidManifest.xml
  10. 83
    0
      lesson03/src/main/java/io/hsiao/lesson03/MainActivity.java
  11. 94
    0
      lesson03/src/main/java/io/hsiao/lesson03/MainListAdapter.java
  12. 33
    0
      lesson03/src/main/java/io/hsiao/lesson03/PanoActivity.java
  13. 48
    0
      lesson03/src/main/java/io/hsiao/lesson03/data/AsyncListLoader.java
  14. 47
    0
      lesson03/src/main/java/io/hsiao/lesson03/data/HttpAPI.java
  15. 34
    0
      lesson03/src/main/res/drawable-v24/ic_launcher_foreground.xml
  16. 170
    0
      lesson03/src/main/res/drawable/ic_launcher_background.xml
  17. 30
    0
      lesson03/src/main/res/layout/activity_main.xml
  18. 22
    0
      lesson03/src/main/res/layout/activity_pano.xml
  19. 73
    0
      lesson03/src/main/res/layout/main_listview_item.xml
  20. 5
    0
      lesson03/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  21. 5
    0
      lesson03/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  22. BIN
      lesson03/src/main/res/mipmap-hdpi/ic_launcher.png
  23. BIN
      lesson03/src/main/res/mipmap-hdpi/ic_launcher_round.png
  24. BIN
      lesson03/src/main/res/mipmap-mdpi/ic_launcher.png
  25. BIN
      lesson03/src/main/res/mipmap-mdpi/ic_launcher_round.png
  26. BIN
      lesson03/src/main/res/mipmap-xhdpi/ic_launcher.png
  27. BIN
      lesson03/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  28. BIN
      lesson03/src/main/res/mipmap-xxhdpi/ic_launcher.png
  29. BIN
      lesson03/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  30. BIN
      lesson03/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  31. BIN
      lesson03/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  32. 6
    0
      lesson03/src/main/res/values/colors.xml
  33. 3
    0
      lesson03/src/main/res/values/strings.xml
  34. 11
    0
      lesson03/src/main/res/values/styles.xml
  35. 17
    0
      lesson03/src/test/java/io/hsiao/lesson03/ExampleUnitTest.java
  36. 1
    1
      settings.gradle

+ 1
- 0
.idea/gradle.xml 파일 보기

@@ -10,6 +10,7 @@
10 10
             <option value="$PROJECT_DIR$" />
11 11
             <option value="$PROJECT_DIR$/lesson01" />
12 12
             <option value="$PROJECT_DIR$/lesson02" />
13
+            <option value="$PROJECT_DIR$/lesson03" />
13 14
           </set>
14 15
         </option>
15 16
         <option name="resolveModulePerSourceSet" value="false" />

+ 1
- 0
.idea/modules.xml 파일 보기

@@ -5,6 +5,7 @@
5 5
       <module fileurl="file://$PROJECT_DIR$/YouMap2.0.iml" filepath="$PROJECT_DIR$/YouMap2.0.iml" />
6 6
       <module fileurl="file://$PROJECT_DIR$/lesson01/lesson01.iml" filepath="$PROJECT_DIR$/lesson01/lesson01.iml" />
7 7
       <module fileurl="file://$PROJECT_DIR$/lesson02/lesson02.iml" filepath="$PROJECT_DIR$/lesson02/lesson02.iml" />
8
+      <module fileurl="file://$PROJECT_DIR$/lesson03/lesson03.iml" filepath="$PROJECT_DIR$/lesson03/lesson03.iml" />
8 9
     </modules>
9 10
   </component>
10 11
 </project>

+ 0
- 1
build.gradle 파일 보기

@@ -9,7 +9,6 @@ buildscript {
9 9
     }
10 10
     dependencies {
11 11
         classpath 'com.android.tools.build:gradle:3.0.1'
12
-        
13 12
 
14 13
         // NOTE: Do not place your application dependencies here; they belong
15 14
         // in the individual module build.gradle files

+ 1
- 0
lesson03/.gitignore 파일 보기

@@ -0,0 +1 @@
1
+/build

+ 35
- 0
lesson03/build.gradle 파일 보기

@@ -0,0 +1,35 @@
1
+apply plugin: 'com.android.application'
2
+android {
3
+    compileSdkVersion 25
4
+
5
+
6
+
7
+    defaultConfig {
8
+        applicationId "io.hsiao.lesson03"
9
+        minSdkVersion 19
10
+        targetSdkVersion 26
11
+        versionCode 1
12
+        versionName "1.0"
13
+
14
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15
+
16
+    }
17
+
18
+    buildTypes {
19
+        release {
20
+            minifyEnabled false
21
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22
+        }
23
+    }
24
+
25
+}
26
+
27
+dependencies {
28
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
29
+    compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.9.1'
30
+    compile group: 'com.alibaba', name: 'fastjson', version: '1.2.45'
31
+    compile 'com.squareup.picasso:picasso:2.5.2'
32
+
33
+    implementation 'com.android.support:appcompat-v7:25.1.0'
34
+    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
35
+}

BIN
lesson03/libs/panowidget.aar 파일 보기


+ 21
- 0
lesson03/proguard-rules.pro 파일 보기

@@ -0,0 +1,21 @@
1
+# Add project specific ProGuard rules here.
2
+# You can control the set of applied configuration files using the
3
+# proguardFiles setting in build.gradle.
4
+#
5
+# For more details, see
6
+#   http://developer.android.com/guide/developing/tools/proguard.html
7
+
8
+# If your project uses WebView with JS, uncomment the following
9
+# and specify the fully qualified class name to the JavaScript interface
10
+# class:
11
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12
+#   public *;
13
+#}
14
+
15
+# Uncomment this to preserve the line number information for
16
+# debugging stack traces.
17
+#-keepattributes SourceFile,LineNumberTable
18
+
19
+# If you keep the line number information, uncomment this to
20
+# hide the original source file name.
21
+#-renamesourcefileattribute SourceFile

+ 26
- 0
lesson03/src/androidTest/java/io/hsiao/lesson03/ExampleInstrumentedTest.java 파일 보기

@@ -0,0 +1,26 @@
1
+package io.hsiao.lesson03;
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
+ * Instrumented test, which will execute on an Android device.
14
+ *
15
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
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("io.hsiao.lesson03", appContext.getPackageName());
25
+    }
26
+}

+ 25
- 0
lesson03/src/main/AndroidManifest.xml 파일 보기

@@ -0,0 +1,25 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="io.hsiao.lesson03">
4
+
5
+    <uses-permission android:name="android.permission.INTERNET" />
6
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7
+
8
+    <application
9
+        android:allowBackup="true"
10
+        android:icon="@mipmap/ic_launcher"
11
+        android:label="@string/app_name"
12
+        android:roundIcon="@mipmap/ic_launcher_round"
13
+        android:supportsRtl="true"
14
+        android:theme="@style/AppTheme">
15
+        <activity android:name=".MainActivity">
16
+            <intent-filter>
17
+                <action android:name="android.intent.action.MAIN" />
18
+
19
+                <category android:name="android.intent.category.LAUNCHER" />
20
+            </intent-filter>
21
+        </activity>
22
+        <activity android:name=".PanoActivity"></activity>
23
+    </application>
24
+
25
+</manifest>

+ 83
- 0
lesson03/src/main/java/io/hsiao/lesson03/MainActivity.java 파일 보기

@@ -0,0 +1,83 @@
1
+package io.hsiao.lesson03;
2
+
3
+import android.content.Intent;
4
+import android.os.AsyncTask;
5
+import android.os.Bundle;
6
+import android.support.v7.app.AppCompatActivity;
7
+import android.util.Log;
8
+import android.view.View;
9
+import android.widget.AbsListView;
10
+import android.widget.AdapterView;
11
+import android.widget.ListView;
12
+import android.widget.ProgressBar;
13
+import android.widget.SimpleAdapter;
14
+
15
+import com.alibaba.fastjson.JSONArray;
16
+
17
+import java.util.ArrayList;
18
+import java.util.HashMap;
19
+import java.util.List;
20
+import java.util.Map;
21
+
22
+import io.hsiao.lesson03.data.AsyncListLoader;
23
+import io.hsiao.lesson03.data.HttpAPI;
24
+
25
+public class MainActivity extends AppCompatActivity {
26
+    private final String TAG = "lesson03";
27
+    private ListView listView;
28
+    private ProgressBar progressBar;
29
+    private MainListAdapter adapter;
30
+
31
+    private int dataOffset = 0;
32
+    private int pageSize = 10;
33
+    private AsyncListLoader loader;
34
+
35
+    @Override
36
+    protected void onCreate(Bundle savedInstanceState) {
37
+        super.onCreate(savedInstanceState);
38
+
39
+        setContentView(R.layout.activity_main);
40
+        this.progressBar = (ProgressBar) this.findViewById(R.id.progressBar);
41
+        this.listView = (ListView) this.findViewById(R.id.main_listview);
42
+        this.adapter = new MainListAdapter(this);
43
+        listView.setAdapter(adapter);
44
+
45
+        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
46
+            @Override
47
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
48
+                MainListAdapter.ViewHolder holder = (MainListAdapter.ViewHolder) view.getTag();
49
+                Log.i(TAG, holder.title.getText().toString());
50
+
51
+                Intent intent =  new Intent(MainActivity.this, PanoActivity.class);
52
+                intent.putExtra("img_url", holder.imgUUID);
53
+
54
+                startActivity(intent);
55
+            }
56
+        });
57
+        listView.setOnScrollListener(new AbsListView.OnScrollListener() {
58
+            @Override
59
+            public void onScrollStateChanged(AbsListView view, int scrollState) {
60
+                if (listView.getLastVisiblePosition() == view.getCount() - 1 &&
61
+                        scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE
62
+                        && !adapter.isDataRunUp()) {
63
+                    dataOffset += pageSize;
64
+                    getData();
65
+                }
66
+            }
67
+
68
+            @Override
69
+            public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
70
+            }
71
+        });
72
+
73
+        getData();
74
+    }
75
+
76
+    private void getData() {
77
+        this.loader = new AsyncListLoader(adapter, progressBar);
78
+        if (progressBar.getVisibility() == View.GONE && this.loader.getStatus() == AsyncTask.Status.PENDING) {
79
+            progressBar.setVisibility(View.VISIBLE);
80
+            this.loader.execute("/feeds/hot?limit=" + pageSize + "&offset=" + dataOffset);
81
+        }
82
+    }
83
+}

+ 94
- 0
lesson03/src/main/java/io/hsiao/lesson03/MainListAdapter.java 파일 보기

@@ -0,0 +1,94 @@
1
+package io.hsiao.lesson03;
2
+
3
+import android.content.Context;
4
+import android.view.LayoutInflater;
5
+import android.view.View;
6
+import android.view.ViewGroup;
7
+import android.widget.BaseAdapter;
8
+import android.widget.ImageView;
9
+import android.widget.TextView;
10
+
11
+import com.alibaba.fastjson.JSONArray;
12
+import com.alibaba.fastjson.JSONObject;
13
+import com.squareup.picasso.Picasso;
14
+
15
+
16
+/**
17
+ * Created by hsiao on 2018/2/4.
18
+ */
19
+
20
+public class MainListAdapter extends BaseAdapter {
21
+    private JSONArray array;
22
+    private  boolean dataRunUp;
23
+    private final Context ctx;
24
+
25
+    public MainListAdapter(Context ctx) {
26
+        this.ctx = ctx;
27
+        this.array = new JSONArray();
28
+    }
29
+
30
+    public void setDataRunUp(boolean dataRunUp) {
31
+        this.dataRunUp = dataRunUp;
32
+    }
33
+
34
+    public boolean isDataRunUp() {
35
+        return dataRunUp;
36
+    }
37
+
38
+    public void addAll(JSONArray arr) {
39
+        this.array.addAll(arr);
40
+    }
41
+
42
+    @Override
43
+    public int getCount() {
44
+        return array.size();
45
+    }
46
+
47
+    @Override
48
+    public Object getItem(int position) {
49
+        return array.get(position);
50
+    }
51
+
52
+    @Override
53
+    public long getItemId(int position) {
54
+        return position;
55
+    }
56
+
57
+    @Override
58
+    public View getView(int position, View convertView, ViewGroup parent) {
59
+        ViewHolder holder;
60
+        if (convertView == null) {
61
+            holder = new ViewHolder();
62
+            convertView = LayoutInflater.from(ctx).inflate(R.layout.main_listview_item, null);
63
+            holder.date = (TextView) convertView.findViewById(R.id.main_list_create_time);
64
+            holder.title = (TextView) convertView.findViewById(R.id.main_list_title);
65
+            holder.desc = (TextView) convertView.findViewById(R.id.main_list_desc);
66
+            holder.likes = (TextView) convertView.findViewById(R.id.main_list_likes);
67
+            holder.thumbnail = (ImageView) convertView.findViewById(R.id.main_list_thumnail);
68
+            convertView.setTag(holder);
69
+        } else {
70
+            holder = (ViewHolder) convertView.getTag();
71
+        }
72
+        JSONObject json = (JSONObject) array.get(position);
73
+        holder.likes.setText(json.getString("likes"));
74
+        holder.title.setText(json.getString("name"));
75
+        holder.desc.setText(json.getString("description"));
76
+        holder.date.setText(json.getString("create_time"));
77
+        holder.imgUUID = json.getString("uuid");
78
+
79
+        Picasso.with(ctx)
80
+                .load("http://reefun.cn/real360/api/obj/thumbnail/" + json.getString("uuid"))
81
+                .into(holder.thumbnail);
82
+
83
+        return convertView;
84
+    }
85
+
86
+    public class ViewHolder {
87
+        ImageView thumbnail;
88
+        TextView title;
89
+        TextView desc;
90
+        TextView date;
91
+        TextView likes;
92
+        String imgUUID;
93
+    }
94
+}

+ 33
- 0
lesson03/src/main/java/io/hsiao/lesson03/PanoActivity.java 파일 보기

@@ -0,0 +1,33 @@
1
+package io.hsiao.lesson03;
2
+
3
+import android.content.Intent;
4
+import android.media.Image;
5
+import android.support.v7.app.AppCompatActivity;
6
+import android.os.Bundle;
7
+import android.widget.ImageView;
8
+
9
+import com.squareup.picasso.Picasso;
10
+
11
+public class PanoActivity extends AppCompatActivity {
12
+
13
+    private ImageView img;
14
+
15
+    @Override
16
+    protected void onCreate(Bundle savedInstanceState) {
17
+        super.onCreate(savedInstanceState);
18
+        setContentView(R.layout.activity_pano);
19
+
20
+        Intent intent = this.getIntent();
21
+        String imgUrl = intent.getStringExtra("img_url");
22
+
23
+        this.img = (ImageView) this.findViewById(R.id.pano_imgview);
24
+
25
+        Picasso p = Picasso.with(this);
26
+        p.setIndicatorsEnabled(true);
27
+
28
+        p.load("http://reefun.cn/real360/api/obj/fetch/"+imgUrl)
29
+                .rotate(45)
30
+
31
+                .into(this.img);
32
+    }
33
+}

+ 48
- 0
lesson03/src/main/java/io/hsiao/lesson03/data/AsyncListLoader.java 파일 보기

@@ -0,0 +1,48 @@
1
+package io.hsiao.lesson03.data;
2
+
3
+import android.os.AsyncTask;
4
+import android.view.View;
5
+import android.widget.ProgressBar;
6
+
7
+
8
+import com.alibaba.fastjson.JSONArray;
9
+
10
+import io.hsiao.lesson03.MainListAdapter;
11
+
12
+/**
13
+ * Created by hsiao on 2018/2/4.
14
+ */
15
+
16
+public class AsyncListLoader extends AsyncTask<String, Boolean, JSONArray> {
17
+
18
+    private final ProgressBar bar;
19
+    private MainListAdapter adapter;
20
+
21
+    public AsyncListLoader(MainListAdapter adapter, ProgressBar bar) {
22
+        this.adapter = adapter;
23
+        this.bar = bar;
24
+    }
25
+
26
+    @Override
27
+    protected JSONArray doInBackground(String... args) {
28
+        JSONArray data = new HttpAPI("http://reefun.cn/real360/api").testGet(args[0]);
29
+        if(data.size()<1){
30
+            adapter.setDataRunUp(true);
31
+        }
32
+        publishProgress(true);
33
+        return data;
34
+    }
35
+
36
+    @Override
37
+    protected void onPostExecute(JSONArray data) {
38
+        adapter.addAll(data);
39
+        adapter.notifyDataSetChanged();
40
+    }
41
+
42
+    @Override
43
+    protected void onProgressUpdate(Boolean... values) {
44
+        if (values[0]) {
45
+            bar.setVisibility(View.GONE);
46
+        }
47
+    }
48
+}

+ 47
- 0
lesson03/src/main/java/io/hsiao/lesson03/data/HttpAPI.java 파일 보기

@@ -0,0 +1,47 @@
1
+package io.hsiao.lesson03.data;
2
+
3
+import android.util.Log;
4
+
5
+import com.alibaba.fastjson.JSONArray;
6
+
7
+import java.io.File;
8
+
9
+import io.hsiao.lesson03.MainListAdapter;
10
+import okhttp3.Cache;
11
+import okhttp3.OkHttpClient;
12
+import okhttp3.Request;
13
+import okhttp3.Response;
14
+
15
+/**
16
+ * Created by hsiao on 2018/2/4.
17
+ */
18
+
19
+public class HttpAPI {
20
+    private final String TAG = "lesson03_http";
21
+    private OkHttpClient client;
22
+    private String urlPrefix;
23
+
24
+    public HttpAPI(String url) {
25
+        this.client = new OkHttpClient.Builder()
26
+                .cache(new Cache(new File("/sdcard/youmap/cache"), 1024 * 1024 * 100))
27
+                .build();
28
+        this.urlPrefix = url;
29
+    }
30
+
31
+    public JSONArray testGet(String uri) {
32
+        final String reqUrl = this.urlPrefix + uri;
33
+        Log.i(TAG, "HTTP请求URL" + reqUrl);
34
+        Request req = new Request.Builder()
35
+                .get()
36
+                .url(reqUrl)
37
+                .build();
38
+        try (Response resp = client.newCall(req).execute()) {
39
+            String retString = resp.body().string();
40
+           return JSONArray.parseArray(retString);
41
+        } catch (Exception ex) {
42
+            ex.printStackTrace();
43
+        }
44
+        return null;
45
+    }
46
+
47
+}

+ 34
- 0
lesson03/src/main/res/drawable-v24/ic_launcher_foreground.xml
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 170
- 0
lesson03/src/main/res/drawable/ic_launcher_background.xml 파일 보기

@@ -0,0 +1,170 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportHeight="108"
6
+    android:viewportWidth="108">
7
+    <path
8
+        android:fillColor="#26A69A"
9
+        android:pathData="M0,0h108v108h-108z" />
10
+    <path
11
+        android:fillColor="#00000000"
12
+        android:pathData="M9,0L9,108"
13
+        android:strokeColor="#33FFFFFF"
14
+        android:strokeWidth="0.8" />
15
+    <path
16
+        android:fillColor="#00000000"
17
+        android:pathData="M19,0L19,108"
18
+        android:strokeColor="#33FFFFFF"
19
+        android:strokeWidth="0.8" />
20
+    <path
21
+        android:fillColor="#00000000"
22
+        android:pathData="M29,0L29,108"
23
+        android:strokeColor="#33FFFFFF"
24
+        android:strokeWidth="0.8" />
25
+    <path
26
+        android:fillColor="#00000000"
27
+        android:pathData="M39,0L39,108"
28
+        android:strokeColor="#33FFFFFF"
29
+        android:strokeWidth="0.8" />
30
+    <path
31
+        android:fillColor="#00000000"
32
+        android:pathData="M49,0L49,108"
33
+        android:strokeColor="#33FFFFFF"
34
+        android:strokeWidth="0.8" />
35
+    <path
36
+        android:fillColor="#00000000"
37
+        android:pathData="M59,0L59,108"
38
+        android:strokeColor="#33FFFFFF"
39
+        android:strokeWidth="0.8" />
40
+    <path
41
+        android:fillColor="#00000000"
42
+        android:pathData="M69,0L69,108"
43
+        android:strokeColor="#33FFFFFF"
44
+        android:strokeWidth="0.8" />
45
+    <path
46
+        android:fillColor="#00000000"
47
+        android:pathData="M79,0L79,108"
48
+        android:strokeColor="#33FFFFFF"
49
+        android:strokeWidth="0.8" />
50
+    <path
51
+        android:fillColor="#00000000"
52
+        android:pathData="M89,0L89,108"
53
+        android:strokeColor="#33FFFFFF"
54
+        android:strokeWidth="0.8" />
55
+    <path
56
+        android:fillColor="#00000000"
57
+        android:pathData="M99,0L99,108"
58
+        android:strokeColor="#33FFFFFF"
59
+        android:strokeWidth="0.8" />
60
+    <path
61
+        android:fillColor="#00000000"
62
+        android:pathData="M0,9L108,9"
63
+        android:strokeColor="#33FFFFFF"
64
+        android:strokeWidth="0.8" />
65
+    <path
66
+        android:fillColor="#00000000"
67
+        android:pathData="M0,19L108,19"
68
+        android:strokeColor="#33FFFFFF"
69
+        android:strokeWidth="0.8" />
70
+    <path
71
+        android:fillColor="#00000000"
72
+        android:pathData="M0,29L108,29"
73
+        android:strokeColor="#33FFFFFF"
74
+        android:strokeWidth="0.8" />
75
+    <path
76
+        android:fillColor="#00000000"
77
+        android:pathData="M0,39L108,39"
78
+        android:strokeColor="#33FFFFFF"
79
+        android:strokeWidth="0.8" />
80
+    <path
81
+        android:fillColor="#00000000"
82
+        android:pathData="M0,49L108,49"
83
+        android:strokeColor="#33FFFFFF"
84
+        android:strokeWidth="0.8" />
85
+    <path
86
+        android:fillColor="#00000000"
87
+        android:pathData="M0,59L108,59"
88
+        android:strokeColor="#33FFFFFF"
89
+        android:strokeWidth="0.8" />
90
+    <path
91
+        android:fillColor="#00000000"
92
+        android:pathData="M0,69L108,69"
93
+        android:strokeColor="#33FFFFFF"
94
+        android:strokeWidth="0.8" />
95
+    <path
96
+        android:fillColor="#00000000"
97
+        android:pathData="M0,79L108,79"
98
+        android:strokeColor="#33FFFFFF"
99
+        android:strokeWidth="0.8" />
100
+    <path
101
+        android:fillColor="#00000000"
102
+        android:pathData="M0,89L108,89"
103
+        android:strokeColor="#33FFFFFF"
104
+        android:strokeWidth="0.8" />
105
+    <path
106
+        android:fillColor="#00000000"
107
+        android:pathData="M0,99L108,99"
108
+        android:strokeColor="#33FFFFFF"
109
+        android:strokeWidth="0.8" />
110
+    <path
111
+        android:fillColor="#00000000"
112
+        android:pathData="M19,29L89,29"
113
+        android:strokeColor="#33FFFFFF"
114
+        android:strokeWidth="0.8" />
115
+    <path
116
+        android:fillColor="#00000000"
117
+        android:pathData="M19,39L89,39"
118
+        android:strokeColor="#33FFFFFF"
119
+        android:strokeWidth="0.8" />
120
+    <path
121
+        android:fillColor="#00000000"
122
+        android:pathData="M19,49L89,49"
123
+        android:strokeColor="#33FFFFFF"
124
+        android:strokeWidth="0.8" />
125
+    <path
126
+        android:fillColor="#00000000"
127
+        android:pathData="M19,59L89,59"
128
+        android:strokeColor="#33FFFFFF"
129
+        android:strokeWidth="0.8" />
130
+    <path
131
+        android:fillColor="#00000000"
132
+        android:pathData="M19,69L89,69"
133
+        android:strokeColor="#33FFFFFF"
134
+        android:strokeWidth="0.8" />
135
+    <path
136
+        android:fillColor="#00000000"
137
+        android:pathData="M19,79L89,79"
138
+        android:strokeColor="#33FFFFFF"
139
+        android:strokeWidth="0.8" />
140
+    <path
141
+        android:fillColor="#00000000"
142
+        android:pathData="M29,19L29,89"
143
+        android:strokeColor="#33FFFFFF"
144
+        android:strokeWidth="0.8" />
145
+    <path
146
+        android:fillColor="#00000000"
147
+        android:pathData="M39,19L39,89"
148
+        android:strokeColor="#33FFFFFF"
149
+        android:strokeWidth="0.8" />
150
+    <path
151
+        android:fillColor="#00000000"
152
+        android:pathData="M49,19L49,89"
153
+        android:strokeColor="#33FFFFFF"
154
+        android:strokeWidth="0.8" />
155
+    <path
156
+        android:fillColor="#00000000"
157
+        android:pathData="M59,19L59,89"
158
+        android:strokeColor="#33FFFFFF"
159
+        android:strokeWidth="0.8" />
160
+    <path
161
+        android:fillColor="#00000000"
162
+        android:pathData="M69,19L69,89"
163
+        android:strokeColor="#33FFFFFF"
164
+        android:strokeWidth="0.8" />
165
+    <path
166
+        android:fillColor="#00000000"
167
+        android:pathData="M79,19L79,89"
168
+        android:strokeColor="#33FFFFFF"
169
+        android:strokeWidth="0.8" />
170
+</vector>

+ 30
- 0
lesson03/src/main/res/layout/activity_main.xml 파일 보기

@@ -0,0 +1,30 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context="io.hsiao.lesson03.MainActivity">
8
+
9
+    <ProgressBar
10
+        android:id="@+id/progressBar"
11
+        style="@style/Widget.AppCompat.ProgressBar"
12
+        android:layout_width="wrap_content"
13
+        android:layout_height="wrap_content"
14
+        android:layout_marginBottom="8dp"
15
+        android:layout_marginEnd="8dp"
16
+        android:layout_marginStart="8dp"
17
+        android:layout_marginTop="8dp"
18
+        android:indeterminate="false"
19
+        android:visibility="gone"
20
+        app:layout_constraintBottom_toBottomOf="@+id/main_listview"
21
+        app:layout_constraintEnd_toEndOf="parent"
22
+        app:layout_constraintStart_toStartOf="parent"
23
+        app:layout_constraintTop_toTopOf="@+id/main_listview" />
24
+
25
+    <ListView
26
+        android:id="@+id/main_listview"
27
+        android:layout_width="match_parent"
28
+        android:layout_height="match_parent"
29
+        android:divider="@color/colorPrimary" />
30
+</android.support.constraint.ConstraintLayout>

+ 22
- 0
lesson03/src/main/res/layout/activity_pano.xml 파일 보기

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context="io.hsiao.lesson03.PanoActivity">
8
+
9
+    <ImageView
10
+        android:id="@+id/pano_imgview"
11
+        android:layout_width="wrap_content"
12
+        android:layout_height="wrap_content"
13
+        android:layout_marginBottom="8dp"
14
+        android:layout_marginEnd="8dp"
15
+        android:layout_marginStart="8dp"
16
+        android:layout_marginTop="8dp"
17
+        app:layout_constraintBottom_toBottomOf="parent"
18
+        app:layout_constraintEnd_toEndOf="parent"
19
+        app:layout_constraintStart_toStartOf="parent"
20
+        app:layout_constraintTop_toTopOf="parent"
21
+        app:srcCompat="@android:drawable/ic_menu_report_image" />
22
+</android.support.constraint.ConstraintLayout>

+ 73
- 0
lesson03/src/main/res/layout/main_listview_item.xml 파일 보기

@@ -0,0 +1,73 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
4
+    xmlns:app="http://schemas.android.com/apk/res-auto"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:layout_weight="1">
8
+
9
+
10
+    <ImageView
11
+        android:id="@+id/main_list_thumnail"
12
+        android:layout_width="150dp"
13
+        android:layout_height="150dp"
14
+        android:layout_marginStart="8dp"
15
+        android:layout_marginTop="8dp"
16
+        android:layout_weight="1"
17
+        app:layout_constraintStart_toStartOf="parent"
18
+        app:layout_constraintTop_toTopOf="@+id/main_list_title"
19
+        app:srcCompat="@android:drawable/ic_menu_report_image" />
20
+
21
+    <TextView
22
+        android:id="@+id/main_list_title"
23
+        android:layout_width="wrap_content"
24
+        android:layout_height="wrap_content"
25
+        android:layout_marginEnd="8dp"
26
+        android:layout_marginStart="8dp"
27
+        android:layout_marginTop="8dp"
28
+        android:layout_weight="1"
29
+        android:text="TextView"
30
+        app:layout_constraintEnd_toEndOf="parent"
31
+        app:layout_constraintStart_toEndOf="@+id/main_list_thumnail"
32
+        app:layout_constraintTop_toTopOf="parent" />
33
+
34
+    <TextView
35
+        android:id="@+id/main_list_desc"
36
+        android:layout_width="wrap_content"
37
+        android:layout_height="wrap_content"
38
+        android:layout_marginEnd="8dp"
39
+        android:layout_marginStart="8dp"
40
+        android:layout_marginTop="8dp"
41
+        android:layout_weight="1"
42
+        android:text="TextView"
43
+        app:layout_constraintEnd_toEndOf="parent"
44
+        app:layout_constraintStart_toEndOf="@+id/main_list_thumnail"
45
+        app:layout_constraintTop_toBottomOf="@+id/main_list_title" />
46
+
47
+    <TextView
48
+        android:id="@+id/main_list_create_time"
49
+        android:layout_width="wrap_content"
50
+        android:layout_height="wrap_content"
51
+        android:layout_marginEnd="8dp"
52
+        android:layout_marginStart="8dp"
53
+        android:layout_marginTop="8dp"
54
+        android:layout_weight="1"
55
+        android:text="TextView"
56
+        app:layout_constraintEnd_toEndOf="parent"
57
+        app:layout_constraintStart_toEndOf="@+id/main_list_thumnail"
58
+        app:layout_constraintTop_toBottomOf="@+id/main_list_desc" />
59
+
60
+    <TextView
61
+        android:id="@+id/main_list_likes"
62
+        android:layout_width="wrap_content"
63
+        android:layout_height="wrap_content"
64
+        android:layout_marginEnd="8dp"
65
+        android:layout_marginStart="8dp"
66
+        android:layout_marginTop="8dp"
67
+        android:layout_weight="1"
68
+        android:text="TextView"
69
+        app:layout_constraintEnd_toEndOf="parent"
70
+        app:layout_constraintStart_toEndOf="@+id/main_list_thumnail"
71
+        app:layout_constraintTop_toBottomOf="@+id/main_list_create_time" />
72
+
73
+</android.support.constraint.ConstraintLayout>

+ 5
- 0
lesson03/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 파일 보기

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@drawable/ic_launcher_background" />
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
5
+</adaptive-icon>

+ 5
- 0
lesson03/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 파일 보기

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@drawable/ic_launcher_background" />
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
5
+</adaptive-icon>

BIN
lesson03/src/main/res/mipmap-hdpi/ic_launcher.png 파일 보기


BIN
lesson03/src/main/res/mipmap-hdpi/ic_launcher_round.png 파일 보기


BIN
lesson03/src/main/res/mipmap-mdpi/ic_launcher.png 파일 보기


BIN
lesson03/src/main/res/mipmap-mdpi/ic_launcher_round.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xhdpi/ic_launcher.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xhdpi/ic_launcher_round.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xxhdpi/ic_launcher.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xxhdpi/ic_launcher_round.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xxxhdpi/ic_launcher.png 파일 보기


BIN
lesson03/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png 파일 보기


+ 6
- 0
lesson03/src/main/res/values/colors.xml 파일 보기

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources>
3
+    <color name="colorPrimary">#ebebeb</color>
4
+    <color name="colorPrimaryDark">#303F9F</color>
5
+    <color name="colorAccent">#FF4081</color>
6
+</resources>

+ 3
- 0
lesson03/src/main/res/values/strings.xml 파일 보기

@@ -0,0 +1,3 @@
1
+<resources>
2
+    <string name="app_name">lesson03</string>
3
+</resources>

+ 11
- 0
lesson03/src/main/res/values/styles.xml 파일 보기

@@ -0,0 +1,11 @@
1
+<resources>
2
+
3
+    <!-- Base application theme. -->
4
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5
+        <!-- Customize your theme here. -->
6
+        <item name="colorPrimary">@color/colorPrimary</item>
7
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8
+        <item name="colorAccent">@color/colorAccent</item>
9
+    </style>
10
+
11
+</resources>

+ 17
- 0
lesson03/src/test/java/io/hsiao/lesson03/ExampleUnitTest.java 파일 보기

@@ -0,0 +1,17 @@
1
+package io.hsiao.lesson03;
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
11
+ */
12
+public class ExampleUnitTest {
13
+    @Test
14
+    public void addition_isCorrect() throws Exception {
15
+        assertEquals(4, 2 + 2);
16
+    }
17
+}

+ 1
- 1
settings.gradle 파일 보기

@@ -1 +1 @@
1
-include ':lesson01', ':lesson02'
1
+include ':lesson01', ':lesson02', ':lesson03'

Loading…
취소
저장