Commits

Juha Kuitunen committed e221683

reverse order of issue comments: oldest first

Comments (0)

Files changed (1)

src/com/saibotd/bitbeaker/IssueActivity.java

 import android.widget.TextView;
 
 public class IssueActivity extends MyActivity {
-    
+
 	private String slug;
 	private String owner;
 	private String title;
 	private int id;
-	
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.issue);
-        Bundle b = getIntent().getExtras();
-        slug = b.getString("slug");
-        owner = b.getString("owner");
-        title = b.getString("title");
-        id = b.getInt("id");
-        ((TextView) findViewById(R.id.issue_title)).setText(title);
-        progressDialog = ProgressDialog.show(this, "", "Loading ...", true);
-        AsyncLoader asyncLoader = new AsyncLoader();
-        asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/" + id);
-    }
-	
+
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.issue);
+		Bundle b = getIntent().getExtras();
+		slug = b.getString("slug");
+		owner = b.getString("owner");
+		title = b.getString("title");
+		id = b.getInt("id");
+		((TextView) findViewById(R.id.issue_title)).setText(title);
+		progressDialog = ProgressDialog.show(this, "", "Loading ...", true);
+		AsyncLoader asyncLoader = new AsyncLoader();
+		asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/" + id);
+	}
+
 	public void AsyncLoaderDone(String result) {
 		super.AsyncLoaderDone(result);
 		JSONObject jsonObject;
 			Log.d("ISSUE_COMMENTS", jsonArray.toString());
 
 			LinearLayout issue_layout = (LinearLayout) findViewById(R.id.issue_layout);
-			for (int i = 0; i < jsonArray.length(); i++) {
+			for (int i = jsonArray.length()-1; i >= 0; i--) {
 
 				// TODO: Use something smarter for creating layout. :)