Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 54012c3

Browse files
committed
netspylib-开发呀哈哈哈
1 parent b3f4c76 commit 54012c3

File tree

5 files changed

+89
-85
lines changed

5 files changed

+89
-85
lines changed

netspylib/src/main/java/com/creditease/netspy/internal/ui/TransactionListFragment.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
import com.creditease.netspy.internal.support.SQLiteUtils;
2828

2929
public class TransactionListFragment extends Fragment implements
30-
SearchView.OnQueryTextListener, LoaderManager.LoaderCallbacks<Cursor> {
30+
SearchView.OnQueryTextListener, LoaderManager.LoaderCallbacks<Cursor> {
3131

3232
private String currentFilter;
3333
private OnListFragmentInteractionListener listener;
3434
private TransactionAdapter adapter;
3535

36-
public TransactionListFragment() {}
36+
public TransactionListFragment() {
37+
}
3738

3839
public static TransactionListFragment newInstance() {
3940
return new TransactionListFragment();
@@ -54,7 +55,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
5455
RecyclerView recyclerView = (RecyclerView) view;
5556
recyclerView.setLayoutManager(new LinearLayoutManager(context));
5657
recyclerView.addItemDecoration(new DividerItemDecoration(getContext(),
57-
DividerItemDecoration.VERTICAL));
58+
DividerItemDecoration.VERTICAL));
5859
adapter = new TransactionAdapter(getContext(), listener);
5960
recyclerView.setAdapter(adapter);
6061
}
@@ -74,7 +75,7 @@ public void onAttach(Context context) {
7475
listener = (OnListFragmentInteractionListener) context;
7576
} else {
7677
throw new RuntimeException(context.toString()
77-
+ " must implement OnListFragmentInteractionListener");
78+
+ " must implement OnListFragmentInteractionListener");
7879
}
7980
}
8081

@@ -115,10 +116,10 @@ public Loader<Cursor> onCreateLoader(int id, Bundle args) {
115116
if (!TextUtils.isEmpty(currentFilter)) {
116117
if (TextUtils.isDigitsOnly(currentFilter)) {
117118
loader.setSelection("responseCode LIKE ?");
118-
loader.setSelectionArgs(new String[]{ currentFilter + "%" });
119+
loader.setSelectionArgs(new String[]{currentFilter + "%"});
119120
} else {
120121
loader.setSelection("path LIKE ?");
121-
loader.setSelectionArgs(new String[]{ "%" + currentFilter + "%" });
122+
loader.setSelectionArgs(new String[]{"%" + currentFilter + "%"});
122123
}
123124
}
124125
loader.setProjection(HttpTransaction.PARTIAL_PROJECTION);

netspylib/src/main/java/com/creditease/netspy/internal/ui/TransactionPayloadFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ private void populateUI() {
7373
switch (type) {
7474
case TYPE_REQUEST:
7575
setText(transaction.getRequestHeadersString(true),
76-
transaction.getFormattedRequestBody(), transaction.requestBodyIsPlainText());
76+
transaction.getFormattedRequestBody(), transaction.requestBodyIsPlainText());
7777
break;
7878
case TYPE_RESPONSE:
7979
setText(transaction.getResponseHeadersString(true),
80-
transaction.getFormattedResponseBody(), transaction.responseBodyIsPlainText());
80+
transaction.getFormattedResponseBody(), transaction.responseBodyIsPlainText());
8181
break;
8282
}
8383
}

netspylib/src/main/res/layout/netspy_fragment_transaction_overview.xml

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,115 +15,115 @@
1515

1616
<TableRow
1717
android:layout_width="match_parent"
18-
android:layout_height="wrap_content" >
18+
android:layout_height="wrap_content">
1919

20-
<TextView
21-
android:layout_width="wrap_content"
22-
android:layout_height="wrap_content"
23-
android:text="@string/netspy_url"
24-
style="@style/NetSpy.TextAppearance.Label"/>
20+
<TextView
21+
style="@style/NetSpy.TextAppearance.Label"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:text="@string/netspy_url" />
2525

26-
<TextView
27-
android:id="@+id/url"
28-
android:layout_width="wrap_content"
29-
android:layout_height="wrap_content"
30-
style="@style/NetSpy.TextAppearance.Value"
31-
tools:text="https://example.com/path/to/resource?here=might_be_really_long"/>
26+
<TextView
27+
android:id="@+id/url"
28+
style="@style/NetSpy.TextAppearance.Value"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
tools:text="https://example.com/path/to/resource?here=might_be_really_long" />
3232

3333
</TableRow>
3434

3535
<TableRow
3636
android:layout_width="match_parent"
37-
android:layout_height="wrap_content" >
37+
android:layout_height="wrap_content">
3838

3939
<TextView
40+
style="@style/NetSpy.TextAppearance.Label"
4041
android:layout_width="wrap_content"
4142
android:layout_height="wrap_content"
42-
android:text="@string/netspy_method"
43-
style="@style/NetSpy.TextAppearance.Label"/>
43+
android:text="@string/netspy_method" />
4444

4545
<TextView
4646
android:id="@+id/method"
47+
style="@style/NetSpy.TextAppearance.Value"
4748
android:layout_width="wrap_content"
4849
android:layout_height="wrap_content"
49-
style="@style/NetSpy.TextAppearance.Value"
50-
tools:text="GET"/>
50+
tools:text="GET" />
5151

5252
</TableRow>
5353

5454
<TableRow
5555
android:layout_width="match_parent"
56-
android:layout_height="wrap_content" >
56+
android:layout_height="wrap_content">
5757

5858
<TextView
59+
style="@style/NetSpy.TextAppearance.Label"
5960
android:layout_width="wrap_content"
6061
android:layout_height="wrap_content"
61-
android:text="@string/netspy_protocol"
62-
style="@style/NetSpy.TextAppearance.Label"/>
62+
android:text="@string/netspy_protocol" />
6363

6464
<TextView
6565
android:id="@+id/protocol"
66+
style="@style/NetSpy.TextAppearance.Value"
6667
android:layout_width="wrap_content"
6768
android:layout_height="wrap_content"
68-
style="@style/NetSpy.TextAppearance.Value"
69-
tools:text="HTTP/1.1"/>
69+
tools:text="HTTP/1.1" />
7070

7171
</TableRow>
7272

7373
<TableRow
7474
android:layout_width="match_parent"
75-
android:layout_height="wrap_content" >
75+
android:layout_height="wrap_content">
7676

7777
<TextView
78+
style="@style/NetSpy.TextAppearance.Label"
7879
android:layout_width="wrap_content"
7980
android:layout_height="wrap_content"
80-
android:text="@string/netspy_status"
81-
style="@style/NetSpy.TextAppearance.Label"/>
81+
android:text="@string/netspy_status" />
8282

8383
<TextView
8484
android:id="@+id/status"
85+
style="@style/NetSpy.TextAppearance.Value"
8586
android:layout_width="wrap_content"
8687
android:layout_height="wrap_content"
87-
style="@style/NetSpy.TextAppearance.Value"
88-
tools:text="Complete"/>
88+
tools:text="Complete" />
8989

9090
</TableRow>
9191

9292
<TableRow
9393
android:layout_width="match_parent"
94-
android:layout_height="wrap_content" >
94+
android:layout_height="wrap_content">
9595

9696
<TextView
97+
style="@style/NetSpy.TextAppearance.Label"
9798
android:layout_width="wrap_content"
9899
android:layout_height="wrap_content"
99-
android:text="@string/netspy_response"
100-
style="@style/NetSpy.TextAppearance.Label"/>
100+
android:text="@string/netspy_response" />
101101

102102
<TextView
103103
android:id="@+id/response"
104+
style="@style/NetSpy.TextAppearance.Value"
104105
android:layout_width="wrap_content"
105106
android:layout_height="wrap_content"
106-
style="@style/NetSpy.TextAppearance.Value"
107-
tools:text="200 OK"/>
107+
tools:text="200 OK" />
108108

109109
</TableRow>
110110

111111
<TableRow
112112
android:layout_width="match_parent"
113-
android:layout_height="wrap_content" >
113+
android:layout_height="wrap_content">
114114

115115
<TextView
116+
style="@style/NetSpy.TextAppearance.Label"
116117
android:layout_width="wrap_content"
117118
android:layout_height="wrap_content"
118-
android:text="@string/netspy_ssl"
119-
style="@style/NetSpy.TextAppearance.Label"/>
119+
android:text="@string/netspy_ssl" />
120120

121121
<TextView
122122
android:id="@+id/ssl"
123+
style="@style/NetSpy.TextAppearance.Value"
123124
android:layout_width="wrap_content"
124125
android:layout_height="wrap_content"
125-
style="@style/NetSpy.TextAppearance.Value"
126-
tools:text="Yes"/>
126+
tools:text="Yes" />
127127

128128
</TableRow>
129129

@@ -133,55 +133,55 @@
133133
android:paddingTop="8dp">
134134

135135
<TextView
136+
style="@style/NetSpy.TextAppearance.Label"
136137
android:layout_width="wrap_content"
137138
android:layout_height="wrap_content"
138-
android:text="@string/netspy_request_time"
139-
style="@style/NetSpy.TextAppearance.Label"/>
139+
android:text="@string/netspy_request_time" />
140140

141141
<TextView
142142
android:id="@+id/request_time"
143+
style="@style/NetSpy.TextAppearance.Value"
143144
android:layout_width="wrap_content"
144145
android:layout_height="wrap_content"
145-
style="@style/NetSpy.TextAppearance.Value"
146-
tools:text="05/02/17 11:52:49"/>
146+
tools:text="05/02/17 11:52:49" />
147147

148148
</TableRow>
149149

150150
<TableRow
151151
android:layout_width="match_parent"
152-
android:layout_height="wrap_content" >
152+
android:layout_height="wrap_content">
153153

154154
<TextView
155+
style="@style/NetSpy.TextAppearance.Label"
155156
android:layout_width="wrap_content"
156157
android:layout_height="wrap_content"
157-
android:text="@string/netspy_response_time"
158-
style="@style/NetSpy.TextAppearance.Label"/>
158+
android:text="@string/netspy_response_time" />
159159

160160
<TextView
161161
android:id="@+id/response_time"
162+
style="@style/NetSpy.TextAppearance.Value"
162163
android:layout_width="wrap_content"
163164
android:layout_height="wrap_content"
164-
style="@style/NetSpy.TextAppearance.Value"
165-
tools:text="05/02/17 11:52:49"/>
165+
tools:text="05/02/17 11:52:49" />
166166

167167
</TableRow>
168168

169169
<TableRow
170170
android:layout_width="match_parent"
171-
android:layout_height="wrap_content" >
171+
android:layout_height="wrap_content">
172172

173173
<TextView
174+
style="@style/NetSpy.TextAppearance.Label"
174175
android:layout_width="wrap_content"
175176
android:layout_height="wrap_content"
176-
android:text="@string/netspy_duration"
177-
style="@style/NetSpy.TextAppearance.Label"/>
177+
android:text="@string/netspy_duration" />
178178

179179
<TextView
180180
android:id="@+id/duration"
181+
style="@style/NetSpy.TextAppearance.Value"
181182
android:layout_width="wrap_content"
182183
android:layout_height="wrap_content"
183-
style="@style/NetSpy.TextAppearance.Value"
184-
tools:text="405 ms"/>
184+
tools:text="405 ms" />
185185

186186
</TableRow>
187187

@@ -191,55 +191,55 @@
191191
android:paddingTop="8dp">
192192

193193
<TextView
194+
style="@style/NetSpy.TextAppearance.Label"
194195
android:layout_width="wrap_content"
195196
android:layout_height="wrap_content"
196-
android:text="@string/netspy_request_size"
197-
style="@style/NetSpy.TextAppearance.Label"/>
197+
android:text="@string/netspy_request_size" />
198198

199199
<TextView
200200
android:id="@+id/request_size"
201+
style="@style/NetSpy.TextAppearance.Value"
201202
android:layout_width="wrap_content"
202203
android:layout_height="wrap_content"
203-
style="@style/NetSpy.TextAppearance.Value"
204-
tools:text="53 KB"/>
204+
tools:text="53 KB" />
205205

206206
</TableRow>
207207

208208
<TableRow
209209
android:layout_width="match_parent"
210-
android:layout_height="wrap_content" >
210+
android:layout_height="wrap_content">
211211

212212
<TextView
213+
style="@style/NetSpy.TextAppearance.Label"
213214
android:layout_width="wrap_content"
214215
android:layout_height="wrap_content"
215-
android:text="@string/netspy_response_size"
216-
style="@style/NetSpy.TextAppearance.Label"/>
216+
android:text="@string/netspy_response_size" />
217217

218218
<TextView
219219
android:id="@+id/response_size"
220+
style="@style/NetSpy.TextAppearance.Value"
220221
android:layout_width="wrap_content"
221222
android:layout_height="wrap_content"
222-
style="@style/NetSpy.TextAppearance.Value"
223-
tools:text="148 KB"/>
223+
tools:text="148 KB" />
224224

225225
</TableRow>
226226

227227
<TableRow
228228
android:layout_width="match_parent"
229-
android:layout_height="wrap_content" >
229+
android:layout_height="wrap_content">
230230

231231
<TextView
232+
style="@style/NetSpy.TextAppearance.Label"
232233
android:layout_width="wrap_content"
233234
android:layout_height="wrap_content"
234-
android:text="@string/netspy_total_size"
235-
style="@style/NetSpy.TextAppearance.Label"/>
235+
android:text="@string/netspy_total_size" />
236236

237237
<TextView
238238
android:id="@+id/total_size"
239+
style="@style/NetSpy.TextAppearance.Value"
239240
android:layout_width="wrap_content"
240241
android:layout_height="wrap_content"
241-
style="@style/NetSpy.TextAppearance.Value"
242-
tools:text="201 KB"/>
242+
tools:text="201 KB" />
243243

244244
</TableRow>
245245

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<menu xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:app="http://schemas.android.com/apk/res-auto" >
5-
<item android:id="@+id/search"
6-
android:title="@string/netspy_search"
4+
xmlns:app="http://schemas.android.com/apk/res-auto">
5+
<item
6+
android:id="@+id/search"
77
android:icon="@drawable/netspy_ic_search_white_24dp"
8-
app:showAsAction="collapseActionView|ifRoom"
9-
app:actionViewClass="android.support.v7.widget.SearchView" />
10-
<item android:title="@string/netspy_clear"
8+
android:title="@string/netspy_search"
9+
app:actionViewClass="android.support.v7.widget.SearchView"
10+
app:showAsAction="collapseActionView|ifRoom" />
11+
<item
1112
android:id="@+id/clear"
1213
android:icon="@drawable/netspy_ic_delete_white_24dp"
14+
android:title="@string/netspy_clear"
1315
app:showAsAction="always" />
14-
<item android:title="@string/netspy_browse_sql_database"
16+
<item
1517
android:id="@+id/browse_sql"
16-
app:showAsAction="never"
17-
android:visible="false"/>
18+
android:title="@string/netspy_browse_sql_database"
19+
android:visible="false"
20+
app:showAsAction="never" />
1821
</menu>

netspylib/src/main/res/values/strings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<string name="netspy_notification_title">Recording HTTP activity</string>
66
<string name="netspy_clear">Clear</string>
77
<string name="netspy_browse_sql_database">Browse SQLite database</string>
8-
<string name="netspy_overview">Overview</string>
9-
<string name="netspy_request">Request</string>
10-
<string name="netspy_response">Response</string>
8+
<string name="netspy_overview">概览</string>
9+
<string name="netspy_request">参数</string>
10+
<string name="netspy_response">返回</string>
1111
<string name="netspy_url">URL</string>
1212
<string name="netspy_method">Method</string>
1313
<string name="netspy_protocol">Protocol</string>

0 commit comments

Comments
 (0)