Skip to content

Commit dfc8d55

Browse files
committed
Sample minor change, before merge
1 parent 0bca2f3 commit dfc8d55

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sample/src/main/java/com/loopj/android/http/sample/GetSample.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.loopj.android.http.sample;
22

3-
import android.os.Bundle;
4-
53
public class GetSample extends SampleParentActivity {
64

75
@Override
@@ -18,9 +16,4 @@ protected boolean isRequestBodyAllowed() {
1816
protected boolean isRequestHeadersAllowed() {
1917
return true;
2018
}
21-
22-
@Override
23-
protected void onCreate(Bundle savedInstanceState) {
24-
super.onCreate(savedInstanceState);
25-
}
2619
}

sample/src/main/java/com/loopj/android/http/sample/SampleParentActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public abstract class SampleParentActivity extends Activity {
1919
private AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
2020
private EditText urlEditText;
2121
private Button executeButton;
22+
private static final LinearLayout.LayoutParams lParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
2223

2324
@Override
2425
protected void onCreate(Bundle savedInstanceState) {
2526
super.onCreate(savedInstanceState);
26-
final LinearLayout.LayoutParams lParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
2727
final LinearLayout content_wrapper = new LinearLayout(this);
2828
content_wrapper.setOrientation(LinearLayout.VERTICAL);
2929
content_wrapper.setLayoutParams(lParams);
@@ -58,6 +58,11 @@ private void setupHeaders() {
5858
executeButton.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
5959
urlLayout.addView(executeButton);
6060
headers.addView(urlLayout);
61+
if(isRequestHeadersAllowed()){
62+
LinearLayout headersLayout = new LinearLayout(this);
63+
headersLayout.setOrientation(LinearLayout.VERTICAL);
64+
headersLayout.setLayoutParams(lParams);
65+
}
6166
}
6267

6368
protected final void addView(View v) {

0 commit comments

Comments
 (0)