From: MRSa Date: Fri, 11 Aug 2017 06:06:24 +0000 (+0900) Subject: お気に入り設定機能、ひととおり。 X-Git-Tag: V123~3 X-Git-Url: http://git.osdn.net/view?p=gokigen%2FA01c.git;a=commitdiff_plain;h=f617090f10a6509bbe4169135a736b4f26bfd8c7 お気に入り設定機能、ひととおり。 --- diff --git a/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea2.java b/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea2.java index 58dd8b9..4b46e7f 100644 --- a/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea2.java +++ b/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea2.java @@ -21,7 +21,7 @@ class PushedArea2 implements IPushedButton @Override public boolean pushedButton(boolean isLongClick) { - int defaultAction = ICameraFeatureDispatcher.FEATURE_ACTION_NONE; + int defaultAction = ICameraFeatureDispatcher.FEATURE_SHOW_FAVORITE_DIALOG; String preference_action_id = ICameraFeatureDispatcher.ACTION_AREA2; if (isLongClick) { diff --git a/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/dialog/FavoriteSettingSelectionDialog.java b/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/dialog/FavoriteSettingSelectionDialog.java index 80fd0d9..053e22f 100644 --- a/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/dialog/FavoriteSettingSelectionDialog.java +++ b/wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/dialog/FavoriteSettingSelectionDialog.java @@ -9,6 +9,7 @@ import android.util.Log; import java.util.Locale; +import jp.sfjp.gokigen.a01c.R; import jp.sfjp.gokigen.a01c.olycamerawrapper.property.ICameraPropertyLoadSaveOperations; @@ -28,8 +29,6 @@ public class FavoriteSettingSelectionDialog implements IDialogDrawer private int selectedId = 0; private boolean isSaveOperation = false; // loadはfalse, saveがtrue - - /** * コンストラクタ * @@ -50,7 +49,6 @@ public class FavoriteSettingSelectionDialog implements IDialogDrawer @Override public void drawDialog(Canvas canvas) { - final float STROKE_WIDTH = 2.0f; float width = canvas.getWidth(); @@ -78,41 +76,138 @@ public class FavoriteSettingSelectionDialog implements IDialogDrawer Paint.Style style; - // Load + // タイトルを入れる + String title = context.getString(R.string.title_my_settings); + paint.setStrokeWidth(1.0f); + paint.setStyle(Paint.Style.FILL); + paint.setTextSize(height_unit * 2.0f); + canvas.drawText(title, (WIDE_MARGIN + width_unit), (HEIGHT_MARGIN + height_unit * 2.3f), paint); + + // 「読込」 style = (isSaveOperation) ? Paint.Style.STROKE : Paint.Style.FILL; + paint.setStrokeWidth(STROKE_WIDTH); paint.setStyle(style); canvas.drawRect((WIDE_MARGIN + (width_unit * 1.0f)), HEIGHT_MARGIN + 4.0f * height_unit, (WIDE_MARGIN + width_unit * (1.0f + 9.0f)), HEIGHT_MARGIN + 8.0f * height_unit, paint); - // Save + // 「読込」の文字 + title = context.getString(R.string.title_tab_title_load); + paint.setTextSize(height_unit * 2.7f); + paint.setStrokeWidth(1.0f); + paint.setStyle(Paint.Style.FILL); + if (isSaveOperation) + { + paint.setColor(Color.WHITE); + } + else + { + paint.setColor(Color.BLACK); + } + canvas.drawText(title, (WIDE_MARGIN + width_unit * 1.5f), (HEIGHT_MARGIN + height_unit * 7.0f), paint); + + // 「保存」 style = (!isSaveOperation) ? Paint.Style.STROKE : Paint.Style.FILL; + paint.setColor(Color.WHITE); + paint.setStrokeWidth(STROKE_WIDTH); paint.setStyle(style); canvas.drawRect((WIDE_MARGIN + (width_unit * 11.0f)), HEIGHT_MARGIN + 4.0f * height_unit, (WIDE_MARGIN + width_unit * (11.0f + 9.0f)), HEIGHT_MARGIN + 8.0f * height_unit, paint); - // ボタン0 + // 「保存」の文字 + title = context.getString(R.string.title_tab_title_save); + paint.setTextSize(height_unit * 2.7f); + paint.setStrokeWidth(1.0f); + paint.setStyle(Paint.Style.FILL); + if (isSaveOperation) + { + paint.setColor(Color.BLACK); + } + else + { + paint.setColor(Color.WHITE); + } + canvas.drawText(title, (WIDE_MARGIN + width_unit * 11.5f), (HEIGHT_MARGIN + height_unit * 7.0f), paint); + + /////// + paint.setStrokeWidth(STROKE_WIDTH); + + // ボタン1 style = (selectedId != 0) ? Paint.Style.STROKE : Paint.Style.FILL; paint.setStyle(style); + paint.setColor(Color.WHITE); canvas.drawRect((WIDE_MARGIN + (width_unit * 1.0f)), HEIGHT_MARGIN + 9.0f * height_unit, (WIDE_MARGIN + width_unit * (1.0f + 3.0f)), HEIGHT_MARGIN + 15.0f * height_unit, paint); - // ボタン1 + paint.setColor((selectedId != 0) ? Color.WHITE : Color.BLACK); + paint.setTextSize(width_unit * 2.5f); + paint.setStyle(Paint.Style.FILL); + paint.setStrokeWidth(1.0f); + canvas.drawText("1", (WIDE_MARGIN + (width_unit * 1.8f)), (HEIGHT_MARGIN + 13.0f * height_unit), paint); + + // ボタン2 style = (selectedId != 1) ? Paint.Style.STROKE : Paint.Style.FILL; paint.setStyle(style); + paint.setColor(Color.WHITE); canvas.drawRect((WIDE_MARGIN + (width_unit * 5.0f)), HEIGHT_MARGIN + 9.0f * height_unit, (WIDE_MARGIN + width_unit * (5.0f + 3.0f)), HEIGHT_MARGIN + 15.0f * height_unit, paint); - // ボタン2 + paint.setColor((selectedId != 1) ? Color.WHITE : Color.BLACK); + paint.setTextSize(width_unit * 2.5f); + paint.setStyle(Paint.Style.FILL); + paint.setStrokeWidth(1.0f); + canvas.drawText("2", (WIDE_MARGIN + (width_unit * 5.8f)), (HEIGHT_MARGIN + 13.0f * height_unit), paint); + + // ボタン3 style = (selectedId != 2) ? Paint.Style.STROKE : Paint.Style.FILL; paint.setStyle(style); + paint.setColor(Color.WHITE); canvas.drawRect((WIDE_MARGIN + (width_unit * 9.0f)), HEIGHT_MARGIN + 9.0f * height_unit, (WIDE_MARGIN + width_unit * (9.0f + 3.0f)), HEIGHT_MARGIN + 15.0f * height_unit, paint); - // ボタン3 + paint.setColor((selectedId != 2) ? Color.WHITE : Color.BLACK); + paint.setTextSize(width_unit * 2.5f); + paint.setStyle(Paint.Style.FILL); + paint.setStrokeWidth(1.0f); + canvas.drawText("3", (WIDE_MARGIN + (width_unit * 9.8f)), (HEIGHT_MARGIN + 13.0f * height_unit), paint); + + // ボタン4 style = (selectedId != 3) ? Paint.Style.STROKE : Paint.Style.FILL; paint.setStyle(style); + paint.setColor(Color.WHITE); canvas.drawRect((WIDE_MARGIN + (width_unit * 13.0f)), HEIGHT_MARGIN + 9.0f * height_unit, (WIDE_MARGIN + width_unit * (13.0f + 3.0f)), HEIGHT_MARGIN + 15.0f * height_unit, paint); - // ボタン4 + paint.setColor((selectedId != 3) ? Color.WHITE : Color.BLACK); + paint.setStyle(Paint.Style.FILL); + paint.setTextSize(width_unit * 2.5f); + paint.setStrokeWidth(1.0f); + canvas.drawText("4", (WIDE_MARGIN + (width_unit * 13.8f)), (HEIGHT_MARGIN + 13.0f * height_unit), paint); + + // ボタン5 style = (selectedId != 4) ? Paint.Style.STROKE : Paint.Style.FILL; paint.setStyle(style); + paint.setColor(Color.WHITE); canvas.drawRect((WIDE_MARGIN + (width_unit * 17.0f)), HEIGHT_MARGIN + 9.0f * height_unit, (WIDE_MARGIN + width_unit * (17.0f + 3.0f)), HEIGHT_MARGIN + 15.0f * height_unit, paint); + paint.setColor((selectedId != 4) ? Color.WHITE : Color.BLACK); + paint.setStyle(Paint.Style.FILL); + paint.setTextSize(width_unit * 2.5f); + paint.setStrokeWidth(1.0f); + canvas.drawText("5", (WIDE_MARGIN + (width_unit * 17.8f)), (HEIGHT_MARGIN + 13.0f * height_unit), paint); + + // Paint + paint.setColor(Color.WHITE); + paint.setTextSize(height_unit * 2.3f); + paint.setStrokeWidth(1.0f); + paint.setStyle(Paint.Style.FILL); + + // 'OK' および 'Cancel' ボタン + title = context.getString(R.string.title_dialog_cancel); + canvas.drawText(title, (WIDE_MARGIN + width_unit * 2.5f), (HEIGHT_MARGIN + height_unit * 19.0f), paint); + if (isSaveOperation) + { + title = context.getString(R.string.title_tab_title_save); + } + else + { + title = context.getString(R.string.title_tab_title_load); + } + canvas.drawText(title, (WIDE_MARGIN + width_unit * 13.5f), (HEIGHT_MARGIN + height_unit * 19.0f), paint); + } diff --git a/wear/src/main/res/values-ja/strings.xml b/wear/src/main/res/values-ja/strings.xml index 2dbf51d..92787ca 100644 --- a/wear/src/main/res/values-ja/strings.xml +++ b/wear/src/main/res/values-ja/strings.xml @@ -44,9 +44,13 @@ 失敗です… --- - 設定 + お気に入り設定 読込 保存 Save Name + + 了解 + 中止 + diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index 6225799..0c01c29 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -43,9 +43,13 @@ FAILED! --- - Favorite + Favorite Settings Load Save Save Name + + OK + Cancel +