wear 2.0
@@ -1,346 +0,0 @@ | ||
1 | -package jp.sfjp.gokigen.prpr0; | |
2 | - | |
3 | -import android.content.ContentResolver; | |
4 | -import android.content.ContentValues; | |
5 | -import android.graphics.Bitmap; | |
6 | -import android.os.Environment; | |
7 | -import android.provider.MediaStore; | |
8 | -import android.util.Log; | |
9 | - | |
10 | -import java.io.BufferedOutputStream; | |
11 | -import java.io.File; | |
12 | -import java.io.FileInputStream; | |
13 | -import java.io.FileOutputStream; | |
14 | -import java.io.InputStream; | |
15 | -import java.io.OutputStream; | |
16 | -import java.text.SimpleDateFormat; | |
17 | -import java.util.Calendar; | |
18 | - | |
19 | -/** | |
20 | - * 外部ストレージにデータを記録するために使うユーティリティ (使えるのか...) | |
21 | - * | |
22 | - * @author MRSa | |
23 | - */ | |
24 | -public class ExternalStorageFileUtility | |
25 | -{ | |
26 | - private static final String TAG = "ExternalStorageFileUtility"; | |
27 | - | |
28 | - private final int COPY_BUFFER_SIZE = 32768; | |
29 | - private final int BUFFER_MARGIN = 4; | |
30 | - | |
31 | - private String baseDirectory = "/"; | |
32 | - | |
33 | - /** | |
34 | - * コンストラクタ | |
35 | - * | |
36 | - * @param offsetDir | |
37 | - */ | |
38 | - public ExternalStorageFileUtility(String offsetDir) | |
39 | - { | |
40 | - prepareBaseDirectory(offsetDir); | |
41 | - } | |
42 | - | |
43 | - /** | |
44 | - * 記録のベースディレクトリを作成し、記録の準備 | |
45 | - * | |
46 | - */ | |
47 | - private boolean prepareBaseDirectory(String offsetDir) | |
48 | - { | |
49 | - String gokigenDirectory = Environment.getExternalStorageDirectory().getPath() + "/Gokigen"; | |
50 | - try | |
51 | - { | |
52 | - File baseDir = new File(gokigenDirectory); | |
53 | - if (baseDir.exists() == false) | |
54 | - { | |
55 | - if (baseDir.mkdirs() == false) | |
56 | - { | |
57 | - baseDirectory = Environment.getExternalStorageDirectory().getPath(); | |
58 | - baseDir = null; | |
59 | - return (false); | |
60 | - } | |
61 | - } | |
62 | - gokigenDirectory = gokigenDirectory + offsetDir; | |
63 | - baseDir = null; | |
64 | - baseDir = new File(gokigenDirectory); | |
65 | - if (baseDir.exists() == false) | |
66 | - { | |
67 | - if (baseDir.mkdirs() == false) | |
68 | - { | |
69 | - baseDirectory = Environment.getExternalStorageDirectory().getPath() + "/Gokigen"; | |
70 | - baseDir = null; | |
71 | - return (false); | |
72 | - } | |
73 | - } | |
74 | - baseDirectory = gokigenDirectory; | |
75 | - return (true); | |
76 | - } | |
77 | - catch (Exception ex) | |
78 | - { | |
79 | - if (Log.isLoggable(TAG, Log.VERBOSE)) | |
80 | - { | |
81 | - Log.v(TAG, "prepareBaseDirectory() : " + ex.getMessage()); | |
82 | - } | |
83 | - } | |
84 | - baseDirectory = Environment.getExternalStorageDirectory().getPath(); | |
85 | - return (false); | |
86 | - } | |
87 | - | |
88 | - public String getGokigenDirectory() | |
89 | - { | |
90 | - return (baseDirectory); | |
91 | - } | |
92 | - | |
93 | - /** | |
94 | - * | |
95 | - * | |
96 | - * @param dirName | |
97 | - * @return | |
98 | - */ | |
99 | - public boolean makeDirectory(String dirName) | |
100 | - { | |
101 | - String makeDir = baseDirectory + "/" + dirName; | |
102 | - try | |
103 | - { | |
104 | - File dir = new File(makeDir); | |
105 | - if (dir.exists() == false) | |
106 | - { | |
107 | - return (dir.mkdirs()); | |
108 | - } | |
109 | - return (true); | |
110 | - } | |
111 | - catch (Exception ex) | |
112 | - { | |
113 | - if (Log.isLoggable(TAG, Log.VERBOSE)) | |
114 | - { | |
115 | - Log.v(TAG, "makeDirectory() : " + ex.getMessage()); | |
116 | - } | |
117 | - } | |
118 | - return (false); | |
119 | - } | |
120 | - | |
121 | - public FileOutputStream openFileStream(String fileName, boolean isAppend) | |
122 | - { | |
123 | - try | |
124 | - { | |
125 | - String targetName = baseDirectory + "/" + fileName; | |
126 | - FileOutputStream fileStream = new FileOutputStream(targetName, isAppend); | |
127 | - return (fileStream); | |
128 | - } | |
129 | - catch (Exception e) | |
130 | - { | |
131 | - if (Log.isLoggable(TAG, Log.VERBOSE)) | |
132 | - { | |
133 | - Log.v(TAG, "openFileStream() : " + e.getMessage()); | |
134 | - } | |
135 | - } | |
136 | - return (null); | |
137 | - } | |
138 | - | |
139 | - private String decideFileNameWithSpecifiedDate(String fileName, String year, String month, String date) | |
140 | - { | |
141 | - String directory = year; | |
142 | - | |
143 | - makeDirectory(year); | |
144 | - | |
145 | - directory = directory + "/" + year + month; | |
146 | - | |
147 | - makeDirectory(directory); | |
148 | - | |
149 | - directory = directory + "/" + year + month + date; | |
150 | - | |
151 | - makeDirectory(directory); | |
152 | - | |
153 | - return (directory + "/" + year + month + date + "-" + fileName); | |
154 | - } | |
155 | - | |
156 | - public String decideFileNameWithDate(String fileName) | |
157 | - { | |
158 | - Calendar calendar = Calendar.getInstance(); | |
159 | - | |
160 | - SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy"); | |
161 | - SimpleDateFormat monthFormat = new SimpleDateFormat("MM"); | |
162 | - SimpleDateFormat dateFormat = new SimpleDateFormat("dd"); | |
163 | - | |
164 | - String year = yearFormat.format(calendar.getTime()); | |
165 | - String month = monthFormat.format(calendar.getTime()); | |
166 | - String date = dateFormat.format(calendar.getTime()); | |
167 | - | |
168 | - return (decideFileNameWithSpecifiedDate(fileName, year, month, date)); | |
169 | - } | |
170 | - | |
171 | - public String decideFileNameWithSpecifiedDate(String fileName, int year, int month, int day) | |
172 | - { | |
173 | - String yearStr = year + ""; | |
174 | - String monthStr = ""; | |
175 | - if (month < 10) | |
176 | - { | |
177 | - monthStr = "0" + month; | |
178 | - } | |
179 | - else | |
180 | - { | |
181 | - monthStr = month + ""; | |
182 | - } | |
183 | - String dayStr = ""; | |
184 | - if (day < 10) | |
185 | - { | |
186 | - dayStr = "0" + day; | |
187 | - } | |
188 | - else | |
189 | - { | |
190 | - dayStr = day + ""; | |
191 | - } | |
192 | - return (decideFileNameWithSpecifiedDate(fileName, yearStr, monthStr, dayStr)); | |
193 | - } | |
194 | - | |
195 | - public String decideDateDirectory(int year, int month, int date) | |
196 | - { | |
197 | - String addMonth = ""; | |
198 | - String addDate = ""; | |
199 | - String directory = baseDirectory + "/" + year + "/"; | |
200 | - if (month < 10) | |
201 | - { | |
202 | - addMonth = "0"; | |
203 | - } | |
204 | - if (date < 10) | |
205 | - { | |
206 | - addDate = "0"; | |
207 | - } | |
208 | - directory = directory + year + addMonth + month + "/" + year + addMonth + month + addDate + date + "/"; | |
209 | - return (directory); | |
210 | - } | |
211 | - | |
212 | - public boolean copyFile(String destFileName, String srcFileName) | |
213 | - { | |
214 | - File srcFile = null; | |
215 | - File dstFile = null; | |
216 | - | |
217 | - boolean ret = false; | |
218 | - InputStream is = null; | |
219 | - OutputStream os = null; | |
220 | - | |
221 | - if (destFileName == srcFileName) | |
222 | - { | |
223 | - return (false); | |
224 | - } | |
225 | - | |
226 | - try | |
227 | - { | |
228 | - srcFile = new File(srcFileName); | |
229 | - if (srcFile.exists() != true) | |
230 | - { | |
231 | - return (false); | |
232 | - } | |
233 | - is = new FileInputStream(srcFile); | |
234 | - | |
235 | - long dataFileSize = srcFile.length(); | |
236 | - byte[] buffer = new byte[COPY_BUFFER_SIZE + BUFFER_MARGIN]; | |
237 | - | |
238 | - dstFile = new File(destFileName); | |
239 | - if (dstFile.exists() == true) | |
240 | - { | |
241 | - dstFile.delete(); | |
242 | - } | |
243 | - | |
244 | - os = new FileOutputStream(dstFile); | |
245 | - if ((is != null)&&(os != null)) | |
246 | - { | |
247 | - while (dataFileSize > 0) | |
248 | - { | |
249 | - int size = is.read(buffer, 0, COPY_BUFFER_SIZE); | |
250 | - if (size <= 0) | |
251 | - { | |
252 | - break; | |
253 | - } | |
254 | - os.write(buffer, 0, size); | |
255 | - } | |
256 | - } | |
257 | - os.flush(); | |
258 | - os.close(); | |
259 | - is.close(); | |
260 | - | |
261 | - dstFile = null; | |
262 | - srcFile = null; | |
263 | - buffer = null; | |
264 | - is = null; | |
265 | - os = null; | |
266 | - ret = true; | |
267 | - System.gc(); | |
268 | - } | |
269 | - catch (Exception e) | |
270 | - { | |
271 | - try | |
272 | - { | |
273 | - if (is != null) | |
274 | - { | |
275 | - is.close(); | |
276 | - } | |
277 | - } | |
278 | - catch (Exception e2) | |
279 | - { | |
280 | - // | |
281 | - } | |
282 | - | |
283 | - try | |
284 | - { | |
285 | - if (os != null) | |
286 | - { | |
287 | - os.close(); | |
288 | - } | |
289 | - } | |
290 | - catch (Exception e2) | |
291 | - { | |
292 | - // | |
293 | - } | |
294 | - is = null; | |
295 | - os = null; | |
296 | - srcFile = null; | |
297 | - dstFile = null; | |
298 | - System.gc(); | |
299 | - | |
300 | - return (false); | |
301 | - } | |
302 | - return (ret); | |
303 | - } | |
304 | - | |
305 | - /** | |
306 | - * BITMAPをPNGイメージにして保存する | |
307 | - * | |
308 | - * @param contentResolver ギャラリーに登録する場合に指定する | |
309 | - * @param targetImage PNGで保存するBitmap | |
310 | - * @return 保存したビットマップのファイル名(nullの場合には保存失敗) | |
311 | - */ | |
312 | - public String putPngImageFromBitmap(ContentResolver contentResolver, String appendDirectory, Bitmap targetImage) | |
313 | - { | |
314 | - String fileName = null; | |
315 | - try | |
316 | - { | |
317 | - long dateTime = Calendar.getInstance().getTime().getTime(); | |
318 | - fileName = dateTime + ".png"; | |
319 | - String imagePath = baseDirectory; | |
320 | - if (appendDirectory != null) | |
321 | - { | |
322 | - imagePath = imagePath + appendDirectory; | |
323 | - } | |
324 | - imagePath = imagePath + "/" + fileName; | |
325 | - BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(imagePath)); | |
326 | - targetImage.compress(Bitmap.CompressFormat.PNG, 100, out); | |
327 | - out.close(); | |
328 | - | |
329 | - /** ContentResolver が指定されていた場合には、ギャラリーに追加する **/ | |
330 | - if (contentResolver != null) | |
331 | - { | |
332 | - ContentValues values = new ContentValues(10); | |
333 | - values.put(MediaStore.Images.Media.TITLE, fileName); | |
334 | - values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName); | |
335 | - values.put(MediaStore.Images.Media.MIME_TYPE, "image/png"); | |
336 | - values.put(MediaStore.Images.Media.DATA, imagePath); | |
337 | - contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); | |
338 | - } | |
339 | - } | |
340 | - catch (Exception ee) | |
341 | - { | |
342 | - return (null); | |
343 | - } | |
344 | - return (fileName); | |
345 | - } | |
346 | -} |
@@ -0,0 +1,158 @@ | ||
1 | +package jp.sfjp.gokigen.prpr0; | |
2 | + | |
3 | +import android.graphics.Bitmap; | |
4 | +import android.os.Environment; | |
5 | +import android.util.Log; | |
6 | + | |
7 | +import java.io.BufferedOutputStream; | |
8 | +import java.io.File; | |
9 | +import java.io.FileOutputStream; | |
10 | +import java.util.Calendar; | |
11 | + | |
12 | +/** | |
13 | + * 外部ストレージにデータを記録するために使うユーティリティ (使えるのか...) | |
14 | + * | |
15 | + * @author MRSa | |
16 | + */ | |
17 | +class ExtStorageFileUtil | |
18 | +{ | |
19 | + private static final String TAG = "ExtStorageFileUtil"; | |
20 | + private String baseDirectory = "/"; | |
21 | + | |
22 | + /** | |
23 | + * コンストラクタ | |
24 | + * | |
25 | + * @param offsetDir オフセットディレクトリ | |
26 | + */ | |
27 | + ExtStorageFileUtil(String offsetDir) | |
28 | + { | |
29 | + prepareBaseDirectory(offsetDir); | |
30 | + } | |
31 | + | |
32 | + /** | |
33 | + * 記録のベースディレクトリを作成し、記録の準備 | |
34 | + * | |
35 | + */ | |
36 | + private void prepareBaseDirectory(String offsetDir) | |
37 | + { | |
38 | + String gokigenDirectory = Environment.getExternalStorageDirectory().getPath() + "/Gokigen"; | |
39 | + try | |
40 | + { | |
41 | + File baseDir = new File(gokigenDirectory); | |
42 | + if (!baseDir.exists()) | |
43 | + { | |
44 | + if (!baseDir.mkdirs()) | |
45 | + { | |
46 | + baseDirectory = Environment.getExternalStorageDirectory().getPath(); | |
47 | + return; | |
48 | + } | |
49 | + } | |
50 | + gokigenDirectory = gokigenDirectory + offsetDir; | |
51 | + baseDir = new File(gokigenDirectory); | |
52 | + if (!baseDir.exists()) | |
53 | + { | |
54 | + if (!baseDir.mkdirs()) | |
55 | + { | |
56 | + baseDirectory = Environment.getExternalStorageDirectory().getPath() + "/Gokigen"; | |
57 | + return; | |
58 | + } | |
59 | + } | |
60 | + baseDirectory = gokigenDirectory; | |
61 | + return; | |
62 | + } | |
63 | + catch (Exception ex) | |
64 | + { | |
65 | + if (Log.isLoggable(TAG, Log.VERBOSE)) | |
66 | + { | |
67 | + Log.v(TAG, "prepareBaseDirectory() : " + ex.getMessage()); | |
68 | + } | |
69 | + } | |
70 | + baseDirectory = Environment.getExternalStorageDirectory().getPath(); | |
71 | + } | |
72 | + | |
73 | + /** | |
74 | + * ベースディレクトリを応答する | |
75 | + * | |
76 | + * @return ファイルのあるベースディレクトリ | |
77 | + */ | |
78 | + | |
79 | + String getGokigenDirectory() | |
80 | + { | |
81 | + return (baseDirectory); | |
82 | + } | |
83 | + | |
84 | + /** | |
85 | + * ディレクトリを作成する | |
86 | + * | |
87 | + * @param dirName ディレクトリ名 | |
88 | + */ | |
89 | + void makeDirectory(String dirName) | |
90 | + { | |
91 | + String makeDir = baseDirectory + "/" + dirName; | |
92 | + try | |
93 | + { | |
94 | + File dir = new File(makeDir); | |
95 | + if (!dir.exists()) | |
96 | + { | |
97 | + boolean ret = dir.mkdirs(); | |
98 | + if (!ret) | |
99 | + { | |
100 | + if (Log.isLoggable(TAG, Log.VERBOSE)) | |
101 | + { | |
102 | + Log.v(TAG, "makeDirectory() : false "); | |
103 | + } | |
104 | + } | |
105 | + } | |
106 | + } | |
107 | + catch (Exception ex) | |
108 | + { | |
109 | + if (Log.isLoggable(TAG, Log.VERBOSE)) | |
110 | + { | |
111 | + Log.v(TAG, "makeDirectory() : " + ex.getMessage()); | |
112 | + } | |
113 | + } | |
114 | + } | |
115 | + | |
116 | + /** | |
117 | + * BITMAPをPNGイメージにして保存する | |
118 | + * | |
119 | + * @param targetImage PNGで保存するBitmap | |
120 | + * @return 保存したビットマップのファイル名(nullの場合には保存失敗) | |
121 | + */ | |
122 | + //String putPngImageFromBitmap(ContentResolver contentResolver, String appendDirectory, Bitmap targetImage) | |
123 | + String putPngImageFromBitmap(String appendDirectory, Bitmap targetImage) | |
124 | + { | |
125 | + String fileName; | |
126 | + try | |
127 | + { | |
128 | + long dateTime = Calendar.getInstance().getTime().getTime(); | |
129 | + fileName = dateTime + ".png"; | |
130 | + String imagePath = baseDirectory; | |
131 | + if (appendDirectory != null) | |
132 | + { | |
133 | + imagePath = imagePath + appendDirectory; | |
134 | + } | |
135 | + imagePath = imagePath + "/" + fileName; | |
136 | + BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(imagePath)); | |
137 | + targetImage.compress(Bitmap.CompressFormat.PNG, 100, out); | |
138 | + out.close(); | |
139 | +/* | |
140 | + // ContentResolver が指定されていた場合には、ギャラリーに追加する | |
141 | + if (contentResolver != null) | |
142 | + { | |
143 | + ContentValues values = new ContentValues(10); | |
144 | + values.put(MediaStore.Images.Media.TITLE, fileName); | |
145 | + values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName); | |
146 | + values.put(MediaStore.Images.Media.MIME_TYPE, "image/png"); | |
147 | + values.put(MediaStore.Images.Media.DATA, imagePath); | |
148 | + contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); | |
149 | + } | |
150 | +*/ | |
151 | + } | |
152 | + catch (Exception ee) | |
153 | + { | |
154 | + return (null); | |
155 | + } | |
156 | + return (fileName); | |
157 | + } | |
158 | +} |
@@ -7,20 +7,23 @@ | ||
7 | 7 | import android.text.format.Time; |
8 | 8 | import android.util.Log; |
9 | 9 | |
10 | +import java.util.Locale; | |
11 | + | |
10 | 12 | /** |
11 | 13 | * 時計の盤面を描画する |
12 | 14 | * Created by MRSa on 2014/12/20. |
13 | 15 | */ |
14 | -public class MyWatchFaceDrawer | |
16 | +class MyWatchFaceDrawer | |
15 | 17 | { |
16 | 18 | private static final String TAG = "MyWatchFaceDrawer"; |
17 | 19 | private MyWatchFaceHolder mHolder = null; |
20 | + private boolean isShowSeconds = false; | |
18 | 21 | |
19 | 22 | /** |
20 | 23 | * コンストラクタ |
21 | 24 | * |
22 | 25 | */ |
23 | - public MyWatchFaceDrawer(MyWatchFaceHolder holder) | |
26 | + MyWatchFaceDrawer(MyWatchFaceHolder holder) | |
24 | 27 | { |
25 | 28 | mHolder = holder; |
26 | 29 | } |
@@ -29,9 +32,9 @@ | ||
29 | 32 | * 初期化 |
30 | 33 | * |
31 | 34 | */ |
32 | - public void initialize() | |
35 | + void initialize(boolean isShowSeconds) | |
33 | 36 | { |
34 | - | |
37 | + this.isShowSeconds = isShowSeconds; | |
35 | 38 | } |
36 | 39 | |
37 | 40 | /** |
@@ -40,11 +43,11 @@ | ||
40 | 43 | * @param bounds 描画領域の大きさ |
41 | 44 | * @param timeToDraw 描画する時刻 |
42 | 45 | */ |
43 | - public void doDraw(Canvas canvas, Rect bounds, Time timeToDraw) | |
46 | + void doDraw(Canvas canvas, Rect bounds, Time timeToDraw) | |
44 | 47 | { |
45 | 48 | if (mHolder == null) |
46 | 49 | { |
47 | - /** 情報保持オブジェクトがない場合はログ表示で終了 **/ | |
50 | + // 情報保持オブジェクトがない場合はログ表示で終了 | |
48 | 51 | if (Log.isLoggable(TAG, Log.DEBUG)) |
49 | 52 | { |
50 | 53 | Log.d(TAG, "doDraw: data holder is null."); |
@@ -54,7 +57,7 @@ | ||
54 | 57 | int width = bounds.width(); |
55 | 58 | int height = bounds.height(); |
56 | 59 | |
57 | - /** 背景画像の描画 **/ | |
60 | + // 背景画像の描画 | |
58 | 61 | Bitmap backgroundBitmap = mHolder.getBackgroundScaledBitmap(width, height); |
59 | 62 | if (backgroundBitmap != null) |
60 | 63 | { |
@@ -61,10 +64,19 @@ | ||
61 | 64 | canvas.drawBitmap(backgroundBitmap, 0, 0, null); |
62 | 65 | } |
63 | 66 | |
64 | - /** 現在時刻を hh:mm 形式にする **/ | |
65 | - String timeString = formatTwoDigitNumber(timeToDraw.hour) + MyWatchFaceHolder.TIME_SEPARATOR + formatTwoDigitNumber(timeToDraw.minute); | |
67 | + String timeString; | |
68 | + if (isShowSeconds) | |
69 | + { | |
70 | + // 現在時刻を hh:mm.ss 形式にする | |
71 | + timeString = formatTwoDigitNumber(timeToDraw.hour) + MyWatchFaceHolder.TIME_SEPARATOR + formatTwoDigitNumber(timeToDraw.minute) + MyWatchFaceHolder.SECOND_SEPARATOR + formatTwoDigitNumber(timeToDraw.second); | |
72 | + } | |
73 | + else | |
74 | + { | |
75 | + // 現在時刻を hh:mm 形式にする | |
76 | + timeString = formatTwoDigitNumber(timeToDraw.hour) + MyWatchFaceHolder.TIME_SEPARATOR + formatTwoDigitNumber(timeToDraw.minute); | |
77 | + } | |
66 | 78 | |
67 | - /** 時刻の表示位置を決める **/ | |
79 | + // 時刻の表示位置を決める | |
68 | 80 | Paint textPaint = mHolder.getTimePaint(); |
69 | 81 | float textWidth = textPaint.measureText(timeString); |
70 | 82 | Paint.FontMetrics fontMetrics = textPaint.getFontMetrics(); |
@@ -72,10 +84,10 @@ | ||
72 | 84 | float baseY = height - fontSize - mHolder.getYOffset(); |
73 | 85 | float baseX = (width - textWidth) / 2.0f; |
74 | 86 | |
75 | - /** 背景の描画(半透明にする) **/ | |
87 | + // 背景の描画(半透明にする) | |
76 | 88 | canvas.drawRoundRect((baseX - 5.0f), baseY + fontMetrics.ascent, (baseX + textWidth +5.0f), (baseY + fontMetrics.descent), 10.0f, 10.0f, mHolder.getBackPaint()); |
77 | 89 | |
78 | - /** 時刻の描画 **/ | |
90 | + // 時刻の描画 | |
79 | 91 | canvas.drawText(timeString, baseX, baseY, textPaint); |
80 | 92 | } |
81 | 93 |
@@ -82,11 +94,11 @@ | ||
82 | 94 | /** |
83 | 95 | * 数字を二桁の数値に揃える |
84 | 96 | * |
85 | - * @param data | |
97 | + * @param data 数値 | |
86 | 98 | * @return string data |
87 | 99 | */ |
88 | 100 | private String formatTwoDigitNumber(int data) |
89 | 101 | { |
90 | - return String.format("%02d", data); | |
102 | + return String.format(Locale.ENGLISH, "%02d", data); | |
91 | 103 | } |
92 | 104 | } |
@@ -18,23 +18,26 @@ | ||
18 | 18 | import java.util.Hashtable; |
19 | 19 | import java.util.Random; |
20 | 20 | |
21 | +import static android.support.wearable.watchface.WatchFaceService.PROPERTY_LOW_BIT_AMBIENT; | |
22 | + | |
21 | 23 | /** |
22 | 24 | * 時計描画用データの保持クラス |
23 | 25 | * |
24 | 26 | * Created by MRSa on 2014/12/20. |
25 | 27 | */ |
26 | -public class MyWatchFaceHolder | |
28 | +class MyWatchFaceHolder | |
27 | 29 | { |
28 | 30 | private static final String TAG = "MyWatchFaceHolder"; |
29 | 31 | private static final int THRESHOLD_RANDOM_SHOW = 60; // ランダムに表示するかどうかの切替え |
30 | 32 | private static final Typeface BOLD_TYPEFACE = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD); |
31 | 33 | private static final Typeface NORMAL_TYPEFACE = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); |
32 | - public static final String TIME_SEPARATOR = ":"; | |
33 | - public static final String DATE_SEPARATOR = "-"; | |
34 | + static final String TIME_SEPARATOR = ":"; | |
35 | + static final String SECOND_SEPARATOR = "."; | |
36 | + // private static final String DATE_SEPARATOR = "-"; | |
34 | 37 | |
35 | 38 | /* device features */ |
36 | - private boolean mLowBitAmbient = false; | |
37 | - private boolean mBurnInProtection = false; | |
39 | + //private boolean mLowBitAmbient = false; | |
40 | + //private boolean mBurnInProtection = false; | |
38 | 41 | private boolean mIsRoundShape = false; |
39 | 42 | |
40 | 43 | /* graphic objects */ |
@@ -53,7 +56,7 @@ | ||
53 | 56 | private Paint mBackPaint = null; |
54 | 57 | private Context context = null; |
55 | 58 | |
56 | - private ExternalStorageFileUtility fileUtility = null; | |
59 | + private ExtStorageFileUtil fileUtility = null; | |
57 | 60 | |
58 | 61 | private Random randomGenerator = null; |
59 | 62 |
@@ -60,11 +63,14 @@ | ||
60 | 63 | /** |
61 | 64 | * コンストラクタ |
62 | 65 | */ |
63 | - public MyWatchFaceHolder(Context parent) | |
66 | + MyWatchFaceHolder(Context parent) | |
64 | 67 | { |
68 | + String offset = "/prpr"; | |
69 | + String dir = "/all"; | |
70 | + | |
65 | 71 | // ファイルユーティリティの作成 |
66 | - fileUtility = new ExternalStorageFileUtility("/prpr"); | |
67 | - fileUtility.makeDirectory("/all"); | |
72 | + fileUtility = new ExtStorageFileUtil(offset); | |
73 | + fileUtility.makeDirectory(dir); | |
68 | 74 | |
69 | 75 | // 乱数生成器 |
70 | 76 | randomGenerator = new Random(); |
@@ -77,9 +83,8 @@ | ||
77 | 83 | /** |
78 | 84 | * 初期化処理 |
79 | 85 | * |
80 | - * @return true : success, false : failure | |
81 | 86 | */ |
82 | - private boolean initialize() | |
87 | + private void initialize() | |
83 | 88 | { |
84 | 89 | initializeGraphicObjects(); |
85 | 90 | initializeDrawTextObjects(); |
@@ -91,22 +96,19 @@ | ||
91 | 96 | { |
92 | 97 | isRandom = true; |
93 | 98 | } |
94 | - return (true); | |
99 | + Log.v(TAG, "nofBitmap: " + nofBitmaps + " rnd : " + isRandom); | |
95 | 100 | } |
96 | 101 | |
97 | - public void onPropertiesChanged(Bundle properties) | |
102 | + void onPropertiesChanged(Bundle properties) | |
98 | 103 | { |
104 | + Log.v(TAG, "PROPERTY_LOW_BIT_AMBIENT " + properties.getBoolean(PROPERTY_LOW_BIT_AMBIENT, false)); | |
99 | 105 | //mLowBitAmbient = properties.getBoolean(PROPERTY_LOW_BIT_AMBIENT, false); |
100 | 106 | //mBurnInProtection = properties.getBoolean(PROPERTY_BURN_IN_PROTECTION, false); |
101 | 107 | } |
102 | 108 | |
103 | - public boolean setAmbientMode(boolean inAmbientMode, boolean previousInAmbientMode) | |
109 | + boolean setAmbientMode(boolean inAmbientMode, boolean previousInAmbientMode) | |
104 | 110 | { |
105 | - if (inAmbientMode == previousInAmbientMode) | |
106 | - { | |
107 | - return (false); | |
108 | - } | |
109 | - return (true); | |
111 | + return (!(inAmbientMode == previousInAmbientMode)); | |
110 | 112 | } |
111 | 113 | |
112 | 114 | /** |
@@ -113,7 +115,7 @@ | ||
113 | 115 | * 終了時処理 (記憶していた画像を示す配列を消去する) |
114 | 116 | * |
115 | 117 | */ |
116 | - public void dispose() | |
118 | + void dispose() | |
117 | 119 | { |
118 | 120 | if (mBackgroundBitmapIds != null) |
119 | 121 | { |
@@ -132,15 +134,14 @@ | ||
132 | 134 | /** |
133 | 135 | * |
134 | 136 | * |
135 | - * @param isRound | |
136 | 137 | */ |
137 | - public void setIsRound(boolean isRound, Resources resources) | |
138 | + void setIsRound(boolean isRound, Resources resources) | |
138 | 139 | { |
139 | 140 | if (mIsRoundShape == isRound) |
140 | 141 | { |
141 | 142 | return; |
142 | 143 | } |
143 | - /** update watch face shape **/ | |
144 | + // update watch face shape | |
144 | 145 | mIsRoundShape = isRound; |
145 | 146 | mTextSize = resources.getDimension(isRound ? R.dimen.text_size_round : R.dimen.text_size); |
146 | 147 | } |
@@ -147,9 +148,8 @@ | ||
147 | 148 | |
148 | 149 | /** |
149 | 150 | * |
150 | - * @return | |
151 | 151 | */ |
152 | - public Paint getTimePaint() | |
152 | + Paint getTimePaint() | |
153 | 153 | { |
154 | 154 | mTimePaint.setTextSize(mTextSize); |
155 | 155 | return (mTimePaint); |
@@ -157,9 +157,8 @@ | ||
157 | 157 | |
158 | 158 | /** |
159 | 159 | * |
160 | - * @return | |
161 | 160 | */ |
162 | - public Paint getBackPaint() | |
161 | + Paint getBackPaint() | |
163 | 162 | { |
164 | 163 | return (mBackPaint); |
165 | 164 | } |
@@ -166,9 +165,8 @@ | ||
166 | 165 | |
167 | 166 | /** |
168 | 167 | * |
169 | - * @return | |
170 | 168 | */ |
171 | - public float getYOffset() | |
169 | + float getYOffset() | |
172 | 170 | { |
173 | 171 | return (mYOffset); |
174 | 172 | } |
@@ -185,13 +183,13 @@ | ||
185 | 183 | mBackgroundBitmapIds = null; |
186 | 184 | mBackgroundBitmapFileNames = null; |
187 | 185 | |
188 | - mBackgroundBitmapFileNames = new Hashtable<Integer, String>(); | |
186 | + mBackgroundBitmapFileNames = new Hashtable<>(); | |
189 | 187 | mBackgroundBitmapFileNames.clear(); |
190 | 188 | |
191 | - /** 表示画像の初期化 **/ | |
189 | + ///表示画像の初期化 | |
192 | 190 | currentBackgroundBitmap = 0; |
193 | 191 | |
194 | - /** ファイルからビットマップを展開する **/ | |
192 | + // ファイルからビットマップを展開する | |
195 | 193 | int nofImages = extractBitmaps(); |
196 | 194 | if (Log.isLoggable(TAG, Log.DEBUG)) |
197 | 195 | { |
@@ -204,8 +202,8 @@ | ||
204 | 202 | return; |
205 | 203 | } |
206 | 204 | |
207 | - /** 背景画像(デフォルト)の設定 **/ | |
208 | - mBackgroundBitmapIds = new Hashtable<Integer, Integer>(); | |
205 | + // 背景画像(デフォルト)の設定 | |
206 | + mBackgroundBitmapIds = new Hashtable<>(); | |
209 | 207 | mBackgroundBitmapIds.clear(); |
210 | 208 | |
211 | 209 | /**/ |
@@ -372,6 +370,192 @@ | ||
372 | 370 | setupBackgroundBitmapFromResId(R.drawable.aoi148); |
373 | 371 | setupBackgroundBitmapFromResId(R.drawable.aoi149); |
374 | 372 | setupBackgroundBitmapFromResId(R.drawable.aoi150); |
373 | + setupBackgroundBitmapFromResId(R.drawable.aoi151); | |
374 | + setupBackgroundBitmapFromResId(R.drawable.aoi152); | |
375 | + setupBackgroundBitmapFromResId(R.drawable.aoi153); | |
376 | + setupBackgroundBitmapFromResId(R.drawable.aoi154); | |
377 | + setupBackgroundBitmapFromResId(R.drawable.aoi155); | |
378 | + setupBackgroundBitmapFromResId(R.drawable.aoi156); | |
379 | + setupBackgroundBitmapFromResId(R.drawable.aoi157); | |
380 | + setupBackgroundBitmapFromResId(R.drawable.aoi158); | |
381 | + setupBackgroundBitmapFromResId(R.drawable.aoi159); | |
382 | + setupBackgroundBitmapFromResId(R.drawable.aoi160); | |
383 | + setupBackgroundBitmapFromResId(R.drawable.aoi161); | |
384 | + setupBackgroundBitmapFromResId(R.drawable.aoi162); | |
385 | + setupBackgroundBitmapFromResId(R.drawable.aoi163); | |
386 | + setupBackgroundBitmapFromResId(R.drawable.aoi164); | |
387 | + setupBackgroundBitmapFromResId(R.drawable.aoi165); | |
388 | + setupBackgroundBitmapFromResId(R.drawable.aoi166); | |
389 | + setupBackgroundBitmapFromResId(R.drawable.aoi167); | |
390 | + setupBackgroundBitmapFromResId(R.drawable.aoi168); | |
391 | + setupBackgroundBitmapFromResId(R.drawable.aoi169); | |
392 | + setupBackgroundBitmapFromResId(R.drawable.aoi170); | |
393 | + setupBackgroundBitmapFromResId(R.drawable.aoi171); | |
394 | + setupBackgroundBitmapFromResId(R.drawable.aoi172); | |
395 | + setupBackgroundBitmapFromResId(R.drawable.aoi173); | |
396 | + setupBackgroundBitmapFromResId(R.drawable.aoi174); | |
397 | + setupBackgroundBitmapFromResId(R.drawable.aoi175); | |
398 | + setupBackgroundBitmapFromResId(R.drawable.aoi176); | |
399 | + setupBackgroundBitmapFromResId(R.drawable.aoi177); | |
400 | + setupBackgroundBitmapFromResId(R.drawable.aoi178); | |
401 | + setupBackgroundBitmapFromResId(R.drawable.aoi179); | |
402 | + setupBackgroundBitmapFromResId(R.drawable.aoi180); | |
403 | + setupBackgroundBitmapFromResId(R.drawable.aoi181); | |
404 | + setupBackgroundBitmapFromResId(R.drawable.aoi182); | |
405 | + setupBackgroundBitmapFromResId(R.drawable.aoi183); | |
406 | + setupBackgroundBitmapFromResId(R.drawable.aoi184); | |
407 | + setupBackgroundBitmapFromResId(R.drawable.aoi185); | |
408 | + setupBackgroundBitmapFromResId(R.drawable.aoi186); | |
409 | + setupBackgroundBitmapFromResId(R.drawable.aoi187); | |
410 | + setupBackgroundBitmapFromResId(R.drawable.aoi188); | |
411 | + setupBackgroundBitmapFromResId(R.drawable.aoi189); | |
412 | + setupBackgroundBitmapFromResId(R.drawable.aoi190); | |
413 | + setupBackgroundBitmapFromResId(R.drawable.aoi191); | |
414 | + setupBackgroundBitmapFromResId(R.drawable.aoi192); | |
415 | + setupBackgroundBitmapFromResId(R.drawable.aoi193); | |
416 | + setupBackgroundBitmapFromResId(R.drawable.aoi194); | |
417 | + setupBackgroundBitmapFromResId(R.drawable.aoi195); | |
418 | + setupBackgroundBitmapFromResId(R.drawable.aoi196); | |
419 | + setupBackgroundBitmapFromResId(R.drawable.aoi197); | |
420 | + setupBackgroundBitmapFromResId(R.drawable.aoi198); | |
421 | + setupBackgroundBitmapFromResId(R.drawable.aoi199); | |
422 | + setupBackgroundBitmapFromResId(R.drawable.aoi200); | |
423 | + setupBackgroundBitmapFromResId(R.drawable.aoi201); | |
424 | + setupBackgroundBitmapFromResId(R.drawable.aoi202); | |
425 | + setupBackgroundBitmapFromResId(R.drawable.aoi203); | |
426 | + setupBackgroundBitmapFromResId(R.drawable.aoi204); | |
427 | + setupBackgroundBitmapFromResId(R.drawable.aoi205); | |
428 | + setupBackgroundBitmapFromResId(R.drawable.aoi206); | |
429 | + setupBackgroundBitmapFromResId(R.drawable.aoi207); | |
430 | + setupBackgroundBitmapFromResId(R.drawable.aoi208); | |
431 | + setupBackgroundBitmapFromResId(R.drawable.aoi209); | |
432 | + setupBackgroundBitmapFromResId(R.drawable.aoi210); | |
433 | + setupBackgroundBitmapFromResId(R.drawable.aoi211); | |
434 | + setupBackgroundBitmapFromResId(R.drawable.aoi212); | |
435 | + setupBackgroundBitmapFromResId(R.drawable.aoi213); | |
436 | + setupBackgroundBitmapFromResId(R.drawable.aoi214); | |
437 | + setupBackgroundBitmapFromResId(R.drawable.aoi215); | |
438 | + setupBackgroundBitmapFromResId(R.drawable.aoi216); | |
439 | + setupBackgroundBitmapFromResId(R.drawable.aoi217); | |
440 | + setupBackgroundBitmapFromResId(R.drawable.aoi218); | |
441 | + setupBackgroundBitmapFromResId(R.drawable.aoi219); | |
442 | + setupBackgroundBitmapFromResId(R.drawable.aoi220); | |
443 | + setupBackgroundBitmapFromResId(R.drawable.aoi221); | |
444 | + setupBackgroundBitmapFromResId(R.drawable.aoi222); | |
445 | + setupBackgroundBitmapFromResId(R.drawable.aoi223); | |
446 | + setupBackgroundBitmapFromResId(R.drawable.aoi224); | |
447 | + setupBackgroundBitmapFromResId(R.drawable.aoi225); | |
448 | + setupBackgroundBitmapFromResId(R.drawable.aoi226); | |
449 | + setupBackgroundBitmapFromResId(R.drawable.aoi227); | |
450 | + setupBackgroundBitmapFromResId(R.drawable.aoi228); | |
451 | + setupBackgroundBitmapFromResId(R.drawable.aoi229); | |
452 | + setupBackgroundBitmapFromResId(R.drawable.aoi230); | |
453 | + setupBackgroundBitmapFromResId(R.drawable.aoi231); | |
454 | + setupBackgroundBitmapFromResId(R.drawable.aoi232); | |
455 | + setupBackgroundBitmapFromResId(R.drawable.aoi233); | |
456 | + setupBackgroundBitmapFromResId(R.drawable.aoi234); | |
457 | + setupBackgroundBitmapFromResId(R.drawable.aoi235); | |
458 | + setupBackgroundBitmapFromResId(R.drawable.aoi236); | |
459 | + setupBackgroundBitmapFromResId(R.drawable.aoi237); | |
460 | + setupBackgroundBitmapFromResId(R.drawable.aoi238); | |
461 | + setupBackgroundBitmapFromResId(R.drawable.aoi239); | |
462 | + setupBackgroundBitmapFromResId(R.drawable.aoi240); | |
463 | + setupBackgroundBitmapFromResId(R.drawable.aoi241); | |
464 | + setupBackgroundBitmapFromResId(R.drawable.aoi242); | |
465 | + setupBackgroundBitmapFromResId(R.drawable.aoi243); | |
466 | + setupBackgroundBitmapFromResId(R.drawable.aoi244); | |
467 | + setupBackgroundBitmapFromResId(R.drawable.aoi245); | |
468 | + setupBackgroundBitmapFromResId(R.drawable.aoi246); | |
469 | + setupBackgroundBitmapFromResId(R.drawable.aoi247); | |
470 | + setupBackgroundBitmapFromResId(R.drawable.aoi248); | |
471 | + setupBackgroundBitmapFromResId(R.drawable.aoi249); | |
472 | + setupBackgroundBitmapFromResId(R.drawable.aoi250); | |
473 | + setupBackgroundBitmapFromResId(R.drawable.aoi251); | |
474 | + setupBackgroundBitmapFromResId(R.drawable.aoi252); | |
475 | + setupBackgroundBitmapFromResId(R.drawable.aoi253); | |
476 | + setupBackgroundBitmapFromResId(R.drawable.aoi254); | |
477 | + setupBackgroundBitmapFromResId(R.drawable.aoi255); | |
478 | + setupBackgroundBitmapFromResId(R.drawable.aoi256); | |
479 | + setupBackgroundBitmapFromResId(R.drawable.aoi257); | |
480 | + setupBackgroundBitmapFromResId(R.drawable.aoi258); | |
481 | + setupBackgroundBitmapFromResId(R.drawable.aoi259); | |
482 | + setupBackgroundBitmapFromResId(R.drawable.aoi260); | |
483 | + setupBackgroundBitmapFromResId(R.drawable.aoi261); | |
484 | + setupBackgroundBitmapFromResId(R.drawable.aoi262); | |
485 | + setupBackgroundBitmapFromResId(R.drawable.aoi263); | |
486 | + setupBackgroundBitmapFromResId(R.drawable.aoi264); | |
487 | + setupBackgroundBitmapFromResId(R.drawable.aoi265); | |
488 | + setupBackgroundBitmapFromResId(R.drawable.aoi266); | |
489 | + setupBackgroundBitmapFromResId(R.drawable.aoi267); | |
490 | + setupBackgroundBitmapFromResId(R.drawable.aoi268); | |
491 | + setupBackgroundBitmapFromResId(R.drawable.aoi269); | |
492 | + setupBackgroundBitmapFromResId(R.drawable.aoi270); | |
493 | + setupBackgroundBitmapFromResId(R.drawable.aoi271); | |
494 | + setupBackgroundBitmapFromResId(R.drawable.aoi272); | |
495 | + setupBackgroundBitmapFromResId(R.drawable.aoi273); | |
496 | + setupBackgroundBitmapFromResId(R.drawable.aoi274); | |
497 | + setupBackgroundBitmapFromResId(R.drawable.aoi275); | |
498 | + setupBackgroundBitmapFromResId(R.drawable.aoi276); | |
499 | + setupBackgroundBitmapFromResId(R.drawable.aoi277); | |
500 | + setupBackgroundBitmapFromResId(R.drawable.aoi278); | |
501 | + setupBackgroundBitmapFromResId(R.drawable.aoi279); | |
502 | + setupBackgroundBitmapFromResId(R.drawable.aoi280); | |
503 | + setupBackgroundBitmapFromResId(R.drawable.aoi281); | |
504 | + setupBackgroundBitmapFromResId(R.drawable.aoi282); | |
505 | + setupBackgroundBitmapFromResId(R.drawable.aoi283); | |
506 | + setupBackgroundBitmapFromResId(R.drawable.aoi284); | |
507 | + setupBackgroundBitmapFromResId(R.drawable.aoi285); | |
508 | + setupBackgroundBitmapFromResId(R.drawable.aoi286); | |
509 | + setupBackgroundBitmapFromResId(R.drawable.aoi287); | |
510 | + setupBackgroundBitmapFromResId(R.drawable.aoi288); | |
511 | + setupBackgroundBitmapFromResId(R.drawable.aoi289); | |
512 | + setupBackgroundBitmapFromResId(R.drawable.aoi290); | |
513 | + setupBackgroundBitmapFromResId(R.drawable.aoi291); | |
514 | + setupBackgroundBitmapFromResId(R.drawable.aoi292); | |
515 | + setupBackgroundBitmapFromResId(R.drawable.aoi293); | |
516 | + setupBackgroundBitmapFromResId(R.drawable.aoi294); | |
517 | + setupBackgroundBitmapFromResId(R.drawable.aoi295); | |
518 | + setupBackgroundBitmapFromResId(R.drawable.aoi296); | |
519 | + setupBackgroundBitmapFromResId(R.drawable.aoi297); | |
520 | + setupBackgroundBitmapFromResId(R.drawable.aoi298); | |
521 | + setupBackgroundBitmapFromResId(R.drawable.aoi299); | |
522 | + setupBackgroundBitmapFromResId(R.drawable.aoi300); | |
523 | + setupBackgroundBitmapFromResId(R.drawable.aoi301); | |
524 | + setupBackgroundBitmapFromResId(R.drawable.aoi302); | |
525 | + setupBackgroundBitmapFromResId(R.drawable.aoi303); | |
526 | + setupBackgroundBitmapFromResId(R.drawable.aoi304); | |
527 | + setupBackgroundBitmapFromResId(R.drawable.aoi305); | |
528 | + setupBackgroundBitmapFromResId(R.drawable.aoi306); | |
529 | + setupBackgroundBitmapFromResId(R.drawable.aoi307); | |
530 | + setupBackgroundBitmapFromResId(R.drawable.aoi308); | |
531 | + setupBackgroundBitmapFromResId(R.drawable.aoi309); | |
532 | + setupBackgroundBitmapFromResId(R.drawable.aoi310); | |
533 | + setupBackgroundBitmapFromResId(R.drawable.aoi311); | |
534 | + setupBackgroundBitmapFromResId(R.drawable.aoi312); | |
535 | + setupBackgroundBitmapFromResId(R.drawable.aoi313); | |
536 | + setupBackgroundBitmapFromResId(R.drawable.aoi314); | |
537 | + setupBackgroundBitmapFromResId(R.drawable.aoi315); | |
538 | + setupBackgroundBitmapFromResId(R.drawable.aoi316); | |
539 | + setupBackgroundBitmapFromResId(R.drawable.aoi317); | |
540 | + setupBackgroundBitmapFromResId(R.drawable.aoi318); | |
541 | + setupBackgroundBitmapFromResId(R.drawable.aoi319); | |
542 | + setupBackgroundBitmapFromResId(R.drawable.aoi320); | |
543 | + setupBackgroundBitmapFromResId(R.drawable.aoi321); | |
544 | + setupBackgroundBitmapFromResId(R.drawable.aoi322); | |
545 | + setupBackgroundBitmapFromResId(R.drawable.aoi323); | |
546 | + setupBackgroundBitmapFromResId(R.drawable.aoi324); | |
547 | + setupBackgroundBitmapFromResId(R.drawable.aoi325); | |
548 | + setupBackgroundBitmapFromResId(R.drawable.aoi326); | |
549 | + setupBackgroundBitmapFromResId(R.drawable.aoi327); | |
550 | + setupBackgroundBitmapFromResId(R.drawable.aoi328); | |
551 | + setupBackgroundBitmapFromResId(R.drawable.aoi329); | |
552 | + setupBackgroundBitmapFromResId(R.drawable.aoi330); | |
553 | + setupBackgroundBitmapFromResId(R.drawable.aoi331); | |
554 | + setupBackgroundBitmapFromResId(R.drawable.aoi332); | |
555 | + setupBackgroundBitmapFromResId(R.drawable.aoi333); | |
556 | + setupBackgroundBitmapFromResId(R.drawable.aoi334); | |
557 | + setupBackgroundBitmapFromResId(R.drawable.aoi335); | |
558 | + setupBackgroundBitmapFromResId(R.drawable.aoi336); | |
375 | 559 | |
376 | 560 | setupBackgroundBitmapFromResId(R.drawable.aohina01); |
377 | 561 | setupBackgroundBitmapFromResId(R.drawable.aohina02); |
@@ -441,7 +625,66 @@ | ||
441 | 625 | setupBackgroundBitmapFromResId(R.drawable.aohina66); |
442 | 626 | setupBackgroundBitmapFromResId(R.drawable.aohina67); |
443 | 627 | setupBackgroundBitmapFromResId(R.drawable.aohina68); |
628 | + setupBackgroundBitmapFromResId(R.drawable.aohina69); | |
629 | + setupBackgroundBitmapFromResId(R.drawable.aohina70); | |
630 | + setupBackgroundBitmapFromResId(R.drawable.aohina71); | |
631 | + setupBackgroundBitmapFromResId(R.drawable.aohina72); | |
632 | + setupBackgroundBitmapFromResId(R.drawable.aohina73); | |
633 | + setupBackgroundBitmapFromResId(R.drawable.aohina74); | |
634 | + setupBackgroundBitmapFromResId(R.drawable.aohina75); | |
635 | + setupBackgroundBitmapFromResId(R.drawable.aohina76); | |
636 | + setupBackgroundBitmapFromResId(R.drawable.aohina77); | |
637 | + setupBackgroundBitmapFromResId(R.drawable.aohina78); | |
638 | + setupBackgroundBitmapFromResId(R.drawable.aohina79); | |
639 | + setupBackgroundBitmapFromResId(R.drawable.aohina80); | |
640 | + setupBackgroundBitmapFromResId(R.drawable.aohina81); | |
641 | + setupBackgroundBitmapFromResId(R.drawable.aohina82); | |
642 | + setupBackgroundBitmapFromResId(R.drawable.aohina83); | |
643 | + setupBackgroundBitmapFromResId(R.drawable.aohina84); | |
644 | + setupBackgroundBitmapFromResId(R.drawable.aohina85); | |
645 | + setupBackgroundBitmapFromResId(R.drawable.aohina86); | |
646 | + setupBackgroundBitmapFromResId(R.drawable.aohina87); | |
647 | + setupBackgroundBitmapFromResId(R.drawable.aohina88); | |
648 | + setupBackgroundBitmapFromResId(R.drawable.aohina89); | |
649 | + setupBackgroundBitmapFromResId(R.drawable.aohina90); | |
650 | + setupBackgroundBitmapFromResId(R.drawable.aohina91); | |
651 | + setupBackgroundBitmapFromResId(R.drawable.aohina92); | |
652 | + setupBackgroundBitmapFromResId(R.drawable.aohina93); | |
653 | + setupBackgroundBitmapFromResId(R.drawable.aohina94); | |
654 | + setupBackgroundBitmapFromResId(R.drawable.aohina95); | |
655 | + setupBackgroundBitmapFromResId(R.drawable.aohina96); | |
656 | + setupBackgroundBitmapFromResId(R.drawable.aohina97); | |
657 | + setupBackgroundBitmapFromResId(R.drawable.aohina98); | |
658 | + setupBackgroundBitmapFromResId(R.drawable.aohina99); | |
659 | + setupBackgroundBitmapFromResId(R.drawable.aohina100); | |
660 | + setupBackgroundBitmapFromResId(R.drawable.aohina101); | |
661 | + setupBackgroundBitmapFromResId(R.drawable.aohina102); | |
662 | + setupBackgroundBitmapFromResId(R.drawable.aohina103); | |
663 | + setupBackgroundBitmapFromResId(R.drawable.aohina104); | |
664 | + setupBackgroundBitmapFromResId(R.drawable.aohina105); | |
665 | + setupBackgroundBitmapFromResId(R.drawable.aohina106); | |
666 | + setupBackgroundBitmapFromResId(R.drawable.aohina107); | |
667 | + setupBackgroundBitmapFromResId(R.drawable.aohina108); | |
668 | + setupBackgroundBitmapFromResId(R.drawable.aohina109); | |
669 | + setupBackgroundBitmapFromResId(R.drawable.aohina110); | |
670 | + setupBackgroundBitmapFromResId(R.drawable.aohina111); | |
671 | + setupBackgroundBitmapFromResId(R.drawable.aohina112); | |
672 | + setupBackgroundBitmapFromResId(R.drawable.aohina113); | |
673 | + setupBackgroundBitmapFromResId(R.drawable.aohina114); | |
674 | + setupBackgroundBitmapFromResId(R.drawable.aohina115); | |
675 | + setupBackgroundBitmapFromResId(R.drawable.aohina116); | |
676 | + setupBackgroundBitmapFromResId(R.drawable.aohina117); | |
677 | + setupBackgroundBitmapFromResId(R.drawable.aohina118); | |
678 | + setupBackgroundBitmapFromResId(R.drawable.aohina119); | |
679 | + setupBackgroundBitmapFromResId(R.drawable.aohina120); | |
680 | + setupBackgroundBitmapFromResId(R.drawable.aohina121); | |
681 | + setupBackgroundBitmapFromResId(R.drawable.aohina122); | |
682 | + setupBackgroundBitmapFromResId(R.drawable.aohina123); | |
683 | + setupBackgroundBitmapFromResId(R.drawable.aohina124); | |
684 | + setupBackgroundBitmapFromResId(R.drawable.aohina125); | |
685 | + setupBackgroundBitmapFromResId(R.drawable.aohina126); | |
444 | 686 | |
687 | + | |
445 | 688 | setupBackgroundBitmapFromResId(R.drawable.yama01); |
446 | 689 | setupBackgroundBitmapFromResId(R.drawable.yama02); |
447 | 690 | setupBackgroundBitmapFromResId(R.drawable.yama03); |
@@ -458,10 +701,108 @@ | ||
458 | 701 | setupBackgroundBitmapFromResId(R.drawable.yama14); |
459 | 702 | setupBackgroundBitmapFromResId(R.drawable.yama15); |
460 | 703 | setupBackgroundBitmapFromResId(R.drawable.yama16); |
704 | + setupBackgroundBitmapFromResId(R.drawable.yama17); | |
705 | + setupBackgroundBitmapFromResId(R.drawable.yama18); | |
706 | + setupBackgroundBitmapFromResId(R.drawable.yama19); | |
707 | + setupBackgroundBitmapFromResId(R.drawable.yama20); | |
708 | + setupBackgroundBitmapFromResId(R.drawable.yama21); | |
709 | + setupBackgroundBitmapFromResId(R.drawable.yama22); | |
710 | + setupBackgroundBitmapFromResId(R.drawable.yama23); | |
711 | + setupBackgroundBitmapFromResId(R.drawable.yama24); | |
712 | + setupBackgroundBitmapFromResId(R.drawable.yama25); | |
713 | + setupBackgroundBitmapFromResId(R.drawable.yama26); | |
714 | + setupBackgroundBitmapFromResId(R.drawable.yama27); | |
715 | + setupBackgroundBitmapFromResId(R.drawable.yama28); | |
716 | + setupBackgroundBitmapFromResId(R.drawable.yama29); | |
717 | + setupBackgroundBitmapFromResId(R.drawable.yama30); | |
718 | + setupBackgroundBitmapFromResId(R.drawable.yama31); | |
719 | + setupBackgroundBitmapFromResId(R.drawable.yama32); | |
720 | + setupBackgroundBitmapFromResId(R.drawable.yama33); | |
721 | + setupBackgroundBitmapFromResId(R.drawable.yama34); | |
722 | + setupBackgroundBitmapFromResId(R.drawable.yama35); | |
723 | + setupBackgroundBitmapFromResId(R.drawable.yama36); | |
724 | + setupBackgroundBitmapFromResId(R.drawable.yama37); | |
725 | + setupBackgroundBitmapFromResId(R.drawable.yama38); | |
726 | + setupBackgroundBitmapFromResId(R.drawable.yama39); | |
727 | + setupBackgroundBitmapFromResId(R.drawable.yama40); | |
728 | + setupBackgroundBitmapFromResId(R.drawable.yama41); | |
729 | + setupBackgroundBitmapFromResId(R.drawable.yama42); | |
730 | + setupBackgroundBitmapFromResId(R.drawable.yama43); | |
731 | + setupBackgroundBitmapFromResId(R.drawable.yama44); | |
732 | + setupBackgroundBitmapFromResId(R.drawable.yama45); | |
733 | + setupBackgroundBitmapFromResId(R.drawable.yama46); | |
734 | + setupBackgroundBitmapFromResId(R.drawable.yama47); | |
735 | + setupBackgroundBitmapFromResId(R.drawable.yama48); | |
736 | + setupBackgroundBitmapFromResId(R.drawable.yama49); | |
737 | + setupBackgroundBitmapFromResId(R.drawable.yama50); | |
738 | + setupBackgroundBitmapFromResId(R.drawable.yama51); | |
739 | + setupBackgroundBitmapFromResId(R.drawable.yama52); | |
740 | + setupBackgroundBitmapFromResId(R.drawable.yama53); | |
741 | + setupBackgroundBitmapFromResId(R.drawable.yama54); | |
742 | + setupBackgroundBitmapFromResId(R.drawable.yama55); | |
743 | + setupBackgroundBitmapFromResId(R.drawable.yama56); | |
744 | + setupBackgroundBitmapFromResId(R.drawable.yama57); | |
745 | + setupBackgroundBitmapFromResId(R.drawable.yama58); | |
746 | + setupBackgroundBitmapFromResId(R.drawable.yama59); | |
747 | + setupBackgroundBitmapFromResId(R.drawable.yama60); | |
748 | + setupBackgroundBitmapFromResId(R.drawable.yama61); | |
749 | + setupBackgroundBitmapFromResId(R.drawable.yama62); | |
750 | + setupBackgroundBitmapFromResId(R.drawable.yama63); | |
751 | + setupBackgroundBitmapFromResId(R.drawable.yama64); | |
752 | + setupBackgroundBitmapFromResId(R.drawable.yama65); | |
753 | + setupBackgroundBitmapFromResId(R.drawable.yama66); | |
754 | + setupBackgroundBitmapFromResId(R.drawable.yama67); | |
755 | + setupBackgroundBitmapFromResId(R.drawable.yama68); | |
756 | + setupBackgroundBitmapFromResId(R.drawable.yama69); | |
757 | + setupBackgroundBitmapFromResId(R.drawable.yama70); | |
758 | + setupBackgroundBitmapFromResId(R.drawable.yama71); | |
759 | + setupBackgroundBitmapFromResId(R.drawable.yama72); | |
760 | + setupBackgroundBitmapFromResId(R.drawable.yama73); | |
461 | 761 | |
762 | + setupBackgroundBitmapFromResId(R.drawable.yuuka01); | |
763 | + setupBackgroundBitmapFromResId(R.drawable.yuuka02); | |
764 | + setupBackgroundBitmapFromResId(R.drawable.yuuka03); | |
765 | + setupBackgroundBitmapFromResId(R.drawable.yuuka04); | |
766 | + setupBackgroundBitmapFromResId(R.drawable.yuuka05); | |
767 | + setupBackgroundBitmapFromResId(R.drawable.yuuka06); | |
768 | + setupBackgroundBitmapFromResId(R.drawable.yuuka07); | |
769 | + setupBackgroundBitmapFromResId(R.drawable.yuuka08); | |
770 | + setupBackgroundBitmapFromResId(R.drawable.yuuka09); | |
771 | + | |
462 | 772 | setupBackgroundBitmapFromResId(R.drawable.aohono01); |
463 | 773 | setupBackgroundBitmapFromResId(R.drawable.aohono02); |
774 | + setupBackgroundBitmapFromResId(R.drawable.aohono03); | |
775 | + setupBackgroundBitmapFromResId(R.drawable.aohono04); | |
776 | + setupBackgroundBitmapFromResId(R.drawable.aohono05); | |
777 | + setupBackgroundBitmapFromResId(R.drawable.aohono06); | |
778 | + setupBackgroundBitmapFromResId(R.drawable.aohono07); | |
779 | + setupBackgroundBitmapFromResId(R.drawable.aohono08); | |
464 | 780 | |
781 | + setupBackgroundBitmapFromResId(R.drawable.honoka01); | |
782 | + setupBackgroundBitmapFromResId(R.drawable.honoka02); | |
783 | + setupBackgroundBitmapFromResId(R.drawable.honoka03); | |
784 | + setupBackgroundBitmapFromResId(R.drawable.honoka04); | |
785 | + setupBackgroundBitmapFromResId(R.drawable.honoka05); | |
786 | + setupBackgroundBitmapFromResId(R.drawable.honoka06); | |
787 | + setupBackgroundBitmapFromResId(R.drawable.honoka07); | |
788 | + setupBackgroundBitmapFromResId(R.drawable.honoka08); | |
789 | + setupBackgroundBitmapFromResId(R.drawable.honoka09); | |
790 | + setupBackgroundBitmapFromResId(R.drawable.honoka10); | |
791 | + setupBackgroundBitmapFromResId(R.drawable.honoka11); | |
792 | + setupBackgroundBitmapFromResId(R.drawable.honoka12); | |
793 | + setupBackgroundBitmapFromResId(R.drawable.honoka13); | |
794 | + setupBackgroundBitmapFromResId(R.drawable.honoka14); | |
795 | + setupBackgroundBitmapFromResId(R.drawable.honoka15); | |
796 | + setupBackgroundBitmapFromResId(R.drawable.honoka16); | |
797 | + setupBackgroundBitmapFromResId(R.drawable.honoka17); | |
798 | + setupBackgroundBitmapFromResId(R.drawable.honoka18); | |
799 | + setupBackgroundBitmapFromResId(R.drawable.honoka19); | |
800 | + setupBackgroundBitmapFromResId(R.drawable.honoka20); | |
801 | + setupBackgroundBitmapFromResId(R.drawable.honoka21); | |
802 | + setupBackgroundBitmapFromResId(R.drawable.honoka22); | |
803 | + setupBackgroundBitmapFromResId(R.drawable.honoka23); | |
804 | + | |
805 | + | |
465 | 806 | setupBackgroundBitmapFromResId(R.drawable.kaede01); |
466 | 807 | setupBackgroundBitmapFromResId(R.drawable.kaede02); |
467 | 808 | setupBackgroundBitmapFromResId(R.drawable.kaede03); |
@@ -477,29 +818,135 @@ | ||
477 | 818 | setupBackgroundBitmapFromResId(R.drawable.kaede13); |
478 | 819 | setupBackgroundBitmapFromResId(R.drawable.kaede14); |
479 | 820 | setupBackgroundBitmapFromResId(R.drawable.kaede15); |
821 | + setupBackgroundBitmapFromResId(R.drawable.kaede16); | |
822 | + setupBackgroundBitmapFromResId(R.drawable.kaede17); | |
823 | + setupBackgroundBitmapFromResId(R.drawable.kaede18); | |
824 | + setupBackgroundBitmapFromResId(R.drawable.kaede19); | |
825 | + setupBackgroundBitmapFromResId(R.drawable.kaede20); | |
826 | + setupBackgroundBitmapFromResId(R.drawable.kaede21); | |
827 | + setupBackgroundBitmapFromResId(R.drawable.kaede22); | |
828 | + setupBackgroundBitmapFromResId(R.drawable.kaede23); | |
829 | + setupBackgroundBitmapFromResId(R.drawable.kaede24); | |
830 | + setupBackgroundBitmapFromResId(R.drawable.kaede25); | |
831 | + setupBackgroundBitmapFromResId(R.drawable.kaede26); | |
832 | + setupBackgroundBitmapFromResId(R.drawable.kaede27); | |
833 | + setupBackgroundBitmapFromResId(R.drawable.kaede28); | |
834 | + setupBackgroundBitmapFromResId(R.drawable.kaede29); | |
835 | + setupBackgroundBitmapFromResId(R.drawable.kaede30); | |
836 | + setupBackgroundBitmapFromResId(R.drawable.kaede31); | |
837 | + setupBackgroundBitmapFromResId(R.drawable.kaede32); | |
838 | + setupBackgroundBitmapFromResId(R.drawable.kaede33); | |
839 | + setupBackgroundBitmapFromResId(R.drawable.kaede34); | |
840 | + setupBackgroundBitmapFromResId(R.drawable.kaede35); | |
841 | + setupBackgroundBitmapFromResId(R.drawable.kaede36); | |
842 | + setupBackgroundBitmapFromResId(R.drawable.kaede37); | |
843 | + setupBackgroundBitmapFromResId(R.drawable.kaede38); | |
844 | + setupBackgroundBitmapFromResId(R.drawable.kaede39); | |
845 | + setupBackgroundBitmapFromResId(R.drawable.kaede40); | |
846 | + setupBackgroundBitmapFromResId(R.drawable.kaede41); | |
847 | + setupBackgroundBitmapFromResId(R.drawable.kaede42); | |
848 | + setupBackgroundBitmapFromResId(R.drawable.kaede43); | |
849 | + setupBackgroundBitmapFromResId(R.drawable.kaede44); | |
850 | + setupBackgroundBitmapFromResId(R.drawable.kaede45); | |
851 | + setupBackgroundBitmapFromResId(R.drawable.kaede46); | |
852 | + setupBackgroundBitmapFromResId(R.drawable.kaede47); | |
853 | + setupBackgroundBitmapFromResId(R.drawable.kaede48); | |
854 | + setupBackgroundBitmapFromResId(R.drawable.kaede49); | |
855 | + setupBackgroundBitmapFromResId(R.drawable.kaede50); | |
856 | + setupBackgroundBitmapFromResId(R.drawable.kaede51); | |
857 | + setupBackgroundBitmapFromResId(R.drawable.kaede52); | |
858 | + setupBackgroundBitmapFromResId(R.drawable.kaede53); | |
859 | + setupBackgroundBitmapFromResId(R.drawable.kaede54); | |
860 | + setupBackgroundBitmapFromResId(R.drawable.kaede55); | |
861 | + setupBackgroundBitmapFromResId(R.drawable.kaede56); | |
862 | + setupBackgroundBitmapFromResId(R.drawable.kaede57); | |
863 | + setupBackgroundBitmapFromResId(R.drawable.kaede58); | |
864 | + setupBackgroundBitmapFromResId(R.drawable.kaede59); | |
865 | + setupBackgroundBitmapFromResId(R.drawable.kaede60); | |
866 | + setupBackgroundBitmapFromResId(R.drawable.kaede61); | |
867 | + setupBackgroundBitmapFromResId(R.drawable.kaede62); | |
868 | + setupBackgroundBitmapFromResId(R.drawable.kaede63); | |
480 | 869 | |
481 | 870 | setupBackgroundBitmapFromResId(R.drawable.kaehina01); |
482 | 871 | setupBackgroundBitmapFromResId(R.drawable.kaehina02); |
483 | 872 | setupBackgroundBitmapFromResId(R.drawable.kaehina03); |
873 | + setupBackgroundBitmapFromResId(R.drawable.kaehina04); | |
874 | + setupBackgroundBitmapFromResId(R.drawable.kaehina05); | |
875 | + setupBackgroundBitmapFromResId(R.drawable.kaehina06); | |
876 | + setupBackgroundBitmapFromResId(R.drawable.kaehina07); | |
877 | + setupBackgroundBitmapFromResId(R.drawable.kaehina08); | |
878 | + setupBackgroundBitmapFromResId(R.drawable.kaehina09); | |
484 | 879 | |
880 | + setupBackgroundBitmapFromResId(R.drawable.kaeyuu01); | |
881 | + setupBackgroundBitmapFromResId(R.drawable.kaeyuu02); | |
882 | + setupBackgroundBitmapFromResId(R.drawable.kaeyuu03); | |
883 | + | |
485 | 884 | setupBackgroundBitmapFromResId(R.drawable.aokae01); |
885 | + setupBackgroundBitmapFromResId(R.drawable.aokae02); | |
886 | + setupBackgroundBitmapFromResId(R.drawable.aokae03); | |
486 | 887 | setupBackgroundBitmapFromResId(R.drawable.kaeao01); |
487 | 888 | setupBackgroundBitmapFromResId(R.drawable.kaeao02); |
488 | 889 | setupBackgroundBitmapFromResId(R.drawable.kaeao03); |
890 | + setupBackgroundBitmapFromResId(R.drawable.kaeao04); | |
891 | + setupBackgroundBitmapFromResId(R.drawable.kaeao05); | |
489 | 892 | |
490 | 893 | setupBackgroundBitmapFromResId(R.drawable.kokoao01); |
491 | 894 | setupBackgroundBitmapFromResId(R.drawable.kokoao02); |
492 | 895 | setupBackgroundBitmapFromResId(R.drawable.kokoao03); |
493 | 896 | setupBackgroundBitmapFromResId(R.drawable.kokoao04); |
897 | + setupBackgroundBitmapFromResId(R.drawable.kokoao05); | |
898 | + setupBackgroundBitmapFromResId(R.drawable.kokoao06); | |
899 | + setupBackgroundBitmapFromResId(R.drawable.kokoao07); | |
900 | + setupBackgroundBitmapFromResId(R.drawable.kokoao08); | |
901 | + setupBackgroundBitmapFromResId(R.drawable.kokoao09); | |
902 | + setupBackgroundBitmapFromResId(R.drawable.kokoao10); | |
903 | + setupBackgroundBitmapFromResId(R.drawable.kokoao11); | |
904 | + setupBackgroundBitmapFromResId(R.drawable.kokoao12); | |
905 | + setupBackgroundBitmapFromResId(R.drawable.kokoao13); | |
906 | + setupBackgroundBitmapFromResId(R.drawable.kokoao14); | |
907 | + setupBackgroundBitmapFromResId(R.drawable.kokoao15); | |
908 | + setupBackgroundBitmapFromResId(R.drawable.kokoao16); | |
909 | + setupBackgroundBitmapFromResId(R.drawable.kokoao17); | |
910 | + setupBackgroundBitmapFromResId(R.drawable.kokoao18); | |
911 | + setupBackgroundBitmapFromResId(R.drawable.kokoao19); | |
912 | + setupBackgroundBitmapFromResId(R.drawable.kokoao20); | |
913 | + setupBackgroundBitmapFromResId(R.drawable.kokoao21); | |
914 | + setupBackgroundBitmapFromResId(R.drawable.kokoao22); | |
915 | + setupBackgroundBitmapFromResId(R.drawable.kokoao23); | |
916 | + setupBackgroundBitmapFromResId(R.drawable.kokoao24); | |
917 | + setupBackgroundBitmapFromResId(R.drawable.kokoao25); | |
918 | + setupBackgroundBitmapFromResId(R.drawable.kokoao26); | |
494 | 919 | |
495 | 920 | setupBackgroundBitmapFromResId(R.drawable.kokohina01); |
496 | 921 | setupBackgroundBitmapFromResId(R.drawable.kokohina02); |
922 | + setupBackgroundBitmapFromResId(R.drawable.kokohina03); | |
923 | + setupBackgroundBitmapFromResId(R.drawable.kokohina04); | |
924 | + setupBackgroundBitmapFromResId(R.drawable.kokohina05); | |
925 | + setupBackgroundBitmapFromResId(R.drawable.kokohina06); | |
926 | + setupBackgroundBitmapFromResId(R.drawable.kokohina07); | |
927 | + setupBackgroundBitmapFromResId(R.drawable.kokohina08); | |
928 | + setupBackgroundBitmapFromResId(R.drawable.kokohina09); | |
929 | + setupBackgroundBitmapFromResId(R.drawable.kokohina10); | |
930 | + setupBackgroundBitmapFromResId(R.drawable.kokohina11); | |
931 | + setupBackgroundBitmapFromResId(R.drawable.kokohina12); | |
932 | + setupBackgroundBitmapFromResId(R.drawable.kokohina13); | |
933 | + setupBackgroundBitmapFromResId(R.drawable.kokohina14); | |
497 | 934 | |
498 | 935 | setupBackgroundBitmapFromResId(R.drawable.kokokae01); |
499 | 936 | setupBackgroundBitmapFromResId(R.drawable.kokokae02); |
500 | 937 | setupBackgroundBitmapFromResId(R.drawable.kokokae03); |
501 | 938 | setupBackgroundBitmapFromResId(R.drawable.kokokae04); |
939 | + setupBackgroundBitmapFromResId(R.drawable.kokokae05); | |
940 | + setupBackgroundBitmapFromResId(R.drawable.kokokae06); | |
941 | + setupBackgroundBitmapFromResId(R.drawable.kokokae07); | |
942 | + setupBackgroundBitmapFromResId(R.drawable.kokokae08); | |
943 | + setupBackgroundBitmapFromResId(R.drawable.kokokae09); | |
944 | + setupBackgroundBitmapFromResId(R.drawable.kokokae10); | |
945 | + setupBackgroundBitmapFromResId(R.drawable.kokokae11); | |
946 | + setupBackgroundBitmapFromResId(R.drawable.kokokae12); | |
502 | 947 | |
948 | + setupBackgroundBitmapFromResId(R.drawable.hinahono01); | |
949 | + | |
503 | 950 | setupBackgroundBitmapFromResId(R.drawable.hinata01); |
504 | 951 | setupBackgroundBitmapFromResId(R.drawable.hinata02); |
505 | 952 | setupBackgroundBitmapFromResId(R.drawable.hinata03); |
@@ -606,6 +1053,165 @@ | ||
606 | 1053 | setupBackgroundBitmapFromResId(R.drawable.hinata103); |
607 | 1054 | setupBackgroundBitmapFromResId(R.drawable.hinata104); |
608 | 1055 | setupBackgroundBitmapFromResId(R.drawable.hinata105); |
1056 | + setupBackgroundBitmapFromResId(R.drawable.hinata106); | |
1057 | + setupBackgroundBitmapFromResId(R.drawable.hinata107); | |
1058 | + setupBackgroundBitmapFromResId(R.drawable.hinata108); | |
1059 | + setupBackgroundBitmapFromResId(R.drawable.hinata109); | |
1060 | + setupBackgroundBitmapFromResId(R.drawable.hinata110); | |
1061 | + setupBackgroundBitmapFromResId(R.drawable.hinata111); | |
1062 | + setupBackgroundBitmapFromResId(R.drawable.hinata112); | |
1063 | + setupBackgroundBitmapFromResId(R.drawable.hinata113); | |
1064 | + setupBackgroundBitmapFromResId(R.drawable.hinata114); | |
1065 | + setupBackgroundBitmapFromResId(R.drawable.hinata115); | |
1066 | + setupBackgroundBitmapFromResId(R.drawable.hinata116); | |
1067 | + setupBackgroundBitmapFromResId(R.drawable.hinata117); | |
1068 | + setupBackgroundBitmapFromResId(R.drawable.hinata118); | |
1069 | + setupBackgroundBitmapFromResId(R.drawable.hinata119); | |
1070 | + setupBackgroundBitmapFromResId(R.drawable.hinata120); | |
1071 | + setupBackgroundBitmapFromResId(R.drawable.hinata121); | |
1072 | + setupBackgroundBitmapFromResId(R.drawable.hinata122); | |
1073 | + setupBackgroundBitmapFromResId(R.drawable.hinata123); | |
1074 | + setupBackgroundBitmapFromResId(R.drawable.hinata124); | |
1075 | + setupBackgroundBitmapFromResId(R.drawable.hinata125); | |
1076 | + setupBackgroundBitmapFromResId(R.drawable.hinata126); | |
1077 | + setupBackgroundBitmapFromResId(R.drawable.hinata127); | |
1078 | + setupBackgroundBitmapFromResId(R.drawable.hinata128); | |
1079 | + setupBackgroundBitmapFromResId(R.drawable.hinata129); | |
1080 | + setupBackgroundBitmapFromResId(R.drawable.hinata130); | |
1081 | + setupBackgroundBitmapFromResId(R.drawable.hinata131); | |
1082 | + setupBackgroundBitmapFromResId(R.drawable.hinata132); | |
1083 | + setupBackgroundBitmapFromResId(R.drawable.hinata133); | |
1084 | + setupBackgroundBitmapFromResId(R.drawable.hinata134); | |
1085 | + setupBackgroundBitmapFromResId(R.drawable.hinata135); | |
1086 | + setupBackgroundBitmapFromResId(R.drawable.hinata136); | |
1087 | + setupBackgroundBitmapFromResId(R.drawable.hinata137); | |
1088 | + setupBackgroundBitmapFromResId(R.drawable.hinata138); | |
1089 | + setupBackgroundBitmapFromResId(R.drawable.hinata139); | |
1090 | + setupBackgroundBitmapFromResId(R.drawable.hinata140); | |
1091 | + setupBackgroundBitmapFromResId(R.drawable.hinata141); | |
1092 | + setupBackgroundBitmapFromResId(R.drawable.hinata142); | |
1093 | + setupBackgroundBitmapFromResId(R.drawable.hinata143); | |
1094 | + setupBackgroundBitmapFromResId(R.drawable.hinata144); | |
1095 | + setupBackgroundBitmapFromResId(R.drawable.hinata145); | |
1096 | + setupBackgroundBitmapFromResId(R.drawable.hinata146); | |
1097 | + setupBackgroundBitmapFromResId(R.drawable.hinata147); | |
1098 | + setupBackgroundBitmapFromResId(R.drawable.hinata148); | |
1099 | + setupBackgroundBitmapFromResId(R.drawable.hinata149); | |
1100 | + setupBackgroundBitmapFromResId(R.drawable.hinata150); | |
1101 | + setupBackgroundBitmapFromResId(R.drawable.hinata151); | |
1102 | + setupBackgroundBitmapFromResId(R.drawable.hinata152); | |
1103 | + setupBackgroundBitmapFromResId(R.drawable.hinata153); | |
1104 | + setupBackgroundBitmapFromResId(R.drawable.hinata154); | |
1105 | + setupBackgroundBitmapFromResId(R.drawable.hinata155); | |
1106 | + setupBackgroundBitmapFromResId(R.drawable.hinata156); | |
1107 | + setupBackgroundBitmapFromResId(R.drawable.hinata157); | |
1108 | + setupBackgroundBitmapFromResId(R.drawable.hinata158); | |
1109 | + setupBackgroundBitmapFromResId(R.drawable.hinata159); | |
1110 | + setupBackgroundBitmapFromResId(R.drawable.hinata160); | |
1111 | + setupBackgroundBitmapFromResId(R.drawable.hinata161); | |
1112 | + setupBackgroundBitmapFromResId(R.drawable.hinata162); | |
1113 | + setupBackgroundBitmapFromResId(R.drawable.hinata163); | |
1114 | + setupBackgroundBitmapFromResId(R.drawable.hinata164); | |
1115 | + setupBackgroundBitmapFromResId(R.drawable.hinata165); | |
1116 | + setupBackgroundBitmapFromResId(R.drawable.hinata166); | |
1117 | + setupBackgroundBitmapFromResId(R.drawable.hinata167); | |
1118 | + setupBackgroundBitmapFromResId(R.drawable.hinata168); | |
1119 | + setupBackgroundBitmapFromResId(R.drawable.hinata169); | |
1120 | + setupBackgroundBitmapFromResId(R.drawable.hinata170); | |
1121 | + setupBackgroundBitmapFromResId(R.drawable.hinata171); | |
1122 | + setupBackgroundBitmapFromResId(R.drawable.hinata172); | |
1123 | + setupBackgroundBitmapFromResId(R.drawable.hinata173); | |
1124 | + setupBackgroundBitmapFromResId(R.drawable.hinata174); | |
1125 | + setupBackgroundBitmapFromResId(R.drawable.hinata175); | |
1126 | + setupBackgroundBitmapFromResId(R.drawable.hinata176); | |
1127 | + setupBackgroundBitmapFromResId(R.drawable.hinata177); | |
1128 | + setupBackgroundBitmapFromResId(R.drawable.hinata178); | |
1129 | + setupBackgroundBitmapFromResId(R.drawable.hinata179); | |
1130 | + setupBackgroundBitmapFromResId(R.drawable.hinata180); | |
1131 | + setupBackgroundBitmapFromResId(R.drawable.hinata181); | |
1132 | + setupBackgroundBitmapFromResId(R.drawable.hinata182); | |
1133 | + setupBackgroundBitmapFromResId(R.drawable.hinata183); | |
1134 | + setupBackgroundBitmapFromResId(R.drawable.hinata184); | |
1135 | + setupBackgroundBitmapFromResId(R.drawable.hinata185); | |
1136 | + setupBackgroundBitmapFromResId(R.drawable.hinata186); | |
1137 | + setupBackgroundBitmapFromResId(R.drawable.hinata187); | |
1138 | + setupBackgroundBitmapFromResId(R.drawable.hinata188); | |
1139 | + setupBackgroundBitmapFromResId(R.drawable.hinata189); | |
1140 | + setupBackgroundBitmapFromResId(R.drawable.hinata190); | |
1141 | + setupBackgroundBitmapFromResId(R.drawable.hinata191); | |
1142 | + setupBackgroundBitmapFromResId(R.drawable.hinata192); | |
1143 | + setupBackgroundBitmapFromResId(R.drawable.hinata193); | |
1144 | + setupBackgroundBitmapFromResId(R.drawable.hinata194); | |
1145 | + setupBackgroundBitmapFromResId(R.drawable.hinata195); | |
1146 | + setupBackgroundBitmapFromResId(R.drawable.hinata196); | |
1147 | + setupBackgroundBitmapFromResId(R.drawable.hinata197); | |
1148 | + setupBackgroundBitmapFromResId(R.drawable.hinata198); | |
1149 | + setupBackgroundBitmapFromResId(R.drawable.hinata199); | |
1150 | + setupBackgroundBitmapFromResId(R.drawable.hinata200); | |
1151 | + setupBackgroundBitmapFromResId(R.drawable.hinata201); | |
1152 | + setupBackgroundBitmapFromResId(R.drawable.hinata202); | |
1153 | + setupBackgroundBitmapFromResId(R.drawable.hinata203); | |
1154 | + setupBackgroundBitmapFromResId(R.drawable.hinata204); | |
1155 | + setupBackgroundBitmapFromResId(R.drawable.hinata205); | |
1156 | + setupBackgroundBitmapFromResId(R.drawable.hinata206); | |
1157 | + setupBackgroundBitmapFromResId(R.drawable.hinata207); | |
1158 | + setupBackgroundBitmapFromResId(R.drawable.hinata208); | |
1159 | + setupBackgroundBitmapFromResId(R.drawable.hinata209); | |
1160 | + setupBackgroundBitmapFromResId(R.drawable.hinata210); | |
1161 | + setupBackgroundBitmapFromResId(R.drawable.hinata211); | |
1162 | + setupBackgroundBitmapFromResId(R.drawable.hinata212); | |
1163 | + setupBackgroundBitmapFromResId(R.drawable.hinata213); | |
1164 | + setupBackgroundBitmapFromResId(R.drawable.hinata214); | |
1165 | + setupBackgroundBitmapFromResId(R.drawable.hinata215); | |
1166 | + setupBackgroundBitmapFromResId(R.drawable.hinata216); | |
1167 | + setupBackgroundBitmapFromResId(R.drawable.hinata217); | |
1168 | + setupBackgroundBitmapFromResId(R.drawable.hinata218); | |
1169 | + setupBackgroundBitmapFromResId(R.drawable.hinata219); | |
1170 | + setupBackgroundBitmapFromResId(R.drawable.hinata220); | |
1171 | + setupBackgroundBitmapFromResId(R.drawable.hinata221); | |
1172 | + setupBackgroundBitmapFromResId(R.drawable.hinata222); | |
1173 | + setupBackgroundBitmapFromResId(R.drawable.hinata223); | |
1174 | + setupBackgroundBitmapFromResId(R.drawable.hinata224); | |
1175 | + setupBackgroundBitmapFromResId(R.drawable.hinata225); | |
1176 | + setupBackgroundBitmapFromResId(R.drawable.hinata226); | |
1177 | + setupBackgroundBitmapFromResId(R.drawable.hinata227); | |
1178 | + setupBackgroundBitmapFromResId(R.drawable.hinata228); | |
1179 | + setupBackgroundBitmapFromResId(R.drawable.hinata229); | |
1180 | + setupBackgroundBitmapFromResId(R.drawable.hinata230); | |
1181 | + setupBackgroundBitmapFromResId(R.drawable.hinata231); | |
1182 | + setupBackgroundBitmapFromResId(R.drawable.hinata232); | |
1183 | + setupBackgroundBitmapFromResId(R.drawable.hinata233); | |
1184 | + setupBackgroundBitmapFromResId(R.drawable.hinata234); | |
1185 | + setupBackgroundBitmapFromResId(R.drawable.hinata235); | |
1186 | + setupBackgroundBitmapFromResId(R.drawable.hinata236); | |
1187 | + setupBackgroundBitmapFromResId(R.drawable.hinata237); | |
1188 | + setupBackgroundBitmapFromResId(R.drawable.hinata238); | |
1189 | + setupBackgroundBitmapFromResId(R.drawable.hinata238); | |
1190 | + setupBackgroundBitmapFromResId(R.drawable.hinata239); | |
1191 | + setupBackgroundBitmapFromResId(R.drawable.hinata240); | |
1192 | + setupBackgroundBitmapFromResId(R.drawable.hinata241); | |
1193 | + setupBackgroundBitmapFromResId(R.drawable.hinata242); | |
1194 | + setupBackgroundBitmapFromResId(R.drawable.hinata243); | |
1195 | + setupBackgroundBitmapFromResId(R.drawable.hinata244); | |
1196 | + setupBackgroundBitmapFromResId(R.drawable.hinata245); | |
1197 | + setupBackgroundBitmapFromResId(R.drawable.hinata246); | |
1198 | + setupBackgroundBitmapFromResId(R.drawable.hinata247); | |
1199 | + setupBackgroundBitmapFromResId(R.drawable.hinata248); | |
1200 | + setupBackgroundBitmapFromResId(R.drawable.hinata249); | |
1201 | + setupBackgroundBitmapFromResId(R.drawable.hinata250); | |
1202 | + setupBackgroundBitmapFromResId(R.drawable.hinata251); | |
1203 | + setupBackgroundBitmapFromResId(R.drawable.hinata252); | |
1204 | + setupBackgroundBitmapFromResId(R.drawable.hinata253); | |
1205 | + setupBackgroundBitmapFromResId(R.drawable.hinata254); | |
1206 | + setupBackgroundBitmapFromResId(R.drawable.hinata255); | |
1207 | + setupBackgroundBitmapFromResId(R.drawable.hinata256); | |
1208 | + setupBackgroundBitmapFromResId(R.drawable.hinata257); | |
1209 | + setupBackgroundBitmapFromResId(R.drawable.hinata258); | |
1210 | + setupBackgroundBitmapFromResId(R.drawable.hinata259); | |
1211 | + setupBackgroundBitmapFromResId(R.drawable.hinata260); | |
1212 | + setupBackgroundBitmapFromResId(R.drawable.hinata261); | |
1213 | + setupBackgroundBitmapFromResId(R.drawable.hinata262); | |
1214 | + setupBackgroundBitmapFromResId(R.drawable.hinata263); | |
609 | 1215 | |
610 | 1216 | setupBackgroundBitmapFromResId(R.drawable.lets1); |
611 | 1217 | setupBackgroundBitmapFromResId(R.drawable.lets2); |
@@ -624,7 +1230,70 @@ | ||
624 | 1230 | setupBackgroundBitmapFromResId(R.drawable.kokona12); |
625 | 1231 | setupBackgroundBitmapFromResId(R.drawable.kokona13); |
626 | 1232 | setupBackgroundBitmapFromResId(R.drawable.kokona14); |
1233 | + setupBackgroundBitmapFromResId(R.drawable.kokona15); | |
1234 | + setupBackgroundBitmapFromResId(R.drawable.kokona16); | |
1235 | + setupBackgroundBitmapFromResId(R.drawable.kokona17); | |
1236 | + setupBackgroundBitmapFromResId(R.drawable.kokona18); | |
1237 | + setupBackgroundBitmapFromResId(R.drawable.kokona19); | |
1238 | + setupBackgroundBitmapFromResId(R.drawable.kokona20); | |
1239 | + setupBackgroundBitmapFromResId(R.drawable.kokona21); | |
1240 | + setupBackgroundBitmapFromResId(R.drawable.kokona22); | |
1241 | + setupBackgroundBitmapFromResId(R.drawable.kokona23); | |
1242 | + setupBackgroundBitmapFromResId(R.drawable.kokona24); | |
1243 | + setupBackgroundBitmapFromResId(R.drawable.kokona25); | |
1244 | + setupBackgroundBitmapFromResId(R.drawable.kokona26); | |
1245 | + setupBackgroundBitmapFromResId(R.drawable.kokona27); | |
1246 | + setupBackgroundBitmapFromResId(R.drawable.kokona28); | |
1247 | + setupBackgroundBitmapFromResId(R.drawable.kokona29); | |
1248 | + setupBackgroundBitmapFromResId(R.drawable.kokona30); | |
1249 | + setupBackgroundBitmapFromResId(R.drawable.kokona31); | |
1250 | + setupBackgroundBitmapFromResId(R.drawable.kokona32); | |
1251 | + setupBackgroundBitmapFromResId(R.drawable.kokona33); | |
1252 | + setupBackgroundBitmapFromResId(R.drawable.kokona34); | |
1253 | + setupBackgroundBitmapFromResId(R.drawable.kokona35); | |
1254 | + setupBackgroundBitmapFromResId(R.drawable.kokona36); | |
1255 | + setupBackgroundBitmapFromResId(R.drawable.kokona37); | |
1256 | + setupBackgroundBitmapFromResId(R.drawable.kokona38); | |
1257 | + setupBackgroundBitmapFromResId(R.drawable.kokona39); | |
1258 | + setupBackgroundBitmapFromResId(R.drawable.kokona40); | |
1259 | + setupBackgroundBitmapFromResId(R.drawable.kokona41); | |
1260 | + setupBackgroundBitmapFromResId(R.drawable.kokona42); | |
1261 | + setupBackgroundBitmapFromResId(R.drawable.kokona43); | |
1262 | + setupBackgroundBitmapFromResId(R.drawable.kokona44); | |
1263 | + setupBackgroundBitmapFromResId(R.drawable.kokona45); | |
1264 | + setupBackgroundBitmapFromResId(R.drawable.kokona46); | |
1265 | + setupBackgroundBitmapFromResId(R.drawable.kokona47); | |
1266 | + setupBackgroundBitmapFromResId(R.drawable.kokona48); | |
1267 | + setupBackgroundBitmapFromResId(R.drawable.kokona49); | |
1268 | + setupBackgroundBitmapFromResId(R.drawable.kokona50); | |
1269 | + setupBackgroundBitmapFromResId(R.drawable.kokona51); | |
1270 | + setupBackgroundBitmapFromResId(R.drawable.kokona52); | |
1271 | + setupBackgroundBitmapFromResId(R.drawable.kokona53); | |
1272 | + setupBackgroundBitmapFromResId(R.drawable.kokona54); | |
1273 | + setupBackgroundBitmapFromResId(R.drawable.kokona55); | |
1274 | + setupBackgroundBitmapFromResId(R.drawable.kokona56); | |
1275 | + setupBackgroundBitmapFromResId(R.drawable.kokona57); | |
1276 | + setupBackgroundBitmapFromResId(R.drawable.kokona58); | |
1277 | + setupBackgroundBitmapFromResId(R.drawable.kokona59); | |
1278 | + setupBackgroundBitmapFromResId(R.drawable.kokona60); | |
1279 | + setupBackgroundBitmapFromResId(R.drawable.kokona61); | |
1280 | + setupBackgroundBitmapFromResId(R.drawable.kokona62); | |
1281 | + setupBackgroundBitmapFromResId(R.drawable.kokona63); | |
1282 | + setupBackgroundBitmapFromResId(R.drawable.kokona64); | |
1283 | + setupBackgroundBitmapFromResId(R.drawable.kokona65); | |
1284 | + setupBackgroundBitmapFromResId(R.drawable.kokona66); | |
1285 | + setupBackgroundBitmapFromResId(R.drawable.kokona67); | |
1286 | + setupBackgroundBitmapFromResId(R.drawable.kokona68); | |
1287 | + setupBackgroundBitmapFromResId(R.drawable.kokona69); | |
1288 | + setupBackgroundBitmapFromResId(R.drawable.kokona70); | |
1289 | + setupBackgroundBitmapFromResId(R.drawable.kokona71); | |
1290 | + setupBackgroundBitmapFromResId(R.drawable.kokona72); | |
1291 | + setupBackgroundBitmapFromResId(R.drawable.kokona73); | |
1292 | + setupBackgroundBitmapFromResId(R.drawable.kokona74); | |
1293 | + setupBackgroundBitmapFromResId(R.drawable.kokona75); | |
627 | 1294 | |
1295 | + setupBackgroundBitmapFromResId(R.drawable.kuma); | |
1296 | + | |
628 | 1297 | System.gc(); |
629 | 1298 | **/ |
630 | 1299 | } |
@@ -725,7 +1394,7 @@ | ||
725 | 1394 | */ |
726 | 1395 | private int decideBackgroundBitmap() |
727 | 1396 | { |
728 | - if (isRandom == false) | |
1397 | + if (!isRandom) | |
729 | 1398 | { |
730 | 1399 | // 画像を順番に表示する |
731 | 1400 | currentBackgroundBitmap++; |
@@ -743,21 +1412,16 @@ | ||
743 | 1412 | /** |
744 | 1413 | * returns background bitmap (scaled) |
745 | 1414 | * |
746 | - * @param width | |
747 | - * @param height | |
748 | - * @return scaled bitmap | |
749 | 1415 | */ |
750 | - public Bitmap getBackgroundScaledBitmap(int width, int height) | |
1416 | + Bitmap getBackgroundScaledBitmap(int width, int height) | |
751 | 1417 | { |
752 | - | |
753 | - /** ヒープメモリ消費削減のため、Bitmapは毎回取得する (これでも描画が間に合うようだ...) **/ | |
754 | - | |
1418 | + // ヒープメモリ消費削減のため、Bitmapは毎回取得する (これでも描画が間に合うようだ...) | |
755 | 1419 | // 表示するビットマップデータを特定する |
756 | 1420 | int backgroundBitmapIndex = decideBackgroundBitmap(); |
757 | - Bitmap bitmapToShow = null; | |
1421 | + Bitmap bitmapToShow; | |
758 | 1422 | try |
759 | 1423 | { |
760 | - if (doUseExternalFiles == true) | |
1424 | + if (doUseExternalFiles) | |
761 | 1425 | { |
762 | 1426 | // 外部ファイルからビットマップデータを読み出す |
763 | 1427 | String fileName = mBackgroundBitmapFileNames.get(backgroundBitmapIndex); |
@@ -802,11 +1466,11 @@ | ||
802 | 1466 | { |
803 | 1467 | Resources resources = context.getResources(); |
804 | 1468 | |
805 | - /* create graphic styles */ | |
1469 | + // create graphic styles | |
806 | 1470 | mTimePaint = createTextPaint(Color.parseColor("white"), BOLD_TYPEFACE); |
807 | 1471 | mBackPaint = createTextPaint(Color.argb(80, 0, 0, 0), NORMAL_TYPEFACE); |
808 | 1472 | |
809 | - /** default watch face is square **/ | |
1473 | + // default watch face is square | |
810 | 1474 | mIsRoundShape = false; |
811 | 1475 | mTextSize = resources.getDimension(R.dimen.text_size); |
812 | 1476 | mYOffset = resources.getDimension(R.dimen.x_offset); |
@@ -814,9 +1478,6 @@ | ||
814 | 1478 | |
815 | 1479 | /** |
816 | 1480 | * 文字表示用のPaintクラス作成メソッド |
817 | - * @param defaultInteractiveColor | |
818 | - * @param typeface | |
819 | - * @return | |
820 | 1481 | */ |
821 | 1482 | private Paint createTextPaint(int defaultInteractiveColor, Typeface typeface) |
822 | 1483 | { |
@@ -3,17 +3,13 @@ | ||
3 | 3 | import android.graphics.Bitmap; |
4 | 4 | import android.graphics.BitmapFactory; |
5 | 5 | import android.util.Log; |
6 | -import android.widget.Toast; | |
7 | 6 | |
8 | 7 | import com.google.android.gms.common.ConnectionResult; |
9 | 8 | import com.google.android.gms.common.api.GoogleApiClient; |
10 | -import com.google.android.gms.common.api.ResultCallback; | |
11 | 9 | import com.google.android.gms.wearable.Asset; |
12 | -import com.google.android.gms.wearable.DataApi; | |
13 | 10 | import com.google.android.gms.wearable.DataEvent; |
14 | 11 | import com.google.android.gms.wearable.DataEventBuffer; |
15 | 12 | import com.google.android.gms.wearable.DataItem; |
16 | -import com.google.android.gms.wearable.PutDataMapRequest; | |
17 | 13 | import com.google.android.gms.wearable.DataMap; |
18 | 14 | import com.google.android.gms.wearable.DataMapItem; |
19 | 15 | import com.google.android.gms.wearable.Wearable; |
@@ -22,9 +18,10 @@ | ||
22 | 18 | import java.util.concurrent.TimeUnit; |
23 | 19 | |
24 | 20 | /** |
25 | - * Created by MRSa on 2014/12/29. | |
21 | + * | |
22 | + * | |
26 | 23 | */ |
27 | -public class MyWatchFaceReceiver | |
24 | +class MyWatchFaceReceiver | |
28 | 25 | { |
29 | 26 | private static final String TAG = "MyWatchFaceReceiver"; |
30 | 27 |
@@ -31,24 +28,24 @@ | ||
31 | 28 | /** |
32 | 29 | * The path for the {@link DataItem} containing {@link MyWatchFaceService} configuration. |
33 | 30 | */ |
34 | - public static final String PATH_WITH_FEATURE = "/gokigen/prpr/feature"; | |
35 | - public static final String PATH_WITH_IMAGE = "/gokigen/prpr/image"; | |
36 | - public static final String KEY_COMMAND_FILE_CLEAR = "CMD_FILE_CLEAR"; | |
37 | - public static final String KEY_COMMAND_CLEAR_RESULT = "CMD_CLEAR_RESULT"; | |
38 | - public static final int COMMAND_VALUE_ALL = -1; | |
31 | + static final String PATH_WITH_FEATURE = "/gokigen/prpr/feature"; | |
32 | + private static final String PATH_WITH_IMAGE = "/gokigen/prpr/image"; | |
33 | + private static final String KEY_COMMAND_FILE_CLEAR = "CMD_FILE_CLEAR"; | |
34 | + private static final String KEY_COMMAND_CLEAR_RESULT = "CMD_CLEAR_RESULT"; | |
35 | + private static final int COMMAND_VALUE_ALL = -1; | |
39 | 36 | |
40 | 37 | private static final long TIMEOUT_SEC = 30; |
41 | 38 | |
42 | 39 | private GoogleApiClient mGoogleApiClient = null; |
43 | - private ExternalStorageFileUtility fileUtility = null; | |
40 | + private ExtStorageFileUtil fileUtility = null; | |
44 | 41 | |
45 | - public MyWatchFaceReceiver(GoogleApiClient client) | |
42 | + MyWatchFaceReceiver(GoogleApiClient client) | |
46 | 43 | { |
47 | 44 | mGoogleApiClient = client; |
48 | - fileUtility = new ExternalStorageFileUtility("/prpr"); | |
45 | + fileUtility = new ExtStorageFileUtil("/prpr"); | |
49 | 46 | } |
50 | 47 | |
51 | - public void onDataChanged(DataEventBuffer dataEvents) | |
48 | + void onDataChanged(DataEventBuffer dataEvents) | |
52 | 49 | { |
53 | 50 | if (Log.isLoggable(TAG, Log.DEBUG)) |
54 | 51 | { |
@@ -66,11 +63,11 @@ | ||
66 | 63 | DataItem dataItem = dataEvent.getDataItem(); |
67 | 64 | if (dataItem.getUri().getPath().equals(PATH_WITH_IMAGE)) |
68 | 65 | { |
69 | - /** 画像を受信した **/ | |
66 | + // 画像を受信した | |
70 | 67 | DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem); |
71 | 68 | Asset profileAsset = dataMapItem.getDataMap().getAsset("prprImage"); |
72 | 69 | Bitmap bitmap = loadBitmapFromAsset(profileAsset); |
73 | - String fileName = outputBitmap(bitmap, true); | |
70 | + String fileName = outputBitmap(bitmap); | |
74 | 71 | if (Log.isLoggable(TAG, Log.INFO)) |
75 | 72 | { |
76 | 73 | Log.i(TAG, "RECEIVED IMAGE : " + fileName); |
@@ -79,7 +76,7 @@ | ||
79 | 76 | } |
80 | 77 | if (!dataItem.getUri().getPath().equals(PATH_WITH_FEATURE)) |
81 | 78 | { |
82 | - /** データアイテム(URI)がCONFIGデータと違う **/ | |
79 | + // データアイテム(URI)がCONFIGデータと違う | |
83 | 80 | if (Log.isLoggable(TAG, Log.INFO)) |
84 | 81 | { |
85 | 82 | Log.i(TAG, "RECEIVED UNKNOWN: " + dataItem.getUri().getPath()); |
@@ -87,13 +84,13 @@ | ||
87 | 84 | continue; |
88 | 85 | } |
89 | 86 | |
90 | - /** ここ以降は呼ばれないぽい(onMessageReceived() で処理される) **/ | |
87 | + // ここ以降は呼ばれないぽい(onMessageReceived() で処理される) | |
91 | 88 | if (Log.isLoggable(TAG, Log.INFO)) |
92 | 89 | { |
93 | 90 | Log.i(TAG, "RECEIVED COMMAND"); |
94 | 91 | } |
95 | 92 | |
96 | - /** CONFIGデータを受信した **/ | |
93 | + // CONFIGデータを受信した | |
97 | 94 | DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem); |
98 | 95 | DataMap config = dataMapItem.getDataMap(); |
99 | 96 | if (Log.isLoggable(TAG, Log.DEBUG)) |
@@ -100,7 +97,7 @@ | ||
100 | 97 | { |
101 | 98 | Log.d(TAG, "Config DataItem updated:" + config); |
102 | 99 | } |
103 | - /** configデータ受信処理 **/ | |
100 | + // configデータ受信処理 | |
104 | 101 | parseDataMap(config); |
105 | 102 | } |
106 | 103 | } |
@@ -111,9 +108,9 @@ | ||
111 | 108 | Log.i(TAG, "MyWatchFaceReceiver::onDataChanged()(Ex.): " + ex.getMessage()); |
112 | 109 | } |
113 | 110 | } |
114 | - finally | |
111 | + //finally | |
115 | 112 | { |
116 | - dataEvents.close(); | |
113 | + //dataEvents.close(); | |
117 | 114 | } |
118 | 115 | if (Log.isLoggable(TAG, Log.DEBUG)) |
119 | 116 | { |
@@ -124,8 +121,6 @@ | ||
124 | 121 | /** |
125 | 122 | * ビットマップの読み出し |
126 | 123 | * |
127 | - * @param asset | |
128 | - * @return | |
129 | 124 | */ |
130 | 125 | private Bitmap loadBitmapFromAsset(Asset asset) |
131 | 126 | { |
@@ -162,7 +157,7 @@ | ||
162 | 157 | return (BitmapFactory.decodeStream(assetInputStream)); |
163 | 158 | } |
164 | 159 | |
165 | - public void parseDataMap(DataMap config) | |
160 | + void parseDataMap(DataMap config) | |
166 | 161 | { |
167 | 162 | if (Log.isLoggable(TAG, Log.DEBUG)) |
168 | 163 | { |
@@ -215,7 +210,7 @@ | ||
215 | 210 | { |
216 | 211 | String file = fileName.getName(); |
217 | 212 | boolean isDelete = fileName.delete(); |
218 | - if (isDelete == true) | |
213 | + if (isDelete) | |
219 | 214 | { |
220 | 215 | nofDeleteFiles++; |
221 | 216 | if (Log.isLoggable(TAG, Log.INFO)) |
@@ -230,9 +225,8 @@ | ||
230 | 225 | * ビットマップをファイルに出力する、ファイル名は現在時刻から自動生成 |
231 | 226 | * |
232 | 227 | * @param bitmap ファイル出力するビットマップ |
233 | - * @param isEntry 表示用に情報登録するかどうか | |
234 | 228 | */ |
235 | - private String outputBitmap(Bitmap bitmap, boolean isEntry) | |
229 | + private String outputBitmap(Bitmap bitmap) | |
236 | 230 | { |
237 | 231 | String fileName = ""; |
238 | 232 | if (bitmap == null) |
@@ -243,19 +237,13 @@ | ||
243 | 237 | } |
244 | 238 | return (fileName); |
245 | 239 | } |
246 | - fileName = fileUtility.putPngImageFromBitmap(null, "/all", bitmap); | |
240 | + //ContentResolver resolver = null; | |
241 | + String directory = "/all"; | |
242 | + fileName = fileUtility.putPngImageFromBitmap(directory, bitmap); | |
247 | 243 | if (Log.isLoggable(TAG, Log.DEBUG)) |
248 | 244 | { |
249 | 245 | Log.d(TAG, "outputBitmap :" + fileName); |
250 | 246 | } |
251 | - /** | |
252 | - if (isEntry == true) | |
253 | - { | |
254 | - // 受信したビットマップを表示用にデータ登録する | |
255 | - nofBitmaps++; | |
256 | - mBackgroundBitmaps.put(nofBitmaps, bitmap); | |
257 | - } | |
258 | - **/ | |
259 | 247 | return (fileName); |
260 | 248 | } |
261 | 249 | /** |
@@ -9,6 +9,7 @@ | ||
9 | 9 | import android.os.Bundle; |
10 | 10 | import android.os.Handler; |
11 | 11 | import android.os.Message; |
12 | +import android.support.annotation.Nullable; | |
12 | 13 | import android.support.wearable.watchface.CanvasWatchFaceService; |
13 | 14 | import android.support.wearable.watchface.WatchFaceStyle; |
14 | 15 | import android.text.format.Time; |
@@ -75,7 +76,7 @@ | ||
75 | 76 | /* initialize your watch face */ |
76 | 77 | myHolder = new MyWatchFaceHolder(MyWatchFaceService.this); |
77 | 78 | myDrawer = new MyWatchFaceDrawer(myHolder); |
78 | - myDrawer.initialize(); | |
79 | + myDrawer.initialize(false); | |
79 | 80 | |
80 | 81 | /* allocate an object to hold the time */ |
81 | 82 | mTime = new Time(); |
@@ -319,7 +320,7 @@ | ||
319 | 320 | } |
320 | 321 | |
321 | 322 | @Override |
322 | - public void onConnectionFailed(ConnectionResult connectionResult) | |
323 | + public void onConnectionFailed(@Nullable ConnectionResult connectionResult) | |
323 | 324 | { |
324 | 325 | if (Log.isLoggable(TAG, Log.DEBUG)) |
325 | 326 | { |
@@ -1,7 +1,7 @@ | ||
1 | 1 | package jp.sfjp.gokigen.prpr0; |
2 | 2 | |
3 | 3 | import android.os.Bundle; |
4 | -import android.support.wearable.companion.WatchFaceCompanion; | |
4 | +import android.support.annotation.Nullable; | |
5 | 5 | import android.util.Log; |
6 | 6 | |
7 | 7 | import com.google.android.gms.common.ConnectionResult; |
@@ -14,9 +14,6 @@ | ||
14 | 14 | import com.google.android.gms.wearable.WearableListenerService; |
15 | 15 | import java.util.concurrent.TimeUnit; |
16 | 16 | |
17 | -/** | |
18 | - * Created by MRSa on 2014/12/23. | |
19 | - */ | |
20 | 17 | public class MyWatchListenerService extends WearableListenerService |
21 | 18 | implements DataApi.DataListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener |
22 | 19 | { |
@@ -86,7 +83,6 @@ | ||
86 | 83 | { |
87 | 84 | Log.e(TAG, "Failed to connect to GoogleApiClient."); |
88 | 85 | } |
89 | - return; | |
90 | 86 | } |
91 | 87 | } |
92 | 88 | } |
@@ -179,7 +175,7 @@ | ||
179 | 175 | } |
180 | 176 | |
181 | 177 | @Override // GoogleApiClient.OnConnectionFailedListener |
182 | - public void onConnectionFailed(ConnectionResult result) | |
178 | + public void onConnectionFailed(@Nullable ConnectionResult result) | |
183 | 179 | { |
184 | 180 | if (Log.isLoggable(TAG, Log.DEBUG)) |
185 | 181 | { |