WIP: for Felix
This commit is contained in:
@@ -39,11 +39,11 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
((AppCompatActivity)getActivity()).getSupportActionBar().hide();
|
|
||||||
getActivity().findViewById(R.id.content).setPadding(0,0,0,0);
|
|
||||||
|
|
||||||
final View view = inflater.inflate(R.layout.fragment_camera, container, false);
|
final View view = inflater.inflate(R.layout.fragment_camera, container, false);
|
||||||
|
|
||||||
|
// Hide the action bar
|
||||||
|
((AppCompatActivity)getActivity()).getSupportActionBar().hide();
|
||||||
|
|
||||||
mCamera = getCameraInstance(facing);
|
mCamera = getCameraInstance(facing);
|
||||||
|
|
||||||
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
||||||
@@ -217,16 +217,13 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
|
.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO Niet helemaal zeker wat dit doet.
|
/**
|
||||||
|
* Restores the action bar when exiting the fragment.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|
||||||
int padding = 16;
|
|
||||||
float scale = getResources().getDisplayMetrics().density;
|
|
||||||
int dp = (int) (padding * scale + 0.5f);
|
|
||||||
((AppCompatActivity)getActivity()).getSupportActionBar().show();
|
((AppCompatActivity)getActivity()).getSupportActionBar().show();
|
||||||
getActivity().findViewById(R.id.content).setPadding(dp,dp,dp,dp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
if (frag instanceof ProfileFragment) {
|
if (frag instanceof ProfileFragment) {
|
||||||
((ProfileFragment) frag).startList();
|
((ProfileFragment) frag).startList();
|
||||||
} else if (frag instanceof TimelineFragment) {
|
} else if (frag instanceof TimelineFragment) {
|
||||||
((TimelineFragment) frag).progressDialog.dismiss();
|
// ((TimelineFragment) frag).progressDialog.dismiss();
|
||||||
((TimelineFragment) frag).startList();
|
((TimelineFragment) frag).startList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import android.widget.Button;
|
|||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@@ -38,6 +39,7 @@ import static android.app.Activity.RESULT_OK;
|
|||||||
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||||
static final int REQUEST_TAKE_PHOTO = 1;
|
static final int REQUEST_TAKE_PHOTO = 1;
|
||||||
ProgressDialog progressDialog;
|
ProgressDialog progressDialog;
|
||||||
|
ProgressBar progressBar;
|
||||||
|
|
||||||
/* Views, buttons and other protected and private inits */
|
/* Views, buttons and other protected and private inits */
|
||||||
protected Button changePwdButton;
|
protected Button changePwdButton;
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import android.app.ProgressDialog;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||||
@@ -21,6 +23,7 @@ public class TimelineFragment extends Fragment {
|
|||||||
private ListView listView;
|
private ListView listView;
|
||||||
private DownloadClass downloadClass;
|
private DownloadClass downloadClass;
|
||||||
ProgressDialog progressDialog;
|
ProgressDialog progressDialog;
|
||||||
|
ProgressBar progressBar;
|
||||||
|
|
||||||
/* Required empty public constructor */
|
/* Required empty public constructor */
|
||||||
public TimelineFragment() {}
|
public TimelineFragment() {}
|
||||||
@@ -32,7 +35,7 @@ public class TimelineFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.downloading_posts), false, false);
|
// progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.downloading_posts), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +53,13 @@ public class TimelineFragment extends Fragment {
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View timeLineInflater = inflater.inflate(R.layout.fragment_timeline, container, false);
|
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);
|
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||||
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) timeLineInflater.findViewById(R.id.swipe);
|
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) timeLineInflater.findViewById(R.id.swipe);
|
||||||
|
|
||||||
@@ -83,6 +93,7 @@ public class TimelineFragment extends Fragment {
|
|||||||
swipeView.setEnabled(firstVisibleItem == 0);
|
swipeView.setEnabled(firstVisibleItem == 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
return timeLineInflater;
|
return timeLineInflater;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,32 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/swipe"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<ListView
|
<ProgressBar
|
||||||
android:id="@+id/list"
|
android:id="@+id/progressbar_timeline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/swipe"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
</ListView>
|
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
<ListView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
</ListView>
|
||||||
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user