• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Simple Notepad Application for Android OS


Commit MetaInfo

Revision7e4c2c8e759f7e44224d4bc3d5dece5bfc9443e9 (tree)
Time2012-09-04 14:47:54
AuthorMasahiko, SAWAI <say@user...>
CommiterMasahiko, SAWAI

Log Message

Dialog 用のテーマを作成

* Theme.Notepad.Dark.Dialog
* Theme.Notepad.Light.Dialog

Change Summary

Incremental Difference

--- a/ToDo.txt
+++ b/ToDo.txt
@@ -20,10 +20,6 @@ Title, Content, Focus
2020 #############################
2121 !! notepad-app
2222
23-* Dialog 用のテーマを作成
24-** Theme.Notepad.Dark.Dialog
25-** Theme.Notepad.Light.Dialog
26-
2723 * テンプレートの書式を変更
2824 ** '#{date}' '#{time}' など?
2925
@@ -43,10 +39,6 @@ Title, Content, Focus
4339 #############################
4440 !! notepad-app-level-11
4541
46-* Dialog 用のテーマを作成
47-** Theme.Notepad.Dark.Dialog
48-** Theme.Notepad.Light.Dialog
49-
5042 * 各種 ListView の layout_margin を修正
5143 ** layout_margin を減らしてリスト項目の layout_margin で調整する
5244 ** ListView 用のスタイルを用意
@@ -106,6 +98,10 @@ Title, Content, Focus
10698
10799 !! notepad-app
108100
101+#* Dialog 用のテーマを作成
102+#** Theme.Notepad.Dark.Dialog
103+#** Theme.Notepad.Light.Dialog
104+
109105 #* AddNewNoteActivity をリファクタリング
110106 #** NoteUtils のメソッドを呼ぶように修正
111107 #** 不要になったメソッドの削除
@@ -116,6 +112,7 @@ Title, Content, Focus
116112 # -> NoteTemplatePickerDialog を実装
117113
118114
115+#############################
119116 !! notepad-app-level-11
120117
121118 #* 新規ノート作成時にテンプレートを選ぶ処理を変更
@@ -135,6 +132,7 @@ Title, Content, Focus
135132 #* NoteListItemViewBinder を NoteCursorAdapter に変更
136133
137134
135+#############################
138136 !! notepad-common
139137
140138 #* 定数定義用インターフェースを notepad-comon に移動
Binary files /dev/null and b/notepad-app/res/drawable-hdpi/dialog_bg_holo_dark.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable-hdpi/dialog_bg_holo_light.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable-ldpi/dialog_bg_holo_dark.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable-ldpi/dialog_bg_holo_light.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable-xhdpi/dialog_bg_holo_dark.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable-xhdpi/dialog_bg_holo_light.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable/dialog_bg_holo_dark.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable/dialog_bg_holo_light.9.png differ
Binary files /dev/null and b/notepad-app/res/drawable/dialog_title_bg.9.png differ
--- a/notepad-app/res/layout/note_template_picker_dialog.xml
+++ b/notepad-app/res/layout/note_template_picker_dialog.xml
@@ -1,6 +1,7 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <FrameLayout
33 xmlns:android="http://schemas.android.com/apk/res/android"
4+ style="@style/body"
45 android:layout_width="fill_parent"
56 android:layout_height="fill_parent"
67 >
--- a/notepad-app/res/values/styles_theme.xml
+++ b/notepad-app/res/values/styles_theme.xml
@@ -47,23 +47,36 @@
4747 <item name="ic_unlock">@drawable/ic_unlock_light</item>
4848 </style>
4949
50- <!-- Dark Theme Dialog -->
51- <!--
52- <style name="Theme.Notepad.Dark.Dialog" parent="@style/Theme.Notepad.Dark" >
53- <item name="android:windowFrame">@drawable/dialog_window_frame</item>
50+ <!-- Dialog Theme -->
51+ <style name="DialogWindowTitle" >
52+ <item name="android:maxLines">1</item>
53+ <item name="android:scrollHorizontally">true</item>
54+ <item name="android:background">@drawable/dialog_title_bg</item>
55+ <item name="android:gravity">center_vertical</item>
56+ <item name="android:textAppearance">?android:textAppearance</item>
57+ <item name="android:textSize">20sp</item>
58+ <item name="android:textColor">#FF00C99B</item>
59+ <item name="android:textStyle">bold</item>
60+ <item name="android:paddingLeft">8dip</item>
61+ </style>
62+
63+ <!-- Dark Dialog -->
64+ <style name="Theme.Notepad.Dark.Dialog" >
65+ <item name="android:windowFrame">@null</item>
66+ <item name="android:windowBackground">@drawable/dialog_bg_holo_dark</item>
67+ <item name="android:windowIsFloating">true</item>
5468 <item name="android:windowContentOverlay">@null</item>
5569 <item name="android:windowNoTitle">false</item>
56- <item name="android:windowIsFloating">true</item>
70+ <item name="android:windowTitleStyle">@style/DialogWindowTitle</item>
5771 </style>
58- -->
5972
60- <!-- Light Theme Dialog -->
61- <!--
62- <style name="Theme.Notepad.Light.Dialog" parent="@style/Theme.Notepad.Light" >
63- <item name="android:windowFrame">@drawable/dialog_window_frame</item>
73+ <!-- Light Dialog -->
74+ <style name="Theme.Notepad.Light.Dialog" >
75+ <item name="android:windowFrame">@null</item>
76+ <item name="android:windowBackground">@drawable/dialog_bg_holo_light</item>
77+ <item name="android:windowIsFloating">true</item>
6478 <item name="android:windowContentOverlay">@null</item>
6579 <item name="android:windowNoTitle">false</item>
66- <item name="android:windowIsFloating">true</item>
80+ <item name="android:windowTitleStyle">@style/DialogWindowTitle</item>
6781 </style>
68- -->
6982 </resources>
--- a/notepad-app/src/org/routine_work/notepad/prefs/NotepadPreferenceUtils.java
+++ b/notepad-app/src/org/routine_work/notepad/prefs/NotepadPreferenceUtils.java
@@ -64,6 +64,30 @@ public class NotepadPreferenceUtils
6464 return themeId;
6565 }
6666
67+ public static int getDialogTheme(Context context)
68+ {
69+ int themeId = R.style.Theme_Notepad_Dark_Dialog;
70+
71+ String preferenceName = context.getPackageName() + "_preferences";
72+ SharedPreferences sharedPreferences = context.getSharedPreferences(preferenceName, Context.MODE_PRIVATE);
73+ String key = context.getString(R.string.notepad_theme_key);
74+ String defaultValue = context.getString(R.string.notepad_theme_default_value);
75+ String themeValue = sharedPreferences.getString(key, defaultValue);
76+
77+ final String themeDark = context.getString(R.string.notepad_theme_dark_value);
78+ final String themeLight = context.getString(R.string.notepad_theme_light_value);
79+ if (themeDark.equals(themeValue))
80+ {
81+ themeId = R.style.Theme_Notepad_Dark_Dialog;
82+ }
83+ else if (themeLight.equals(themeValue))
84+ {
85+ themeId = R.style.Theme_Notepad_Light_Dialog;
86+ }
87+
88+ return themeId;
89+ }
90+
6791 public static boolean getActionBarAutoHide(Context context)
6892 {
6993 boolean actionBarAutoHide;
--- a/notepad-app/src/org/routine_work/notepad/template/NoteTemplatePickerDialog.java
+++ b/notepad-app/src/org/routine_work/notepad/template/NoteTemplatePickerDialog.java
@@ -34,6 +34,7 @@ import android.widget.AdapterView.OnItemClickListener;
3434 import android.widget.ListView;
3535 import android.widget.SimpleCursorAdapter;
3636 import org.routine_work.notepad.R;
37+import org.routine_work.notepad.prefs.NotepadPreferenceUtils;
3738 import org.routine_work.notepad.provider.NoteStore;
3839 import org.routine_work.notepad.utils.NoteTemplateConstants;
3940 import org.routine_work.notepad.utils.NoteUtils;
@@ -57,7 +58,8 @@ public class NoteTemplatePickerDialog extends Dialog
5758
5859 public NoteTemplatePickerDialog(Context context)
5960 {
60- super(context);
61+ super(context, NotepadPreferenceUtils.getDialogTheme(context));
62+// super(context);
6163 }
6264
6365 public OnItemClickListener getOnItemClickListener()