Merge remote-tracking branch 'origin/master' into niels-profile
This commit is contained in:
@@ -6,7 +6,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "nl.myhyvesbookplus.tagram"
|
applicationId "nl.myhyvesbookplus.tagram"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 21
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package nl.myhyvesbookplus.tagram;
|
package nl.myhyvesbookplus.tagram;
|
||||||
|
|
||||||
|
import android.app.Fragment;
|
||||||
import android.app.FragmentManager;
|
import android.app.FragmentManager;
|
||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -104,11 +105,6 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
this.finish();
|
this.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void testCreatePost(View view) {
|
|
||||||
// DownloadClass downloadClass = new DownloadClass();
|
|
||||||
// downloadClass.getPosts();
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ProfilePictureUpdated(Boolean success) {
|
public void ProfilePictureUpdated(Boolean success) {
|
||||||
Log.d(TAG, "ProfilePictureUpdated: Ja ik luister naar je!");
|
Log.d(TAG, "ProfilePictureUpdated: Ja ik luister naar je!");
|
||||||
@@ -125,10 +121,11 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void PostDownloaded() {
|
public void PostDownloaded() {
|
||||||
FragmentManager fragmentManager = getFragmentManager();
|
FragmentManager fragmentManager = getFragmentManager();
|
||||||
fragmentManager.findFragmentById(R.id.content);
|
Fragment frag = fragmentManager.findFragmentById(R.id.content);
|
||||||
TimelineFragment frag = (TimelineFragment) fragmentManager.findFragmentById(R.id.content);
|
|
||||||
frag.startList();
|
|
||||||
|
|
||||||
|
if (frag instanceof TimelineFragment) {
|
||||||
|
((TimelineFragment) frag).startList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ 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.AdapterView;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -22,7 +24,7 @@ import nl.myhyvesbookplus.tagram.model.UriPost;
|
|||||||
* Created by marijnjansen on 26/06/2017.
|
* Created by marijnjansen on 26/06/2017.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class TimeLineAdapter extends BaseAdapter {
|
public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
||||||
private static final String TAG = "TimeLineAdapter";
|
private static final String TAG = "TimeLineAdapter";
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@@ -55,12 +57,20 @@ public class TimeLineAdapter extends BaseAdapter {
|
|||||||
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
||||||
|
|
||||||
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
||||||
TextView nietslechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
||||||
ImageView photo = (ImageView) rowView.findViewById(R.id.timeline_image);
|
ImageView photo = (ImageView) rowView.findViewById(R.id.timeline_image);
|
||||||
|
ImageButton nietSlechtButton = (ImageButton) rowView.findViewById(R.id.niet_slecht_button);
|
||||||
|
|
||||||
|
nietSlechtButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
UriPost post = (UriPost) getItem(position);
|
UriPost post = (UriPost) getItem(position);
|
||||||
|
|
||||||
nietslechts.setText(Integer.toString(post.getNietSlechts()));
|
nietSlechts.setText(Integer.toString(post.getNietSlechts()));
|
||||||
comment.setText(post.getComment());
|
comment.setText(post.getComment());
|
||||||
|
|
||||||
StorageReference ref = FirebaseStorage.getInstance().getReferenceFromUrl(post.getUri());
|
StorageReference ref = FirebaseStorage.getInstance().getReferenceFromUrl(post.getUri());
|
||||||
@@ -72,4 +82,24 @@ public class TimeLineAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
return rowView;
|
return rowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback method to be invoked when an item in this AdapterView has
|
||||||
|
* been clicked.
|
||||||
|
* <p>
|
||||||
|
* Implementers can call getItemAtPosition(position) if they need
|
||||||
|
* to access the data associated with the selected item.
|
||||||
|
*
|
||||||
|
* @param parent The AdapterView where the click happened.
|
||||||
|
* @param view The view within the AdapterView that was clicked (this
|
||||||
|
* will be a view provided by the adapter)
|
||||||
|
* @param position The position of the view in the adapter.
|
||||||
|
* @param id The row id of the item that was clicked.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Log.d(TAG, "onItemClick: rowNumber! "+ position);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ import android.widget.ListView;
|
|||||||
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple {@link Fragment} subclass.
|
|
||||||
* Use the {@link TimelineFragment#newInstance} factory method to
|
|
||||||
* create an instance of this fragment.
|
|
||||||
*/
|
|
||||||
public class TimelineFragment extends Fragment {
|
public class TimelineFragment extends Fragment {
|
||||||
final private static String TAG = "TimelineFragment";
|
|
||||||
|
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private DownloadClass downloadClass;
|
private DownloadClass downloadClass;
|
||||||
@@ -25,29 +19,15 @@ public class TimelineFragment extends Fragment {
|
|||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this factory method to create a new instance of
|
|
||||||
* this fragment using the provided parameters.
|
|
||||||
* @return A new instance of fragment TimelineFragment.
|
|
||||||
*/
|
|
||||||
// TODO: Rename and change types and number of parameters
|
|
||||||
public static TimelineFragment newInstance() {
|
|
||||||
TimelineFragment fragment = new TimelineFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_timeline, container, false);
|
View view = inflater.inflate(R.layout.fragment_timeline, container, false);
|
||||||
|
|
||||||
listView = (ListView) view.findViewById(R.id.listview);
|
listView = (ListView) view.findViewById(R.id.listview);
|
||||||
|
|
||||||
downloadClass = new DownloadClass(getActivity());
|
downloadClass = new DownloadClass(getActivity());
|
||||||
downloadClass.getPostsFromServer();
|
downloadClass.getPostsFromServer();
|
||||||
|
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
android:layout_height="40dp">
|
android:layout_height="40dp">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
android:id="@+id/niet_slecht_button"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#fbbf2d</color>
|
<color name="colorPrimary">#fbbf2d</color>
|
||||||
<color name="colorPrimaryDark">#ffa70f</color>
|
<color name="colorPrimaryDark">#ffa70f</color>
|
||||||
<color name="colorAccent">#4bAfe5</color>
|
<!--<color name="colorAccent">#4bAfe5</color>-->
|
||||||
<!--<color name="colorAccent">#4CAF50</color>-->
|
<color name="colorAccent">#4CAF50</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
<string name="profile_picture_description">profile picture</string>
|
<string name="profile_picture_description">profile picture</string>
|
||||||
<string name="change_psw_button">Change Password</string>
|
<string name="change_psw_button">Change Password</string>
|
||||||
<string name="please_wait">Please Wait</string>
|
<string name="please_wait">Please Wait</string>
|
||||||
<string name="mail_successful">An e-mail was sent. Please follow its instructions.</string>
|
|
||||||
<string name="mail_failed">An error occurred. Please check internet connection.</string>
|
|
||||||
<string name="niet_slecht">\"Niet slecht.\"s</string>
|
<string name="niet_slecht">\"Niet slecht.\"s</string>
|
||||||
<string name="upload">Upload</string>
|
<string name="upload">Upload</string>
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
|
<string name="mail_successful">An e-mail was sent. Please follow its instructions.</string>
|
||||||
|
<string name="mail_failed">An error occurred. Please check internet connection.</string>
|
||||||
<string name="image_save_error">Saving image to storage failed. Please make sure there is space available on the device.</string>
|
<string name="image_save_error">Saving image to storage failed. Please make sure there is space available on the device.</string>
|
||||||
<string name="update_profile_pic_error">Updating the profile picture failed. Please check network connection.</string>
|
<string name="update_profile_pic_error">Updating the profile picture failed. Please check network connection.</string>
|
||||||
<string name="upload_profile_pic">Uploading profile picture...</string>
|
<string name="upload_profile_pic">Uploading profile picture...</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user