mirror of https://github.com/ThmmyNoLife/mTHMMY
Thodoris1999
6 years ago
6 changed files with 117 additions and 3 deletions
@ -0,0 +1,41 @@ |
|||
package gr.thmmy.mthmmy.activities.main.shoutbox; |
|||
|
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
|
|||
import java.util.ArrayList; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import gr.thmmy.mthmmy.model.Shout; |
|||
import gr.thmmy.mthmmy.utils.CustomRecyclerView; |
|||
|
|||
public class ShoutAdapter extends CustomRecyclerView.Adapter<ShoutAdapter.ShoutViewHolder> { |
|||
private ArrayList<Shout> shouts; |
|||
|
|||
public ShoutAdapter(ArrayList<Shout> shouts) { |
|||
this.shouts = shouts; |
|||
} |
|||
|
|||
@NonNull |
|||
@Override |
|||
public ShoutViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public void onBindViewHolder(@NonNull ShoutViewHolder holder, int position) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public int getItemCount() { |
|||
return shouts.size(); |
|||
} |
|||
|
|||
static class ShoutViewHolder extends CustomRecyclerView.ViewHolder { |
|||
|
|||
public ShoutViewHolder(@NonNull View itemView) { |
|||
super(itemView); |
|||
} |
|||
} |
|||
} |
@ -1,7 +1,41 @@ |
|||
package gr.thmmy.mthmmy.activities.main.shoutbox; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.annotation.Nullable; |
|||
import gr.thmmy.mthmmy.R; |
|||
import gr.thmmy.mthmmy.activities.main.forum.ForumFragment; |
|||
import gr.thmmy.mthmmy.base.BaseFragment; |
|||
import gr.thmmy.mthmmy.utils.CustomRecyclerView; |
|||
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; |
|||
|
|||
public class ShoutboxFragment extends BaseFragment { |
|||
|
|||
private static final String TAG = "ShoutboxFragment"; |
|||
|
|||
private MaterialProgressBar progressBar; |
|||
|
|||
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; |
|||
} |
|||
|
|||
@Nullable |
|||
@Override |
|||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|||
final View rootView = inflater.inflate(R.layout.fragment_shoutbox, container, false); |
|||
|
|||
progressBar = rootView.findViewById(R.id.progressBar); |
|||
CustomRecyclerView recyclerView = rootView.findViewById(R.id.shoutbox_recyclerview); |
|||
|
|||
return super.onCreateView(inflater, container, savedInstanceState); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:orientation="vertical" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
|||
android:id="@+id/swiperefresh" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
<gr.thmmy.mthmmy.utils.CustomRecyclerView |
|||
android:id="@+id/shoutbox_recyclerview" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
tools:listitem="@layout/shout"/> |
|||
|
|||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
|||
|
|||
<me.zhanghai.android.materialprogressbar.MaterialProgressBar |
|||
android:id="@+id/progressBar" |
|||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="@dimen/progress_bar_height" |
|||
android:layout_alignParentTop="true" |
|||
android:indeterminate="true" |
|||
android:visibility="invisible" |
|||
app:mpb_indeterminateTint="@color/accent" |
|||
app:mpb_progressStyle="horizontal"/> |
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:orientation="vertical" android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</LinearLayout> |
Loading…
Reference in new issue