Paul profile #6

Merged
11306084 merged 29 commits from paul-profile into master 2017-06-22 11:39:39 +02:00
3 changed files with 37 additions and 13 deletions
Showing only changes of commit 27416aae85 - Show all commits

View File

@@ -221,6 +221,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
});
}
//TODO Make modular for use with Profile fragment.
/**
* Saves the Username to Firebase
* @param user The User object that needs to be updated

View File

@@ -1,12 +1,18 @@
package nl.myhyvesbookplus.tagram;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
/**
@@ -27,6 +33,9 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
private String mParam1;
private String mParam2;
protected Button logOutButton, profilePicButton;
protected FirebaseAuth mAuth;
private OnFragmentInteractionListener mListener;
public ProfileFragment() {
@@ -51,12 +60,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
return fragment;
}
protected void bindOnClick() {
profilePicButton.setOnClickListener(this);
logOutButton.setOnClickListener(this);
}
@Override
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
@@ -65,11 +69,25 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
}
}
/**
* Assigns all views.
*/
protected void findViews(View view) {
profilePicButton = (Button) view.findViewById(R.id.profile_pic_button);
bindOnClick();
}
protected void bindOnClick() {
profilePicButton.setOnClickListener(this);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_profile, container, false);
View view = inflater.inflate(R.layout.fragment_profile, container, false);
findViews(view);
return view;
}
// TODO: Rename method, update argument and hook method into UI event
@@ -86,11 +104,18 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
profilePicOnClick();
break;
case R.id.logout_button:
logOutOnClick();
// logOutOnClick();
break;
}
}
// TODO Make the function actually do something.
public void profilePicOnClick() {
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
@@ -113,10 +138,8 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
* See the Android Training lesson http://developer.android.com/training/basics/fragments/communicating.html
* for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name

View File

@@ -7,7 +7,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"