You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by sagar15795 <gi...@git.apache.org> on 2016/06/16 19:37:57 UTC

[GitHub] incubator-taverna-mobile pull request #18: [WIP]Redesigning the workflow sho...

GitHub user sagar15795 opened a pull request:

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

    [WIP]Redesigning the workflow showing method 

    - [ ]  Design UI for WorkFlows.
    - [x]  Add Retrofit Network Request in ApiManager 
    - [x]  Add ApiManger wiring with the DataManager.
    - [ ]  [WIP]Add Network call in WorkFlows Presenter (Logic class) class and showing in RecyclerView.
    - [ ]  Design Workflow details UI.
    - [ ]  Add Workflow Details Network call and parsing with UI, when will click on the workflow.

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

    $ git pull https://github.com/sagar15795/incubator-taverna-mobile Dashboard

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

    https://github.com/apache/incubator-taverna-mobile/pull/18.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 #18
    
----
commit 29c308ea83e092f8819710da6777f770380953d4
Author: Sagar <ku...@gmail.com>
Date:   2016-06-15T18:27:59Z

    add workflow model class

commit 735a21f81644cbbee2d702f68c44f04a927750a5
Author: Sagar <ku...@gmail.com>
Date:   2016-06-15T18:40:46Z

    add Retrofit service for get all Workflow

commit 5690ec2ea1eeddfb43b2957a58891db89f477e2a
Author: Sagar <ku...@gmail.com>
Date:   2016-06-15T18:41:25Z

    add DataManager for getting all Workflow

commit 7407a1a6634a5f8ee8fe2f6909f9f67ad351cbc4
Author: Sagar <ku...@gmail.com>
Date:   2016-06-15T18:45:47Z

    refactor class path

commit 1a772560d847dbad4aa0bebf184b47734f918da6
Author: Sagar <ku...@gmail.com>
Date:   2016-06-16T19:27:13Z

    add Workflow detail pojo

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700708
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/APIEndPoint.java ---
    @@ -0,0 +1,29 @@
    +/*
    + * 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.data.remote;
    +
    +//This class contains all the Constants for API End Points
    +
    +public class APIEndPoint {
    +    public static final String ALLANNOUNCEMENT = "announcements.xml";
    --- End diff --
    
    ALLANNOUNCEMENT to ALL_ANNOUNCEMENT


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: [WIP]Redesigning the workflow sho...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68404988
  
    --- Diff: app/build.gradle ---
    @@ -59,4 +61,7 @@ dependencies {
             exclude module: 'stax-api'
             exclude module: 'xpp3'
         }
    +
    +    compile 'com.github.bumptech.glide:glide:3.6.0'
    +    compile 'com.caverock:androidsvg:1.2.1'
    --- End diff --
    
    License OK: [Apache License 2.0](https://github.com/BigBadaboom/androidsvg)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68718477
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/adapter/WorkflowAdapter.java ---
    @@ -0,0 +1,159 @@
    +package org.apache.taverna.mobile.ui.adapter;
    +
    +import com.bumptech.glide.GenericRequestBuilder;
    +import com.bumptech.glide.Glide;
    +import com.bumptech.glide.load.engine.DiskCacheStrategy;
    +import com.bumptech.glide.load.model.StreamEncoder;
    +import com.bumptech.glide.load.resource.file.FileToStreamDecoder;
    +import com.caverock.androidsvg.SVG;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.utils.SvgDecoder;
    +import org.apache.taverna.mobile.utils.SvgDrawableTranscoder;
    +import org.apache.taverna.mobile.utils.SvgSoftwareLayerSetter;
    +
    +import android.content.Context;
    +import android.graphics.drawable.PictureDrawable;
    +import android.net.Uri;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ImageView;
    +import android.widget.ProgressBar;
    +import android.widget.TextView;
    +
    +import java.io.InputStream;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    +
    +    private final int VIEW_ITEM = 1;
    +    private final int VIEW_PROG = 0;
    +
    +    private static final String TAG = WorkflowAdapter.class.getName();
    +
    +    private final List<Workflow> mWorkflowList;
    +
    +    private final Context context;
    +
    +    private GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder;
    +
    +    public WorkflowAdapter(List<Workflow> mWorkflowList, Context context) {
    +        this.mWorkflowList = mWorkflowList;
    +        this.context = context;
    +    }
    +
    +    public void addWorkflow(Workflow workflow) {
    +        this.mWorkflowList.add(workflow);
    +        this.notifyDataSetChanged();
    +
    +    }
    +
    +    @Override
    +    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    +        RecyclerView.ViewHolder vh;
    +
    +        requestBuilder = Glide.with(context)
    --- End diff --
    
    Remove from here and put in Contractor 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700451
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/DetailWorkflow.java ---
    @@ -0,0 +1,256 @@
    +/*
    + * 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.data.model;
    +
    +
    +import org.simpleframework.xml.Attribute;
    +import org.simpleframework.xml.Element;
    +import org.simpleframework.xml.ElementList;
    +import org.simpleframework.xml.Root;
    +
    +import android.os.Parcel;
    +import android.os.Parcelable;
    +
    +import java.util.List;
    +
    +@Root(name = "workflow")
    +public class DetailWorkflow implements Parcelable {
    +
    +    @Attribute(name = "resource", required = false)
    --- End diff --
    
    Leave one line gape between the POJO objects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701651
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowFragment.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.workflow;
    +
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.DataManager;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.data.model.Workflows;
    +import org.apache.taverna.mobile.ui.adapter.EndlessRecyclerOnScrollListener;
    +import org.apache.taverna.mobile.ui.adapter.WorkflowAdapter;
    +import org.apache.taverna.mobile.utils.ConnectionInfo;
    +
    +import android.os.Bundle;
    +import android.support.v4.app.Fragment;
    +import android.support.v7.widget.DefaultItemAnimator;
    +import android.support.v7.widget.LinearLayoutManager;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ProgressBar;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowFragment extends Fragment implements WorkflowMvpView {
    +    public final String LOG_TAG = getClass().getSimpleName();
    +
    +    @BindView(R.id.rvDashboard)
    +    RecyclerView mRecyclerView;
    +
    +    @BindView(R.id.progress_circular)
    +    ProgressBar mProgressBar;
    +
    +    private DataManager dataManager;
    +
    +    private WorkflowPresenter mWorkflowPresenter;
    +
    +    private WorkflowAdapter mWorkflowAdapter;
    +
    +    private ConnectionInfo mConnectionInfo;
    +    private int mPageNumber = 1;
    +    private List<Workflow> mWorkflowList;
    +
    +    @Override
    +    public void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +
    +        mWorkflowList = new ArrayList<>();
    +        dataManager = new DataManager();
    +        mWorkflowPresenter = new WorkflowPresenter(dataManager);
    +        mConnectionInfo = new ConnectionInfo(getContext());
    +    }
    +
    +    @Override
    +    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
    +            savedInstanceState) {
    +
    +        View rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
    +        ButterKnife.bind(this, rootView);
    +        mWorkflowPresenter.attachView(this);
    +
    +        final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    +
    +        mRecyclerView.setLayoutManager(layoutManager);
    +        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    +        mRecyclerView.hasFixedSize();
    +        mWorkflowAdapter = new WorkflowAdapter(mWorkflowList, getContext());
    +        mRecyclerView.setAdapter(mWorkflowAdapter);
    +
    +        showProgressbar(true);
    --- End diff --
    
    Remove this method call and Handle all Logic call in Presenter


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700589
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/Uploader.java ---
    @@ -0,0 +1,105 @@
    +/*
    + * 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.data.model;
    +
    +import org.simpleframework.xml.Attribute;
    +import org.simpleframework.xml.Root;
    +import org.simpleframework.xml.Text;
    +
    +import android.os.Parcel;
    +import android.os.Parcelable;
    +
    +@Root(name = "uploader")
    +public class Uploader implements Parcelable {
    +    @Attribute(name = "resource", required = false)
    --- End diff --
    
    Leave one line gap between the POJO objects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700572
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/Type.java ---
    @@ -0,0 +1,106 @@
    +/*
    + * 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.data.model;
    +
    +import org.simpleframework.xml.Attribute;
    +import org.simpleframework.xml.Root;
    +import org.simpleframework.xml.Text;
    +
    +import android.os.Parcel;
    +import android.os.Parcelable;
    +
    +@Root(name = "type")
    +public class Type implements Parcelable {
    +
    +    @Attribute(name = "resource", required = false)
    +    String resource;
    --- End diff --
    
    Leave one line gap between the POJO objects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700360
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/BaseApiManager.java ---
    @@ -26,6 +42,7 @@ public BaseApiManager() {
                     .baseUrl(ENDPOINT)
    --- End diff --
    
    Replace ENDPOINT to END_POINT and make public static


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: [WIP]Redesigning the workflow sho...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68405148
  
    --- Diff: app/build.gradle ---
    @@ -40,6 +40,8 @@ dependencies {
     
         compile 'com.squareup.retrofit2:retrofit:2.0.2'
         compile "com.squareup.retrofit2:adapter-rxjava:2.0.2"
    +    compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
    --- End diff --
    
    License OK: [Apache License 2.0](https://github.com/square/okhttp/blob/master/LICENSE.txt)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700542
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/LicenseType.java ---
    @@ -0,0 +1,106 @@
    +/*
    + * 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.data.model;
    +
    +
    +import org.simpleframework.xml.Attribute;
    +import org.simpleframework.xml.Text;
    +
    +import android.os.Parcel;
    +import android.os.Parcelable;
    +
    +public class LicenseType implements Parcelable {
    +
    +    @Attribute(name = "resource", required = false)
    --- End diff --
    
    Leave one line gap between the POJO objects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701369
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/adapter/EndlessRecyclerOnScrollListener.java ---
    @@ -28,7 +28,7 @@
         private int previousTotal = 0; // The total number of items in the dataset after the last load
         private boolean loading = true; // True if we are still waiting for the last set of data to
         // load.
    -    private int visibleThreshold = 1; // The minimum amount of items to have below your current
    +    private int visibleThreshold = 5; // The minimum amount of items to have below your current
    --- End diff --
    
    initialize visibleThreshold = 1 because we don't want to API Request till that user will reach to the last element


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700562
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/Tag.java ---
    @@ -0,0 +1,106 @@
    +/*
    + * 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.data.model;
    +
    +
    +import org.simpleframework.xml.Attribute;
    +import org.simpleframework.xml.Root;
    +import org.simpleframework.xml.Text;
    +
    +import android.os.Parcel;
    +import android.os.Parcelable;
    +@Root(name = "tag")
    +public class Tag implements Parcelable {
    +
    +    @Attribute(name = "resource", required = false)
    +    String resource;
    --- End diff --
    
    Leave one line gap between the POJO objects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700784
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/BaseApiManager.java ---
    @@ -26,6 +42,7 @@ public BaseApiManager() {
                     .baseUrl(ENDPOINT)
    --- End diff --
    
    Replace ENDPOINT to END_POINT and make public static


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700721
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/APIEndPoint.java ---
    @@ -0,0 +1,29 @@
    +/*
    + * 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.data.remote;
    +
    +//This class contains all the Constants for API End Points
    +
    +public class APIEndPoint {
    --- End diff --
    
    Good Job \U0001f44d  for this implementation


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700633
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/APIEndPoint.java ---
    @@ -0,0 +1,29 @@
    +/*
    + * 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.data.remote;
    +
    +//This class contains all the Constants for API End Points
    +
    +public class APIEndPoint {
    +    public static final String ALLANNOUNCEMENT = "announcements.xml";
    +    public static final String ANNOUNCEMENT = "announcement.xml";
    --- End diff --
    
    Good Job \U0001f44d 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701732
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowFragment.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.workflow;
    +
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.DataManager;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.data.model.Workflows;
    +import org.apache.taverna.mobile.ui.adapter.EndlessRecyclerOnScrollListener;
    +import org.apache.taverna.mobile.ui.adapter.WorkflowAdapter;
    +import org.apache.taverna.mobile.utils.ConnectionInfo;
    +
    +import android.os.Bundle;
    +import android.support.v4.app.Fragment;
    +import android.support.v7.widget.DefaultItemAnimator;
    +import android.support.v7.widget.LinearLayoutManager;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ProgressBar;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowFragment extends Fragment implements WorkflowMvpView {
    +    public final String LOG_TAG = getClass().getSimpleName();
    +
    +    @BindView(R.id.rvDashboard)
    +    RecyclerView mRecyclerView;
    +
    +    @BindView(R.id.progress_circular)
    +    ProgressBar mProgressBar;
    +
    +    private DataManager dataManager;
    +
    +    private WorkflowPresenter mWorkflowPresenter;
    +
    +    private WorkflowAdapter mWorkflowAdapter;
    +
    +    private ConnectionInfo mConnectionInfo;
    +    private int mPageNumber = 1;
    +    private List<Workflow> mWorkflowList;
    +
    +    @Override
    +    public void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +
    +        mWorkflowList = new ArrayList<>();
    +        dataManager = new DataManager();
    +        mWorkflowPresenter = new WorkflowPresenter(dataManager);
    +        mConnectionInfo = new ConnectionInfo(getContext());
    +    }
    +
    +    @Override
    +    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
    +            savedInstanceState) {
    +
    +        View rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
    +        ButterKnife.bind(this, rootView);
    +        mWorkflowPresenter.attachView(this);
    +
    +        final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    +
    +        mRecyclerView.setLayoutManager(layoutManager);
    +        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    +        mRecyclerView.hasFixedSize();
    +        mWorkflowAdapter = new WorkflowAdapter(mWorkflowList, getContext());
    +        mRecyclerView.setAdapter(mWorkflowAdapter);
    +
    +        showProgressbar(true);
    +        mWorkflowPresenter.loadAllWorkflow(mPageNumber);
    +
    +        mRecyclerView.setOnScrollListener(new EndlessRecyclerOnScrollListener(layoutManager) {
    --- End diff --
    
    setOnScrollListener is depreciated use addOnScrollListener


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701197
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/adapter/WorkflowAdapter.java ---
    @@ -0,0 +1,149 @@
    +package org.apache.taverna.mobile.ui.adapter;
    +
    +import com.bumptech.glide.GenericRequestBuilder;
    +import com.bumptech.glide.Glide;
    +import com.bumptech.glide.load.engine.DiskCacheStrategy;
    +import com.bumptech.glide.load.model.StreamEncoder;
    +import com.bumptech.glide.load.resource.file.FileToStreamDecoder;
    +import com.caverock.androidsvg.SVG;
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.utils.SvgDecoder;
    +import org.apache.taverna.mobile.utils.SvgDrawableTranscoder;
    +import org.apache.taverna.mobile.utils.SvgSoftwareLayerSetter;
    +
    +import android.content.Context;
    +import android.graphics.drawable.PictureDrawable;
    +import android.net.Uri;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ImageView;
    +import android.widget.ProgressBar;
    +import android.widget.TextView;
    +
    +import java.io.InputStream;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    +
    +    private final int VIEW_ITEM = 1;
    +    private final int VIEW_PROG = 0;
    +
    +    private static final String TAG = WorkflowAdapter.class.getName();
    +
    +    private final List<Workflow> mWorkflowList;
    +
    +    private final Context context;
    +
    +    private GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder;
    +
    +    public WorkflowAdapter(List<Workflow> mWorkflowList, Context context) {
    +        this.mWorkflowList = mWorkflowList;
    +        this.context = context;
    +    }
    +
    +    public void addWorkflow(Workflow workflow) {
    +        this.mWorkflowList.add(workflow);
    +        this.notifyDataSetChanged();
    +
    +    }
    +
    +    @Override
    +    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    +        RecyclerView.ViewHolder vh;
    +        requestBuilder = Glide.with(context)
    +                .using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class)
    +                .from(Uri.class)
    +                .as(SVG.class)
    +                .transcode(new SvgDrawableTranscoder(), PictureDrawable.class)
    +                .sourceEncoder(new StreamEncoder())
    +                .cacheDecoder(new FileToStreamDecoder<SVG>(new SvgDecoder()))
    +                .decoder(new SvgDecoder())
    +                .placeholder(R.drawable.tavernalogo)
    +                .error(R.drawable.tavernalogo)
    +                .animate(android.R.anim.fade_in)
    +                .listener(new SvgSoftwareLayerSetter<Uri>());
    +        if (viewType == VIEW_ITEM) {
    +            View v = LayoutInflater.from(parent.getContext()).inflate(
    +                    R.layout.item_recyclerview_dashboard, parent, false);
    +
    +            vh = new ViewHolder(v);
    +        } else {
    +            View v = LayoutInflater.from(parent.getContext()).inflate(
    +                    R.layout.item_progressbar, parent, false);
    +
    +            vh = new ProgressViewHolder(v);
    +        }
    +        return vh;
    +    }
    +
    +    @Override
    +    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    +        if (holder instanceof ViewHolder) {
    +
    +            Workflow workflow = mWorkflowList.get(position);
    +            String date = workflow.getCreatedAt()
    +                    .substring(0, workflow.getCreatedAt().indexOf(' '));
    +            ((ViewHolder) holder).tvDate.setText(date);
    +            ((ViewHolder) holder).tvTitle.setText(workflow.getTitle());
    +            ((ViewHolder) holder).tvType.setText(workflow.getType().getContent());
    +            ((ViewHolder) holder).tvUploader.setText(workflow.getUploader().getContent());
    +            Uri uri = Uri.parse(workflow.getSvgUri());
    +            requestBuilder
    +                    .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    +                    .load(uri)
    +                    .placeholder(R.drawable.placeholder)
    +                    .error(R.drawable.placeholder)
    +                    .into(((ViewHolder) holder).ivWorkflowImage);
    +        }
    +    }
    +
    +    @Override
    +    public int getItemCount() {
    +        Log.d(TAG, "getItemCount: " + mWorkflowList.size());
    +        return mWorkflowList.size();
    +    }
    +
    +    @Override
    +    public int getItemViewType(int position) {
    +        return mWorkflowList.get(position) != null ? VIEW_ITEM : VIEW_PROG;
    +    }
    +
    +
    +    class ViewHolder extends RecyclerView.ViewHolder {
    +
    +        @BindView(R.id.tvDate)
    --- End diff --
    
    Give a line gap between the Objects


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700508
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/model/Author.java ---
    @@ -6,9 +24,7 @@
     import android.os.Parcel;
     import android.os.Parcelable;
     
    -/**
    - * Created by Sagar
    - */
    +
     public class Author implements Parcelable {
     
         public static final Parcelable.Creator<Author> CREATOR = new Parcelable.Creator<Author>() {
    --- End diff --
    
    POJO objects should be first and then getter setter and at last Parcelable code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68700750
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/APIEndPoint.java ---
    @@ -0,0 +1,29 @@
    +/*
    + * 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.data.remote;
    +
    +//This class contains all the Constants for API End Points
    +
    +public class APIEndPoint {
    +    public static final String ALLANNOUNCEMENT = "announcements.xml";
    +    public static final String ANNOUNCEMENT = "announcement.xml";
    +    public static final String ALLWORKFLOW = "workflows.xml";
    --- End diff --
    
    ALLWORKFLOW to ALL_WORKFLOW


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: [WIP]Redesigning the workflow sho...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68405092
  
    --- Diff: app/build.gradle ---
    @@ -59,4 +61,7 @@ dependencies {
             exclude module: 'stax-api'
             exclude module: 'xpp3'
         }
    +
    +    compile 'com.github.bumptech.glide:glide:3.6.0'
    --- End diff --
    
    License OK: [BSD 2-Clause and Apache](https://github.com/bumptech/glide/blob/master/LICENSE)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701840
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowFragment.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.workflow;
    +
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.DataManager;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.data.model.Workflows;
    +import org.apache.taverna.mobile.ui.adapter.EndlessRecyclerOnScrollListener;
    +import org.apache.taverna.mobile.ui.adapter.WorkflowAdapter;
    +import org.apache.taverna.mobile.utils.ConnectionInfo;
    +
    +import android.os.Bundle;
    +import android.support.v4.app.Fragment;
    +import android.support.v7.widget.DefaultItemAnimator;
    +import android.support.v7.widget.LinearLayoutManager;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ProgressBar;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowFragment extends Fragment implements WorkflowMvpView {
    +    public final String LOG_TAG = getClass().getSimpleName();
    +
    +    @BindView(R.id.rvDashboard)
    +    RecyclerView mRecyclerView;
    +
    +    @BindView(R.id.progress_circular)
    +    ProgressBar mProgressBar;
    +
    +    private DataManager dataManager;
    +
    +    private WorkflowPresenter mWorkflowPresenter;
    +
    +    private WorkflowAdapter mWorkflowAdapter;
    +
    +    private ConnectionInfo mConnectionInfo;
    +    private int mPageNumber = 1;
    +    private List<Workflow> mWorkflowList;
    +
    +    @Override
    +    public void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +
    +        mWorkflowList = new ArrayList<>();
    +        dataManager = new DataManager();
    +        mWorkflowPresenter = new WorkflowPresenter(dataManager);
    +        mConnectionInfo = new ConnectionInfo(getContext());
    +    }
    +
    +    @Override
    +    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
    +            savedInstanceState) {
    +
    +        View rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
    +        ButterKnife.bind(this, rootView);
    +        mWorkflowPresenter.attachView(this);
    +
    +        final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    +
    +        mRecyclerView.setLayoutManager(layoutManager);
    +        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    +        mRecyclerView.hasFixedSize();
    +        mWorkflowAdapter = new WorkflowAdapter(mWorkflowList, getContext());
    +        mRecyclerView.setAdapter(mWorkflowAdapter);
    +
    +        showProgressbar(true);
    +        mWorkflowPresenter.loadAllWorkflow(mPageNumber);
    +
    +        mRecyclerView.setOnScrollListener(new EndlessRecyclerOnScrollListener(layoutManager) {
    +            @Override
    +            public void onLoadMore(int current_page) {
    +
    +                if (mConnectionInfo.isConnectingToInternet()
    +                        && mWorkflowList.size() % 10 == 0) {
    +                    mWorkflowList.add(null);
    +                    mWorkflowAdapter.notifyItemInserted(mWorkflowList.size());
    +                    ++mPageNumber;
    +                    mWorkflowPresenter.loadAllWorkflow(mPageNumber);
    +                    Log.i(LOG_TAG, "Loading more");
    +                } else if (!mConnectionInfo.isConnectingToInternet()) {
    +                    Log.i(LOG_TAG, "Internet not available. Not loading more posts.");
    --- End diff --
    
    Same as above


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-taverna-mobile pull request #18: Redesigning the workflow showing ...

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

    https://github.com/apache/incubator-taverna-mobile/pull/18#discussion_r68701830
  
    --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowFragment.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.workflow;
    +
    +
    +import org.apache.taverna.mobile.R;
    +import org.apache.taverna.mobile.data.DataManager;
    +import org.apache.taverna.mobile.data.model.Workflow;
    +import org.apache.taverna.mobile.data.model.Workflows;
    +import org.apache.taverna.mobile.ui.adapter.EndlessRecyclerOnScrollListener;
    +import org.apache.taverna.mobile.ui.adapter.WorkflowAdapter;
    +import org.apache.taverna.mobile.utils.ConnectionInfo;
    +
    +import android.os.Bundle;
    +import android.support.v4.app.Fragment;
    +import android.support.v7.widget.DefaultItemAnimator;
    +import android.support.v7.widget.LinearLayoutManager;
    +import android.support.v7.widget.RecyclerView;
    +import android.util.Log;
    +import android.view.LayoutInflater;
    +import android.view.View;
    +import android.view.ViewGroup;
    +import android.widget.ProgressBar;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import butterknife.BindView;
    +import butterknife.ButterKnife;
    +
    +public class WorkflowFragment extends Fragment implements WorkflowMvpView {
    +    public final String LOG_TAG = getClass().getSimpleName();
    +
    +    @BindView(R.id.rvDashboard)
    +    RecyclerView mRecyclerView;
    +
    +    @BindView(R.id.progress_circular)
    +    ProgressBar mProgressBar;
    +
    +    private DataManager dataManager;
    +
    +    private WorkflowPresenter mWorkflowPresenter;
    +
    +    private WorkflowAdapter mWorkflowAdapter;
    +
    +    private ConnectionInfo mConnectionInfo;
    +    private int mPageNumber = 1;
    +    private List<Workflow> mWorkflowList;
    +
    +    @Override
    +    public void onCreate(Bundle savedInstanceState) {
    +        super.onCreate(savedInstanceState);
    +
    +        mWorkflowList = new ArrayList<>();
    +        dataManager = new DataManager();
    +        mWorkflowPresenter = new WorkflowPresenter(dataManager);
    +        mConnectionInfo = new ConnectionInfo(getContext());
    +    }
    +
    +    @Override
    +    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
    +            savedInstanceState) {
    +
    +        View rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
    +        ButterKnife.bind(this, rootView);
    +        mWorkflowPresenter.attachView(this);
    +
    +        final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    +
    +        mRecyclerView.setLayoutManager(layoutManager);
    +        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    +        mRecyclerView.hasFixedSize();
    +        mWorkflowAdapter = new WorkflowAdapter(mWorkflowList, getContext());
    +        mRecyclerView.setAdapter(mWorkflowAdapter);
    +
    +        showProgressbar(true);
    +        mWorkflowPresenter.loadAllWorkflow(mPageNumber);
    +
    +        mRecyclerView.setOnScrollListener(new EndlessRecyclerOnScrollListener(layoutManager) {
    +            @Override
    +            public void onLoadMore(int current_page) {
    +
    +                if (mConnectionInfo.isConnectingToInternet()
    +                        && mWorkflowList.size() % 10 == 0) {
    +                    mWorkflowList.add(null);
    +                    mWorkflowAdapter.notifyItemInserted(mWorkflowList.size());
    +                    ++mPageNumber;
    +                    mWorkflowPresenter.loadAllWorkflow(mPageNumber);
    +                    Log.i(LOG_TAG, "Loading more");
    --- End diff --
    
    Please use Log carefully read this http://stackoverflow.com/a/7959379/3176277.
    Here Lod.d should be used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---