Commits

Ville Saalo committed 82f0970

Bitbeaker issue #53: Issues should have their authors and creation date displayed

  • Participants
  • Parent commits df85708

Comments (0)

Files changed (4)

File res/layout/issue.xml

                 android:text="@string/nothing"
                 android:textStyle="bold">
             </TextView>
+            
+
+           <LinearLayout
+            android:id="@+id/issueSubmitterInfoTable"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:focusableInTouchMode="true"
+            android:orientation="horizontal" >
+            
+            		<TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/issueAuthorLabel"
+                        android:paddingRight="5dip"
+                        android:textStyle="italic" >
+                    </TextView>
+
+                    <TextView
+                        android:id="@+id/issueAuthor"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/nothing" >
+                    </TextView>
+                    
+                    <TextView
+                        android:id="@+id/issueOnTimestampLabel"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/issueOnTimestampLabel"
+                        android:textStyle="italic" >
+                    </TextView>
+                    
+                    <TextView
+                        android:id="@+id/issueTimestamp"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/nothing"
+                        android:textStyle="italic" >
+                    </TextView>
+
+            </LinearLayout>
 
             <TableLayout
                 android:id="@+id/issueStatusTable"
                     </TextView>
 
                 </TableRow>
-                
-                <TableRow>
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="@string/issueAuthorLabel"
-                        android:paddingRight="5dip" >
-                    </TextView>
-
-                    <TextView
-                        android:id="@+id/issueAuthor"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="@string/nothing" >
-                    </TextView>
-
-                </TableRow>
 
             </TableLayout>
 

File res/values-fi/strings.xml

     <string name="issueStatusLabel">Tila:</string>
     <string name="issueTypeLabel">Tyyppi:</string>
     <string name="issuePriorityLabel">Prioriteetti:</string>
-    <string name="issueAuthorLabel">Lähettänyt:</string>
+    <string name="issueAuthorLabel">Raportoinut:</string>
+    <string name="issueOnTimestampLabel">Pvm:</string>
     
     <!-- LauncherActivity.java -->
     <string name="changeset_not_found">Muutoskokoelmaa ei löytynyt!</string>

File res/values/strings.xml

     <string name="issueStatusLabel">Status:</string>
     <string name="issueTypeLabel">Type:</string>
     <string name="issuePriorityLabel">Priority:</string>
-    <string name="issueAuthorLabel">Submitted by:</string>
+    <string name="issueAuthorLabel">By:</string>
+    <string name="issueOnTimestampLabel">on</string>
     
     <!-- LauncherActivity.java -->
     <string name="changeset_not_found">Changeset not found!</string>

File src/com/saibotd/bitbeaker/IssueActivity.java

 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuInflater;
 import com.actionbarsherlock.view.MenuItem;
+import com.saibotd.bitbeaker.clicklisteners.UserProfileActivityStartingClickListener;
 
 public class IssueActivity extends MyActivity {
 
 		TextView issueType = (TextView) findViewById(R.id.issueType);
 		TextView issuePriority = (TextView) findViewById(R.id.issuePriority);
 		TextView issueAuthor = (TextView) findViewById(R.id.issueAuthor);
+		TextView issueCreationDate = (TextView) findViewById(R.id.issueTimestamp);
 		issue_data = result;
 		try {
 			jsonObject = new JSONObject(result);
 
 			title = jsonObject.getString("title");
 			issueTitle.setText(title);
-
+			
+			final String issueCreator = jsonObject.getJSONObject("reported_by").getString("username");
 			issueStatus.setText(Helper.translateApiString(jsonObject.getString("status")));
 			issueType.setText(Helper.translateApiString(jsonObject.getJSONObject("metadata").getString("kind")));
 			issuePriority.setText(Helper.translateApiString(jsonObject.getString("priority")));
-			issueAuthor.setText(jsonObject.getJSONObject("reported_by").getString("username"));
+			issueAuthor.setText(issueCreator + " ");
+			issueAuthor.setOnClickListener(new UserProfileActivityStartingClickListener(issueCreator));
+			issueCreationDate.setText(" " + Helper.dateFormat(jsonObject.getString("utc_created_on")));
 
-			TextView issue_content = (TextView) listViewHeader.findViewById(R.id.issue_content);
+			TextView issueContent = (TextView) listViewHeader.findViewById(R.id.issue_content);
 			TextView comments_count = (TextView) listViewHeader.findViewById(R.id.issue_comments_count);
-			issue_content.setText(MarkupHelper.handleMarkup(jsonObject.getString("content"), owner, slug));
-			issue_content.setMovementMethod(LinkMovementMethod.getInstance());
+			issueContent.setText(MarkupHelper.handleMarkup(jsonObject.getString("content"), owner, slug));
+			issueContent.setMovementMethod(LinkMovementMethod.getInstance());
 			comments_count.setText(this.getString(R.string.issue_comments) + " " + jsonObject.getString("comment_count"));
 
 			loadComments();