You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by Hiteshgautam01 <gi...@git.apache.org> on 2018/05/25 22:54:05 UTC

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

GitHub user Hiteshgautam01 opened a pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78

    Feat: User details in nav header and New User Profile Activity

    Please make sure these boxes are checked before submitting your pull request - thanks!
    
    - [ ] Apply the `AndroidStyle.xml` style template to your code in Android Studio.
    
    - [ ] Run the checks with `./gradlew check` to make sure you didn't break anything
    
    - [ ] If you have multiple commits please combine them into one commit by squashing them.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Hiteshgautam01/incubator-taverna-mobile user_profile_nav

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-taverna-mobile/pull/78.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #78
    
----
commit 5c6d2d2e46c07bd74c8fef86a5d0e3a5fb7b062e
Author: Hitesh Gautam <ga...@...>
Date:   2018-05-25T22:31:48Z

    Feat: User details in nav header and New User Profile Activity

----


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596956
  
    --- 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();
    --- End diff --
    
    use `userDescription` in place of `description `


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192598590
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    --- End diff --
    
    Because if I set this to wrap content, the image will stretch in the length and hide the nav drawer due to its size.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579551
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,325 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"
    +                    />
    --- End diff --
    
    move this to above line.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191054643
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/UserProfileActivity.java ---
    @@ -0,0 +1,171 @@
    +package org.apache.taverna.mobile.ui;
    +
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +import android.view.View;
    +import android.widget.LinearLayout;
    +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 butterknife.BindView;
    +import butterknife.ButterKnife;
    +import de.hdodenhof.circleimageview.CircleImageView;
    +
    +import static org.apache.taverna.mobile.TavernaApplication.getContext;
    +
    +
    +public class UserProfileActivity extends AppCompatActivity{
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @BindView(R.id.user_name)
    +    TextView user_name;
    +
    +    @BindView(R.id.user_avatar)
    +    CircleImageView user_avatar;
    +
    +    @BindView(R.id.user_email)
    +    TextView user_email;
    +
    +    @BindView(R.id.user_website)
    +    TextView user_website;
    +
    +    @BindView(R.id.user_description)
    +    TextView user_description;
    +
    +    @BindView(R.id.user_city)
    +    TextView user_city;
    +
    +    @BindView(R.id.user_country)
    +    TextView user_country;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout my_workflow_layout;
    +
    +    @BindView(R.id.my_favorite_workflow)
    +    LinearLayout my_favorite_workflow;
    +
    +    private DataManager dataManager;
    +
    +    @Override
    +    protected void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_user_profile);
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle(R.string.title_user_profile);
    +
    +            setUserDetail();
    +
    +            my_workflow_layout.setOnClickListener(new View.OnClickListener() {
    +                @Override
    +                public void onClick(View v) {
    +                    //In this onClick listener we have to go from this UserProfileActivity to myWorkflows fragment.
    +                    //Suggest the method to perform this action.
    --- End diff --
    
    `UserProfile` -> `myWorkflow` and `myWorkflow` -> `UserProfile`. So make a separate activity for myworkflow and just show the myworkflow fragment in it.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597025
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    --- End diff --
    
    use `userCountry` in place of `country`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597194
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    --- End diff --
    
    why 178dp?


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192688510
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    --- End diff --
    
    Done


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579555
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,325 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"
    +                    />
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"
    +                    />
    --- End diff --
    
    move this to above line 



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192621601
  
    --- 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;
    --- End diff --
    
    make it `userCountry` or `mUserCountry`. And all the above also.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192663024
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    --- End diff --
    
    @Hiteshgautam01 see this link https://stackoverflow.com/questions/20563524/how-to-add-and-in-android-strings-xml


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579307
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +284,44 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +        NavigationView navigationView =  findViewById(R.id.nav_view);
    +        View header_view =  navigationView.getHeaderView(0);
    --- End diff --
    
    make it `headeView` in place of `header_view`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192662444
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    --- End diff --
    
    Then make it 170dp


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579432
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java ---
    @@ -0,0 +1,163 @@
    +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.LinearLayout;
    +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 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;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout myWorkflowLayout;
    +
    +    @BindView(R.id.my_favorite_workflow_layout)
    +    LinearLayout myFavoriteWorkflowLayout;
    +
    +    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();
    +
    +        myWorkflowLayout.setOnClickListener(new View.OnClickListener() {
    --- End diff --
    
    use butterknife `@onClick` annotation for click listener.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579331
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +284,44 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +        NavigationView navigationView =  findViewById(R.id.nav_view);
    +        View header_view =  navigationView.getHeaderView(0);
    +
    +        String avatar = dataManager.getPreferencesHelper().getUserAvatar();
    --- End diff --
    
    I think this is avatar URL. So, Use `avatarUrl` in place of `avatar`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596819
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +283,43 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +
    +        View headerView =  navigationView.getHeaderView(0);
    +        String avatar = dataManager.getPreferencesHelper().getUserAvatar();
    --- End diff --
    
    make `avatar` to `avatarUrl` and `getUserAvatar()` to `getUserAvatarUrl()`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579439
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java ---
    @@ -0,0 +1,163 @@
    +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.LinearLayout;
    +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 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;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout myWorkflowLayout;
    +
    +    @BindView(R.id.my_favorite_workflow_layout)
    +    LinearLayout myFavoriteWorkflowLayout;
    +
    +    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();
    +
    +        myWorkflowLayout.setOnClickListener(new View.OnClickListener() {
    +            @Override
    +            public void onClick(View v) {
    +                Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class);
    +                getActivity().startActivity(intent);
    +            }
    +        });
    +
    +        myFavoriteWorkflowLayout.setOnClickListener(new View.OnClickListener() {
    --- End diff --
    
    use butterknife `@onClick` annotation for click listener.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-taverna-mobile/pull/78


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191053774
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/UserProfileActivity.java ---
    @@ -0,0 +1,171 @@
    +package org.apache.taverna.mobile.ui;
    +
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +import android.view.View;
    +import android.widget.LinearLayout;
    +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 butterknife.BindView;
    +import butterknife.ButterKnife;
    +import de.hdodenhof.circleimageview.CircleImageView;
    +
    +import static org.apache.taverna.mobile.TavernaApplication.getContext;
    +
    +
    +public class UserProfileActivity extends AppCompatActivity{
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @BindView(R.id.user_name)
    +    TextView user_name;
    +
    +    @BindView(R.id.user_avatar)
    +    CircleImageView user_avatar;
    +
    +    @BindView(R.id.user_email)
    +    TextView user_email;
    +
    +    @BindView(R.id.user_website)
    +    TextView user_website;
    +
    +    @BindView(R.id.user_description)
    +    TextView user_description;
    +
    +    @BindView(R.id.user_city)
    +    TextView user_city;
    +
    +    @BindView(R.id.user_country)
    +    TextView user_country;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout my_workflow_layout;
    +
    +    @BindView(R.id.my_favorite_workflow)
    +    LinearLayout my_favorite_workflow;
    +
    +    private DataManager dataManager;
    +
    +    @Override
    +    protected void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_user_profile);
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle(R.string.title_user_profile);
    +
    +            setUserDetail();
    +
    +            my_workflow_layout.setOnClickListener(new View.OnClickListener() {
    +                @Override
    +                public void onClick(View v) {
    +                    //In this onClick listener we have to go from this UserProfileActivity to myWorkflows fragment.
    +                    //Suggest the method to perform this action.
    --- End diff --
    
    `UserProfile` -> `myWorkflow` and `myWorkflow` -> `UserProfile`. So make a separate activity for myworkflow and just initiate the myworkflow fragment in it.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597106
  
    --- Diff: app/src/main/res/layout/activity_user_profile.xml ---
    @@ -0,0 +1,32 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout
    +    xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    android:orientation="vertical">
    +
    +    <include layout="@layout/appbar" />
    +
    +    <FrameLayout
    +        android:id="@+id/frame_container"
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent"
    +        />
    --- End diff --
    
    move the close tag above
    



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191046498
  
    --- Diff: app/build.gradle ---
    @@ -86,6 +86,7 @@ dependencies {
     
         //Dependencies for butterknife
         implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
    +    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    --- End diff --
    
    remove this library.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597171
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,322 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"/>
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"/>
    +
    +                <TextView
    +                    android:id="@+id/user_description"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:textAlignment="center"
    +                    android:gravity="center"
    +                    android:layout_below="@id/user_name"
    +                    android:layout_marginTop="@dimen/user_description_margin_top"
    +                    android:textColor="@color/white"
    +                    android:text=""/>
    +
    +            </RelativeLayout>
    +
    +            <LinearLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="match_parent"
    +                android:orientation="vertical">
    +
    +                <LinearLayout
    +                    android:id="@+id/email_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_email_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_email"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_email"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/website_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_language_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_website"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_website"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/city_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_location_city_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_city"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_city"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/country_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_location_on_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_country"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_country"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    --- End diff --
    
    remove this.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579461
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java ---
    @@ -0,0 +1,163 @@
    +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.LinearLayout;
    +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 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;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout myWorkflowLayout;
    +
    +    @BindView(R.id.my_favorite_workflow_layout)
    +    LinearLayout myFavoriteWorkflowLayout;
    +
    +    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();
    +
    +        myWorkflowLayout.setOnClickListener(new View.OnClickListener() {
    +            @Override
    +            public void onClick(View v) {
    +                Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class);
    +                getActivity().startActivity(intent);
    +            }
    +        });
    +
    +        myFavoriteWorkflowLayout.setOnClickListener(new View.OnClickListener() {
    +            @Override
    +            public void onClick(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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatar = dataManager.getPreferencesHelper().getUserAvatar();
    --- End diff --
    
    make `avatar` to `avatarUrl` 


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579414
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileActivity.java ---
    @@ -0,0 +1,75 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.taverna.mobile.ui.userprofile;
    +
    +import android.os.Bundle;
    +import android.support.annotation.Nullable;
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.utils.Constants;
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class UserProfileActivity extends AppCompatActivity {
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @Override
    +    protected void onCreate(@Nullable Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_user_profile);
    +
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle("Profile");
    +        }
    +
    +        if (savedInstanceState == null) {
    +            getSupportFragmentManager().beginTransaction()
    --- End diff --
    
    use `ActivityUtils.addFragmentToActivity` method


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192662757
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    +        }
    +
    +        if (description != null) {
    +            description = android.text.Html.fromHtml(description).toString();
    +            userDescription.setText(description);
    +        } else {
    +            userDescription.setText("");
    --- End diff --
    
    @Hiteshgautam01 could you show screenshots for the same?


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596968
  
    --- 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();
    --- End diff --
    
    use `userEmail` in place of `email`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192685918
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    +        }
    +
    +        if (description != null) {
    +            description = android.text.Html.fromHtml(description).toString();
    +            userDescription.setText(description);
    +        } else {
    +            userDescription.setText("");
    --- End diff --
    
    <img src="https://user-images.githubusercontent.com/31414276/40911055-7326e280-680b-11e8-897a-b4b9a8496bb4.png" width ="260px" height ="auto">



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597068
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    --- End diff --
    
    move `<NA>`to string.xml and use it in all fields.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597215
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    +	xmlns:app="http://schemas.android.com/apk/res-auto"
    +	android:background="@drawable/nav_header"
    +	android:orientation="vertical"
    +	android:weightSum="1">
    +
     <LinearLayout
    -	xmlns:android="http://schemas.android.com/apk/res/android"
    -	xmlns:tools="http://schemas.android.com/tools"
     	android:layout_width="match_parent"
    -	android:layout_height="match_parent"
    +	android:layout_height="wrap_content"
     	android:orientation="vertical"
    -	android:background="#ccc">
    +	android:layout_alignParentBottom="true"
    +	android:layout_alignParentLeft="true"
    +	android:layout_alignParentStart="true"
    +	android:layout_marginBottom="@dimen/layout_marginBottom">
     
    -	<LinearLayout
    -		android:orientation="vertical"
    -		android:layout_width="match_parent"
    +	<TextView
    +		android:id="@+id/nav_user_name"
    +		android:layout_width="wrap_content"
     		android:layout_height="wrap_content"
    -		android:background="@drawable/sliding_header">
    -	</LinearLayout>
    +		android:layout_marginLeft="@dimen/tv_layout_marginLeft"
    +		android:textColor="@color/white"
    +		android:text="@string/username"
    +		android:textSize="@dimen/tv_textSize"
    +		android:textStyle="bold"
    +		/>
    +
    +	<TextView
    +		android:id="@+id/nav_user_email"
    +		android:layout_width="wrap_content"
    +		android:layout_height="wrap_content"
    +		android:textColor="@color/white"
    +		android:layout_marginLeft="@dimen/tv_layout_marginLeft"
    +		android:text="@string/email"
    +		android:textSize="@dimen/tv_textSize"
    +		android:textStyle="normal"
    +		/>
    --- End diff --
    
    move the close tag above 


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191048452
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/UserProfileActivity.java ---
    @@ -0,0 +1,171 @@
    +package org.apache.taverna.mobile.ui;
    +
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +import android.view.View;
    +import android.widget.LinearLayout;
    +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 butterknife.BindView;
    +import butterknife.ButterKnife;
    +import de.hdodenhof.circleimageview.CircleImageView;
    +
    +import static org.apache.taverna.mobile.TavernaApplication.getContext;
    +
    +
    +public class UserProfileActivity extends AppCompatActivity{
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @BindView(R.id.user_name)
    +    TextView user_name;
    +
    +    @BindView(R.id.user_avatar)
    +    CircleImageView user_avatar;
    +
    +    @BindView(R.id.user_email)
    +    TextView user_email;
    +
    +    @BindView(R.id.user_website)
    +    TextView user_website;
    +
    +    @BindView(R.id.user_description)
    +    TextView user_description;
    +
    +    @BindView(R.id.user_city)
    +    TextView user_city;
    +
    +    @BindView(R.id.user_country)
    +    TextView user_country;
    +
    +    @BindView(R.id.my_workflow_layout)
    +    LinearLayout my_workflow_layout;
    +
    +    @BindView(R.id.my_favorite_workflow)
    +    LinearLayout my_favorite_workflow;
    +
    +    private DataManager dataManager;
    +
    +    @Override
    +    protected void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_user_profile);
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle(R.string.title_user_profile);
    +
    +            setUserDetail();
    +
    +            my_workflow_layout.setOnClickListener(new View.OnClickListener() {
    +                @Override
    +                public void onClick(View v) {
    +                    //In this onClick listener we have to go from this UserProfileActivity to myWorkflows fragment.
    +                    //Suggest the method to perform this action.
    --- End diff --
    
    Hey @sagar15795 , Suggest the best possible method to perform this action


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579244
  
    --- Diff: app/build.gradle ---
    @@ -68,6 +68,7 @@ dependencies {
         implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
         implementation "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
     
    +    implementation 'com.android.support:design:27.1.0'
    --- End diff --
    
    We are already using this library.
    Check below line.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596843
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +283,43 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +
    +        View headerView =  navigationView.getHeaderView(0);
    +        String avatar = dataManager.getPreferencesHelper().getUserAvatar();
    +        final CircleImageView navUserAvatar = headerView.findViewById(R.id.nav_user_avatar);
    +
    +        Glide.with(getContext())
    +                .load(avatar)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<?
    +                            super GlideDrawable> glideAnimation) {
    +                        navUserAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        navUserAvatar.setOnClickListener(new View.OnClickListener() {
    --- End diff --
    
    use `@onclick` annotation from butterknife library


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192598247
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    --- End diff --
    
    When I put <NA> between the strings tag it says that Element NA is not closed Because the string file is XML based and it was reading the tags before and after the NA.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597102
  
    --- Diff: app/src/main/res/layout/activity_favourite_workflows.xml ---
    @@ -0,0 +1,34 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout
    +    xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    android:orientation="vertical">
    +
    +    <include layout="@layout/appbar" />
    +
    +    <FrameLayout
    +        android:id="@+id/frame_container"
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent"
    +        />
    --- End diff --
    
    move the close tag above
    



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
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`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597253
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    +	xmlns:app="http://schemas.android.com/apk/res-auto"
    +	android:background="@drawable/nav_header"
    +	android:orientation="vertical"
    +	android:weightSum="1">
    +
     <LinearLayout
    -	xmlns:android="http://schemas.android.com/apk/res/android"
    -	xmlns:tools="http://schemas.android.com/tools"
     	android:layout_width="match_parent"
    -	android:layout_height="match_parent"
    +	android:layout_height="wrap_content"
     	android:orientation="vertical"
    -	android:background="#ccc">
    +	android:layout_alignParentBottom="true"
    +	android:layout_alignParentLeft="true"
    +	android:layout_alignParentStart="true"
    +	android:layout_marginBottom="@dimen/layout_marginBottom">
     
    -	<LinearLayout
    -		android:orientation="vertical"
    -		android:layout_width="match_parent"
    +	<TextView
    +		android:id="@+id/nav_user_name"
    +		android:layout_width="wrap_content"
     		android:layout_height="wrap_content"
    -		android:background="@drawable/sliding_header">
    -	</LinearLayout>
    +		android:layout_marginLeft="@dimen/tv_layout_marginLeft"
    +		android:textColor="@color/white"
    +		android:text="@string/username"
    +		android:textSize="@dimen/tv_textSize"
    +		android:textStyle="bold"
    +		/>
    +
    +	<TextView
    +		android:id="@+id/nav_user_email"
    +		android:layout_width="wrap_content"
    +		android:layout_height="wrap_content"
    +		android:textColor="@color/white"
    +		android:layout_marginLeft="@dimen/tv_layout_marginLeft"
    +		android:text="@string/email"
    +		android:textSize="@dimen/tv_textSize"
    +		android:textStyle="normal"
    +		/>
    +</LinearLayout>
    +
    +	<de.hdodenhof.circleimageview.CircleImageView
    +		android:id="@+id/nav_user_avatar"
    +		android:layout_width="@dimen/user_image_length"
    +		android:layout_height="@dimen/user_image_length"
    +		android:layout_marginLeft="@dimen/user_image_margin_left"
    +		android:layout_marginTop="@dimen/user_image_margin_top"
    +		app:civ_border_color="@color/white"
    +		/>
    --- End diff --
    
    move the close tag above
    



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191054525
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/UserProfileActivity.java ---
    @@ -0,0 +1,171 @@
    +package org.apache.taverna.mobile.ui;
    +
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +import android.view.View;
    +import android.widget.LinearLayout;
    +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 butterknife.BindView;
    +import butterknife.ButterKnife;
    +import de.hdodenhof.circleimageview.CircleImageView;
    +
    +import static org.apache.taverna.mobile.TavernaApplication.getContext;
    +
    +
    +public class UserProfileActivity extends AppCompatActivity{
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @BindView(R.id.user_name)
    +    TextView user_name;
    --- End diff --
    
    Use camel notation for the variable name. Also, use `m` prefix for all class variables.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192621687
  
    --- 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) {
    --- End diff --
    
    have you used this function? Please delete it if you are not using it.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579272
  
    --- Diff: app/src/main/AndroidManifest.xml ---
    @@ -1,5 +1,4 @@
    -<?xml version="1.0" encoding="utf-8"?>
    -<!--
    +<?xml version="1.0" encoding="utf-8"?><!--
    --- End diff --
    
    remove all unwanted changes from the whole file.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579246
  
    --- Diff: app/build.gradle ---
    @@ -86,6 +87,7 @@ dependencies {
     
         //Dependencies for butterknife
         implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
    +    implementation 'com.android.support:support-v4:27.1.1'
    --- End diff --
    
    We are already using this library.
    Check below line.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597078
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    +        }
    +
    +        if (description != null) {
    +            description = android.text.Html.fromHtml(description).toString();
    +            userDescription.setText(description);
    +        } else {
    +            userDescription.setText("");
    --- End diff --
    
    Why is it empty on null?


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596873
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/myworkflows/MyWorkflowsActivity.java ---
    @@ -0,0 +1,60 @@
    +package org.apache.taverna.mobile.ui.myworkflows;
    +
    +import android.support.annotation.Nullable;
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +import android.support.v7.widget.Toolbar;
    +import android.view.Menu;
    +import android.view.MenuItem;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.utils.ActivityUtils;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class MyWorkflowsActivity extends AppCompatActivity {
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @Override
    +    protected void onCreate(@Nullable Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_my_workflows);
    +
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle("My Workflows");
    --- End diff --
    
    move `"My Workflows"` to `string.xml`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579612
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,325 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"
    +                    />
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"
    +                    />
    +
    +                <TextView
    +                    android:id="@+id/user_description"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:textAlignment="center"
    +                    android:gravity="center"
    +                    android:layout_below="@id/user_name"
    +                    android:layout_marginTop="@dimen/user_description_margin_top"
    +                    android:textColor="@color/white"
    +                    android:text=""/>
    +
    +            </RelativeLayout>
    +
    +            <LinearLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="match_parent"
    +                android:orientation="vertical"
    +                >
    --- End diff --
    
    move this to above line


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596947
  
    --- 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();
    --- End diff --
    
    use `userName` in place of `name`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596897
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileActivity.java ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.taverna.mobile.ui.userprofile;
    +
    +import android.os.Bundle;
    +import android.support.annotation.Nullable;
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.support.v7.widget.Toolbar;
    +import android.view.MenuItem;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.utils.ActivityUtils;
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class UserProfileActivity extends AppCompatActivity {
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @Override
    +    protected void onCreate(@Nullable Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_user_profile);
    +
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle("Profile");
    --- End diff --
    
    move `"Profile"` to `string.xml`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597204
  
    --- Diff: app/src/main/res/layout/nav_header.xml ---
    @@ -1,35 +1,67 @@
    +<?xml version="1.0" encoding="utf-8"?>
     <!--
    -Apache Taverna Mobile
    -Copyright 2015 The Apache Software Foundation
    -This product includes software developed at
    -The Apache Software Foundation (http://www.apache.org/).
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
     
    -Licensed to the Apache Software Foundation (ASF) under one or more
    -contributor license agreements. See the NOTICE file distributed with
    -this work for additional information regarding copyright ownership.
    -The ASF licenses this file to You under the Apache License, Version 2.0
    -(the "License"); you may not use this file except in compliance with
    -the License. You may obtain a copy of the License at
    -http://www.apache.org/licenses/LICENSE-2.0
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
     -->
    +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +	android:layout_width="match_parent"
    +	android:layout_height="178dp"
    +	xmlns:app="http://schemas.android.com/apk/res-auto"
    +	android:background="@drawable/nav_header"
    +	android:orientation="vertical"
    +	android:weightSum="1">
    +
     <LinearLayout
    -	xmlns:android="http://schemas.android.com/apk/res/android"
    -	xmlns:tools="http://schemas.android.com/tools"
     	android:layout_width="match_parent"
    -	android:layout_height="match_parent"
    +	android:layout_height="wrap_content"
     	android:orientation="vertical"
    -	android:background="#ccc">
    +	android:layout_alignParentBottom="true"
    +	android:layout_alignParentLeft="true"
    +	android:layout_alignParentStart="true"
    +	android:layout_marginBottom="@dimen/layout_marginBottom">
     
    -	<LinearLayout
    -		android:orientation="vertical"
    -		android:layout_width="match_parent"
    +	<TextView
    +		android:id="@+id/nav_user_name"
    +		android:layout_width="wrap_content"
     		android:layout_height="wrap_content"
    -		android:background="@drawable/sliding_header">
    -	</LinearLayout>
    +		android:layout_marginLeft="@dimen/tv_layout_marginLeft"
    +		android:textColor="@color/white"
    +		android:text="@string/username"
    +		android:textSize="@dimen/tv_textSize"
    +		android:textStyle="bold"
    +		/>
    --- End diff --
    
    move the close tag above
    



---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579359
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +284,44 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +        NavigationView navigationView =  findViewById(R.id.nav_view);
    +        View header_view =  navigationView.getHeaderView(0);
    +
    +        String avatar = dataManager.getPreferencesHelper().getUserAvatar();
    +        final CircleImageView nav_user_avatar = header_view.findViewById(R.id.nav_user_avatar);
    --- End diff --
    
    make it `navUserAvatar` in place of `nav_user_avatar`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597039
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    --- End diff --
    
    make `getUserAvatar()` to `getUserAvatarUrl()`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597010
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    --- End diff --
    
    use `userCity` in place of `city`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579292
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java ---
    @@ -271,6 +284,44 @@ private void signOut() {
             finish();
         }
     
    +    private void setNavHeader() {
    +        NavigationView navigationView =  findViewById(R.id.nav_view);
    --- End diff --
    
    use butterknife for this.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596861
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/favouriteworkflow/FavouriteWorkflowsActivity.java ---
    @@ -0,0 +1,60 @@
    +package org.apache.taverna.mobile.ui.favouriteworkflow;
    +
    +import android.support.annotation.Nullable;
    +import android.support.v7.app.ActionBar;
    +import android.support.v7.app.AppCompatActivity;
    +import android.os.Bundle;
    +import android.support.v7.widget.Toolbar;
    +import android.view.Menu;
    +import android.view.MenuItem;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.utils.ActivityUtils;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class FavouriteWorkflowsActivity extends AppCompatActivity {
    +
    +    @BindView(R.id.toolbar)
    +    Toolbar mToolbar;
    +
    +    @Override
    +    protected void onCreate(@Nullable Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +        setContentView(R.layout.activity_favourite_workflows);
    +
    +        ButterKnife.bind(this);
    +
    +        setSupportActionBar(mToolbar);
    +        ActionBar actionbar = getSupportActionBar();
    +
    +        if (actionbar != null) {
    +            actionbar.setHomeButtonEnabled(true);
    +            actionbar.setDisplayHomeAsUpEnabled(true);
    +            actionbar.setTitle("Favourite Workflows");
    --- End diff --
    
    move `"Favourite Workflows"`to `string.xml`


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597157
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,322 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"/>
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"/>
    +
    +                <TextView
    +                    android:id="@+id/user_description"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:textAlignment="center"
    +                    android:gravity="center"
    +                    android:layout_below="@id/user_name"
    +                    android:layout_marginTop="@dimen/user_description_margin_top"
    +                    android:textColor="@color/white"
    +                    android:text=""/>
    +
    +            </RelativeLayout>
    +
    +            <LinearLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="match_parent"
    +                android:orientation="vertical">
    +
    +                <LinearLayout
    +                    android:id="@+id/email_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_email_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_email"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_email"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/website_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_language_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_website"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_website"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    --- End diff --
    
    remove this.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by Hiteshgautam01 <gi...@git.apache.org>.
Github user Hiteshgautam01 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192598483
  
    --- 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();
    +        String city = dataManager.getPreferencesHelper().getUserCity();
    +        String country = dataManager.getPreferencesHelper().getUserCountry();
    +
    +        String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar();
    +        Glide.with(getContext())
    +                .load(avatarUrl)
    +                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                .placeholder(R.drawable.ic_account_circle_black_24dp)
    +                .error(R.drawable.ic_account_circle_black_24dp)
    +                .into(new SimpleTarget<GlideDrawable>() {
    +                    @Override
    +                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super
    +                            GlideDrawable> glideAnimation) {
    +                        userAvatar.setImageDrawable(resource);
    +                    }
    +                });
    +
    +        if (name != null) {
    +            userName.setText(name);
    +        } else {
    +            userName.setText("<NA>");
    +        }
    +
    +        if (description != null) {
    +            description = android.text.Html.fromHtml(description).toString();
    +            userDescription.setText(description);
    +        } else {
    +            userDescription.setText("");
    --- End diff --
    
    In the UI screenshot, the description is under the name of the user. If anyone has not included the description and we set the field to null then the UI does not look incomplete or blank for a field.  And if we set <NA> then it looks ugly under the name and the user can't find that the <NA> field is for description.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597166
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,322 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"/>
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"/>
    +
    +                <TextView
    +                    android:id="@+id/user_description"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:textAlignment="center"
    +                    android:gravity="center"
    +                    android:layout_below="@id/user_name"
    +                    android:layout_marginTop="@dimen/user_description_margin_top"
    +                    android:textColor="@color/white"
    +                    android:text=""/>
    +
    +            </RelativeLayout>
    +
    +            <LinearLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="match_parent"
    +                android:orientation="vertical">
    +
    +                <LinearLayout
    +                    android:id="@+id/email_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_email_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_email"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_email"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/website_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_language_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_website"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_website"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    +                        android:textSize="@dimen/row_entry_text_size"
    +                        android:layout_gravity="center_vertical"
    +                        android:paddingRight="@dimen/row_entry_padding_right"/>
    +
    +                </LinearLayout>
    +
    +                <LinearLayout
    +                    android:id="@+id/city_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_location_city_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_city"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_city"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    --- End diff --
    
    remove this.


---

[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...

Posted by sagar15795 <gi...@git.apache.org>.
Github user sagar15795 commented on a diff in the pull request:

    https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597150
  
    --- Diff: app/src/main/res/layout/fragment_user_profile.xml ---
    @@ -0,0 +1,322 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<!--
    +   Licensed to the Apache Software Foundation (ASF) under one or more
    +   contributor license agreements.  See the NOTICE file distributed with
    +   this work for additional information regarding copyright ownership.
    +   The ASF licenses this file to You under the Apache License, Version 2.0
    +   (the "License"); you may not use this file except in compliance with
    +   the License.  You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +-->
    +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    +    android:layout_width="match_parent"
    +    android:layout_height="match_parent"
    +    xmlns:app="http://schemas.android.com/apk/res-auto"
    +    android:orientation="vertical">
    +
    +    <android.support.v4.widget.NestedScrollView
    +        android:layout_width="match_parent"
    +        android:layout_height="match_parent">
    +
    +        <LinearLayout
    +            android:layout_width="match_parent"
    +            android:layout_height="wrap_content"
    +            android:orientation="vertical">
    +
    +            <RelativeLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="@dimen/top_background_height"
    +                android:orientation="vertical"
    +                android:background="@color/colorPrimary"
    +                android:gravity="center_vertical">
    +
    +                <de.hdodenhof.circleimageview.CircleImageView
    +                    android:id="@+id/user_avatar"
    +                    android:layout_width="@dimen/user_image_height"
    +                    android:layout_height="@dimen/user_image_height"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_centerVertical="true"
    +                    android:layout_centerInParent="true"
    +                    android:layout_alignParentTop="true"
    +                    app:civ_border_color="@color/white"/>
    +
    +                <TextView
    +                    android:id="@+id/user_name"
    +                    android:layout_width="wrap_content"
    +                    android:layout_height="wrap_content"
    +                    android:text="@string/user_name"
    +                    android:textColor="@color/white"
    +                    android:textSize="@dimen/user_name_text_size"
    +                    android:layout_below="@+id/user_avatar"
    +                    android:layout_centerHorizontal="true"
    +                    android:layout_marginTop="@dimen/user_name_margin_top"/>
    +
    +                <TextView
    +                    android:id="@+id/user_description"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:textAlignment="center"
    +                    android:gravity="center"
    +                    android:layout_below="@id/user_name"
    +                    android:layout_marginTop="@dimen/user_description_margin_top"
    +                    android:textColor="@color/white"
    +                    android:text=""/>
    +
    +            </RelativeLayout>
    +
    +            <LinearLayout
    +                android:layout_width="match_parent"
    +                android:layout_height="match_parent"
    +                android:orientation="vertical">
    +
    +                <LinearLayout
    +                    android:id="@+id/email_layout"
    +                    android:layout_width="match_parent"
    +                    android:layout_height="wrap_content"
    +                    android:orientation="horizontal">
    +
    +                    <LinearLayout
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:layout_weight="1"
    +                        android:padding="@dimen/coloumn_linear_layout_padding"
    +                        android:orientation="horizontal">
    +
    +                        <ImageView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:src="@drawable/ic_email_black_24dp"/>
    +
    +                        <TextView
    +                            android:layout_width="wrap_content"
    +                            android:layout_height="wrap_content"
    +                            android:text="@string/user_email"
    +                            android:textColor="@color/colorBlack"
    +                            android:textSize="@dimen/row_title_text_size"
    +                            android:layout_marginLeft="@dimen/row_title_margin_left"
    +                            android:layout_gravity="center"/>
    +
    +                    </LinearLayout>
    +
    +                    <TextView
    +                        android:id="@+id/user_email"
    +                        android:layout_width="wrap_content"
    +                        android:layout_height="wrap_content"
    +                        android:text=""
    --- End diff --
    
    remove this.


---