Commits

Tobias Duehr committed cbab705

git repos should be working now, also some optimizations regarding ICS - hope it won't affect older devices ...

Comments (0)

Files changed (13)

AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.saibotd.bitbeaker"
-      android:versionName="1.1" android:versionCode="6">
-    <uses-sdk android:minSdkVersion="8" />
+      android:versionName="1.2" android:versionCode="8">
+    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14"/>
     <uses-permission android:name="android.permission.INTERNET"></uses-permission>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 
-    <application android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar" android:icon="@drawable/icon" android:name="Bitbeaker">
+    <application android:label="@string/app_name" android:theme="@style/bbTheme" android:icon="@drawable/icon" android:name="Bitbeaker">
         <activity android:label="@string/app_name" android:name="LoginActivity" android:noHistory="true">
         	<meta-data android:name="android.app.default_searchable" android:value=".SearchableActivity" />
             <intent-filter>

gen/com/saibotd/bitbeaker/R.java

     }
     public static final class attr {
     }
+    public static final class color {
+        public static final int colors=0x7f080000;
+    }
     public static final class drawable {
         public static final int add=0x7f020000;
         public static final int bg=0x7f020001;
         public static final int top_search=0x7f020014;
     }
     public static final class id {
-        public static final int TextView01=0x7f080020;
-        public static final int TextView02=0x7f08001e;
-        public static final int ad_space=0x7f08000b;
-        public static final int bt_issues=0x7f080028;
-        public static final int bt_new_issue=0x7f08000c;
-        public static final int bt_save_new_issue=0x7f080022;
-        public static final int bt_search=0x7f080006;
-        public static final int bt_source_browser=0x7f080027;
-        public static final int bt_wiki=0x7f080029;
-        public static final int changeset_files=0x7f080002;
-        public static final int changeset_loading=0x7f080026;
-        public static final int changeset_message=0x7f080000;
-        public static final int changeset_what=0x7f08000e;
-        public static final int frameLayout1=0x7f08000f;
-        public static final int header_title=0x7f080005;
-        public static final int icon=0x7f080024;
-        public static final int imageView1=0x7f080004;
-        public static final int is_locked=0x7f080014;
-        public static final int issue_content=0x7f080009;
-        public static final int issue_status=0x7f080008;
-        public static final int issue_title=0x7f080007;
-        public static final int issues_list=0x7f08000a;
-        public static final int issues_subtitle=0x7f080012;
-        public static final int issues_title=0x7f080010;
-        public static final int issues_what=0x7f080011;
-        public static final int login_button=0x7f08001b;
-        public static final int login_password=0x7f08001a;
-        public static final int login_username=0x7f080019;
-        public static final int menu_logout=0x7f08002d;
-        public static final int menu_refresh=0x7f08002c;
-        public static final int new_issue_content=0x7f08001f;
-        public static final int new_issue_title=0x7f08001d;
-        public static final int new_issue_type=0x7f080021;
-        public static final int owner_listitem_repositories=0x7f080015;
-        public static final int repositories_list=0x7f080023;
-        public static final int repository_changesets=0x7f080025;
-        public static final int repository_description=0x7f08001c;
-        public static final int scrollView1=0x7f080018;
-        public static final int source_title=0x7f080016;
-        public static final int source_webview=0x7f08002a;
-        public static final int source_what=0x7f080017;
-        public static final int subtitle=0x7f08000d;
-        public static final int textView1=0x7f080001;
-        public static final int title=0x7f080003;
-        public static final int title_listitem_repositories=0x7f080013;
-        public static final int wiki_webview=0x7f08002b;
+        public static final int TextView01=0x7f0a0021;
+        public static final int TextView02=0x7f0a001f;
+        public static final int ad_space=0x7f0a000b;
+        public static final int bt_issues=0x7f0a0029;
+        public static final int bt_new_issue=0x7f0a000c;
+        public static final int bt_save_new_issue=0x7f0a0023;
+        public static final int bt_search=0x7f0a0006;
+        public static final int bt_source_browser=0x7f0a0028;
+        public static final int bt_wiki=0x7f0a002a;
+        public static final int changeset_files=0x7f0a0002;
+        public static final int changeset_loading=0x7f0a0027;
+        public static final int changeset_message=0x7f0a0000;
+        public static final int changeset_what=0x7f0a000e;
+        public static final int frameLayout1=0x7f0a0010;
+        public static final int header_title=0x7f0a0005;
+        public static final int icon=0x7f0a0025;
+        public static final int imageView1=0x7f0a0004;
+        public static final int is_locked=0x7f0a0015;
+        public static final int issue_content=0x7f0a0009;
+        public static final int issue_status=0x7f0a0008;
+        public static final int issue_title=0x7f0a0007;
+        public static final int issues_list=0x7f0a000a;
+        public static final int issues_subtitle=0x7f0a0013;
+        public static final int issues_title=0x7f0a0011;
+        public static final int issues_what=0x7f0a0012;
+        public static final int listitem_issue=0x7f0a000f;
+        public static final int login_button=0x7f0a001c;
+        public static final int login_password=0x7f0a001b;
+        public static final int login_username=0x7f0a001a;
+        public static final int menu_logout=0x7f0a002e;
+        public static final int menu_refresh=0x7f0a002d;
+        public static final int new_issue_content=0x7f0a0020;
+        public static final int new_issue_title=0x7f0a001e;
+        public static final int new_issue_type=0x7f0a0022;
+        public static final int owner_listitem_repositories=0x7f0a0016;
+        public static final int repositories_list=0x7f0a0024;
+        public static final int repository_changesets=0x7f0a0026;
+        public static final int repository_description=0x7f0a001d;
+        public static final int scrollView1=0x7f0a0019;
+        public static final int source_title=0x7f0a0017;
+        public static final int source_webview=0x7f0a002b;
+        public static final int source_what=0x7f0a0018;
+        public static final int subtitle=0x7f0a000d;
+        public static final int textView1=0x7f0a0001;
+        public static final int title=0x7f0a0003;
+        public static final int title_listitem_repositories=0x7f0a0014;
+        public static final int wiki_webview=0x7f0a002c;
     }
     public static final class layout {
         public static final int changeset=0x7f030000;
         public static final int wiki=0x7f03000e;
     }
     public static final class menu {
-        public static final int mainmenu=0x7f070000;
+        public static final int mainmenu=0x7f090000;
     }
     public static final class string {
         public static final int app_name=0x7f050001;
         public static final int website=0x7f050004;
         public static final int wiki=0x7f050002;
     }
+    public static final class style {
+        public static final int bbTheme=0x7f070000;
+    }
     public static final class xml {
         public static final int searchable=0x7f040000;
     }

proguard.cfg

--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keepclasseswithmembernames class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembernames class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}

res/color/colors.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+	<color name="translucent_black">#80000000</color>
+</resources>

res/layout/listitem_issues.xml

 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="match_parent"
-  android:layout_height="match_parent" android:orientation="vertical" android:padding="4dip">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/listitem_issue"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="4dip" >
+
     <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">
         <FrameLayout android:layout_height="match_parent" android:id="@+id/frameLayout1" android:layout_width="match_parent">
             <TextView android:layout_height="wrap_content" android:text="TextView" android:textSize="18dip" android:layout_width="match_parent" android:paddingRight="20dip" android:id="@+id/issues_title"></TextView>

res/values-v11/themes.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <style parent="@android:style/Theme.DeviceDefault.Light.NoActionBar" name="bbTheme"></style>
+    
+</resources>

res/values/themes.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <style parent="@android:style/Theme.Light.NoTitleBar" name="bbTheme"></style>
+    
+</resources>

src/com/saibotd/bitbeaker/IssuesActivity.java

     		ImageView icon = (ImageView) view.findViewById(R.id.issues_what);
     		try {
     			String type = this.getItem(position).getJSONObject("metadata").getString("kind");
+    			String status = this.getItem(position).getString("status");
     			title.setText(this.getItem(position).getString("title"));
-    			subtitle.setText(this.getItem(position).getString("created_on") + " - " + this.getItem(position).getString("comment_count") + " comment(s)");
+    			subtitle.setText(status + " - " + this.getItem(position).getString("created_on") + " - " + this.getItem(position).getString("comment_count") + " comment(s)");
     			if(type.equals("bug")) icon.setImageResource(R.drawable.bug);
     			if(type.equals("enhancement")) icon.setImageResource(R.drawable.enhancement);
     			if(type.equals("proposal")) icon.setImageResource(R.drawable.proposal);
     			if(type.equals("task")) icon.setImageResource(R.drawable.task);
+    			//if(status.equals("resolved")) title.getBackground().setAlpha(45);
     		} catch (JSONException e) {
     			// TODO Auto-generated catch block
     			e.printStackTrace();

src/com/saibotd/bitbeaker/MyActivity.java

 	}
 	
 	protected String getAuthHTTPS(String webadress) {
-		Log.d("getAuthHTTPS", webadress);
 		String cache = bitbeaker.getKV(webadress);
         if(cache != null) return cache;
 		URL url;

src/com/saibotd/bitbeaker/RepositoriesActivity.java

     		    	Intent intent = new Intent(v.getContext(), RepositoryActivity.class);
     				Bundle b = new Bundle();
     				b.putString("slug", rec.getString("slug"));
+    				b.putString("scm", rec.getString("scm"));
     				b.putString("owner", rec.getString("owner"));
     				intent.putExtras(b);
     				v.getContext().startActivity(intent);

src/com/saibotd/bitbeaker/RepositoryActivity.java

     
 	private String slug;
 	private String owner;
+	private String scm;
 	private Boolean firstCall;
 	
     public void onCreate(Bundle savedInstanceState) {
         setContentView(R.layout.repository);
         Bundle b = getIntent().getExtras();
         slug = b.getString("slug");
+        scm = b.getString("scm");
         owner = b.getString("owner");
         firstCall = true;
         Log.d("SLUG", slug);
+        Log.d("SCM", scm);
         Log.d("OWNER", owner);
         AsyncLoader asyncLoader = new AsyncLoader();
         asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+ slug +"/");
 			Bundle b = new Bundle();
 			b.putString("slug", slug);
 			b.putString("owner", owner);
+			b.putString("scm", scm);
 			b.putString("subdir", "/");
 			intent.putExtras(b);
 			v.getContext().startActivity(intent);

src/com/saibotd/bitbeaker/SourceActivity.java

 public class SourceActivity extends MyActivity {
     
 	private String slug;
+	private String scm;	
 	private String owner;
 	private String file;
 	private String code;
         setContentView(R.layout.source);
         Bundle b = getIntent().getExtras();
         slug = b.getString("slug");
+        scm = b.getString("scm");
         owner = b.getString("owner");
         file = b.getString("file");
         progressDialog = ProgressDialog.show(this, "", "Loading ...", true);
         AsyncLoader asyncLoader = new AsyncLoader();
-        asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+slug+"/raw/tip" + file);
+        if(scm.equals("git")) asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+slug+"/raw/master" + file);
+        else asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/"+ owner +"/"+slug+"/raw/tip" + file);
         ((TextView) findViewById(R.id.header_title)).setText(slug + file);
     }
 	

src/com/saibotd/bitbeaker/SourceBrowserActivity.java

 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.ViewGroup;
 public class SourceBrowserActivity extends MyActivity {
 	
 	private String slug;
+	private String scm;
 	private String owner;
 	private String subdir;
 	
         super.onCreate(savedInstanceState);
         Bundle b = getIntent().getExtras();
         slug = b.getString("slug");
+        scm = b.getString("scm");
         owner = b.getString("owner");
         subdir = b.getString("subdir");
         //setListAdapter(new SourceBrowserAdapter(this, slug, owner, subdir));
         setContentView(R.layout.repositories);
         ((TextView) findViewById(R.id.header_title)).setText(slug + subdir);
         AsyncLoader asyncLoader = new AsyncLoader();
-        asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/" + owner + "/"+slug+"/src/tip" + subdir);
+        if(scm.equals("git")) asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/" + owner + "/"+slug+"/src/master" + subdir);
+        else asyncLoader.execute("https://api.bitbucket.org/1.0/repositories/" + owner + "/"+slug+"/src/tip" + subdir);
         progressDialog = ProgressDialog.show(this, "", "Loading ...", true);
     }
     
     				if(rec.substring(0, 4).equals("dir_")){
     					Bundle b = new Bundle();
     					b.putString("slug", slug);
+    					b.putString("scm", scm);
     					b.putString("owner", owner);
     					b.putString("subdir", subdir + rec.substring(4) + "/");
     					Intent intent = new Intent(v.getContext(), SourceBrowserActivity.class);
     				} else {
     					Bundle b = new Bundle();
     					b.putString("slug", slug);
+    					b.putString("scm", scm);
     					b.putString("owner", owner);
     					b.putString("file", subdir + rec.substring(4));
     					Intent intent = new Intent(v.getContext(), SourceActivity.class);