Merge lp:~openerp-dev/openerp-mobile-client/trunk-note_grid_update-sla into lp:openerp-mobile-client

Proposed by Shailesh Lakum(OpenERP)
Status: Merged
Merged at revision: 158
Proposed branch: lp:~openerp-dev/openerp-mobile-client/trunk-note_grid_update-sla
Merge into: lp:openerp-mobile-client
Diff against target: 329 lines (+42/-36)
8 files modified
res/layout/fragment_note_compose.xml (+8/-12)
res/layout/fragment_note_detail.xml (+4/-4)
res/menu/menu_fragment_note_new_edit.xml (+4/-3)
res/values/strings.xml (+2/-0)
src/com/openerp/addons/note/Note.java (+3/-2)
src/com/openerp/addons/note/NoteComposeActivity.java (+14/-11)
src/com/openerp/addons/note/NoteDB.java (+2/-0)
src/com/openerp/addons/note/NoteDetail.java (+5/-4)
To merge this branch: bzr merge lp:~openerp-dev/openerp-mobile-client/trunk-note_grid_update-sla
Reviewer Review Type Date Requested Status
Dharmang Soni (OpenERP) Pending
Review via email: mp+217383@code.launchpad.net

Description of the change

Hello,

Following updates are done in Note module:

1) Attachment with Expandable Grid Support
2) Audio, File, Image attachment support
3) Speech to text in note compose

Thanks,
Shailesh Lakum (sla)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'res/drawable-hdpi/ic_action_cancel.png'
2Binary files res/drawable-hdpi/ic_action_cancel.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/ic_action_cancel.png 2014-04-28 07:01:36 +0000 differ
3=== added file 'res/drawable-hdpi/ic_menu_action_content_new_attachment.png'
4Binary files res/drawable-hdpi/ic_menu_action_content_new_attachment.png 1970-01-01 00:00:00 +0000 and res/drawable-hdpi/ic_menu_action_content_new_attachment.png 2014-04-28 07:01:36 +0000 differ
5=== added file 'res/drawable-mdpi/ic_action_cancel.png'
6Binary files res/drawable-mdpi/ic_action_cancel.png 1970-01-01 00:00:00 +0000 and res/drawable-mdpi/ic_action_cancel.png 2014-04-28 07:01:36 +0000 differ
7=== added file 'res/drawable-mdpi/ic_menu_action_content_new_attachment.png'
8Binary files res/drawable-mdpi/ic_menu_action_content_new_attachment.png 1970-01-01 00:00:00 +0000 and res/drawable-mdpi/ic_menu_action_content_new_attachment.png 2014-04-28 07:01:36 +0000 differ
9=== added file 'res/drawable-xhdpi/ic_action_cancel.png'
10Binary files res/drawable-xhdpi/ic_action_cancel.png 1970-01-01 00:00:00 +0000 and res/drawable-xhdpi/ic_action_cancel.png 2014-04-28 07:01:36 +0000 differ
11=== added file 'res/drawable-xhdpi/ic_menu_action_content_new_attachment.png'
12Binary files res/drawable-xhdpi/ic_menu_action_content_new_attachment.png 1970-01-01 00:00:00 +0000 and res/drawable-xhdpi/ic_menu_action_content_new_attachment.png 2014-04-28 07:01:36 +0000 differ
13=== added file 'res/drawable-xxhdpi/ic_action_cancel.png'
14Binary files res/drawable-xxhdpi/ic_action_cancel.png 1970-01-01 00:00:00 +0000 and res/drawable-xxhdpi/ic_action_cancel.png 2014-04-28 07:01:36 +0000 differ
15=== added file 'res/drawable-xxhdpi/ic_menu_action_content_new_attachment.png'
16Binary files res/drawable-xxhdpi/ic_menu_action_content_new_attachment.png 1970-01-01 00:00:00 +0000 and res/drawable-xxhdpi/ic_menu_action_content_new_attachment.png 2014-04-28 07:01:36 +0000 differ
17=== modified file 'res/layout/fragment_note_compose.xml'
18--- res/layout/fragment_note_compose.xml 2014-04-14 13:27:33 +0000
19+++ res/layout/fragment_note_compose.xml 2014-04-28 07:01:36 +0000
20@@ -4,17 +4,13 @@
21 android:layout_height="match_parent"
22 android:background="#f5f5f5"
23 android:clipToPadding="false"
24- android:fillViewport="true"
25- android:paddingBottom="10dp"
26- android:paddingLeft="10dp"
27- android:paddingRight="10dp"
28 android:paddingTop="?android:attr/actionBarSize" >
29
30 <LinearLayout
31 android:layout_width="match_parent"
32 android:layout_height="wrap_content"
33 android:orientation="vertical"
34- android:padding="15dp" >
35+ android:padding="10dp" >
36
37 <EditText
38 android:id="@+id/edtNoteTitleInput"
39@@ -48,19 +44,19 @@
40 android:fontFamily="sans-serif-light"
41 android:hint="@string/compose_note_description" />
42
43- <GridView
44+ <WebView
45+ android:id="@+id/webNoteComposeWebViewPad"
46+ android:layout_width="match_parent"
47+ android:layout_height="wrap_content"
48+ android:visibility="invisible" />
49+
50+ <com.openerp.util.controls.ExpandableHeightGridView
51 android:id="@+id/noteAttachmentGrid"
52 android:layout_width="match_parent"
53 android:layout_height="match_parent"
54 android:horizontalSpacing="5dp"
55 android:numColumns="2"
56 android:verticalSpacing="5dp" />
57-
58- <WebView
59- android:id="@+id/webNoteComposeWebViewPad"
60- android:layout_width="match_parent"
61- android:layout_height="match_parent"
62- android:visibility="invisible" />
63 </LinearLayout>
64
65 </ScrollView>
66\ No newline at end of file
67
68=== modified file 'res/layout/fragment_note_detail.xml'
69--- res/layout/fragment_note_detail.xml 2014-04-14 13:27:33 +0000
70+++ res/layout/fragment_note_detail.xml 2014-04-28 07:01:36 +0000
71@@ -40,23 +40,23 @@
72 android:layout_width="fill_parent"
73 android:layout_height="wrap_content"
74 android:layout_marginBottom="10dp"
75+ android:fontFamily="sans-serif-condensed"
76 android:padding="10dp"
77- android:fontFamily="sans-serif-condensed"
78 android:textAppearance="?android:attr/textAppearanceMedium"
79 android:textStyle="bold" />
80
81 <TextView
82 android:id="@+id/txvNoteDetailMemo"
83- android:fontFamily="sans-serif-light"
84 android:layout_width="fill_parent"
85 android:layout_height="wrap_content"
86 android:layout_marginBottom="10dp"
87 android:autoLink="web"
88 android:background="@android:color/transparent"
89+ android:fontFamily="sans-serif-light"
90 android:padding="10dp"
91 android:textAppearance="?android:attr/textAppearanceMedium" />
92-
93- <GridView
94+
95+ <com.openerp.util.controls.ExpandableHeightGridView
96 android:id="@+id/noteGridViewAttach"
97 android:layout_width="fill_parent"
98 android:layout_height="fill_parent"
99
100=== modified file 'res/menu/menu_fragment_note_new_edit.xml'
101--- res/menu/menu_fragment_note_new_edit.xml 2014-04-14 13:27:33 +0000
102+++ res/menu/menu_fragment_note_new_edit.xml 2014-04-28 07:01:36 +0000
103@@ -4,10 +4,10 @@
104 android:id="@+id/menu_note_speech_to_text"
105 android:icon="@drawable/ic_action_speech_to_text"
106 android:showAsAction="always"
107- android:title="Speech to text"/>
108+ android:title="@string/note_menu_title_speech_to_text"/>
109 <item
110 android:id="@+id/menu_note_attach"
111- android:icon="@drawable/ic_action_content_new_attachment"
112+ android:icon="@drawable/ic_menu_action_content_new_attachment"
113 android:showAsAction="always"
114 android:title="Attachement">
115 <menu>
116@@ -27,7 +27,8 @@
117 </item>
118 <item
119 android:id="@+id/menu_note_cancel"
120- android:showAsAction="never"
121+ android:icon="@drawable/ic_action_cancel"
122+ android:showAsAction="always"
123 android:title="Cancel">
124 </item>
125
126
127=== modified file 'res/values/strings.xml'
128--- res/values/strings.xml 2014-04-14 13:27:33 +0000
129+++ res/values/strings.xml 2014-04-28 07:01:36 +0000
130@@ -27,5 +27,7 @@
131 <!-- Detail Note Fragment Strings -->
132 <string name="detail_note_name">Note Name</string>
133 <string name="detail_note_memo">Note Memo</string>
134+
135+ <string name="note_menu_title_speech_to_text">Speech to text</string>
136
137 </resources>
138\ No newline at end of file
139
140=== modified file 'src/com/openerp/addons/note/Note.java'
141--- src/com/openerp/addons/note/Note.java 2014-04-14 13:27:33 +0000
142+++ src/com/openerp/addons/note/Note.java 2014-04-28 07:01:36 +0000
143@@ -250,8 +250,9 @@
144 whereArgs = new String[] { "true", mStageId + "" };
145 break;
146 }
147- mNotesList.addAll(db().select(where, whereArgs, null, null,
148- "id DESC"));
149+ List<OEDataRow> result = db().select(where, whereArgs, null, null,
150+ "id DESC");
151+ mNotesList.addAll(result);
152 return null;
153 }
154
155
156=== modified file 'src/com/openerp/addons/note/NoteComposeActivity.java'
157--- src/com/openerp/addons/note/NoteComposeActivity.java 2014-04-14 13:27:33 +0000
158+++ src/com/openerp/addons/note/NoteComposeActivity.java 2014-04-28 07:01:36 +0000
159@@ -52,7 +52,6 @@
160 import android.view.ViewGroup;
161 import android.webkit.WebView;
162 import android.widget.EditText;
163-import android.widget.GridView;
164 import android.widget.ImageView;
165 import android.widget.TextView;
166 import android.widget.Toast;
167@@ -70,6 +69,7 @@
168 import com.openerp.support.OEUser;
169 import com.openerp.support.listview.OEListAdapter;
170 import com.openerp.util.HTMLHelper;
171+import com.openerp.util.controls.ExpandableHeightGridView;
172 import com.openerp.util.tags.MultiTagsTextView.TokenListener;
173 import com.openerp.util.tags.TagsView;
174 import com.openerp.util.tags.TagsView.CustomTagViewListener;
175@@ -121,12 +121,12 @@
176 EditText edtNoteTitle = null;
177 EditText edtNoteDescription = null;
178 TagsView mNoteTagsView = null;
179- GridView mNoteAttachmentGrid = null;
180+ ExpandableHeightGridView mNoteAttachmentGrid = null;
181 List<Object> mNoteAttachmentList = new ArrayList<Object>();
182 OEListAdapter mNoteListAdapterAttach = null;
183 Attachment mAttachment = null;
184-
185 PackageManager mPackageManager = null;
186+ String oldName = null;
187
188 @Override
189 protected void onCreate(Bundle savedInstanceState) {
190@@ -153,7 +153,6 @@
191 private void handleIntent() {
192 Log.d(TAG, "NoteComposeActivity->handleIntent()");
193 Intent intent = getIntent();
194-
195 if (intent.hasExtra("request_code")) {
196 Attachment.Types type = (Types) intent.getExtras().get(
197 "request_code");
198@@ -175,7 +174,8 @@
199 @SuppressLint("SetJavaScriptEnabled")
200 private void initNote() {
201 Intent intent = getIntent();
202- mNoteAttachmentGrid = (GridView) findViewById(R.id.noteAttachmentGrid);
203+ mNoteAttachmentGrid = (ExpandableHeightGridView) findViewById(R.id.noteAttachmentGrid);
204+ mNoteAttachmentGrid.setExpanded(true);
205 edtNoteTitle = (EditText) findViewById(R.id.edtNoteTitleInput);
206 edtNoteDescription = (EditText) findViewById(R.id.edtNoteComposeDescription);
207 mWebViewPad = (WebView) findViewById(R.id.webNoteComposeWebViewPad);
208@@ -200,6 +200,7 @@
209 .get("key_" + mStageId));
210 if (intent.hasExtra("note_title")) {
211 edtNoteTitle.setText(intent.getStringExtra("note_title"));
212+ oldName = intent.getStringExtra("note_title");
213 }
214
215 if (mPadInstalled) {
216@@ -230,6 +231,7 @@
217 }
218 if (mEditMode) {
219 edtNoteTitle.setText(mNoteRow.getString("name"));
220+ oldName = mNoteRow.getString("name");
221 List<OEDataRow> tags = mNoteRow.getM2MRecord("tag_ids")
222 .browseEach();
223 if (tags != null) {
224@@ -515,7 +517,9 @@
225 }
226
227 public void saveNote(Integer mNoteId) {
228- if (mOpenERP != null) {
229+ if (mOpenERP == null) {
230+ Toast.makeText(mContext, "No Connection", Toast.LENGTH_LONG).show();
231+ } else {
232 OEValues values = new OEValues();
233 String name = edtNoteTitle.getText().toString();
234 String memo = "";
235@@ -536,7 +540,9 @@
236 } catch (Exception e) {
237 }
238 } else {
239- memo = name + "<br/>" + edtNoteDescription.getText().toString();
240+ memo = edtNoteDescription.getText().toString();
241+ if (oldName != name)
242+ memo = name + "<br/>" + memo.replace(oldName, "");
243 }
244 name = noteName(name + "\n" + memo);
245 List<Integer> tag_ids = new ArrayList<Integer>();
246@@ -569,10 +575,8 @@
247 data.putExtra("result", id);
248 data.putExtra("is_new", is_new);
249 setResult(RESULT_OK, data);
250- finish();
251- } else {
252- Toast.makeText(mContext, "No Connection", Toast.LENGTH_LONG).show();
253 }
254+ finish();
255 }
256
257 private String noteName(String memo) {
258@@ -637,7 +641,6 @@
259
260 builder.setPositiveButton("Create", new OnClickListener() {
261 public void onClick(DialogInterface di, int i) {
262- // do something with onClick
263 String mToast = "No Connection ";
264 if ((stage.getText().toString()).equalsIgnoreCase("Add New")
265 || (stage.getText().toString())
266
267=== modified file 'src/com/openerp/addons/note/NoteDB.java'
268--- src/com/openerp/addons/note/NoteDB.java 2014-04-09 12:50:36 +0000
269+++ src/com/openerp/addons/note/NoteDB.java 2014-04-28 07:01:36 +0000
270@@ -82,8 +82,10 @@
271 public List<OEColumn> getModelColumns() {
272 List<OEColumn> cols = new ArrayList<OEColumn>();
273 cols.add(new OEColumn("name", "Name", OEFields.text()));
274+ cols.add(new OEColumn("sequence", "Sequence", OEFields.integer()));
275 cols.add(new OEColumn("stage_color", "Stage Color", OEFields
276 .varchar(10), false));
277+
278 return cols;
279 }
280
281
282=== modified file 'src/com/openerp/addons/note/NoteDetail.java'
283--- src/com/openerp/addons/note/NoteDetail.java 2014-04-15 11:59:20 +0000
284+++ src/com/openerp/addons/note/NoteDetail.java 2014-04-28 07:01:36 +0000
285@@ -38,7 +38,6 @@
286 import android.view.View;
287 import android.view.View.OnClickListener;
288 import android.view.ViewGroup;
289-import android.widget.GridView;
290 import android.widget.ImageView;
291 import android.widget.TextView;
292 import android.widget.Toast;
293@@ -55,6 +54,7 @@
294 import com.openerp.support.listview.OEListAdapter;
295 import com.openerp.util.HTMLHelper;
296 import com.openerp.util.TextViewTags;
297+import com.openerp.util.controls.ExpandableHeightGridView;
298 import com.openerp.util.drawer.DrawerItem;
299
300 public class NoteDetail extends BaseFragment {
301@@ -69,7 +69,7 @@
302 String mPadURL = "";
303 String mNoteMemo = "";
304 String mMessageBody = "";
305- GridView mNoteGridViewAttach = null;
306+ ExpandableHeightGridView mNoteGridViewAttach = null;
307 List<Object> mNotesListAttach = new ArrayList<Object>();
308 OEListAdapter mNoteListAdapterAttach = null;
309 Ir_AttachmentDBHelper mAttachmentDB = null;
310@@ -103,8 +103,9 @@
311 private void showNoteDetails(int note_id) {
312 mNoteDetailTitle = (TextView) mView
313 .findViewById(R.id.txvNoteDetailTitle);
314- mNoteGridViewAttach = (GridView) mView
315+ mNoteGridViewAttach = (ExpandableHeightGridView) mView
316 .findViewById(R.id.noteGridViewAttach);
317+ mNoteGridViewAttach.setExpanded(true);
318 mNoteDetailMemo = (TextView) mView.findViewById(R.id.txvNoteDetailMemo);
319 mNoteTags = (TextView) mView.findViewById(R.id.edtNoteTagsView);
320
321@@ -251,7 +252,7 @@
322 NoteComposeActivity.class);
323 Bundle noteArgs = new Bundle();
324 noteArgs.putInt("note_id", mArgument.getInt("note_id"));
325- noteArgs.putString("Attachment", "New");
326+ // noteArgs.putString("Attachment", "New");
327 manageNote.putExtras(noteArgs);
328 startActivity(manageNote);
329 return true;

Subscribers

People subscribed via source and target branches

to all changes: