Commit 91f75509 authored by Varun Patil's avatar Varun Patil

Add loading progress spinner to most fragments where necessary

parent c8b9e97c
...@@ -277,6 +277,8 @@ public class BodyFragment extends Fragment { ...@@ -277,6 +277,8 @@ public class BodyFragment extends Fragment {
}); });
childrenRecyclerView.setAdapter(childrenAdapter); childrenRecyclerView.setAdapter(childrenAdapter);
childrenRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); childrenRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
/** /**
......
...@@ -162,6 +162,8 @@ public class CalendarFragment extends BaseFragment { ...@@ -162,6 +162,8 @@ public class CalendarFragment extends BaseFragment {
}); });
eventRecyclerView.setAdapter(eventAdapter); eventRecyclerView.setAdapter(eventAdapter);
eventRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); eventRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
} }
...@@ -144,6 +144,7 @@ public class FeedFragment extends BaseFragment { ...@@ -144,6 +144,7 @@ public class FeedFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private class updateDatabase extends AsyncTask<List<Event>, Void, Integer> { private class updateDatabase extends AsyncTask<List<Event>, Void, Integer> {
......
...@@ -146,6 +146,7 @@ public class MessMenuFragment extends BaseFragment { ...@@ -146,6 +146,7 @@ public class MessMenuFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private class updateDatabase extends AsyncTask<List<HostelMessMenu>, Void, Integer> { private class updateDatabase extends AsyncTask<List<HostelMessMenu>, Void, Integer> {
......
...@@ -110,6 +110,7 @@ public class NewsFragment extends BaseFragment { ...@@ -110,6 +110,7 @@ public class NewsFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
...@@ -111,6 +111,7 @@ public class PlacementBlogFragment extends BaseFragment { ...@@ -111,6 +111,7 @@ public class PlacementBlogFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
...@@ -123,6 +123,8 @@ public class ProfileFragment extends BaseFragment { ...@@ -123,6 +123,8 @@ public class ProfileFragment extends BaseFragment {
userRollNumberTextView.setText(user.getUserRollNumber()); userRollNumberTextView.setText(user.getUserRollNumber());
userEmailIDTextView.setText(user.getUserEmail()); userEmailIDTextView.setText(user.getUserEmail());
userContactNumberTextView.setText(user.getUserContactNumber()); userContactNumberTextView.setText(user.getUserContactNumber());
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
......
...@@ -111,6 +111,7 @@ public class TrainingBlogFragment extends BaseFragment { ...@@ -111,6 +111,7 @@ public class TrainingBlogFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
...@@ -189,4 +189,16 @@ ...@@ -189,4 +189,16 @@
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -73,4 +73,16 @@ ...@@ -73,4 +73,16 @@
android:src="@android:drawable/ic_input_add" android:src="@android:drawable/ic_input_add"
android:tint="@android:color/black" /> android:tint="@android:color/black" />
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -26,4 +26,16 @@ ...@@ -26,4 +26,16 @@
android:layout_margin="16dp" android:layout_margin="16dp"
android:src="@android:drawable/ic_input_add" android:src="@android:drawable/ic_input_add"
android:tint="@android:color/black" /> android:tint="@android:color/black" />
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:orientation="vertical"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment">
<Spinner <LinearLayout
android:id="@+id/hostel_spinner" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:theme="@style/AppTheme" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/mess_menu_swipe_refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment"> tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment">
<android.support.v7.widget.RecyclerView <Spinner
android:id="@+id/mess_menu_recycler_view" android:id="@+id/hostel_spinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:theme="@style/AppTheme" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/mess_menu_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/mess_menu_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
</android.support.v4.widget.SwipeRefreshLayout> <ProgressBar
</LinearLayout> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:orientation="vertical"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.ProfileFragment">
<LinearLayout <LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="vertical"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.ProfileFragment">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_profile_picture_profile"
android:layout_width="135dp"
android:layout_height="99dp"
android:layout_margin="32dp" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32dp" android:orientation="horizontal">
android:orientation="vertical">
<TextView
android:id="@+id/user_name_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/user_rollno_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
<TextView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_email_profile" android:id="@+id/user_profile_picture_profile"
android:layout_width="match_parent" android:layout_width="135dp"
android:layout_height="wrap_content" android:layout_height="99dp"
android:layout_marginBottom="2dp" android:layout_margin="32dp" />
android:textSize="16sp" />
<TextView <LinearLayout
android:id="@+id/user_contact_no_profile" android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="2dp" android:layout_marginTop="32dp"
android:textSize="16sp" /> android:orientation="vertical">
<TextView
android:id="@+id/user_name_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/user_rollno_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/user_email_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/user_contact_no_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> <android.support.v7.widget.RecyclerView
android:id="@+id/role_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView <android.support.design.widget.TabLayout
android:id="@+id/role_recycler_view" android:id="@+id/tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="40dp"
android:background="@color/colorPrimaryDark">
<android.support.design.widget.TabLayout <android.support.design.widget.TabItem
android:id="@+id/tab_layout" android:id="@+id/following_tab"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"> android:text="Following" />
<android.support.design.widget.TabItem <android.support.design.widget.TabItem
android:id="@+id/following_tab" android:id="@+id/events_tab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Following" /> android:text="Events" />
<android.support.design.widget.TabItem </android.support.design.widget.TabLayout>
android:id="@+id/events_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Events" />
</android.support.design.widget.TabLayout> <android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager </LinearLayout>
android:id="@+id/viewPager" <RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="match_parent"
android:gravity="center" >
</LinearLayout> <ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment