Add progress bar for timeline
This commit is contained in:
@@ -16,7 +16,6 @@ import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.bumptech.glide.Glide;
|
||||
@@ -39,7 +38,6 @@ import static android.app.Activity.RESULT_OK;
|
||||
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
static final int REQUEST_TAKE_PHOTO = 1;
|
||||
ProgressDialog progressDialog;
|
||||
ProgressBar progressBar;
|
||||
|
||||
/* Views, buttons and other protected and private inits */
|
||||
protected Button changePwdButton;
|
||||
@@ -233,3 +231,5 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package nl.myhyvesbookplus.tagram;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -22,20 +20,17 @@ public class TimelineFragment extends Fragment {
|
||||
/* Some protected and private inits */
|
||||
private ListView listView;
|
||||
private DownloadClass downloadClass;
|
||||
ProgressDialog progressDialog;
|
||||
ProgressBar progressBar;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
/* Required empty public constructor */
|
||||
public TimelineFragment() {}
|
||||
|
||||
/**
|
||||
* Overridden onCreate which also starts a progress dialog for the posts being downloaded.
|
||||
* @param savedInstanceState The standard return of the onCreate method.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.downloading_posts), false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,12 +48,8 @@ public class TimelineFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View timeLineInflater = inflater.inflate(R.layout.fragment_timeline, container, false);
|
||||
|
||||
// progressBar = new ProgressBar(getActivity());
|
||||
Log.d("TIMELINEFRAGMENT", "onCreateView: PROGRESSBAR");
|
||||
progressBar = (ProgressBar) timeLineInflater.findViewById(R.id.progressbar_timeline);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
progressBar.bringToFront();
|
||||
|
||||
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) timeLineInflater.findViewById(R.id.swipe);
|
||||
@@ -93,7 +84,6 @@ public class TimelineFragment extends Fragment {
|
||||
swipeView.setEnabled(firstVisibleItem == 0);
|
||||
}
|
||||
});
|
||||
progressBar.setVisibility(View.GONE);
|
||||
return timeLineInflater;
|
||||
}
|
||||
|
||||
@@ -103,5 +93,6 @@ public class TimelineFragment extends Fragment {
|
||||
public void startList() {
|
||||
TimeLineAdapter adapter = new TimeLineAdapter(getActivity(), downloadClass.getmList());
|
||||
listView.setAdapter(adapter);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user