mirror of https://github.com/ThmmyNoLife/mTHMMY
Ezerous
8 years ago
12 changed files with 311 additions and 109 deletions
@ -0,0 +1,34 @@ |
|||||
|
package gr.thmmy.mthmmy.data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
|
||||
|
public class Board { |
||||
|
private final String name; |
||||
|
private final String boardURL; |
||||
|
|
||||
|
private ArrayList <Board> subBoards; |
||||
|
private ArrayList <TopicSummary> topicSummaries; |
||||
|
|
||||
|
public Board(String name, String boardURL) { |
||||
|
this.name = name; |
||||
|
this.boardURL = boardURL; |
||||
|
subBoards = new ArrayList<>(); |
||||
|
topicSummaries = new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public String getBoardURL() { |
||||
|
return boardURL; |
||||
|
} |
||||
|
|
||||
|
public ArrayList<Board> getSubBoards() { |
||||
|
return subBoards; |
||||
|
} |
||||
|
|
||||
|
public ArrayList<TopicSummary> getTopicSummaries() { |
||||
|
return topicSummaries; |
||||
|
} |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package gr.thmmy.mthmmy.data; |
||||
|
|
||||
|
import com.bignerdranch.expandablerecyclerview.model.Parent; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import static android.R.attr.id; |
||||
|
|
||||
|
public class Category implements Parent<Board> |
||||
|
{ |
||||
|
private final String name; |
||||
|
private final String categoryURL; |
||||
|
private boolean expanded = false; |
||||
|
private List<Board> boards; |
||||
|
|
||||
|
public Category(String name, String categoryURL) { |
||||
|
this.name = name; |
||||
|
this.categoryURL = categoryURL; |
||||
|
boards = new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
public int getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public String getCategoryURL() { |
||||
|
return categoryURL; |
||||
|
} |
||||
|
|
||||
|
public boolean isExpanded() { |
||||
|
return expanded; |
||||
|
} |
||||
|
|
||||
|
public List<Board> getBoards() { |
||||
|
return boards; |
||||
|
} |
||||
|
|
||||
|
public void setExpanded(boolean expanded) { |
||||
|
this.expanded = expanded; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Board> getChildList() { |
||||
|
return getBoards(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean isInitiallyExpanded() { |
||||
|
return expanded; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<RelativeLayout |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent"> |
||||
|
|
||||
|
<android.support.v7.widget.RecyclerView |
||||
|
android:id="@+id/list" |
||||
|
android:name="gr.thmmy.mthmmy.sections.forum.ForumFragment" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:background="@color/background" |
||||
|
android:clipToPadding="false" |
||||
|
android:paddingBottom="4dp" |
||||
|
android:paddingTop="4dp" |
||||
|
app:layoutManager="LinearLayoutManager" |
||||
|
tools:context=".activities.main.forum.ForumFragment" /> |
||||
|
|
||||
|
<ProgressBar |
||||
|
android:id="@+id/progressBar" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_centerHorizontal="true" |
||||
|
android:layout_centerVertical="true" |
||||
|
android:visibility="invisible"/> |
||||
|
|
||||
|
</RelativeLayout> |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:orientation="vertical" |
||||
|
android:paddingEnd="4dp" |
||||
|
android:paddingStart="4dp"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/board" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:textAppearance="?attr/textAppearanceListItem" |
||||
|
android:textColor="@color/primary_text"/> |
||||
|
|
||||
|
</LinearLayout> |
@ -0,0 +1,27 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:paddingEnd="4dp" |
||||
|
android:paddingStart="4dp"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/category" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_alignParentStart="true" |
||||
|
android:textAppearance="?attr/textAppearanceListItem" |
||||
|
android:textColor="@color/md_yellow_600"/> |
||||
|
|
||||
|
<ImageView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_alignParentEnd="true" |
||||
|
app:srcCompat="@android:drawable/arrow_down_float" |
||||
|
android:id="@+id/arrow" |
||||
|
android:contentDescription="arrow" /> |
||||
|
|
||||
|
|
||||
|
</RelativeLayout> |
Loading…
Reference in new issue