Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of Android's Hackbook example
Summary: Cleaning of the Hackbook code. Main reason of this commit is mixing tabs and white spaces inside the code, which makes the code ugly (for example browsing the code inside github). In addition I also refactored few other things: - I tried to wrap the lines to 100 characters per line (80 per comments) - at least in those places where it made sense - Remove trailing whitespaces and unnecessary blank lines - Add missing @OverRide adnnotations - Fixed syntax in some places (like "for(i=0;..." -> "for (i = 0;...") - Added missing 'static' keywords Test Plan: Run the app and see if everything works :-) Reviewers: jimbru, raghuc1, vksgupta, dalves Reviewed By: dalves CC: platform-diffs@lists, nbushak, dalves Differential Revision: 370079
- Loading branch information
Kamil Kraszewski
authored and
Kamil Kraszewski
committed
Dec 1, 2011
1 parent
f4b2b9e
commit 61551e0
Showing
36 changed files
with
2,553 additions
and
2,433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.facebook.android" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
<supports-screens | ||
android:smallScreens="true" | ||
android:normalScreens="true" | ||
android:largeScreens="true" | ||
android:anyDensity="true" /> | ||
<application android:icon="@drawable/icon" | ||
android:label="@string/app_name" | ||
android:debuggable="true"> | ||
<activity android:name=".SplashActivity" | ||
android:label="@string/app_name" | ||
android:screenOrientation="portrait"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".Hackbook" | ||
android:label="@string/app_name" | ||
android:configChanges="keyboardHidden" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".GraphExplorer" | ||
android:windowSoftInputMode="stateHidden" | ||
android:screenOrientation="portrait" /> | ||
<activity android:name=".IntentUriHandler"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<data android:scheme="fbgraphex" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".FriendsList" | ||
android:screenOrientation="portrait" /> | ||
<activity | ||
android:name=".Places" | ||
android:screenOrientation="portrait" /> | ||
</application> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> | ||
<uses-sdk android:minSdkVersion="3" /> | ||
</manifest> | ||
package="com.facebook.android" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
<supports-screens | ||
android:smallScreens="true" | ||
android:normalScreens="true" | ||
android:largeScreens="true" | ||
android:anyDensity="true" /> | ||
<application android:icon="@drawable/icon" | ||
android:label="@string/app_name" | ||
android:debuggable="true"> | ||
<activity android:name=".SplashActivity" | ||
android:label="@string/app_name" | ||
android:screenOrientation="portrait"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".Hackbook" | ||
android:label="@string/app_name" | ||
android:configChanges="keyboardHidden" | ||
android:screenOrientation="portrait"> | ||
</activity> | ||
<activity | ||
android:name=".GraphExplorer" | ||
android:windowSoftInputMode="stateHidden" | ||
android:screenOrientation="portrait" /> | ||
<activity android:name=".IntentUriHandler"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<data android:scheme="fbgraphex" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".FriendsList" | ||
android:screenOrientation="portrait" /> | ||
<activity | ||
android:name=".Places" | ||
android:screenOrientation="portrait" /> | ||
</application> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> | ||
<uses-sdk android:minSdkVersion="3" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="?android:attr/listPreferredItemHeight"> | ||
<TextView | ||
<TextView | ||
android:id="@+id/connection_name" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textSize="26sp" | ||
android:textColor="@color/lite_blue" | ||
android:paddingLeft="5dp" /> | ||
</RelativeLayout> | ||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<TabHost | ||
android:layout_width="wrap_content" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/tabHost"> | ||
<RelativeLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="fill_parent"> | ||
<TabWidget | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@android:id/tabs" /> | ||
<FrameLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@android:id/tabcontent" | ||
android:layout_below="@android:id/tabs"> | ||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/fields_layout"> | ||
<Button android:id="@+id/get_fields_button" | ||
android:text="@string/get_fields" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:padding="10dp" /> | ||
<ListView | ||
android:id="@+id/fields_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" /> | ||
</LinearLayout> | ||
<ListView | ||
android:id="@+id/connections_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" /> | ||
</FrameLayout> | ||
</RelativeLayout> | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<TabHost | ||
android:layout_width="wrap_content" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/tabHost"> | ||
<RelativeLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="fill_parent"> | ||
<TabWidget | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@android:id/tabs" /> | ||
<FrameLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@android:id/tabcontent" | ||
android:layout_below="@android:id/tabs"> | ||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/fields_layout"> | ||
<Button android:id="@+id/get_fields_button" | ||
android:text="@string/get_fields" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:padding="10dp" /> | ||
<ListView | ||
android:id="@+id/fields_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" /> | ||
</LinearLayout> | ||
<ListView | ||
android:id="@+id/connections_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" /> | ||
</FrameLayout> | ||
</RelativeLayout> | ||
</TabHost> | ||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<CheckBox | ||
android:id="@+id/fields_checkbox" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<CheckBox | ||
android:id="@+id/fields_checkbox" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
<TextView | ||
<TextView | ||
android:id="@+id/fields_info" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:orientation="vertical" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content"> | ||
<EditText | ||
android:layout_height="wrap_content" | ||
android:layout_width="240dp" | ||
android:layout_weight="1" | ||
android:textSize="25px" | ||
android:gravity="left|center" | ||
android:id="@+id/fqlquery" /> | ||
<Button android:id="@+id/submit_button" | ||
android:text="@string/submit" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:padding="10dp" /> | ||
</LinearLayout> | ||
<View | ||
android:layout_width="fill_parent" | ||
android:layout_height="3dip" | ||
android:background="@color/grey" /> | ||
<ScrollView | ||
android:id="@+id/ScrollView01" | ||
android:layout_height="fill_parent" | ||
android:layout_width="fill_parent"> | ||
<TextView | ||
android:id="@+id/fqlOutput" | ||
android:textColor="@color/white" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingTop="3dp" | ||
android:paddingLeft="3dp" | ||
android:visibility="invisible" | ||
android:background="@color/grey" /> | ||
</ScrollView> | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:orientation="vertical" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content"> | ||
<EditText | ||
android:layout_height="wrap_content" | ||
android:layout_width="240dp" | ||
android:layout_weight="1" | ||
android:textSize="25px" | ||
android:gravity="left|center" | ||
android:id="@+id/fqlquery" /> | ||
<Button android:id="@+id/submit_button" | ||
android:text="@string/submit" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:padding="10dp" /> | ||
</LinearLayout> | ||
<View | ||
android:layout_width="fill_parent" | ||
android:layout_height="3dip" | ||
android:background="@color/grey" /> | ||
<ScrollView | ||
android:id="@+id/ScrollView01" | ||
android:layout_height="fill_parent" | ||
android:layout_width="fill_parent"> | ||
<TextView | ||
android:id="@+id/fqlOutput" | ||
android:textColor="@color/white" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingTop="3dp" | ||
android:paddingLeft="3dp" | ||
android:visibility="invisible" | ||
android:background="@color/grey" /> | ||
</ScrollView> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<ListView | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:background="@color/black"> | ||
<ListView | ||
android:id="@+id/friends_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" /> | ||
</LinearLayout> | ||
android:layout_height="fill_parent" /> | ||
</LinearLayout> |
Oops, something went wrong.