diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java index dfd1d38e..69739514 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java @@ -290,7 +290,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo pUnread = true; } pStartedBy = topicColumns.get(3).text(); - pStats = "Replies " + topicColumns.get(4).text() + ", Views " + topicColumns.get(5).text(); + pStats = "Replies: " + topicColumns.get(4).text() + ", Views: " + topicColumns.get(5).text(); pLastPost = topicColumns.last().text(); if (pLastPost.contains("by")) { diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java index 97857440..6c5e50db 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java @@ -90,7 +90,7 @@ class BoardAdapter extends RecyclerView.Adapter { return new TitlesViewHolder(subBoardTitle); } else if (viewType == VIEW_TYPE_SUB_BOARD) { View subBoard = LayoutInflater.from(parent.getContext()). - inflate(R.layout.activity_board_sub_board, parent, false); + inflate(R.layout.activity_board_sub_board_row, parent, false); return new SubBoardViewHolder(subBoard); } else if (viewType == VIEW_TYPE_TOPIC_TITLE) { TextView topicTitle = new TextView(context); @@ -111,7 +111,7 @@ class BoardAdapter extends RecyclerView.Adapter { return new TitlesViewHolder(topicTitle); } else if (viewType == VIEW_TYPE_TOPIC) { View topic = LayoutInflater.from(parent.getContext()). - inflate(R.layout.activity_board_topic, parent, false); + inflate(R.layout.activity_board_topic_row, parent, false); return new TopicViewHolder(topic); } else if (viewType == VIEW_TYPE_LOADING) { View loading = LayoutInflater.from(parent.getContext()). diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java index 1ecbd360..70a0eed9 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java @@ -1,6 +1,5 @@ package gr.thmmy.mthmmy.activities.main.recent; -import android.os.AsyncTask; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -21,7 +20,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import gr.thmmy.mthmmy.R; -import gr.thmmy.mthmmy.base.BaseApplication; import gr.thmmy.mthmmy.base.BaseFragment; import gr.thmmy.mthmmy.model.TopicSummary; import gr.thmmy.mthmmy.session.SessionManager; @@ -55,8 +53,7 @@ public class RecentFragment extends BaseFragment { private RecentTask recentTask; // Required empty public constructor - public RecentFragment() { - } + public RecentFragment() {} /** * Use ONLY this factory method to create a new instance of @@ -147,9 +144,9 @@ public class RecentFragment extends BaseFragment { topicSummaries.addAll(fetchedRecent); recentAdapter.notifyDataSetChanged(); } else if (resultCode == NetworkResultCodes.NETWORK_ERROR) { - Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Network error", Toast.LENGTH_SHORT).show(); + Toast.makeText(getContext(), "Network error", Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," + + Toast.makeText(getContext(), "Unexpected error," + " please contact the developers with the details", Toast.LENGTH_LONG).show(); } diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java index 6f0cc15d..79b21b03 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java @@ -23,7 +23,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import gr.thmmy.mthmmy.R; -import gr.thmmy.mthmmy.base.BaseApplication; import gr.thmmy.mthmmy.base.BaseFragment; import gr.thmmy.mthmmy.model.TopicSummary; import gr.thmmy.mthmmy.session.SessionManager; @@ -183,9 +182,9 @@ public class UnreadFragment extends BaseFragment { progressBar.setVisibility(ProgressBar.INVISIBLE); swipeRefreshLayout.setRefreshing(false); if (resultCode == NetworkResultCodes.NETWORK_ERROR) - Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Network error", Toast.LENGTH_SHORT).show(); + Toast.makeText(getContext(), "Network error", Toast.LENGTH_SHORT).show(); else - Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," + + Toast.makeText(getContext(), "Unexpected error," + " please contact the developers with the details", Toast.LENGTH_LONG).show(); } } diff --git a/app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml index f100d7d9..0e9dc941 100644 --- a/app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml +++ b/app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml @@ -1,5 +1,5 @@ - + android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml b/app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml index ff9c29f4..3924bc11 100644 --- a/app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml +++ b/app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml @@ -1,5 +1,5 @@ - + android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/app/src/main/res/layout/activity_board_sub_board.xml b/app/src/main/res/layout/activity_board_sub_board_row.xml similarity index 92% rename from app/src/main/res/layout/activity_board_sub_board.xml rename to app/src/main/res/layout/activity_board_sub_board_row.xml index eadcd8b4..880ae31d 100644 --- a/app/src/main/res/layout/activity_board_sub_board.xml +++ b/app/src/main/res/layout/activity_board_sub_board_row.xml @@ -3,25 +3,25 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/card_background" - android:orientation="vertical"> + android:background="@color/card_background"> + android:paddingStart="16dp" + android:paddingEnd="0dp"> + android:paddingStart="0dp" + android:paddingEnd="16dp" + app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp"/> @@ -77,8 +79,8 @@ android:id="@+id/child_board_last_post" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="1dp" android:layout_marginTop="1dp" + android:layout_marginBottom="1dp" android:clickable="true" android:focusable="true" android:text="@string/child_board_last_post" diff --git a/app/src/main/res/layout/activity_board_topic.xml b/app/src/main/res/layout/activity_board_topic_row.xml similarity index 95% rename from app/src/main/res/layout/activity_board_topic.xml rename to app/src/main/res/layout/activity_board_topic_row.xml index 4888f6aa..6c816409 100644 --- a/app/src/main/res/layout/activity_board_topic.xml +++ b/app/src/main/res/layout/activity_board_topic_row.xml @@ -9,8 +9,8 @@ android:clickable="true" android:focusable="true" android:orientation="vertical" - android:paddingLeft="16dp" - android:paddingRight="16dp"> + android:paddingStart="16dp" + android:paddingEnd="0dp"> + android:paddingStart="0dp" + android:paddingEnd="16dp" + app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp"/>