Browse Source

BoardActivity arrows enlargement

pull/61/merge
Ezerous 6 years ago
parent
commit
b3230e75a6
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  2. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java
  3. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  4. 5
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java
  5. 4
      app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml
  6. 4
      app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml
  7. 20
      app/src/main/res/layout/activity_board_sub_board_row.xml
  8. 8
      app/src/main/res/layout/activity_board_topic_row.xml

2
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; pUnread = true;
} }
pStartedBy = topicColumns.get(3).text(); 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(); pLastPost = topicColumns.last().text();
if (pLastPost.contains("by")) { if (pLastPost.contains("by")) {

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

@ -90,7 +90,7 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
return new TitlesViewHolder(subBoardTitle); return new TitlesViewHolder(subBoardTitle);
} else if (viewType == VIEW_TYPE_SUB_BOARD) { } else if (viewType == VIEW_TYPE_SUB_BOARD) {
View subBoard = LayoutInflater.from(parent.getContext()). 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); return new SubBoardViewHolder(subBoard);
} else if (viewType == VIEW_TYPE_TOPIC_TITLE) { } else if (viewType == VIEW_TYPE_TOPIC_TITLE) {
TextView topicTitle = new TextView(context); TextView topicTitle = new TextView(context);
@ -111,7 +111,7 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
return new TitlesViewHolder(topicTitle); return new TitlesViewHolder(topicTitle);
} else if (viewType == VIEW_TYPE_TOPIC) { } else if (viewType == VIEW_TYPE_TOPIC) {
View topic = LayoutInflater.from(parent.getContext()). 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); return new TopicViewHolder(topic);
} else if (viewType == VIEW_TYPE_LOADING) { } else if (viewType == VIEW_TYPE_LOADING) {
View loading = LayoutInflater.from(parent.getContext()). View loading = LayoutInflater.from(parent.getContext()).

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

@ -1,6 +1,5 @@
package gr.thmmy.mthmmy.activities.main.recent; package gr.thmmy.mthmmy.activities.main.recent;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -21,7 +20,6 @@ import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.base.BaseApplication;
import gr.thmmy.mthmmy.base.BaseFragment; import gr.thmmy.mthmmy.base.BaseFragment;
import gr.thmmy.mthmmy.model.TopicSummary; import gr.thmmy.mthmmy.model.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.session.SessionManager;
@ -55,8 +53,7 @@ public class RecentFragment extends BaseFragment {
private RecentTask recentTask; private RecentTask recentTask;
// Required empty public constructor // Required empty public constructor
public RecentFragment() { public RecentFragment() {}
}
/** /**
* Use ONLY this factory method to create a new instance of * Use ONLY this factory method to create a new instance of
@ -147,9 +144,9 @@ public class RecentFragment extends BaseFragment {
topicSummaries.addAll(fetchedRecent); topicSummaries.addAll(fetchedRecent);
recentAdapter.notifyDataSetChanged(); recentAdapter.notifyDataSetChanged();
} else if (resultCode == NetworkResultCodes.NETWORK_ERROR) { } 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 { } else {
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," + Toast.makeText(getContext(), "Unexpected error," +
" please contact the developers with the details", Toast.LENGTH_LONG).show(); " please contact the developers with the details", Toast.LENGTH_LONG).show();
} }

5
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.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.base.BaseApplication;
import gr.thmmy.mthmmy.base.BaseFragment; import gr.thmmy.mthmmy.base.BaseFragment;
import gr.thmmy.mthmmy.model.TopicSummary; import gr.thmmy.mthmmy.model.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.session.SessionManager;
@ -183,9 +182,9 @@ public class UnreadFragment extends BaseFragment {
progressBar.setVisibility(ProgressBar.INVISIBLE); progressBar.setVisibility(ProgressBar.INVISIBLE);
swipeRefreshLayout.setRefreshing(false); swipeRefreshLayout.setRefreshing(false);
if (resultCode == NetworkResultCodes.NETWORK_ERROR) 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 else
Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "Unexpected error," + Toast.makeText(getContext(), "Unexpected error," +
" please contact the developers with the details", Toast.LENGTH_LONG).show(); " please contact the developers with the details", Toast.LENGTH_LONG).show();
} }
} }

4
app/src/main/res/drawable/ic_arrow_drop_down_accent_24dp.xml

@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="@color/accent" <vector android:height="48dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,10l5,5 5,-5z"/> <path android:fillColor="#FF000000" android:pathData="M7,10l5,5 5,-5z"/>
</vector> </vector>

4
app/src/main/res/drawable/ic_arrow_drop_up_accent_24dp.xml

@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="@color/accent" <vector android:height="48dp" android:tint="@color/accent"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M7,14l5,-5 5,5z"/> <path android:fillColor="#FF000000" android:pathData="M7,14l5,-5 5,5z"/>
</vector> </vector>

20
app/src/main/res/layout/activity_board_sub_board.xml → app/src/main/res/layout/activity_board_sub_board_row.xml

@ -3,25 +3,25 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/card_background" android:background="@color/card_background">
android:orientation="vertical">
<LinearLayout <LinearLayout
android:id="@+id/child_board_row" android:id="@+id/child_board_row"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:baselineAligned="false"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="16dp" android:paddingStart="16dp"
android:paddingRight="16dp"> android:paddingEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -41,7 +41,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
android:contentDescription="@string/child_board_button" android:contentDescription="@string/child_board_button"
app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp" /> android:paddingStart="0dp"
android:paddingEnd="16dp"
app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -56,8 +58,8 @@
android:id="@+id/child_board_mods" android:id="@+id/child_board_mods"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:text="@string/child_board_mods" android:text="@string/child_board_mods"
android:textColor="@color/secondary_text" android:textColor="@color/secondary_text"
android:textSize="12sp" android:textSize="12sp"
@ -67,8 +69,8 @@
android:id="@+id/child_board_stats" android:id="@+id/child_board_stats"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:text="@string/child_board_stats" android:text="@string/child_board_stats"
android:textColor="@color/secondary_text" android:textColor="@color/secondary_text"
android:textSize="12sp" /> android:textSize="12sp" />
@ -77,8 +79,8 @@
android:id="@+id/child_board_last_post" android:id="@+id/child_board_last_post"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:text="@string/child_board_last_post" android:text="@string/child_board_last_post"

8
app/src/main/res/layout/activity_board_topic.xml → app/src/main/res/layout/activity_board_topic_row.xml

@ -9,8 +9,8 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="16dp" android:paddingStart="16dp"
android:paddingRight="16dp"> android:paddingEnd="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -48,7 +48,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
android:contentDescription="@string/child_board_button" android:contentDescription="@string/child_board_button"
app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp" /> android:paddingStart="0dp"
android:paddingEnd="16dp"
app:srcCompat="@drawable/ic_arrow_drop_down_accent_24dp"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
Loading…
Cancel
Save