Added functionality framework for the profile pic button for Paul. He can now bind actions to the button.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,11 +60,6 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
|
||||
return fragment;
|
||||
}
|
||||
|
||||
protected void bindOnClick() {
|
||||
profilePicButton.setOnClickListener(this);
|
||||
logOutButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user