taverna-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sagar15795 <...@git.apache.org>
Subject [GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Date Sun, 03 Jun 2018 17:40:44 GMT
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596997
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java
---
    @@ -0,0 +1,154 @@
    +package org.apache.taverna.mobile.ui.userprofile;
    +
    +import android.content.Intent;
    +import android.os.Bundle;
    +import android.support.v4.app.Fragment;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.TextView;
    +
    +import com.bumptech.glide.Glide;
    +import com.bumptech.glide.load.engine.DiskCacheStrategy;
    +import com.bumptech.glide.load.resource.drawable.GlideDrawable;
    +import com.bumptech.glide.request.animation.GlideAnimation;
    +import com.bumptech.glide.request.target.SimpleTarget;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.DataManager;
    +import org.apache.taverna.mobile.data.local.PreferencesHelper;
    +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity;
    +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +import butterknife.OnClick;
    +import de.hdodenhof.circleimageview.CircleImageView;
    +
    +import static android.os.Build.ID;
    +
    +public class UserProfileFragment extends Fragment {
    +
    +    @BindView(R.id.user_name)
    +    TextView userName;
    +
    +    @BindView(R.id.user_avatar)
    +    CircleImageView userAvatar;
    +
    +    @BindView(R.id.user_email)
    +    TextView userEmail;
    +
    +    @BindView(R.id.user_website)
    +    TextView userWebsite;
    +
    +    @BindView(R.id.user_description)
    +    TextView userDescription;
    +
    +    @BindView(R.id.user_city)
    +    TextView userCity;
    +
    +    @BindView(R.id.user_country)
    +    TextView userCountry;
    +
    +    private DataManager dataManager;
    +
    +    public static UserProfileFragment newInstance(String id) {
    +
    +        Bundle args = new Bundle();
    +
    +        args.putString(ID, id);
    +
    +        UserProfileFragment fragment = new UserProfileFragment();
    +        fragment.setArguments(args);
    +        return fragment;
    +    }
    +
    +    @Override
    +    public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState)
{
    +        return inflater.inflate(R.layout.fragment_user_profile, parent, false);
    +
    +    }
    +
    +    @Override
    +    public void onViewCreated(View view, Bundle savedInstanceState) {
    +        ButterKnife.bind(this, view);
    +
    +        setUserDetail();
    +
    +    }
    +
    +    @OnClick(R.id.my_workflow_layout)
    +    void myWorkflows(View v) {
    +        Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class);
    +        getActivity().startActivity(intent);
    +    }
    +
    +    @OnClick(R.id.my_favorite_workflow_layout)
    +    void myFavoriteWorkflow(View v) {
    +        Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class);
    +        getActivity().startActivity(intent);
    +    }
    +
    +    private void setUserDetail() {
    +
    +        dataManager = new DataManager(new PreferencesHelper(getContext()));
    +
    +        String name = dataManager.getPreferencesHelper().getUserName();
    +        String description = dataManager.getPreferencesHelper().getUserDescription();
    +        String email = dataManager.getPreferencesHelper().getUserEmail();
    +        String website = dataManager.getPreferencesHelper().getUserWebsite();
    --- End diff --
    
    use `userWebsite` in place of `website`


---

Mime
View raw message