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

Commit 5ec7739

Browse files
committed
JavaDocs for classes
1 parent f921a62 commit 5ec7739

21 files changed

+108
-3
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737
import org.json.JSONArray;
3838
import org.json.JSONException;
3939

40+
/**
41+
* Stores the global variables which are frequently used.
42+
*
43+
* {@link #max_message_id} This is the last Message ID stored in our database.
44+
* {@link #you} A reference to the user currently logged in.
45+
* {@link #api_key} Stores the API_KEY which was obtained from the server on successful authentication.
46+
* {@link #mutedTopics} Stores the concatenated ID for the stream and topic (Same strings as {@link Message#getIdForHolder()}
47+
* {@link #setupEmoji()} This is called to initialize and add records the existing emoticons in the assets folder.
48+
*/
4049
public class ZulipApp extends Application {
4150
private static final String API_KEY = "api_key";
4251
private static final String EMAIL = "email";

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
import java.util.List;
1717

18+
/**
19+
* Adapter used for the RecyclerView here{@link DevAuthActivity} for showing Emails in the DevAuthBackend
20+
*/
1821
class AuthEmailAdapter extends RecyclerView.Adapter<AuthEmailAdapter.AuthEmailViewHolder> {
1922

2023
private static final int VIEW_TYPE_HEADER = 0;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import java.util.ArrayList;
2121
import java.util.List;
2222

23+
/**
24+
* Activity where the Emails for the DevAuthBackend are displayed.
25+
*/
2326
public class DevAuthActivity extends Activity {
2427
private RecyclerView recyclerView;
2528
private ProgressDialog connectionProgressDialog;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import java.util.ArrayList;
1414
import java.util.List;
1515

16+
/**
17+
* Adapter for the left side drawer of the streams and subjects.
18+
*/
1619
public class ExpandableStreamDrawerAdapter extends SimpleCursorTreeAdapter {
1720

1821
public ExpandableStreamDrawerAdapter(final Context context, Cursor cursor, int groupLayout,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
import com.zulip.android.R;
99

10+
/**
11+
* Activity to display Legal Information
12+
*/
1013
public class LegalActivity extends Activity {
1114

1215
@Override

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636

3737
import java.util.List;
3838

39+
/**
40+
* Activity to Login through various backends on a specified server.
41+
* Currently supported LoginAuths are Emailbackend and DevAuthBackend.
42+
*/
3943
public class LoginActivity extends AppCompatActivity implements View.OnClickListener,
4044
GoogleApiClient.OnConnectionFailedListener {
4145
private static final String TAG = "LoginActivity";

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
import java.util.Arrays;
4242
import java.util.List;
4343

44-
44+
/**
45+
* This is a Fragment which holds the recyclerView for displaying the messages
46+
* initiated and called by {@link ZulipActivity}
47+
*/
4548
public class MessageListFragment extends Fragment implements MessageListener {
4649
private static final int PIXEL_OFFSET_MESSAGE_HEADERS = 24;
4750
private LinearLayoutManager linearLayoutManager;

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,19 @@
3939
import java.util.Arrays;
4040
import java.util.List;
4141

42-
42+
/**
43+
* An adapter to bind the messages to a RecyclerView.
44+
* This has two main ViewTypes {@link MessageHeaderParent.MessageHeaderHolder} and {@link MessageHolder}
45+
* Each Message is inserted to its MessageHeader which are distinguished by the {@link Message#getIdForHolder()}
46+
* saved in {@link MessageHeaderParent#getId()}
47+
*
48+
* There are two ways to insert a message in this adapter one {@link RecyclerMessageAdapter#addMessage(Message, int)}
49+
* and second one {@link RecyclerMessageAdapter#addNewMessage(Message)}
50+
* The first one is used to add old messages from the databases with {@link com.zulip.android.util.MessageListener.LoadPosition#BELOW}
51+
* and {@link com.zulip.android.util.MessageListener.LoadPosition#INITIAL}. This is for the threaded view and the messages are added
52+
* to the existing messageHeaderParents.
53+
* In addNewMessages the messages are loaded in the bottom and new headers are created if it does not matches the last header.
54+
*/
4355
public class RecyclerMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
4456

4557
public static final int VIEWTYPE_MESSAGE_HEADER = 1;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494

9595
import org.json.JSONObject;
9696

97+
/**
98+
* The main Activity responsible for holding the {@link MessageListFragment} which has the list to the
99+
* messages
100+
* */
97101
public class ZulipActivity extends AppCompatActivity implements
98102
MessageListFragment.Listener, NarrowListener {
99103

app/src/main/java/com/zulip/android/networking/AsyncCursorAdapterUpdater.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
import com.zulip.android.util.ZLog;
1010

11+
/**
12+
* A background task which asynchronously updates data.
13+
* Used here{@link com.zulip.android.activities.RefreshableCursorAdapter} for updating the
14+
* online people in the person (right) drawer.
15+
*/
1116
public class AsyncCursorAdapterUpdater extends
1217
AsyncTask<String, String, Cursor> {
1318

0 commit comments

Comments
 (0)