Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 8790b3b

Browse files
kunall17niftynei
authored andcommitted
Make private fields
1 parent b10cabf commit 8790b3b

26 files changed

+135
-133
lines changed

app/src/androidTest/java/com/zulip/android/activities/LoginDevAuthTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void setup() {
5858
closeSoftKeyboard();
5959
}
6060

61-
public void getDevEmails() {
61+
private void getDevEmails() {
6262

6363
closeSoftKeyboard();
6464
//Uncheck Checkbox
@@ -106,7 +106,7 @@ protected boolean matchesSafely(Button item) {
106106
}
107107

108108

109-
public void loginThroughDevMail() {
109+
private void loginThroughDevMail() {
110110

111111
//If EMAIL not specified click on first EMAIL.
112112
if (EMAIL_TEST.equals("")) {
@@ -121,7 +121,7 @@ public void loginThroughDevMail() {
121121
assertThat(ZulipApp.get().getEmail(), is(EMAIL_TEST));
122122
}
123123

124-
public static ViewAssertion hasItemsCount() {
124+
private static ViewAssertion hasItemsCount() {
125125
return new ViewAssertion() {
126126
@Override
127127
public void check(View view, NoMatchingViewException e) {

app/src/androidTest/java/com/zulip/android/test/UnsortedTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
public class UnsortedTests extends ActivityUnitTestCase<ZulipActivity> {
3030

31-
public static final String TESTUSER_EXAMPLE_COM = "[email protected]";
31+
private static final String TESTUSER_EXAMPLE_COM = "[email protected]";
3232
private ZulipApp app;
33-
RuntimeExceptionDao<Message, Object> messageDao;
33+
private RuntimeExceptionDao<Message, Object> messageDao;
3434

3535
public UnsortedTests() {
3636
super(ZulipActivity.class);
@@ -54,7 +54,7 @@ public void testMessageCreation() throws JSONException {
5454
5555
}
5656

57-
public void checkRanges(String rangestr) throws SQLException {
57+
private void checkRanges(String rangestr) throws SQLException {
5858
List<MessageRange> ranges = app.getDao(MessageRange.class)
5959
.queryBuilder().orderBy("low", true).query();
6060
String s = "";
@@ -214,7 +214,7 @@ public void testAGOMFetch() throws SQLException, InterruptedException,
214214

215215
}
216216

217-
protected Message sampleMessage(ZulipApp app, int id) throws SQLException {
217+
private Message sampleMessage(ZulipApp app, int id) throws SQLException {
218218
Message rtr = new Message(app);
219219
rtr.setSender(Person.getOrUpdate(app, "Test User",
220220
TESTUSER_EXAMPLE_COM, ""));
@@ -230,7 +230,7 @@ protected Message sampleMessage(ZulipApp app, int id) throws SQLException {
230230
* Run this before each test to set up the activity.
231231
*/
232232
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
233-
protected void prepTests() {
233+
private void prepTests() {
234234
setApplication(app);
235235
this.startActivity(new Intent(getInstrumentation().getTargetContext(),
236236
ZulipActivity.class), null, null);

app/src/androidTest/java/com/zulip/android/test/mutated/FakeAsyncGetOldMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class FakeAsyncGetOldMessages extends
1919
private boolean fmCalled;
2020
public List<Message> appendTheseMessages;
2121
public List<FakeAsyncGetOldMessages> recurseRequestsReceived;
22-
public MessageListFragment myfragment;
22+
private MessageListFragment myfragment;
2323

2424
public FakeAsyncGetOldMessages(MessageListFragment fragment) {
2525
super(fragment);

app/src/main/java/com/zulip/android/ZulipApp.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
import org.json.JSONException;
3737

3838
public class ZulipApp extends Application {
39-
public static final String API_KEY = "api_key";
40-
public static final String EMAIL = "email";
39+
private static final String API_KEY = "api_key";
40+
private static final String EMAIL = "email";
4141
private static ZulipApp instance;
4242
private static final String USER_AGENT = "ZulipAndroid";
4343
private static final String DEFAULT_SERVER_URL = "https://api.zulip.com/";
4444
private Person you;
4545
private SharedPreferences settings;
4646
private String api_key;
4747
private int max_message_id;
48-
DatabaseHelper databaseHelper;
49-
Set<String> mutedTopics;
48+
private DatabaseHelper databaseHelper;
49+
private Set<String> mutedTopics;
5050
private static final String MUTED_TOPIC_KEY = "mutedTopics";
5151

5252
/**
@@ -134,7 +134,7 @@ public int getAppVersion() {
134134
}
135135
}
136136

137-
public void afterLogin() {
137+
private void afterLogin() {
138138
String email = settings.getString(EMAIL, null);
139139
setEmail(email);
140140
setupEmoji();
@@ -358,7 +358,7 @@ public static ZulipApp getInstance() {
358358
return instance;
359359
}
360360

361-
public static void setInstance(ZulipApp instance) {
361+
private static void setInstance(ZulipApp instance) {
362362
ZulipApp.instance = instance;
363363
}
364364

app/src/main/java/com/zulip/android/activities/LoginActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public void onTaskFailure(String result) {
266266
}
267267
}
268268

269-
protected void openLegal() {
269+
private void openLegal() {
270270
Intent i = new Intent(this, LegalActivity.class);
271271
startActivityForResult(i, 0);
272272
}
@@ -301,7 +301,7 @@ public void onConnectionFailed(ConnectionResult result) {
301301
}
302302
}
303303

304-
public void setupGoogleSignIn() {
304+
private void setupGoogleSignIn() {
305305
if (mGoogleApiClient == null) {
306306
GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
307307
.requestEmail()

app/src/main/java/com/zulip/android/activities/MessageListFragment.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ public interface Listener {
7373

7474
public ZulipApp app;
7575

76-
SparseArray<Message> messageIndex;
76+
private SparseArray<Message> messageIndex;
7777
RecyclerMessageAdapter adapter;
78-
boolean loadingMessages = true;
78+
private boolean loadingMessages = true;
7979
// Whether we've loaded all available messages in that direction
80-
boolean loadedToTop = false;
81-
boolean loadedToBottom = false;
80+
private boolean loadedToTop = false;
81+
private boolean loadedToBottom = false;
8282

83-
List<Message> mutedMessages;
84-
int firstMessageId = -1;
85-
int lastMessageId = -1;
83+
private List<Message> mutedMessages;
84+
private int firstMessageId = -1;
85+
private int lastMessageId = -1;
8686

87-
boolean paused = false;
88-
boolean initialized = false;
89-
List<Message> messageList;
9087
TextView emptyTextView;
88+
private boolean paused = false;
89+
private boolean initialized = false;
90+
private List<Message> messageList;
9191

9292
public MessageListFragment() {
9393
app = ZulipApp.get();
@@ -425,7 +425,7 @@ public void onMessageError(LoadPosition pos) {
425425
// successful
426426
}
427427

428-
public void loadMoreMessages(final LoadPosition pos) {
428+
private void loadMoreMessages(final LoadPosition pos) {
429429
int above = 0;
430430
int below = 0;
431431
int around;
@@ -477,15 +477,15 @@ public void onTaskFailure(String result) {
477477
});
478478
}
479479

480-
public Boolean listHasMostRecent() {
480+
private Boolean listHasMostRecent() {
481481
return lastMessageId == app.getMaxMessageId();
482482
}
483483

484-
public void selectMessage(final Message message) {
484+
private void selectMessage(final Message message) {
485485
recyclerView.scrollToPosition(adapter.getItemIndex(message));
486486
}
487487

488-
public Message getMessageById(int id) {
488+
private Message getMessageById(int id) {
489489
return this.messageIndex.get(id);
490490
}
491491
}

0 commit comments

Comments
 (0)