Browse Source

Code cleanup

pull/24/head
Ezerous 8 years ago
parent
commit
1cac15844c
  1. 13
      app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
  2. 5
      app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java
  3. 12
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  4. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  5. 30
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java
  6. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java
  7. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsAdapter.java
  8. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
  9. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java
  10. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  11. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
  12. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  13. 10
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java
  14. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java
  15. 17
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
  16. 10
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
  17. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java
  18. 10
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java
  19. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java
  20. 27
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  21. 50
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

13
app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java

@ -6,7 +6,6 @@ import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.CoordinatorLayout;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.webkit.WebView; import android.webkit.WebView;
@ -36,10 +35,10 @@ public class AboutActivity extends BaseActivity {
String versionName = BuildConfig.VERSION_NAME; String versionName = BuildConfig.VERSION_NAME;
//Initialize appbar //Initialize appbar
appBar = (AppBarLayout) findViewById(R.id.appbar); appBar = findViewById(R.id.appbar);
coordinatorLayout = (CoordinatorLayout) findViewById(R.id.main_content); coordinatorLayout = findViewById(R.id.main_content);
//Initialize toolbar //Initialize toolbar
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(R.string.about); toolbar.setTitle(R.string.about);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
@ -50,10 +49,10 @@ public class AboutActivity extends BaseActivity {
createDrawer(); createDrawer();
drawer.setSelection(ABOUT_ID); drawer.setSelection(ABOUT_ID);
final ScrollView mainContent = (ScrollView) findViewById(R.id.scrollview); final ScrollView mainContent = findViewById(R.id.scrollview);
trollGif = (FrameLayout) findViewById(R.id.trollPicFrame); trollGif = findViewById(R.id.trollPicFrame);
TextView tv = (TextView) findViewById(R.id.version); TextView tv = findViewById(R.id.version);
if (tv != null) if (tv != null)
tv.setText(getString(R.string.version, versionName)); tv.setText(getString(R.string.version, versionName));

5
app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java

@ -4,7 +4,6 @@ import android.content.Intent;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -34,7 +33,7 @@ public class BookmarkActivity extends BaseActivity {
setContentView(R.layout.activity_bookmark); setContentView(R.layout.activity_bookmark);
//Initialize toolbar //Initialize toolbar
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("Bookmarks"); toolbar.setTitle("Bookmarks");
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
@ -45,7 +44,7 @@ public class BookmarkActivity extends BaseActivity {
createDrawer(); createDrawer();
drawer.setSelection(BOOKMARKS_ID); drawer.setSelection(BOOKMARKS_ID);
LinearLayout bookmarksLinearView = (LinearLayout) findViewById(R.id.bookmarks_container); LinearLayout bookmarksLinearView = findViewById(R.id.bookmarks_container);
LayoutInflater layoutInflater = getLayoutInflater(); LayoutInflater layoutInflater = getLayoutInflater();
if(!getBoardsBookmarked().isEmpty()) { if(!getBoardsBookmarked().isEmpty()) {

12
app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java

@ -42,10 +42,10 @@ public class LoginActivity extends BaseActivity {
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
//Variables initialization //Variables initialization
inputUsername = (EditText) findViewById(R.id.username); inputUsername = findViewById(R.id.username);
inputPassword = (EditText) findViewById(R.id.password); inputPassword = findViewById(R.id.password);
btnLogin = (AppCompatButton) findViewById(R.id.btnLogin); btnLogin = findViewById(R.id.btnLogin);
AppCompatButton btnGuest = (AppCompatButton) findViewById(R.id.btnContinueAsGuest); AppCompatButton btnGuest = findViewById(R.id.btnContinueAsGuest);
//Login button Click Event //Login button Click Event
btnLogin.setOnClickListener(new View.OnClickListener() { btnLogin.setOnClickListener(new View.OnClickListener() {
@ -138,8 +138,8 @@ public class LoginActivity extends BaseActivity {
protected void onPreExecute() { //Show a progress dialog until done protected void onPreExecute() { //Show a progress dialog until done
btnLogin.setEnabled(false); //Login button shouldn't be pressed during this btnLogin.setEnabled(false); //Login button shouldn't be pressed during this
spinner = (LinearLayout) findViewById(R.id.login_progress_bar); spinner = findViewById(R.id.login_progress_bar);
loginContent = (ScrollView) findViewById(R.id.inner_scroll_view); loginContent = findViewById(R.id.inner_scroll_view);
View view = getCurrentFocus(); View view = getCurrentFocus();
if (view != null) { if (view != null) {

9
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java

@ -7,7 +7,6 @@ import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageButton; import android.widget.ImageButton;
@ -76,7 +75,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
} }
//Initializes graphics //Initializes graphics
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
if (boardTitle != null && !Objects.equals(boardTitle, "")) toolbar.setTitle(boardTitle); if (boardTitle != null && !Objects.equals(boardTitle, "")) toolbar.setTitle(boardTitle);
else toolbar.setTitle("Board"); else toolbar.setTitle("Board");
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
@ -89,8 +88,8 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
setBoardBookmark((ImageButton) findViewById(R.id.bookmark)); setBoardBookmark((ImageButton) findViewById(R.id.bookmark));
createDrawer(); createDrawer();
progressBar = (MaterialProgressBar) findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);
newTopicFAB = (FloatingActionButton) findViewById(R.id.board_fab); newTopicFAB = findViewById(R.id.board_fab);
newTopicFAB.setEnabled(false); newTopicFAB.setEnabled(false);
newTopicFAB.hide(); newTopicFAB.hide();
/*if (!sessionManager.isLoggedIn()) newTopicFAB.hide(); /*if (!sessionManager.isLoggedIn()) newTopicFAB.hide();
@ -124,7 +123,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
}*/ }*/
boardAdapter = new BoardAdapter(getApplicationContext(), parsedSubBoards, parsedTopics); boardAdapter = new BoardAdapter(getApplicationContext(), parsedSubBoards, parsedTopics);
RecyclerView mainContent = (RecyclerView) findViewById(R.id.board_recycler_view); RecyclerView mainContent = findViewById(R.id.board_recycler_view);
mainContent.setAdapter(boardAdapter); mainContent.setAdapter(boardAdapter);
final LinearLayoutManager layoutManager = new LinearLayoutManager(this); final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
mainContent.setLayoutManager(layoutManager); mainContent.setLayoutManager(layoutManager);

30
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java

@ -275,13 +275,13 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
SubBoardViewHolder(View board) { SubBoardViewHolder(View board) {
super(board); super(board);
boardRow = (LinearLayout) board.findViewById(R.id.child_board_row); boardRow = board.findViewById(R.id.child_board_row);
boardExpandable = (LinearLayout) board.findViewById(R.id.child_board_expandable); boardExpandable = board.findViewById(R.id.child_board_expandable);
showHideExpandable = (ImageButton) board.findViewById(R.id.child_board_expand_collapse_button); showHideExpandable = board.findViewById(R.id.child_board_expand_collapse_button);
boardTitle = (TextView) board.findViewById(R.id.child_board_title); boardTitle = board.findViewById(R.id.child_board_title);
boardMods = (TextView) board.findViewById(R.id.child_board_mods); boardMods = board.findViewById(R.id.child_board_mods);
boardStats = (TextView) board.findViewById(R.id.child_board_stats); boardStats = board.findViewById(R.id.child_board_stats);
boardLastPost = (TextView) board.findViewById(R.id.child_board_last_post); boardLastPost = board.findViewById(R.id.child_board_last_post);
} }
} }
@ -292,13 +292,13 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
TopicViewHolder(View topic) { TopicViewHolder(View topic) {
super(topic); super(topic);
topicRow = (LinearLayout) topic.findViewById(R.id.topic_row_linear); topicRow = topic.findViewById(R.id.topic_row_linear);
topicExpandable = (LinearLayout) topic.findViewById(R.id.topic_expandable); topicExpandable = topic.findViewById(R.id.topic_expandable);
showHideExpandable = (ImageButton) topic.findViewById(R.id.topic_expand_collapse_button); showHideExpandable = topic.findViewById(R.id.topic_expand_collapse_button);
topicSubject = (TextView) topic.findViewById(R.id.topic_subject); topicSubject = topic.findViewById(R.id.topic_subject);
topicStartedBy = (TextView) topic.findViewById(R.id.topic_started_by); topicStartedBy = topic.findViewById(R.id.topic_started_by);
topicStats = (TextView) topic.findViewById(R.id.topic_stats); topicStats = topic.findViewById(R.id.topic_stats);
topicLastPost = (TextView) topic.findViewById(R.id.topic_last_post); topicLastPost = topic.findViewById(R.id.topic_last_post);
} }
} }
@ -313,7 +313,7 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
LoadingViewHolder(View itemView) { LoadingViewHolder(View itemView) {
super(itemView); super(itemView);
progressBar = (MaterialProgressBar) itemView.findViewById(R.id.recycler_progress_bar); progressBar = itemView.findViewById(R.id.recycler_progress_bar);
} }
} }
} }

9
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java

@ -7,7 +7,6 @@ import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View; import android.view.View;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Toast; import android.widget.Toast;
@ -75,7 +74,7 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
} else downloadsUrl = downloadsIndexUrl; } else downloadsUrl = downloadsIndexUrl;
//Initialize toolbar //Initialize toolbar
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
if (downloadsTitle == null || Objects.equals(downloadsTitle, "")) if (downloadsTitle == null || Objects.equals(downloadsTitle, ""))
toolbar.setTitle("Downloads"); toolbar.setTitle("Downloads");
toolbar.setTitle(downloadsTitle); toolbar.setTitle(downloadsTitle);
@ -88,9 +87,9 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
createDrawer(); createDrawer();
drawer.setSelection(DOWNLOADS_ID); drawer.setSelection(DOWNLOADS_ID);
progressBar = (MaterialProgressBar) findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);
recyclerView = (RecyclerView) findViewById(R.id.downloads_recycler_view); recyclerView = findViewById(R.id.downloads_recycler_view);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getApplicationContext()); final LinearLayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(layoutManager); recyclerView.setLayoutManager(layoutManager);
@ -113,7 +112,7 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter.
} }
}); });
uploadFAB = (FloatingActionButton) findViewById(R.id.download_fab); uploadFAB = findViewById(R.id.download_fab);
uploadFAB.setEnabled(false); uploadFAB.setEnabled(false);
uploadFAB.hide(); uploadFAB.hide();

18
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsAdapter.java

@ -174,14 +174,14 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
DownloadViewHolder(View download) { DownloadViewHolder(View download) {
super(download); super(download);
upperLinear = (LinearLayout) download.findViewById(R.id.upper_linear); upperLinear = download.findViewById(R.id.upper_linear);
downloadRow = (LinearLayout) download.findViewById(R.id.download_row); downloadRow = download.findViewById(R.id.download_row);
informationExpandable = (LinearLayout) download.findViewById(R.id.child_board_expandable); informationExpandable = download.findViewById(R.id.child_board_expandable);
title = (TextView) download.findViewById(R.id.download_title); title = download.findViewById(R.id.download_title);
subTitle = (TextView) download.findViewById(R.id.download_sub_title); subTitle = download.findViewById(R.id.download_sub_title);
uploaderDate = (TextView) download.findViewById(R.id.download_extra_info); uploaderDate = download.findViewById(R.id.download_extra_info);
extraInfo = (TextView) download.findViewById(R.id.download_uploader_date); extraInfo = download.findViewById(R.id.download_uploader_date);
informationExpandableBtn = (ImageButton) download.findViewById(R.id.download_information_button); informationExpandableBtn = download.findViewById(R.id.download_information_button);
} }
} }
@ -190,7 +190,7 @@ class DownloadsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
LoadingViewHolder(View itemView) { LoadingViewHolder(View itemView) {
super(itemView); super(itemView);
progressBar = (MaterialProgressBar) itemView.findViewById(R.id.recycler_progress_bar); progressBar = itemView.findViewById(R.id.recycler_progress_bar);
} }
} }
} }

4
app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java

@ -73,10 +73,10 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF
//Set up the ViewPager with the sections adapter. //Set up the ViewPager with the sections adapter.
viewPager = (ViewPager) findViewById(R.id.container); viewPager = findViewById(R.id.container);
viewPager.setAdapter(sectionsPagerAdapter); viewPager.setAdapter(sectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
setMainActivity(this); setMainActivity(this);

4
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java

@ -70,7 +70,7 @@ class ForumAdapter extends ExpandableRecyclerAdapter<Category, Board, ForumAdapt
CategoryViewHolder(View itemView) { CategoryViewHolder(View itemView) {
super(itemView); super(itemView);
categoryTextview = (TextView) itemView.findViewById(R.id.category); categoryTextview = itemView.findViewById(R.id.category);
} }
void bind(Category category) { void bind(Category category) {
@ -86,7 +86,7 @@ class ForumAdapter extends ExpandableRecyclerAdapter<Category, Board, ForumAdapt
BoardViewHolder(View itemView) { BoardViewHolder(View itemView) {
super(itemView); super(itemView);
boardTextView = (TextView) itemView.findViewById(R.id.board); boardTextView = itemView.findViewById(R.id.board);
} }
void bind(final Board board) { void bind(final Board board) {

6
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -98,7 +98,7 @@ public class ForumFragment extends BaseFragment {
// Set the adapter // Set the adapter
if (rootView instanceof RelativeLayout) { if (rootView instanceof RelativeLayout) {
progressBar = (MaterialProgressBar) rootView.findViewById(R.id.progressBar); progressBar = rootView.findViewById(R.id.progressBar);
forumAdapter = new ForumAdapter(getContext(), categories, fragmentInteractionListener); forumAdapter = new ForumAdapter(getContext(), categories, fragmentInteractionListener);
forumAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() { forumAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() {
@Override @Override
@ -124,7 +124,7 @@ public class ForumFragment extends BaseFragment {
} }
}); });
CustomRecyclerView recyclerView = (CustomRecyclerView) rootView.findViewById(R.id.list); CustomRecyclerView recyclerView = rootView.findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext()); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext());
recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
@ -132,7 +132,7 @@ public class ForumFragment extends BaseFragment {
recyclerView.addItemDecoration(dividerItemDecoration); recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setAdapter(forumAdapter); recyclerView.setAdapter(forumAdapter);
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swiperefresh); swipeRefreshLayout = rootView.findViewById(R.id.swiperefresh);
swipeRefreshLayout.setOnRefreshListener( swipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() { new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override

6
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java

@ -77,9 +77,9 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> {
ViewHolder(View view) { ViewHolder(View view) {
super(view); super(view);
mView = view; mView = view;
mTitleView = (TextView) view.findViewById(R.id.title); mTitleView = view.findViewById(R.id.title);
mUserView = (TextView) view.findViewById(R.id.lastUser); mUserView = view.findViewById(R.id.lastUser);
mDateTimeView = (TextView) view.findViewById(R.id.dateTime); mDateTimeView = view.findViewById(R.id.dateTime);
} }
} }
} }

6
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -95,10 +95,10 @@ public class RecentFragment extends BaseFragment {
// Set the adapter // Set the adapter
if (rootView instanceof RelativeLayout) { if (rootView instanceof RelativeLayout) {
progressBar = (MaterialProgressBar) rootView.findViewById(R.id.progressBar); progressBar = rootView.findViewById(R.id.progressBar);
recentAdapter = new RecentAdapter(getActivity(), topicSummaries, fragmentInteractionListener); recentAdapter = new RecentAdapter(getActivity(), topicSummaries, fragmentInteractionListener);
CustomRecyclerView recyclerView = (CustomRecyclerView) rootView.findViewById(R.id.list); CustomRecyclerView recyclerView = rootView.findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext()); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext());
recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
@ -106,7 +106,7 @@ public class RecentFragment extends BaseFragment {
recyclerView.addItemDecoration(dividerItemDecoration); recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setAdapter(recentAdapter); recyclerView.setAdapter(recentAdapter);
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swiperefresh); swipeRefreshLayout = rootView.findViewById(R.id.swiperefresh);
swipeRefreshLayout.setOnRefreshListener( swipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() { new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override

10
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java

@ -114,9 +114,9 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
ViewHolder(View view) { ViewHolder(View view) {
super(view); super(view);
mView = view; mView = view;
mTitleView = (TextView) view.findViewById(R.id.title); mTitleView = view.findViewById(R.id.title);
mUserView = (TextView) view.findViewById(R.id.lastUser); mUserView = view.findViewById(R.id.lastUser);
mDateTimeView = (TextView) view.findViewById(R.id.dateTime); mDateTimeView = view.findViewById(R.id.dateTime);
} }
} }
@ -125,7 +125,7 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
EmptyViewHolder(View view) { EmptyViewHolder(View view) {
super(view); super(view);
text = (TextView) view.findViewById(R.id.text); text = view.findViewById(R.id.text);
} }
} }
@ -137,7 +137,7 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
MarkReadViewHolder(View view) { MarkReadViewHolder(View view) {
super(view); super(view);
mView = view; mView = view;
text = (TextView) view.findViewById(R.id.mark_read); text = view.findViewById(R.id.mark_read);
} }
} }

6
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

@ -98,7 +98,7 @@ public class UnreadFragment extends BaseFragment {
// Set the adapter // Set the adapter
if (rootView instanceof RelativeLayout) { if (rootView instanceof RelativeLayout) {
progressBar = (MaterialProgressBar) rootView.findViewById(R.id.progressBar); progressBar = rootView.findViewById(R.id.progressBar);
unreadAdapter = new UnreadAdapter(getActivity(), topicSummaries, unreadAdapter = new UnreadAdapter(getActivity(), topicSummaries,
fragmentInteractionListener, new UnreadAdapter.MarkReadInteractionListener() { fragmentInteractionListener, new UnreadAdapter.MarkReadInteractionListener() {
@Override @Override
@ -110,7 +110,7 @@ public class UnreadFragment extends BaseFragment {
} }
}); });
CustomRecyclerView recyclerView = (CustomRecyclerView) rootView.findViewById(R.id.list); CustomRecyclerView recyclerView = rootView.findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext()); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext());
recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
@ -118,7 +118,7 @@ public class UnreadFragment extends BaseFragment {
recyclerView.addItemDecoration(dividerItemDecoration); recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setAdapter(unreadAdapter); recyclerView.setAdapter(unreadAdapter);
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swiperefresh); swipeRefreshLayout = rootView.findViewById(R.id.swiperefresh);
swipeRefreshLayout.setOnRefreshListener( swipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() { new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override

17
app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java

@ -13,7 +13,6 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.content.res.ResourcesCompat; import android.support.v4.content.res.ResourcesCompat;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
@ -105,7 +104,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
profileUrl = extras.getString(BUNDLE_PROFILE_URL); profileUrl = extras.getString(BUNDLE_PROFILE_URL);
//Initializes graphic elements //Initializes graphic elements
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(null); toolbar.setTitle(null);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
@ -115,9 +114,9 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
createDrawer(); createDrawer();
progressBar = (MaterialProgressBar) findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);
thumbnailView = (ImageView) findViewById(R.id.user_thumbnail); thumbnailView = findViewById(R.id.user_thumbnail);
if (!Objects.equals(thumbnailUrl, "")) if (!Objects.equals(thumbnailUrl, ""))
//noinspection ConstantConditions //noinspection ConstantConditions
Picasso.with(this) Picasso.with(this)
@ -130,15 +129,15 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
, R.drawable.ic_default_user_thumbnail, null)) , R.drawable.ic_default_user_thumbnail, null))
.transform(new CircleTransform()) .transform(new CircleTransform())
.into(thumbnailView); .into(thumbnailView);
usernameView = (TextView) findViewById(R.id.profile_activity_username); usernameView = findViewById(R.id.profile_activity_username);
usernameView.setTypeface(Typeface.createFromAsset(this.getAssets() usernameView.setTypeface(Typeface.createFromAsset(this.getAssets()
, "fonts/fontawesome-webfont.ttf")); , "fonts/fontawesome-webfont.ttf"));
if (username != null && !Objects.equals(username, "")) usernameView.setText(username); if (username != null && !Objects.equals(username, "")) usernameView.setText(username);
personalTextView = (TextView) findViewById(R.id.profile_activity_personal_text); personalTextView = findViewById(R.id.profile_activity_personal_text);
viewPager = (ViewPager) findViewById(R.id.profile_tab_container); viewPager = findViewById(R.id.profile_tab_container);
pmFAB = (FloatingActionButton) findViewById(R.id.profile_fab); pmFAB = findViewById(R.id.profile_fab);
pmFAB.setEnabled(false); pmFAB.setEnabled(false);
pmFAB.hide(); pmFAB.hide();
/*if (!sessionManager.isLoggedIn()) pmFAB.hide(); /*if (!sessionManager.isLoggedIn()) pmFAB.hide();
@ -311,7 +310,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
} }
setupViewPager(viewPager, profilePage); setupViewPager(viewPager, profilePage);
TabLayout tabLayout = (TabLayout) findViewById(R.id.profile_tabs); TabLayout tabLayout = findViewById(R.id.profile_tabs);
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
if (tabSelect != 0) { if (tabSelect != 0) {
TabLayout.Tab tab = tabLayout.getTabAt(tabSelect); TabLayout.Tab tab = tabLayout.getTabAt(tabSelect);

10
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java

@ -97,10 +97,10 @@ class LatestPostsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
LatestPostViewHolder(View itemView) { LatestPostViewHolder(View itemView) {
super(itemView); super(itemView);
latestPostsRow = (RelativeLayout) itemView.findViewById(R.id.latest_posts_row); latestPostsRow = itemView.findViewById(R.id.latest_posts_row);
postTitle = (TextView) itemView.findViewById(R.id.title); postTitle = itemView.findViewById(R.id.title);
postDate = (TextView) itemView.findViewById(R.id.date); postDate = itemView.findViewById(R.id.date);
post = (WebView) itemView.findViewById(R.id.post); post = itemView.findViewById(R.id.post);
} }
} }
@ -109,7 +109,7 @@ class LatestPostsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
LoadingViewHolder(View itemView) { LoadingViewHolder(View itemView) {
super(itemView); super(itemView);
progressBar = (MaterialProgressBar) itemView.findViewById(R.id.recycler_progress_bar); progressBar = itemView.findViewById(R.id.recycler_progress_bar);
} }
} }
} }

4
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java

@ -84,7 +84,7 @@ public class LatestPostsFragment extends BaseFragment implements LatestPostsAdap
Bundle savedInstanceState) { Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_latest_posts, container, false); final View rootView = inflater.inflate(R.layout.fragment_latest_posts, container, false);
latestPostsAdapter = new LatestPostsAdapter(fragmentInteractionListener, parsedTopicSummaries); latestPostsAdapter = new LatestPostsAdapter(fragmentInteractionListener, parsedTopicSummaries);
RecyclerView mainContent = (RecyclerView) rootView.findViewById(R.id.profile_latest_posts_recycler); RecyclerView mainContent = rootView.findViewById(R.id.profile_latest_posts_recycler);
mainContent.setAdapter(latestPostsAdapter); mainContent.setAdapter(latestPostsAdapter);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); final LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
mainContent.setLayoutManager(layoutManager); mainContent.setLayoutManager(layoutManager);
@ -106,7 +106,7 @@ public class LatestPostsFragment extends BaseFragment implements LatestPostsAdap
} }
} }
}); });
progressBar = (MaterialProgressBar) rootView.findViewById(R.id.progressBar); progressBar = rootView.findViewById(R.id.progressBar);
return rootView; return rootView;
} }

10
app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java

@ -90,8 +90,8 @@ public class StatsFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_stats, container, false); final View rootView = inflater.inflate(R.layout.fragment_stats, container, false);
mainContent = (LinearLayout) rootView.findViewById(R.id.main_content); mainContent = rootView.findViewById(R.id.main_content);
progressBar = (MaterialProgressBar) rootView.findViewById(R.id.progressBar); progressBar = rootView.findViewById(R.id.progressBar);
if (haveParsed) if (haveParsed)
populateLayout(); populateLayout();
return rootView; return rootView;
@ -224,7 +224,7 @@ public class StatsFragment extends Fragment {
((TextView) mainContent.findViewById(R.id.posting_activity_by_time_title)) ((TextView) mainContent.findViewById(R.id.posting_activity_by_time_title))
.setText(postingActivityByTimeTitle); .setText(postingActivityByTimeTitle);
LineChart postingActivityByTimeChart = (LineChart) mainContent LineChart postingActivityByTimeChart = mainContent
.findViewById(R.id.posting_activity_by_time_chart); .findViewById(R.id.posting_activity_by_time_chart);
postingActivityByTimeChart.setDescription(null); postingActivityByTimeChart.setDescription(null);
postingActivityByTimeChart.getLegend().setEnabled(false); postingActivityByTimeChart.getLegend().setEnabled(false);
@ -257,7 +257,7 @@ public class StatsFragment extends Fragment {
((TextView) mainContent.findViewById(R.id.most_popular_boards_by_posts_title)) ((TextView) mainContent.findViewById(R.id.most_popular_boards_by_posts_title))
.setText(mostPopularBoardsByPostsTitle); .setText(mostPopularBoardsByPostsTitle);
HorizontalBarChart mostPopularBoardsByPostsChart = (HorizontalBarChart) mainContent. HorizontalBarChart mostPopularBoardsByPostsChart = mainContent.
findViewById(R.id.most_popular_boards_by_posts_chart); findViewById(R.id.most_popular_boards_by_posts_chart);
mostPopularBoardsByPostsChart.setDescription(null); mostPopularBoardsByPostsChart.setDescription(null);
mostPopularBoardsByPostsChart.getLegend().setEnabled(false); mostPopularBoardsByPostsChart.getLegend().setEnabled(false);
@ -298,7 +298,7 @@ public class StatsFragment extends Fragment {
((TextView) mainContent.findViewById(R.id.most_popular_boards_by_activity_title)) ((TextView) mainContent.findViewById(R.id.most_popular_boards_by_activity_title))
.setText(mostPopularBoardsByActivityTitle); .setText(mostPopularBoardsByActivityTitle);
HorizontalBarChart mostPopularBoardsByActivityChart = (HorizontalBarChart) mainContent. HorizontalBarChart mostPopularBoardsByActivityChart = mainContent.
findViewById(R.id.most_popular_boards_by_activity_chart); findViewById(R.id.most_popular_boards_by_activity_chart);
mostPopularBoardsByActivityChart.setDescription(null); mostPopularBoardsByActivityChart.setDescription(null);
mostPopularBoardsByActivityChart.getLegend().setEnabled(false); mostPopularBoardsByActivityChart.getLegend().setEnabled(false);

2
app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java

@ -77,7 +77,7 @@ public class SummaryFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_summary, container, false); final View rootView = inflater.inflate(R.layout.fragment_summary, container, false);
mainContent = (LinearLayout) rootView.findViewById(R.id.profile_activity_content); mainContent = rootView.findViewById(R.id.profile_activity_content);
if (!parsedProfileSummaryData.isEmpty() && isAdded()) if (!parsedProfileSummaryData.isEmpty() && isAdded())
populateLayout(); populateLayout();
return rootView; return rootView;

27
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -11,7 +11,6 @@ import android.os.Handler;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.Html; import android.text.Html;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.TextUtils; import android.text.TextUtils;
@ -143,8 +142,8 @@ public class TopicActivity extends BaseActivity {
thisPageBookmark = new Bookmark(topicTitle, ThmmyPage.getTopicId(topicPageUrl)); thisPageBookmark = new Bookmark(topicTitle, ThmmyPage.getTopicId(topicPageUrl));
//Initializes graphics //Initializes graphics
toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbarTitle = (TextView) toolbar.findViewById(R.id.toolbar_title); toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
toolbarTitle.setSingleLine(true); toolbarTitle.setSingleLine(true);
toolbarTitle.setEllipsize(TextUtils.TruncateAt.MARQUEE); toolbarTitle.setEllipsize(TextUtils.TruncateAt.MARQUEE);
toolbarTitle.setMarqueeRepeatLimit(-1); toolbarTitle.setMarqueeRepeatLimit(-1);
@ -162,11 +161,11 @@ public class TopicActivity extends BaseActivity {
createDrawer(); createDrawer();
progressBar = (MaterialProgressBar) findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);
postsList = new ArrayList<>(); postsList = new ArrayList<>();
recyclerView = (RecyclerView) findViewById(R.id.topic_recycler_view); recyclerView = findViewById(R.id.topic_recycler_view);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
recyclerView.setOnTouchListener( recyclerView.setOnTouchListener(
new View.OnTouchListener() { new View.OnTouchListener() {
@ -183,9 +182,9 @@ public class TopicActivity extends BaseActivity {
topicAdapter = new TopicAdapter(this, postsList, topicTask); topicAdapter = new TopicAdapter(this, postsList, topicTask);
recyclerView.setAdapter(topicAdapter); recyclerView.setAdapter(topicAdapter);
replyFAB = (FloatingActionButton) findViewById(R.id.topic_fab); replyFAB = findViewById(R.id.topic_fab);
replyFAB.setEnabled(false); replyFAB.setEnabled(false);
bottomNavBar = (LinearLayout) findViewById(R.id.bottom_navigation_bar); bottomNavBar = findViewById(R.id.bottom_navigation_bar);
if (!sessionManager.isLoggedIn()) replyFAB.hide(); if (!sessionManager.isLoggedIn()) replyFAB.hide();
else { else {
replyFAB.setOnClickListener(new View.OnClickListener() { replyFAB.setOnClickListener(new View.OnClickListener() {
@ -204,11 +203,11 @@ public class TopicActivity extends BaseActivity {
} }
//Sets bottom navigation bar //Sets bottom navigation bar
firstPage = (ImageButton) findViewById(R.id.page_first_button); firstPage = findViewById(R.id.page_first_button);
previousPage = (ImageButton) findViewById(R.id.page_previous_button); previousPage = findViewById(R.id.page_previous_button);
pageIndicator = (TextView) findViewById(R.id.page_indicator); pageIndicator = findViewById(R.id.page_indicator);
nextPage = (ImageButton) findViewById(R.id.page_next_button); nextPage = findViewById(R.id.page_next_button);
lastPage = (ImageButton) findViewById(R.id.page_last_button); lastPage = findViewById(R.id.page_last_button);
initDecrementButton(firstPage, LARGE_STEP); initDecrementButton(firstPage, LARGE_STEP);
initDecrementButton(previousPage, SMALL_STEP); initDecrementButton(previousPage, SMALL_STEP);
@ -243,10 +242,10 @@ public class TopicActivity extends BaseActivity {
LinearLayout infoDialog = (LinearLayout) inflater.inflate(R.layout.dialog_topic_info LinearLayout infoDialog = (LinearLayout) inflater.inflate(R.layout.dialog_topic_info
, null); , null);
((TextView) infoDialog.findViewById(R.id.dialog_title)).setText("Info"); ((TextView) infoDialog.findViewById(R.id.dialog_title)).setText("Info");
TextView treeAndMods = (TextView) infoDialog.findViewById(R.id.topic_tree_and_mods); TextView treeAndMods = infoDialog.findViewById(R.id.topic_tree_and_mods);
treeAndMods.setText(topicTreeAndMods); treeAndMods.setText(topicTreeAndMods);
treeAndMods.setMovementMethod(LinkMovementMethod.getInstance()); treeAndMods.setMovementMethod(LinkMovementMethod.getInstance());
TextView usersViewing = (TextView) infoDialog.findViewById(R.id.users_viewing); TextView usersViewing = infoDialog.findViewById(R.id.users_viewing);
usersViewing.setText(topicViewers); usersViewing.setText(topicViewers);
usersViewing.setMovementMethod(LinkMovementMethod.getInstance()); usersViewing.setMovementMethod(LinkMovementMethod.getInstance());

50
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -139,7 +139,7 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
inflate(R.layout.activity_topic_quick_reply_row, parent, false); inflate(R.layout.activity_topic_quick_reply_row, parent, false);
view.findViewById(R.id.quick_reply_submit).setEnabled(true); view.findViewById(R.id.quick_reply_submit).setEnabled(true);
final EditText quickReplyText = (EditText) view.findViewById(R.id.quick_reply_text); final EditText quickReplyText = view.findViewById(R.id.quick_reply_text);
quickReplyText.setFocusableInTouchMode(true); quickReplyText.setFocusableInTouchMode(true);
quickReplyText.setOnFocusChangeListener(new View.OnFocusChangeListener() { quickReplyText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override @Override
@ -511,29 +511,29 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
super(view); super(view);
//Initializes layout's graphic elements //Initializes layout's graphic elements
//Standard stuff //Standard stuff
cardView = (CardView) view.findViewById(R.id.card_view); cardView = view.findViewById(R.id.card_view);
cardChildLinear = (LinearLayout) view.findViewById(R.id.card_child_linear); cardChildLinear = view.findViewById(R.id.card_child_linear);
postDateAndNumber = (FrameLayout) view.findViewById(R.id.post_date_and_number_exp); postDateAndNumber = view.findViewById(R.id.post_date_and_number_exp);
postDate = (TextView) view.findViewById(R.id.post_date); postDate = view.findViewById(R.id.post_date);
postNum = (TextView) view.findViewById(R.id.post_number); postNum = view.findViewById(R.id.post_number);
thumbnail = (ImageView) view.findViewById(R.id.thumbnail); thumbnail = view.findViewById(R.id.thumbnail);
username = (TextView) view.findViewById(R.id.username); username = view.findViewById(R.id.username);
subject = (TextView) view.findViewById(R.id.subject); subject = view.findViewById(R.id.subject);
post = (WebView) view.findViewById(R.id.post); post = view.findViewById(R.id.post);
post.setBackgroundColor(Color.argb(1, 255, 255, 255)); post.setBackgroundColor(Color.argb(1, 255, 255, 255));
quoteToggle = (ImageButton) view.findViewById(R.id.toggle_quote_button); quoteToggle = view.findViewById(R.id.toggle_quote_button);
bodyFooterDivider = view.findViewById(R.id.body_footer_divider); bodyFooterDivider = view.findViewById(R.id.body_footer_divider);
postFooter = (LinearLayout) view.findViewById(R.id.post_footer); postFooter = view.findViewById(R.id.post_footer);
//User's extra info //User's extra info
header = (RelativeLayout) view.findViewById(R.id.header); header = view.findViewById(R.id.header);
userExtraInfo = (LinearLayout) view.findViewById(R.id.user_extra_info); userExtraInfo = view.findViewById(R.id.user_extra_info);
specialRank = (TextView) view.findViewById(R.id.special_rank); specialRank = view.findViewById(R.id.special_rank);
rank = (TextView) view.findViewById(R.id.rank); rank = view.findViewById(R.id.rank);
gender = (TextView) view.findViewById(R.id.gender); gender = view.findViewById(R.id.gender);
numberOfPosts = (TextView) view.findViewById(R.id.number_of_posts); numberOfPosts = view.findViewById(R.id.number_of_posts);
personalText = (TextView) view.findViewById(R.id.personal_text); personalText = view.findViewById(R.id.personal_text);
stars = (TextView) view.findViewById(R.id.stars); stars = view.findViewById(R.id.stars);
} }
} }
@ -550,15 +550,15 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
QuickReplyViewHolder(View quickReply, CustomEditTextListener replySubject QuickReplyViewHolder(View quickReply, CustomEditTextListener replySubject
, CustomEditTextListener replyText) { , CustomEditTextListener replyText) {
super(quickReply); super(quickReply);
thumbnail = (ImageView) quickReply.findViewById(R.id.thumbnail); thumbnail = quickReply.findViewById(R.id.thumbnail);
username = (TextView) quickReply.findViewById(R.id.username); username = quickReply.findViewById(R.id.username);
this.quickReply = (EditText) quickReply.findViewById(R.id.quick_reply_text); this.quickReply = quickReply.findViewById(R.id.quick_reply_text);
this.replyText = replyText; this.replyText = replyText;
this.quickReply.addTextChangedListener(replyText); this.quickReply.addTextChangedListener(replyText);
quickReplySubject = (EditText) quickReply.findViewById(R.id.quick_reply_subject); quickReplySubject = quickReply.findViewById(R.id.quick_reply_subject);
this.replySubject = replySubject; this.replySubject = replySubject;
quickReplySubject.addTextChangedListener(replySubject); quickReplySubject.addTextChangedListener(replySubject);
submitButton = (AppCompatImageButton) quickReply.findViewById(R.id.quick_reply_submit); submitButton = quickReply.findViewById(R.id.quick_reply_submit);
} }
} }

Loading…
Cancel
Save