Skip to content

Commit

Permalink
Added progress layout for messages
Browse files Browse the repository at this point in the history
  • Loading branch information
V1rex committed Jun 3, 2018
1 parent d05945f commit ce7d2e3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
public class MessagesFragment extends Fragment {

private RecyclerView mList;
private LinearLayout mLoaderMessage;
private DatabaseReference mReference;
private FirebaseRecyclerAdapter<Meeting, MeetingsViewHolder> firebaseRecyclerAdapter;
private FirebaseRecyclerOptions<Meeting> options;
Expand Down Expand Up @@ -75,6 +76,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
mReference = FirebaseDatabase.getInstance().getReference().child("Data").child("users").child(mAuth.getUid()).child("mettings");
mReference.keepSynced(true);

mLoaderMessage = (LinearLayout) view.findViewById(R.id.message_load_progress);
mLoaderMessage.setVisibility(View.VISIBLE);

mList =(RecyclerView) view.findViewById(R.id.meetings_recyclerview);
mList.setHasFixedSize(true);
mList.setLayoutManager(new LinearLayoutManager(this.getActivity()));
Expand All @@ -93,6 +97,7 @@ public MeetingsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int view

@Override
protected void onBindViewHolder(@NonNull MeetingsViewHolder holder, int position, @NonNull final Meeting model) {
mLoaderMessage.setVisibility(View.GONE);
holder.setmPlaceTextView(model.getmPlace());
holder.setmTypeEditText(model.getmType());
holder.setmDateEditText(model.getmDate());
Expand Down
28 changes: 28 additions & 0 deletions app/src/main/res/layout/fragment_message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@

</LinearLayout>

<LinearLayout
android:id="@+id/message_load_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical"
>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/loading"
android:gravity="center"
android:textSize="24sp"
android:textColor="#2d2b2b"
android:fontFamily="sans-serif-condensed"
/>
<ProgressBar
android:padding="16dp"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
/>

</LinearLayout>

<LinearLayout
android:id="@+id/linearlayout_received"
android:layout_width="match_parent"
Expand Down

0 comments on commit ce7d2e3

Please sign in to comment.