Commits

Tobias Duehr committed 2f378a3

Create new issues - done!

Comments (0)

Files changed (4)

gen/com/saibotd/bitbeaker/R.java

-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found.  It
- * should not be modified by hand.
- */
-
-package com.saibotd.bitbeaker;
-
-public final class R {
-    public static final class array {
-        public static final int type_of_issue=0x7f060000;
-    }
-    public static final class attr {
-    }
-    public static final class drawable {
-        public static final int add=0x7f020000;
-        public static final int bg=0x7f020001;
-        public static final int bug=0x7f020002;
-        public static final int del=0x7f020003;
-        public static final int edit=0x7f020004;
-        public static final int enhancement=0x7f020005;
-        public static final int file=0x7f020006;
-        public static final int folder=0x7f020007;
-        public static final int header=0x7f020008;
-        public static final int ic_menu_refresh=0x7f020009;
-        public static final int ic_menu_search_holo_dark=0x7f02000a;
-        public static final int ic_menu_share=0x7f02000b;
-        public static final int ic_menu_stop=0x7f02000c;
-        public static final int icon=0x7f02000d;
-        public static final int lock=0x7f02000e;
-        public static final int logo_big=0x7f02000f;
-        public static final int proposal=0x7f020010;
-        public static final int top_bg=0x7f020011;
-        public static final int top_search=0x7f020012;
-    }
-    public static final class id {
-        public static final int TextView01=0x7f08001c;
-        public static final int TextView02=0x7f08001a;
-        public static final int ad_space=0x7f080008;
-        public static final int bt_issues=0x7f080024;
-        public static final int bt_new_issue=0x7f080009;
-        public static final int bt_save_new_issue=0x7f08001e;
-        public static final int bt_search=0x7f080006;
-        public static final int bt_source_browser=0x7f080023;
-        public static final int bt_wiki=0x7f080025;
-        public static final int changeset_files=0x7f080002;
-        public static final int changeset_loading=0x7f080022;
-        public static final int changeset_message=0x7f080000;
-        public static final int changeset_what=0x7f08000c;
-        public static final int frameLayout1=0x7f08000b;
-        public static final int header_title=0x7f080005;
-        public static final int icon=0x7f080020;
-        public static final int imageView1=0x7f080004;
-        public static final int is_locked=0x7f080011;
-        public static final int issues_list=0x7f080007;
-        public static final int issues_subtitle=0x7f08000f;
-        public static final int issues_title=0x7f08000d;
-        public static final int issues_what=0x7f08000e;
-        public static final int login_button=0x7f080017;
-        public static final int login_password=0x7f080016;
-        public static final int login_username=0x7f080015;
-        public static final int menu_logout=0x7f080029;
-        public static final int menu_refresh=0x7f080028;
-        public static final int new_issue_content=0x7f08001b;
-        public static final int new_issue_title=0x7f080019;
-        public static final int new_issue_type=0x7f08001d;
-        public static final int owner_listitem_repositories=0x7f080012;
-        public static final int repositories_list=0x7f08001f;
-        public static final int repository_changesets=0x7f080021;
-        public static final int repository_description=0x7f080018;
-        public static final int source_title=0x7f080013;
-        public static final int source_webview=0x7f080026;
-        public static final int source_what=0x7f080014;
-        public static final int subtitle=0x7f08000a;
-        public static final int textView1=0x7f080001;
-        public static final int title=0x7f080003;
-        public static final int title_listitem_repositories=0x7f080010;
-        public static final int wiki_webview=0x7f080027;
-    }
-    public static final class layout {
-        public static final int changeset=0x7f030000;
-        public static final int header=0x7f030001;
-        public static final int issues=0x7f030002;
-        public static final int listitem=0x7f030003;
-        public static final int listitem_changeset=0x7f030004;
-        public static final int listitem_issues=0x7f030005;
-        public static final int listitem_repositories=0x7f030006;
-        public static final int listitem_source=0x7f030007;
-        public static final int login=0x7f030008;
-        public static final int new_issue=0x7f030009;
-        public static final int repositories=0x7f03000a;
-        public static final int repository=0x7f03000b;
-        public static final int source=0x7f03000c;
-        public static final int wiki=0x7f03000d;
-    }
-    public static final class menu {
-        public static final int mainmenu=0x7f070000;
-    }
-    public static final class string {
-        public static final int app_name=0x7f050001;
-        public static final int browse_source=0x7f05000c;
-        public static final int changes=0x7f05000b;
-        public static final int changesets=0x7f050005;
-        public static final int clear_cache=0x7f050013;
-        public static final int content=0x7f050016;
-        public static final int description=0x7f050006;
-        public static final int files=0x7f05000a;
-        public static final int hello=0x7f050000;
-        public static final int issue_tracker=0x7f050003;
-        public static final int issues=0x7f05000f;
-        public static final int log_out=0x7f050010;
-        public static final int login=0x7f050008;
-        public static final int new_issue=0x7f050014;
-        public static final int nothing=0x7f050007;
-        public static final int pleaseenterbitbucket=0x7f050009;
-        public static final int refresh=0x7f050012;
-        public static final int search_repo=0x7f050011;
-        public static final int source=0x7f05000e;
-        public static final int source_browser=0x7f05000d;
-        public static final int submit_new_issue=0x7f050018;
-        public static final int title=0x7f050015;
-        public static final int type=0x7f050017;
-        public static final int website=0x7f050004;
-        public static final int wiki=0x7f050002;
-    }
-    public static final class xml {
-        public static final int searchable=0x7f040000;
-    }
-}
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.saibotd.bitbeaker;
+
+public final class R {
+    public static final class array {
+        public static final int type_of_issue=0x7f060000;
+    }
+    public static final class attr {
+    }
+    public static final class drawable {
+        public static final int add=0x7f020000;
+        public static final int bg=0x7f020001;
+        public static final int bug=0x7f020002;
+        public static final int del=0x7f020003;
+        public static final int edit=0x7f020004;
+        public static final int enhancement=0x7f020005;
+        public static final int file=0x7f020006;
+        public static final int folder=0x7f020007;
+        public static final int header=0x7f020008;
+        public static final int ic_menu_refresh=0x7f020009;
+        public static final int ic_menu_search_holo_dark=0x7f02000a;
+        public static final int ic_menu_share=0x7f02000b;
+        public static final int ic_menu_stop=0x7f02000c;
+        public static final int icon=0x7f02000d;
+        public static final int lock=0x7f02000e;
+        public static final int logo_big=0x7f02000f;
+        public static final int proposal=0x7f020010;
+        public static final int top_bg=0x7f020011;
+        public static final int top_search=0x7f020012;
+    }
+    public static final class id {
+        public static final int TextView01=0x7f08001d;
+        public static final int TextView02=0x7f08001b;
+        public static final int ad_space=0x7f080008;
+        public static final int bt_issues=0x7f080025;
+        public static final int bt_new_issue=0x7f080009;
+        public static final int bt_save_new_issue=0x7f08001f;
+        public static final int bt_search=0x7f080006;
+        public static final int bt_source_browser=0x7f080024;
+        public static final int bt_wiki=0x7f080026;
+        public static final int changeset_files=0x7f080002;
+        public static final int changeset_loading=0x7f080023;
+        public static final int changeset_message=0x7f080000;
+        public static final int changeset_what=0x7f08000c;
+        public static final int frameLayout1=0x7f08000b;
+        public static final int header_title=0x7f080005;
+        public static final int icon=0x7f080021;
+        public static final int imageView1=0x7f080004;
+        public static final int is_locked=0x7f080011;
+        public static final int issues_list=0x7f080007;
+        public static final int issues_subtitle=0x7f08000f;
+        public static final int issues_title=0x7f08000d;
+        public static final int issues_what=0x7f08000e;
+        public static final int login_button=0x7f080017;
+        public static final int login_password=0x7f080016;
+        public static final int login_username=0x7f080015;
+        public static final int menu_logout=0x7f08002a;
+        public static final int menu_refresh=0x7f080029;
+        public static final int new_issue_content=0x7f08001c;
+        public static final int new_issue_title=0x7f08001a;
+        public static final int new_issue_type=0x7f08001e;
+        public static final int owner_listitem_repositories=0x7f080012;
+        public static final int repositories_list=0x7f080020;
+        public static final int repository_changesets=0x7f080022;
+        public static final int repository_description=0x7f080019;
+        public static final int scrollView1=0x7f080018;
+        public static final int source_title=0x7f080013;
+        public static final int source_webview=0x7f080027;
+        public static final int source_what=0x7f080014;
+        public static final int subtitle=0x7f08000a;
+        public static final int textView1=0x7f080001;
+        public static final int title=0x7f080003;
+        public static final int title_listitem_repositories=0x7f080010;
+        public static final int wiki_webview=0x7f080028;
+    }
+    public static final class layout {
+        public static final int changeset=0x7f030000;
+        public static final int header=0x7f030001;
+        public static final int issues=0x7f030002;
+        public static final int listitem=0x7f030003;
+        public static final int listitem_changeset=0x7f030004;
+        public static final int listitem_issues=0x7f030005;
+        public static final int listitem_repositories=0x7f030006;
+        public static final int listitem_source=0x7f030007;
+        public static final int login=0x7f030008;
+        public static final int new_issue=0x7f030009;
+        public static final int repositories=0x7f03000a;
+        public static final int repository=0x7f03000b;
+        public static final int source=0x7f03000c;
+        public static final int wiki=0x7f03000d;
+    }
+    public static final class menu {
+        public static final int mainmenu=0x7f070000;
+    }
+    public static final class string {
+        public static final int app_name=0x7f050001;
+        public static final int browse_source=0x7f05000c;
+        public static final int changes=0x7f05000b;
+        public static final int changesets=0x7f050005;
+        public static final int clear_cache=0x7f050013;
+        public static final int content=0x7f050016;
+        public static final int description=0x7f050006;
+        public static final int files=0x7f05000a;
+        public static final int hello=0x7f050000;
+        public static final int issue_tracker=0x7f050003;
+        public static final int issues=0x7f05000f;
+        public static final int log_out=0x7f050010;
+        public static final int login=0x7f050008;
+        public static final int new_issue=0x7f050014;
+        public static final int nothing=0x7f050007;
+        public static final int pleaseenterbitbucket=0x7f050009;
+        public static final int refresh=0x7f050012;
+        public static final int search_repo=0x7f050011;
+        public static final int source=0x7f05000e;
+        public static final int source_browser=0x7f05000d;
+        public static final int submit_new_issue=0x7f050018;
+        public static final int title=0x7f050015;
+        public static final int type=0x7f050017;
+        public static final int website=0x7f050004;
+        public static final int wiki=0x7f050002;
+    }
+    public static final class xml {
+        public static final int searchable=0x7f040000;
+    }
+}

res/layout/new_issue.xml

   xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
   <include layout="@layout/header" android:layout_width="match_parent" android:layout_height="wrap_content"/>
-    <LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content">
-        <TextView android:layout_height="wrap_content" android:autoLink="all" android:linksClickable="true" android:layout_marginRight="42dip" android:layout_width="match_parent" android:id="@+id/repository_description" android:text="@string/title"></TextView>
-        <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/new_issue_title">
-            <requestFocus></requestFocus>
-        </EditText>
-        <TextView android:text="@string/content" android:autoLink="all" android:linksClickable="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="42dip" android:id="@+id/TextView02"></TextView>
-        <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textMultiLine" android:layout_weight="1" android:id="@+id/new_issue_content"></EditText>
-        <TextView android:autoLink="all" android:linksClickable="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="42dip" android:id="@+id/TextView01" android:text="@string/type"></TextView>
-        <Spinner android:layout_width="match_parent" android:layout_height="wrap_content" android:entries="@array/type_of_issue" android:id="@+id/new_issue_type"></Spinner>
-    </LinearLayout>
-    <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" >
-        <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">
-            <Button android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/bt_save_new_issue" android:text="@string/submit_new_issue"></Button>
-        </LinearLayout>
-    </LinearLayout>
+  <ScrollView android:id="@+id/scrollView1" android:layout_width="match_parent" android:layout_height="wrap_content">
+      <LinearLayout android:layout_width="match_parent" android:orientation="vertical" android:layout_height="wrap_content">
+          <TextView android:text="@string/title" android:autoLink="all" android:layout_margin="5dip" android:layout_height="wrap_content" android:id="@+id/repository_description" android:layout_width="match_parent" android:linksClickable="true"></TextView>
+          <EditText android:inputType="text" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/new_issue_title"></EditText>
+          <TextView android:text="@string/content" android:autoLink="all" android:layout_margin="5dip" android:layout_height="wrap_content" android:id="@+id/TextView02" android:layout_width="match_parent" android:linksClickable="true"></TextView>
+          <EditText android:inputType="textMultiLine" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/new_issue_content" android:lines="3"></EditText>
+          <TextView android:text="@string/type" android:autoLink="all" android:layout_margin="5dip" android:layout_height="wrap_content" android:id="@+id/TextView01" android:layout_width="match_parent" android:linksClickable="true"></TextView>
+          <Spinner android:layout_width="match_parent" android:id="@+id/new_issue_type" android:layout_height="wrap_content" android:entries="@array/type_of_issue"></Spinner>
+          <Button android:layout_height="wrap_content" android:text="@string/submit_new_issue" android:layout_weight="1" android:id="@+id/bt_save_new_issue" android:layout_width="match_parent"></Button>
+      </LinearLayout>
+  </ScrollView>
   
 </LinearLayout>

src/com/saibotd/bitbeaker/MyActivity.java

 				urlConnection.setDoOutput(true);
 				OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
 				out.write(postParams);
+				Log.d("POST", postParams);
 				out.close();
 			}
 			in = new BufferedInputStream(urlConnection.getInputStream());

src/com/saibotd/bitbeaker/NewIssueActivity.java

 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
-import android.widget.AdapterView;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.Spinner;
 	
 	private String slug;
 	private String owner;
-	private String type;
 	
     @Override
     public void onCreate(Bundle savedInstanceState) {
         Bundle b = getIntent().getExtras();
         slug = b.getString("slug");
         owner = b.getString("owner");
-        type = "bug";
-        //setListAdapter(new IssuesAdapter(this, slug, owner));
+        bitbeaker.delKV("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/");
         setContentView(R.layout.new_issue);
         ((TextView) findViewById(R.id.header_title)).setText(slug);
         Button newIssue = (Button) findViewById(R.id.bt_save_new_issue);
 		newIssue.setOnClickListener(saveNewIssueClickListener);
-		Spinner spinner =  ((Spinner) findViewById(R.id.new_issue_type));
-		spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
-		    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
-		    	type = parent.getItemAtPosition(pos).toString();
-		    	Log.d("SPINNER", type);
-		    }
-		    public void onNothingSelected(AdapterView<?> parent) {
-		    	type = "bug";
-		    }
-		});
     }
     
     private void showLoading(){
     }
     
     private void done(){
+    	bitbeaker.delKV("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/");
     	Toast.makeText(this, "New issue submitted!", 1000);
-    	bitbeaker.delKV("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/");
     	finish();
     }
     
     
     private OnClickListener saveNewIssueClickListener = new OnClickListener() {
 		public void onClick(View v) {
-			/*
-	    	Intent intent = new Intent(v.getContext(), NewIssueActivity.class);
-			Bundle b = new Bundle();
-			b.putString("slug", slug);
-			b.putString("owner", owner);
-			intent.putExtras(b);
-			v.getContext().startActivity(intent);
-			*/
 			showLoading();
 			String title = ((EditText) findViewById(R.id.new_issue_title)).getText().toString();
 			String content = ((EditText) findViewById(R.id.new_issue_content)).getText().toString();
+			String type = ((Spinner) findViewById(R.id.new_issue_type)).getSelectedItem().toString(); 
 	        AsyncLoader asyncLoader = new AsyncLoader();
 	        asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/issues/", "title=" + URLEncoder.encode(title) + "&content=" + URLEncoder.encode(content) + "&kind=" + URLEncoder.encode(type));
-	        //progressDialog = ProgressDialog.show(this, "", "Loading ...", true);
 		}
 	};
 	
     protected void AsyncLoaderDone(String result) {
     	super.AsyncLoaderDone(result);
-    	Log.d("BLA", result);
+    	Log.d("RES", result);
     	done();
 	}
 	
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.