diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index eb1e9854..35b6c054 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -49,7 +49,7 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.main.MainActivity"/>
-
+
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
index 500aeb59..de0c32fd 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
@@ -1,7 +1,6 @@
package gr.thmmy.mthmmy.activities;
import android.content.pm.ActivityInfo;
-import android.content.res.Configuration;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v4.widget.DrawerLayout;
@@ -15,6 +14,7 @@ import android.widget.Toast;
import gr.thmmy.mthmmy.BuildConfig;
import gr.thmmy.mthmmy.R;
+import gr.thmmy.mthmmy.activities.base.BaseActivity;
public class AboutActivity extends BaseActivity {
private static final int TIME_INTERVAL = 1000;
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
index 054f95cb..0be2b11e 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
@@ -12,6 +12,7 @@ import android.widget.ScrollView;
import android.widget.Toast;
import gr.thmmy.mthmmy.R;
+import gr.thmmy.mthmmy.activities.base.BaseActivity;
import gr.thmmy.mthmmy.activities.main.MainActivity;
import mthmmy.utils.Report;
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/BaseActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseActivity.java
similarity index 98%
rename from app/src/main/java/gr/thmmy/mthmmy/activities/BaseActivity.java
rename to app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseActivity.java
index 2b86b6e5..5fdb737a 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/BaseActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseActivity.java
@@ -1,4 +1,4 @@
-package gr.thmmy.mthmmy.activities;
+package gr.thmmy.mthmmy.activities.base;
import android.app.ProgressDialog;
import android.content.Context;
@@ -37,13 +37,15 @@ import com.squareup.picasso.Picasso;
import java.util.concurrent.TimeUnit;
import gr.thmmy.mthmmy.R;
+import gr.thmmy.mthmmy.activities.AboutActivity;
+import gr.thmmy.mthmmy.activities.LoginActivity;
import gr.thmmy.mthmmy.activities.main.MainActivity;
import gr.thmmy.mthmmy.session.SessionManager;
import okhttp3.OkHttpClient;
import static gr.thmmy.mthmmy.session.SessionManager.LOGGED_IN;
-public class BaseActivity extends AppCompatActivity
+public abstract class BaseActivity extends AppCompatActivity
{
// Client & Cookies
protected static OkHttpClient client;
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseFragment.java
new file mode 100644
index 00000000..efa61dba
--- /dev/null
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseFragment.java
@@ -0,0 +1,86 @@
+package gr.thmmy.mthmmy.activities.base;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+
+import mthmmy.utils.Report;
+import okhttp3.OkHttpClient;
+
+public abstract class BaseFragment extends Fragment {
+ protected static final String ARG_SECTION_NUMBER = "SectionNumber";
+ protected static final String ARG_TAG = "FragmentTAG";
+
+ protected FragmentInteractionListener fragmentInteractionListener;
+
+ private String TAG;
+ protected int sectionNumber;
+ protected OkHttpClient client;
+
+ @Override
+ public void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ TAG = getArguments().getString(ARG_TAG);
+ sectionNumber = getArguments().getInt(ARG_SECTION_NUMBER);
+ client = BaseActivity.getClient();
+ Report.d(TAG, "onCreate");
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ Report.d(TAG, "onStart");
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ Report.d(TAG, "onResume");
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ Report.d(TAG, "onPause");
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ Report.d(TAG, "onStop");
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ cancelTask();
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+ if (context instanceof FragmentInteractionListener) {
+ fragmentInteractionListener = (FragmentInteractionListener) context;
+
+ } else {
+ throw new RuntimeException(context.toString()
+ + " must implement OnFragmentInteractionListener");
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ super.onDetach();
+ fragmentInteractionListener = null;
+ }
+
+ protected abstract void cancelTask();
+
+ /**
+ * This interface MUST be extended by the fragment subclass AND implemented by
+ * the activity that contains it, to allow communication upon interaction,
+ * between the fragment and the activity/ other fragments
+ */
+ public interface FragmentInteractionListener {}
+}
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
index 4f30b797..9362f14a 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
@@ -11,8 +11,8 @@ import android.support.v7.widget.Toolbar;
import android.widget.Toast;
import gr.thmmy.mthmmy.R;
-import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity;
+import gr.thmmy.mthmmy.activities.base.BaseActivity;
import gr.thmmy.mthmmy.activities.main.forum.ForumFragment;
import gr.thmmy.mthmmy.activities.main.recent.RecentFragment;
import gr.thmmy.mthmmy.activities.topic.TopicActivity;
@@ -20,7 +20,7 @@ import gr.thmmy.mthmmy.data.TopicSummary;
import static gr.thmmy.mthmmy.session.SessionManager.LOGGED_OUT;
-public class MainActivity extends BaseActivity implements RecentFragment.OnListFragmentInteractionListener, ForumFragment.OnListFragmentInteractionListener {
+public class MainActivity extends BaseActivity implements RecentFragment.RecentFragmentInteractionListener, ForumFragment.ForumFragmentInteractionListener {
//----------------------------------------CLASS VARIABLES-----------------------------------------
private static final String TAG = "MainActivity";
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java
index 9e7d54c3..9fe11cf1 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumAdapter.java
@@ -9,21 +9,21 @@ import android.widget.TextView;
import java.util.List;
import gr.thmmy.mthmmy.R;
-import gr.thmmy.mthmmy.activities.main.recent.RecentFragment;
+import gr.thmmy.mthmmy.activities.base.BaseFragment;
import gr.thmmy.mthmmy.data.TopicSummary;
/**
* {@link RecyclerView.Adapter} that can display a {@link TopicSummary} and makes a call to the
- * specified {@link RecentFragment.OnListFragmentInteractionListener}.
+ * specified {@link ForumFragment.ForumFragmentInteractionListener}.
*/
-public class ForumAdapter extends RecyclerView.Adapter {
+class ForumAdapter extends RecyclerView.Adapter {
private final List recentList;
- private final ForumFragment.OnListFragmentInteractionListener mListener;
+ private final ForumFragment.ForumFragmentInteractionListener mListener;
- public ForumAdapter(List topicSummaryList, ForumFragment.OnListFragmentInteractionListener listener) {
+ ForumAdapter(List topicSummaryList, BaseFragment.FragmentInteractionListener listener) {
this.recentList = topicSummaryList;
- mListener = listener;
+ mListener = (ForumFragment.ForumFragmentInteractionListener)listener;
}
@@ -64,24 +64,19 @@ public class ForumAdapter extends RecyclerView.Adapter
return recentList.size();
}
- public class ViewHolder extends RecyclerView.ViewHolder {
- public final View mView;
- public final TextView mTitleView;
- public final TextView mUserView;
- public final TextView mDateTimeView;
+ class ViewHolder extends RecyclerView.ViewHolder {
+ final View mView;
+ final TextView mTitleView;
+ final TextView mUserView;
+ final TextView mDateTimeView;
public TopicSummary topic;
- public ViewHolder(View view) {
+ ViewHolder(View view) {
super(view);
mView = view;
mTitleView = (TextView) view.findViewById(R.id.title);
mUserView = (TextView) view.findViewById(R.id.lastUser);
mDateTimeView = (TextView) view.findViewById(R.id.dateTime);
}
-
-// @Override
-// public String toString() {
-// return super.toString() + " '" + mContentView.getText() + "'";
-// }
}
}
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
index 798dfd0f..f4f48bc6 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
@@ -1,9 +1,7 @@
package gr.thmmy.mthmmy.activities.main.forum;
-import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
@@ -24,30 +22,27 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gr.thmmy.mthmmy.R;
-import gr.thmmy.mthmmy.activities.BaseActivity;
+import gr.thmmy.mthmmy.activities.base.BaseFragment;
import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CustomRecyclerView;
import mthmmy.utils.Report;
import okhttp3.HttpUrl;
-import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
/**
- * A simple {@link Fragment} subclass.
+ * A {@link BaseFragment} subclass.
* Activities that contain this fragment must implement the
- * {@link ForumFragment.OnListFragmentInteractionListener} interface
+ * {@link ForumFragment.ForumFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link ForumFragment#newInstance} factory method to
* create an instance of this fragment.
*/
-public class ForumFragment extends Fragment
+public class ForumFragment extends BaseFragment
{
private static final String TAG = "ForumFragment";
// Fragment initialization parameters, e.g. ARG_SECTION_NUMBER
- private static final String ARG_SECTION_NUMBER = "SectionNumber";
- private int sectionNumber;
private ProgressBar progressBar;
private SwipeRefreshLayout swipeRefreshLayout;
@@ -55,13 +50,10 @@ public class ForumFragment extends Fragment
private List topicSummaries;
- private OnListFragmentInteractionListener mListener;
-
- private OkHttpClient client;
+ private ForumTask forumTask;
// Required empty public constructor
- public ForumFragment() {
- }
+ public ForumFragment() {}
/**
* Use ONLY this factory method to create a new instance of
@@ -73,28 +65,16 @@ public class ForumFragment extends Fragment
public static ForumFragment newInstance(int sectionNumber) {
ForumFragment fragment = new ForumFragment();
Bundle args = new Bundle();
+ args.putString(ARG_TAG, TAG);
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
- public int getSectionNumber() {
- return sectionNumber;
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- sectionNumber = getArguments().getInt(ARG_SECTION_NUMBER);
-
- client = BaseActivity.getClient();
-
topicSummaries = new ArrayList<>();
-
-
- if (sectionNumber == 1) //?
- Report.d(TAG, "onCreate");
}
@Override
@@ -102,43 +82,11 @@ public class ForumFragment extends Fragment
super.onActivityCreated(savedInstanceState);
if (sectionNumber == 1)//temp
{
- if (topicSummaries.isEmpty())
- new RecentTask().execute();
-
-
+ if (topicSummaries.isEmpty()) new ForumTask().execute();
}
Report.d(TAG, "onActivityCreated");
}
- @Override
- public void onStart() {
- super.onStart();
- if (sectionNumber == 1)
- Report.d(TAG, "onStart");
- }
-
- @Override
- public void onResume() {
- super.onResume();
- if (sectionNumber == 1)
- Report.d(TAG, "onResume");
- }
-
- @Override
- public void onPause() {
- super.onPause();
- if (sectionNumber == 1)
- Report.d(TAG, "onPause");
- }
-
- @Override
- public void onStop() {
- super.onStop();
- if (sectionNumber == 1)
- Report.d(TAG, "onStop");
- }
-
-
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@@ -148,7 +96,7 @@ public class ForumFragment extends Fragment
// Set the adapter
if (rootView instanceof RelativeLayout) {
progressBar = (ProgressBar) rootView.findViewById(R.id.progressBar);
- forumAdapter = new ForumAdapter(topicSummaries, mListener);
+ forumAdapter = new ForumAdapter(topicSummaries, fragmentInteractionListener);
CustomRecyclerView recyclerView = (CustomRecyclerView) rootView.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(rootView.findViewById(R.id.list).getContext()));
@@ -159,52 +107,32 @@ public class ForumFragment extends Fragment
new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
- new RecentTask().execute();
-
+ if (forumTask != null && forumTask.getStatus() != AsyncTask.Status.RUNNING) {
+ forumTask = new ForumTask();
+ forumTask.execute();
+ }
}
}
);
-
-
}
-
return rootView;
}
@Override
- public void onAttach(Context context) {
- super.onAttach(context);
- if (context instanceof OnListFragmentInteractionListener) {
- mListener = (OnListFragmentInteractionListener) context;
-
- } else {
- throw new RuntimeException(context.toString()
- + " must implement OnFragmentInteractionListener");
- }
- }
-
- @Override
- public void onDetach() {
- super.onDetach();
- mListener = null;
+ protected void cancelTask() {
+ if(forumTask!=null&&forumTask.getStatus()!= AsyncTask.Status.RUNNING)
+ forumTask.cancel(true);
}
- /**
- * This interface must be implemented by activities that contain this
- * fragment to allow an interaction in this fragment to be communicated
- * to the activity and potentially other fragments contained in that
- * activity.
- */
- public interface OnListFragmentInteractionListener {
- // TODO: Update argument type and name
+ public interface ForumFragmentInteractionListener extends FragmentInteractionListener{
void onFragmentInteraction(TopicSummary topicSummary);
}
//---------------------------------------ASYNC TASK-----------------------------------
- public class RecentTask extends AsyncTask {
- private static final String TAG = "RecentTask";
+ public class ForumTask extends AsyncTask {
+ private static final String TAG = "ForumTask";
private final HttpUrl thmmyUrl = SessionManager.indexUrl;
private Document document;
@@ -226,10 +154,10 @@ public class ForumFragment extends Fragment
parse(document);
return 0;
} catch (IOException e) {
- Report.d("DEB", "ERROR", e);
+ Report.d(TAG, "Network Error", e);
return 1;
} catch (Exception e) {
- Report.d("DEB", "ERROR", e);
+ Report.d(TAG, "ERROR", e);
return 2;
}
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
index 2a2f3602..f5460ccb 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
@@ -9,20 +9,21 @@ import android.widget.TextView;
import java.util.List;
import gr.thmmy.mthmmy.R;
+import gr.thmmy.mthmmy.activities.base.BaseFragment;
import gr.thmmy.mthmmy.data.TopicSummary;
/**
* {@link RecyclerView.Adapter} that can display a {@link TopicSummary} and makes a call to the
- * specified {@link RecentFragment.OnListFragmentInteractionListener}.
+ * specified {@link RecentFragment.RecentFragmentInteractionListener}.
*/
-public class RecentAdapter extends RecyclerView.Adapter {
+class RecentAdapter extends RecyclerView.Adapter {
private final List recentList;
- private final RecentFragment.OnListFragmentInteractionListener mListener;
+ private final RecentFragment.RecentFragmentInteractionListener mListener;
- public RecentAdapter(List topicSummaryList, RecentFragment.OnListFragmentInteractionListener listener) {
+ RecentAdapter(List topicSummaryList, BaseFragment.FragmentInteractionListener listener) {
this.recentList = topicSummaryList;
- mListener = listener;
+ mListener = (RecentFragment.RecentFragmentInteractionListener) listener;
}
@@ -63,24 +64,19 @@ public class RecentAdapter extends RecyclerView.Adapter topicSummaries;
- private OnListFragmentInteractionListener mListener;
-
- private OkHttpClient client;
-
private RecentTask recentTask;
// Required empty public constructor
- public RecentFragment() {
- }
+ public RecentFragment() {}
/**
* Use ONLY this factory method to create a new instance of
@@ -74,28 +64,16 @@ public class RecentFragment extends Fragment {
public static RecentFragment newInstance(int sectionNumber) {
RecentFragment fragment = new RecentFragment();
Bundle args = new Bundle();
+ args.putString(ARG_TAG, TAG);
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
- public int getSectionNumber() {
- return sectionNumber;
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- sectionNumber = getArguments().getInt(ARG_SECTION_NUMBER);
-
- client = BaseActivity.getClient();
-
topicSummaries = new ArrayList<>();
-
-
- if (sectionNumber == 1) //?
- Report.d(TAG, "onCreate");
}
@Override
@@ -113,34 +91,6 @@ public class RecentFragment extends Fragment {
Report.d(TAG, "onActivityCreated");
}
- @Override
- public void onStart() {
- super.onStart();
- if (sectionNumber == 1)
- Report.d(TAG, "onStart");
- }
-
- @Override
- public void onResume() {
- super.onResume();
- if (sectionNumber == 1)
- Report.d(TAG, "onResume");
- }
-
- @Override
- public void onPause() {
- super.onPause();
- if (sectionNumber == 1)
- Report.d(TAG, "onPause");
- }
-
- @Override
- public void onStop() {
- super.onStop();
- if (sectionNumber == 1)
- Report.d(TAG, "onStop");
- }
-
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -151,7 +101,7 @@ public class RecentFragment extends Fragment {
// Set the adapter
if (rootView instanceof RelativeLayout) {
progressBar = (ProgressBar) rootView.findViewById(R.id.progressBar);
- recentAdapter = new RecentAdapter(topicSummaries, mListener);
+ recentAdapter = new RecentAdapter(topicSummaries, fragmentInteractionListener);
CustomRecyclerView recyclerView = (CustomRecyclerView) rootView.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(rootView.findViewById(R.id.list).getContext()));
@@ -162,63 +112,33 @@ public class RecentFragment extends Fragment {
new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
- if(recentTask!=null&&recentTask.getStatus()!= AsyncTask.Status.RUNNING) {
+ if (recentTask != null && recentTask.getStatus() != AsyncTask.Status.RUNNING) {
recentTask = new RecentTask();
recentTask.execute();
}
-
}
}
);
-
-
}
return rootView;
}
@Override
- public void onAttach(Context context) {
- super.onAttach(context);
- if (context instanceof OnListFragmentInteractionListener) {
- mListener = (OnListFragmentInteractionListener) context;
-
- } else {
- throw new RuntimeException(context.toString()
- + " must implement OnFragmentInteractionListener");
- }
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
+ protected void cancelTask() {
if(recentTask!=null&&recentTask.getStatus()!= AsyncTask.Status.RUNNING)
recentTask.cancel(true);
}
-
- @Override
- public void onDetach() {
- super.onDetach();
- mListener = null;
- }
-
- /**
- * This interface must be implemented by activities that contain this
- * fragment to allow an interaction in this fragment to be communicated
- * to the activity and potentially other fragments contained in that
- * activity.
- */
- public interface OnListFragmentInteractionListener {
- // TODO: Update argument type and name
+ public interface RecentFragmentInteractionListener extends FragmentInteractionListener {
void onFragmentInteraction(TopicSummary topicSummary);
}
//---------------------------------------ASYNC TASK-----------------------------------
public class RecentTask extends AsyncTask {
- private static final String TAG = "RecentTask";
+ private static final String TAG = "ForumTask";
private final HttpUrl thmmyUrl = SessionManager.indexUrl;
private Document document;
@@ -239,7 +159,7 @@ public class RecentFragment extends Fragment {
parse(document);
return 0;
} catch (IOException e) {
- Report.d(TAG, "ERROR", e);
+ Report.d(TAG, "Network Error", e);
return 1;
} catch (Exception e) {
Report.d(TAG, "ERROR", e);
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
index 56bf936d..f7aa90ee 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
@@ -10,7 +10,6 @@ import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.Html;
-import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -28,8 +27,8 @@ import java.util.ArrayList;
import javax.net.ssl.SSLHandshakeException;
import gr.thmmy.mthmmy.R;
-import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity;
+import gr.thmmy.mthmmy.activities.base.BaseActivity;
import gr.thmmy.mthmmy.utils.CircleTransform;
import mthmmy.utils.Report;
import okhttp3.Request;
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileParser.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileParser.java
index 830d260e..29a7e934 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileParser.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileParser.java
@@ -1,7 +1,5 @@
package gr.thmmy.mthmmy.activities.profile;
-import android.util.Log;
-
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
index 2d0716e5..0c6358d8 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
@@ -31,16 +31,13 @@ import org.jsoup.nodes.Document;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.net.SocketException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
-import javax.net.ssl.SSLHandshakeException;
-
import gr.thmmy.mthmmy.R;
-import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity;
+import gr.thmmy.mthmmy.activities.base.BaseActivity;
import gr.thmmy.mthmmy.data.Post;
import mthmmy.utils.Report;
import okhttp3.Call;