[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-10-03 Thread sagar15795
Github user sagar15795 commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81689609
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -49,11 +52,19 @@
 
 private static final String PREF_KEY_USER_WEBSITE = 
"pref_user_website";
 
+private static final String PREF_KEY_PLAYER_CREDENTIAL = 
"pref_player_credential";
+
+public static final String PREF_KEY_PLAYER_URL = "pref_player_url";
+
+public static final String PLAYER_DEFAULT_URL = 
"http://139.59.28.12:3000/";;
--- End diff --

This is mine server.

It will be good if we can get server from Apache INFRA.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-10-03 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-10-03 Thread stain
Github user stain commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81539219
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -49,11 +52,19 @@
 
 private static final String PREF_KEY_USER_WEBSITE = 
"pref_user_website";
 
+private static final String PREF_KEY_PLAYER_CREDENTIAL = 
"pref_player_credential";
+
+public static final String PREF_KEY_PLAYER_URL = "pref_player_url";
+
+public static final String PLAYER_DEFAULT_URL = 
"http://139.59.28.12:3000/";;
--- End diff --

Could we avoid hard-coding this particular server? I have no idea which 
server that is.. :)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81198174
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -169,4 +178,25 @@ private void setUserAvatar(String userAvatar) {
 
 }
 
+public boolean isUserPlayerLoggedInFlag() {
+return mPref.getBoolean(PREF_KEY_PLAYER_LOGGED_IN, false);
+}
+
+public void setUserPlayerLoggedInFlagAndCredential(Boolean flag, 
String credential) {
+mPref.edit().putBoolean(PREF_KEY_PLAYER_LOGGED_IN, flag).apply();
+mPref.edit().putString(PREF_KEY_PLAYER_CREDENTIAL, 
credential).apply();
+}
+
+public void setUserPlayerLoggedInFlag(Boolean flag) {
+mPref.edit().putBoolean(PREF_KEY_PLAYER_LOGGED_IN, flag).apply();
+
+}
+
+public String getUserPlayerCredential() {
+return mPref.getString(PREF_KEY_PLAYER_CREDENTIAL, " ");
+}
+
+public String getPlayerURL() {
+return sharedPref.getString(PREF_KEY_PLAYER_URL, 
"http://139.59.28.12:3000/";);
--- End diff --

make string variable global and use it here, So that next time when you 
will change this address then you do not need to go through whole file.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117469
  
--- Diff: app/src/main/res/layout/fragment_player_login_layout.xml ---
@@ -0,0 +1,86 @@
+
+
+http://schemas.android.com/apk/res/android";
+android:layout_width="match_parent"
+android:layout_height="match_parent"
+android:padding="40dp"
+>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117416
  
--- Diff: app/src/main/res/layout/fragment_player_login_layout.xml ---
@@ -0,0 +1,86 @@
+
+
+http://schemas.android.com/apk/res/android";
+android:layout_width="match_parent"
+android:layout_height="match_parent"
+android:padding="40dp"
+>
+
+
--- End diff --

Remove hard coded string to strings.xml



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117376
  
--- Diff: app/src/main/res/layout/fragment_downloading.xml ---
@@ -0,0 +1,50 @@
+
+
+http://schemas.android.com/apk/res/android";
+android:layout_width="match_parent"
+android:layout_height="match_parent">
+
+
+
+
+
+
--- End diff --

Remove hard-coded string


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117238
  
--- Diff: app/src/main/res/layout/fragment_detail_workflow.xml ---
@@ -15,123 +15,147 @@
See the License for the specific language governing permissions and
limitations under the License.
 -->
-http://schemas.android.com/apk/res/android";
-xmlns:app="http://schemas.android.com/apk/res-auto";
+http://schemas.android.com/apk/res/android";
+xmlns:app="http://schemas.android.com/apk/res-auto";
+android:layout_width="match_parent"
+android:layout_height="match_parent">
+
+
+android:layout_height="match_parent"
+android:orientation="vertical">
 
-
 
-
-
+
+
 
-
-
+
+
 
-
 
-
+android:text="title"
+android:textColor="@android:color/black"
+android:textSize="20sp"/>
 
-
 
-
+android:layout_height="50dp"
+android:paddingLeft="10dp"
+android:src="@mipmap/ic_launcher"/>
 
-
 
-
-
-
-
+android:text="type"/>
--- End diff --

remove hard-coded string to strings.xml


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117284
  
--- Diff: app/src/main/res/layout/fragment_downloading.xml ---
@@ -0,0 +1,50 @@
+
+
+http://schemas.android.com/apk/res/android";
+android:layout_width="match_parent"
+android:layout_height="match_parent">
+
+
+
+
+
--- End diff --

Remove hard-coded string 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117095
  
--- Diff: app/src/main/res/layout/fragment_detail_workflow.xml ---
@@ -15,123 +15,147 @@
See the License for the specific language governing permissions and
limitations under the License.
 -->
-http://schemas.android.com/apk/res/android";
-xmlns:app="http://schemas.android.com/apk/res-auto";
+http://schemas.android.com/apk/res/android";
+xmlns:app="http://schemas.android.com/apk/res-auto";
+android:layout_width="match_parent"
+android:layout_height="match_parent">
+
+
+android:layout_height="match_parent"
+android:orientation="vertical">
 
-
 
-
-
+
+
 
-
-
+
+
 
-
 
-
+android:text="title"
+android:textColor="@android:color/black"
+android:textSize="20sp"/>
 
-
 
-
+android:layout_height="50dp"
+android:paddingLeft="10dp"
+android:src="@mipmap/ic_launcher"/>
 
-
 
-

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81117047
  
--- Diff: app/src/main/res/layout/fragment_detail_workflow.xml ---
@@ -15,123 +15,147 @@
See the License for the specific language governing permissions and
limitations under the License.
 -->
-http://schemas.android.com/apk/res/android";
-xmlns:app="http://schemas.android.com/apk/res-auto";
+http://schemas.android.com/apk/res/android";
+xmlns:app="http://schemas.android.com/apk/res-auto";
+android:layout_width="match_parent"
+android:layout_height="match_parent">
+
+
+android:layout_height="match_parent"
+android:orientation="vertical">
 
-
 
-
-
+
+
 
-
-
+
+
 
-
 
-
+android:text="title"
--- End diff --

String this hard coded string.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81116635
  
--- Diff: app/src/main/java/org/apache/taverna/mobile/utils/WebViewGen.java 
---
@@ -0,0 +1,111 @@
+/*
+ * 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.utils;
+
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ProgressBar;
+
+import org.apache.taverna.mobile.R;
+
+public class WebViewGen extends Fragment {
--- End diff --

ambiguous class naming, Please fix.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81116672
  
--- Diff: app/src/main/java/org/apache/taverna/mobile/utils/WebViewGen.java 
---
@@ -0,0 +1,111 @@
+/*
+ * 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.utils;
+
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ProgressBar;
+
+import org.apache.taverna.mobile.R;
+
+public class WebViewGen extends Fragment {
+private static final String PARAM1 = "url";
--- End diff --

remove hard coded string 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81116220
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,177 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
+@BindView(R.id.stepsView)
+StepsView mStepsView;
+@BindView(R.id.viewpager)
+NonSwipeableViewPager mPager;
+int position = 0;
+String workflowRunURL;
+private DataManager dataManager;
+private WorkflowRunPresenter mWorkflowRunPresenter;
+private PagerAdapter mPagerAdapter;
+
+@Override
+protected void onCreate(@Nullable Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+setContentView(R.layout.activity_workflow_run);
+
+ButterKnife.bind(this);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+
+mWorkflowRunPresenter = new WorkflowRunPresenter(dataManager);
+
+mWorkflowRunPresenter.attachView(this);
+
+
+mStepsView.setCompletedPosition(position % labels.length)
+.setLabels(labels)
+.setBarColorIndicator(
+
getContext().getResources().getColor(R.color.material_blue_grey_800))
+
.setProgressColorIndicator(getContext().getResources().getColor(R.color
+.colorPrimary))
+
.setLabelColorIndicator(getContext().getResources().getColor(R.color.colorPrimary))
+.drawView();
+
+
+mPagerAdapter = new 
ScreenSlidePagerAdapter(getSupportFragmentManager());
+mPager.setAdapter(mPagerAdapter);
+
+if (dataManager.getPreferencesHelper().isUserPlayerLoggedInFlag()) 
{
+mPager.setCurrentItem(++position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+}
+
+@Override
+protected void onDestroy() {
+super.onDestroy();
+mWorkflowRunPresenter.detachView();
+}
+
+
+@Override
+public void onSuccessfulLogin() {
+position = 1;
+mPager.setCurrentItem(position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+@Override
+pu

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81116163
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,177 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
+@BindView(R.id.stepsView)
+StepsView mStepsView;
+@BindView(R.id.viewpager)
+NonSwipeableViewPager mPager;
+int position = 0;
+String workflowRunURL;
+private DataManager dataManager;
+private WorkflowRunPresenter mWorkflowRunPresenter;
+private PagerAdapter mPagerAdapter;
+
+@Override
+protected void onCreate(@Nullable Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+setContentView(R.layout.activity_workflow_run);
+
+ButterKnife.bind(this);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+
+mWorkflowRunPresenter = new WorkflowRunPresenter(dataManager);
+
+mWorkflowRunPresenter.attachView(this);
+
+
+mStepsView.setCompletedPosition(position % labels.length)
+.setLabels(labels)
+.setBarColorIndicator(
+
getContext().getResources().getColor(R.color.material_blue_grey_800))
+
.setProgressColorIndicator(getContext().getResources().getColor(R.color
+.colorPrimary))
+
.setLabelColorIndicator(getContext().getResources().getColor(R.color.colorPrimary))
+.drawView();
+
+
+mPagerAdapter = new 
ScreenSlidePagerAdapter(getSupportFragmentManager());
+mPager.setAdapter(mPagerAdapter);
+
+if (dataManager.getPreferencesHelper().isUserPlayerLoggedInFlag()) 
{
+mPager.setCurrentItem(++position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+}
+
+@Override
+protected void onDestroy() {
+super.onDestroy();
+mWorkflowRunPresenter.detachView();
+}
+
+
+@Override
+public void onSuccessfulLogin() {
+position = 1;
+mPager.setCurrentItem(position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+@Override
+pu

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81116006
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,177 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
+@BindView(R.id.stepsView)
+StepsView mStepsView;
+@BindView(R.id.viewpager)
+NonSwipeableViewPager mPager;
+int position = 0;
+String workflowRunURL;
+private DataManager dataManager;
+private WorkflowRunPresenter mWorkflowRunPresenter;
+private PagerAdapter mPagerAdapter;
+
+@Override
+protected void onCreate(@Nullable Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+setContentView(R.layout.activity_workflow_run);
+
+ButterKnife.bind(this);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+
+mWorkflowRunPresenter = new WorkflowRunPresenter(dataManager);
+
+mWorkflowRunPresenter.attachView(this);
+
+
+mStepsView.setCompletedPosition(position % labels.length)
+.setLabels(labels)
+.setBarColorIndicator(
+
getContext().getResources().getColor(R.color.material_blue_grey_800))
+
.setProgressColorIndicator(getContext().getResources().getColor(R.color
+.colorPrimary))
+
.setLabelColorIndicator(getContext().getResources().getColor(R.color.colorPrimary))
+.drawView();
+
+
+mPagerAdapter = new 
ScreenSlidePagerAdapter(getSupportFragmentManager());
+mPager.setAdapter(mPagerAdapter);
+
+if (dataManager.getPreferencesHelper().isUserPlayerLoggedInFlag()) 
{
+mPager.setCurrentItem(++position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+}
+
+@Override
+protected void onDestroy() {
+super.onDestroy();
+mWorkflowRunPresenter.detachView();
+}
+
+
+@Override
+public void onSuccessfulLogin() {
+position = 1;
+mPager.setCurrentItem(position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+@Override
+pu

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81115928
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,177 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
+@BindView(R.id.stepsView)
+StepsView mStepsView;
+@BindView(R.id.viewpager)
+NonSwipeableViewPager mPager;
--- End diff --

give a single line space between the variables, As you have managed in 
other fragments.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81115797
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,177 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
--- End diff --

put this string array in strings.xml


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81115604
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowdetail/WorkflowDetailPresenter.java
 ---
@@ -192,11 +192,12 @@ public void onNext(Boolean b) {
 }));
 }
 
+
 private Map getDetailQueryOptions() {
 
 Map option = new HashMap<>();
 option.put("elements", 
"id,title,type,uploader,preview,created-at,svg,updated-at," +
-"description,license-type,tags");
+"description,license-type,tags,content-uri");
--- End diff --

Looks nice, but writing hard-coded strings, make the difficult to other 
contributors, So please put these 
id,title,type,uploader,preview,created-at,svg,updated-at string in 
Constant.java


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81115119
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowdetail/WorkflowDetailFragment.java
 ---
@@ -166,6 +168,18 @@ void favClick(View v) {
 }
 
 
+@OnClick(R.id.fabRun)
+void fabRunClick(View v) {
+if (mWorkflow.getType().getContent().equals("Taverna 2")) {
+Intent intent = new Intent(getActivity(), 
WorkflowRunActivity.class);
+intent.putExtra(WorkflowRunActivity.WORKFLOW_URL, 
mWorkflow.getContentUri());
+startActivity(intent);
+} else {
+Toast.makeText(getActivity(), "We can only run Taverna 2 
workflow", Toast
--- End diff --

Remove hard-codded string and put in strings.xml


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81115065
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowdetail/WorkflowDetailFragment.java
 ---
@@ -166,6 +168,18 @@ void favClick(View v) {
 }
 
 
+@OnClick(R.id.fabRun)
+void fabRunClick(View v) {
+if (mWorkflow.getType().getContent().equals("Taverna 2")) {
--- End diff --

"Taverna 2" put in strings.xml.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81114917
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowdetail/WorkflowDetailFragment.java
 ---
@@ -166,6 +168,18 @@ void favClick(View v) {
 }
 
 
+@OnClick(R.id.fabRun)
+void fabRunClick(View v) {
--- End diff --

ambiguous method name, onClickRunWorkflow();


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81114330
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginPresenter.java
 ---
@@ -0,0 +1,102 @@
+/*
+ * 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.playerlogin;
+
+import android.util.Base64;
+import android.util.Log;
+
+import org.apache.taverna.mobile.data.DataManager;
+import org.apache.taverna.mobile.ui.base.BasePresenter;
+
+import okhttp3.ResponseBody;
+import retrofit2.adapter.rxjava.HttpException;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+
+public class PlayerLoginPresenter extends 
BasePresenter {
+
+private static final String TAG = 
PlayerLoginPresenter.class.getSimpleName();
+
+private DataManager mDataManager;
+
+private Subscription mSubscriptions;
+
+public PlayerLoginPresenter(DataManager dataManager) {
+mDataManager = dataManager;
+}
+
+@Override
+public void attachView(PlayerLoginMvpView mvpView) {
+super.attachView(mvpView);
+}
+
+@Override
+public void detachView() {
+super.detachView();
+if (mSubscriptions != null) mSubscriptions.unsubscribe();
+}
+
+public void playerLogin(final String username, final String password, 
final boolean loginFlag) {
+if (mSubscriptions != null) mSubscriptions.unsubscribe();
+
+mSubscriptions = 
mDataManager.authPlayerUserLoginDetail(getEncodedCredential(username,
+password), loginFlag)
+.observeOn(AndroidSchedulers.mainThread())
+.subscribeOn(Schedulers.io())
+.subscribe(new Observer() {
+@Override
+public void onCompleted() {
+
+}
+
+@Override
+public void onError(Throwable e) {
+Log.e(TAG, "onError: ", e);
+if (e instanceof HttpException) {
+if (((HttpException) e).code() == 401) {
+getMvpView().showCredentialError();
+} else if (((HttpException) e).code() == 406) {
+getMvpView().validCredential();
+mDataManager.getPreferencesHelper()
+
.setUserPlayerLoggedInFlagAndCredential(loginFlag,
+
getEncodedCredential(username, password));
+
+} else {
+getMvpView().showError("Server Error");
--- End diff --

Do not user hard coded strings. Remove this with string resources


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81113965
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+  

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81112043
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+  

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81112071
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+  

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r8902
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+  

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r8827
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+  

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r8707
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
--- End diff --

If it is not useful so, please remove.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r8548
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
--- End diff --

Remove one line space.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81110845
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/DownloadingFragment.java ---
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import org.apache.taverna.mobile.R;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+
+public class DownloadingFragment extends Fragment {
+
+private static final String ARGS_MESSAGE = "args_message";
+
+String message;
+
+@BindView(R.id.tvMessage)
+TextView tvMessage;
--- End diff --

Naming convention is not good, refactor tvMessage to tv_message;


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81110725
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/DownloadingFragment.java ---
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import org.apache.taverna.mobile.R;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+
+public class DownloadingFragment extends Fragment {
+
+private static final String ARGS_MESSAGE = "args_message";
+
+String message;
--- End diff --

message should be private 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81110632
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/DownloadingFragment.java ---
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import org.apache.taverna.mobile.R;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+
+public class DownloadingFragment extends Fragment {
+
+private static final String ARGS_MESSAGE = "args_message";
+
+String message;
+
+@BindView(R.id.tvMessage)
+TextView tvMessage;
+
+public static DownloadingFragment newInstance(String message) {
+
+Bundle args = new Bundle();
+args.putString(ARGS_MESSAGE, message);
+DownloadingFragment fragment = new DownloadingFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+
+@Override
+public void onCreate(@Nullable Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+message = getArguments().getString(ARGS_MESSAGE);
--- End diff --

This can be raised null pointer exception, So Please check first 
getArguments() is not null.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81110329
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/DownloadingFragment.java ---
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import org.apache.taverna.mobile.R;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+
+public class DownloadingFragment extends Fragment {
+
+private static final String ARGS_MESSAGE = "args_message";
--- End diff --

Do not use hard-coded string, Please put this String in Utils Constant class


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81110078
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/remote/TavernaPlayerService.java
 ---
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+
+import org.apache.taverna.mobile.data.model.PlayerWorkflow;
+import org.apache.taverna.mobile.data.model.PlayerWorkflowDetail;
+
+import okhttp3.RequestBody;
+import okhttp3.ResponseBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+import rx.Observable;
+
+public interface TavernaPlayerService {
+
+@POST("/workflows.json")
+@Headers({
+APIEndPoint.JSON_CONTENT_HEADER,
+APIEndPoint.JSON_ACCEPT_HEADER,
+APIEndPoint.UTF_CONTENT_ENCODING_HEADER})
+Observable uploadWorkflow(@Body RequestBody body, 
@Header("Authorization")
+String authorization);
+
+@POST("/users/sign_in")
+@Headers({
--- End diff --

Here you have single Header, So put in single line.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread sagar15795
Github user sagar15795 commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81109899
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginFragment.java
 ---
@@ -0,0 +1,263 @@
+/*
+ * 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.playerlogin;
+
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+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.utils.ConnectionInfo;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+
+public class PlayerLoginFragment extends Fragment implements 
PlayerLoginMvpView, View
+.OnFocusChangeListener {
+
+@BindView(R.id.etEmail)
+EditText mEditTextEmail;
+
+@BindView(R.id.etPassword)
+EditText mEditTextPassword;
+
+@BindView(R.id.input_layout_email)
+TextInputLayout mTextInputEmail;
+
+@BindView(R.id.input_layout_password)
+TextInputLayout mTextInputPassword;
+
+@BindView(R.id.cbRemember)
+CheckBox mCheckBoxRemember;
+OnSuccessful mCallback;
+private DataManager dataManager;
+private PlayerLoginPresenter mPlayerLoginPresenter;
+
+public static PlayerLoginFragment newInstance() {
+
+Bundle args = new Bundle();
+
+PlayerLoginFragment fragment = new PlayerLoginFragment();
+fragment.setArguments(args);
+return fragment;
+}
+
+@Override
+public void onCreate(Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+mPlayerLoginPresenter = new PlayerLoginPresenter(dataManager);
+
+}
+
+@Override
+public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle
+savedInstanceState) {
+
+View rootView = 
inflater.inflate(R.layout.fragment_player_login_layout, container, false);
+ButterKnife.bind(this, rootView);
+mPlayerLoginPresenter.attachView(this);
+return rootView;
+}
+
+@Override
+public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+super.onActivityCreated(savedInstanceState);
+
+
+mEditTextEmail.addTextChangedListener(new 
CustomTextWatcher(mEditTextEmail));
+
+
+mEditTextPassword.addTextChangedListener(new 
CustomTextWatcher(mEditTextPassword));
+
+mEditTextEmail.setOnFocusChangeListener(this);
+
+mEditTextPassword.setOnFocusChangeListener(this);
+
+
+//mPlayerLoginPresenter.PlayerLogin("kumarsagar15...@gmail.com", 
"Sagarishere", true);
+
+
+}
+
+
+@Override
+public void onDestroyView() {
+super.onDestroyView();
+mPlayerLoginPresenter.detachView();
+}
+
+
+@OnClick(R.id.bLogin)
+public void login(View v) {
+if (ConnectionInfo.isConnectingToInternet(getContext())) {
+if (!mEditTextEmail.getText().toString().trim().isEmpty() && 
!mEditTextPassword
+.getText().toString().trim().isEmpty()) {
+
+
m

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81107802
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/remote/APIEndPoint.java ---
@@ -29,5 +29,13 @@
 public static final String USER = "user.xml";
 public static final String LICENSE = "license.xml";
 public static final String WHOAMI = "whoami.xml";
+
+
+public static final String XML_ACCEPT_HEADER = "Accept: 
application/xml";
+public static final String JSON_ACCEPT_HEADER = "Accept: 
application/json";
+public static final String JSON_CONTENT_HEADER = "Content-Type: 
application/json";
+public static final String UTF_CONTENT_ENCODING_HEADER = 
"Content-Encoding: UTF-8";
--- End diff --

Good job, You have managed Headers very well.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81107513
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -169,4 +178,28 @@ private void setUserAvatar(String userAvatar) {
 
 }
 
+public boolean isUserPlayerLoggedInFlag() {
+return mPref.getBoolean(PREF_KEY_PLAYER_LOGGED_IN, false);
+}
+
+public void setUserPlayerLoggedInFlagAndCredential(Boolean flag, 
String credential) {
+
+mPref.edit().putBoolean(PREF_KEY_PLAYER_LOGGED_IN, flag).apply();
+
+mPref.edit().putString(PREF_KEY_PLAYER_CREDENTIAL, 
credential).apply();
+}
+
+public void setUserPlayerLoggedInFlag(Boolean flag) {
+
+mPref.edit().putBoolean(PREF_KEY_PLAYER_LOGGED_IN, flag).apply();
+
+}
+
--- 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81107468
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -169,4 +178,28 @@ private void setUserAvatar(String userAvatar) {
 
 }
 
+public boolean isUserPlayerLoggedInFlag() {
+return mPref.getBoolean(PREF_KEY_PLAYER_LOGGED_IN, false);
+}
+
+public void setUserPlayerLoggedInFlagAndCredential(Boolean flag, 
String credential) {
--- End diff --

There should not be a single line gap. Please remove .


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-29 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r81107282
  
--- Diff: app/src/main/java/org/apache/taverna/mobile/data/DataManager.java 
---
@@ -166,6 +170,45 @@ public PreferencesHelper getPreferencesHelper() {
 });
 }
 
+/**
+ * @param url is Workflow's content xml URL
+ * @return OkHTTP ResponseBody of download file
+ */
+public Observable downloadWorkflowContent(String url) {
+return 
mBaseApiManager.getTavernaApi().downloadWorkflowContent(url);
+}
+
+/**
+ * @param body is body of upload workflow's detail
+ * @param baseAuth is base64 encoded credential
+ * @return Workflow's ID
+ */
+public Observable uploadWorkflowContent(RequestBody 
body, String baseAuth) {
+return mBaseApiManager.getTavernaPlayerApi().uploadWorkflow(body, 
baseAuth);
+}
+
+/**
+ * @param credentials is base64 encoded credential
+ * @param flagLogin   is used to maintain the Remain login or not
+ * @return okHTTP ResponseBody
+ */
+
+public Observable authPlayerUserLoginDetail(final String 
credentials,
+  final 
boolean flagLogin) {
+return 
mBaseApiManager.getTavernaPlayerApi().playerlogin(credentials)
+.concatMap(new Func1>() {
--- End diff --

Remove concatMap, There is no use of concaMap.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-26 Thread ianwdunlop
Github user ianwdunlop commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r80463001
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/playerlogin/PlayerLoginPresenter.java
 ---
@@ -0,0 +1,97 @@
+/*
+ * 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.playerlogin;
+
+import android.util.Base64;
+import android.util.Log;
+
+import org.apache.taverna.mobile.data.DataManager;
+import org.apache.taverna.mobile.ui.base.BasePresenter;
+
+import okhttp3.ResponseBody;
+import retrofit2.adapter.rxjava.HttpException;
+import rx.Observer;
+import rx.Subscription;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+
+public class PlayerLoginPresenter extends 
BasePresenter {
+
+private DataManager mDataManager;
+
+private Subscription mSubscriptions;
+
+public PlayerLoginPresenter(DataManager dataManager) {
+mDataManager = dataManager;
+}
+
+@Override
+public void attachView(PlayerLoginMvpView mvpView) {
+super.attachView(mvpView);
+}
+
+@Override
+public void detachView() {
+super.detachView();
+if (mSubscriptions != null) mSubscriptions.unsubscribe();
+}
+
+public void playerLogin(final String username, final String password, 
final boolean loginFlag) {
+if (mSubscriptions != null) mSubscriptions.unsubscribe();
+
+mSubscriptions = 
mDataManager.authPlayerUserLoginDetail(getEncodedCredential(username,
+password), loginFlag)
+.observeOn(AndroidSchedulers.mainThread())
+.subscribeOn(Schedulers.io())
+.subscribe(new Observer() {
+@Override
+public void onCompleted() {
+
+}
+
+@Override
+public void onError(Throwable e) {
+Log.e("TAG", "onError: ", e);
+if (e instanceof HttpException) {
+if (((HttpException) e).code() == 401) {
+getMvpView().showCredentialError();
+} else if (((HttpException) e).code() == 406) {
+getMvpView().validCredential();
+
mDataManager.getPreferencesHelper().setUserPlayerLoggedInFlag
+(loginFlag, 
getEncodedCredential(username, password));
+
+}
+}
+}
+
+@Override
+public void onNext(ResponseBody responseBody) {
+Log.e("hello", "onCompleted: " + 
responseBody.byteStream());
--- End diff --

Might need something more useful than "hello"


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-26 Thread ianwdunlop
Github user ianwdunlop commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r80462841
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/remote/BaseApiManager.java ---
@@ -20,27 +20,42 @@
 
 import retrofit2.Retrofit;
 import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
+import retrofit2.converter.gson.GsonConverterFactory;
 import retrofit2.converter.simplexml.SimpleXmlConverterFactory;
 
 
 public class BaseApiManager {
 
 
-public static final String END_POINT = "http://www.myexperiment.org/";;
-public TavernaService mTavernaService;
+public static final String MY_EXPERIMENT_END_POINT = 
"http://www.myexperiment.org/";;
 
-public BaseApiManager() {
+public static final String TAVERNA_PLAYER_END_POINT = 
"http://139.59.28.12:3000/";;
--- End diff --

I know it is useful for testing but might not be a good idea to distribute 
code with it hard coded.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-26 Thread ianwdunlop
Github user ianwdunlop commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/28#discussion_r80462360
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunActivity.java
 ---
@@ -0,0 +1,172 @@
+/*
+ * 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.workflowrun;
+
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.view.PagerAdapter;
+import android.widget.Toast;
+
+import com.anton46.stepsview.StepsView;
+
+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.DownloadingFragment;
+import org.apache.taverna.mobile.ui.playerlogin.PlayerLoginFragment;
+import org.apache.taverna.mobile.utils.NonSwipeableViewPager;
+import org.apache.taverna.mobile.utils.WebViewGen;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.raizlabs.android.dbflow.config.FlowManager.getContext;
+
+public class WorkflowRunActivity extends FragmentActivity implements 
WorkflowRunMvpView,
+PlayerLoginFragment.OnSuccessful {
+
+public static final String WORKFLOW_URL = "Workflow_url";
+private final String[] labels = {"Player\nLogin", "Download", 
"Upload", "Inputs &\n Run"};
+@BindView(R.id.stepsView)
+StepsView mStepsView;
+@BindView(R.id.viewpager)
+NonSwipeableViewPager mPager;
+int position = 0;
+String workflowRunURL;
+private DataManager dataManager;
+private WorkflowRunPresenter mWorkflowRunPresenter;
+private PagerAdapter mPagerAdapter;
+
+@Override
+protected void onCreate(@Nullable Bundle savedInstanceState) {
+super.onCreate(savedInstanceState);
+
+setContentView(R.layout.activity_workflow_run);
+
+ButterKnife.bind(this);
+
+dataManager = new DataManager(new PreferencesHelper(getContext()));
+
+mWorkflowRunPresenter = new WorkflowRunPresenter(dataManager);
+
+mWorkflowRunPresenter.attachView(this);
+
+
+mStepsView.setCompletedPosition(position % labels.length)
+.setLabels(labels)
+.setBarColorIndicator(
+
getContext().getResources().getColor(R.color.material_blue_grey_800))
+
.setProgressColorIndicator(getContext().getResources().getColor(R.color
+.colorPrimary))
+
.setLabelColorIndicator(getContext().getResources().getColor(R.color.colorPrimary))
+.drawView();
+
+
+mPagerAdapter = new 
ScreenSlidePagerAdapter(getSupportFragmentManager());
+mPager.setAdapter(mPagerAdapter);
+
+if (dataManager.getPreferencesHelper().isUserPlayerLoggedInFlag()) 
{
+mPager.setCurrentItem(++position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+}
+
+@Override
+protected void onDestroy() {
+super.onDestroy();
+mWorkflowRunPresenter.detachView();
+}
+
+
+@Override
+public void onSuccessfulLogin() {
+position = 1;
+mPager.setCurrentItem(position);
+mStepsView.setCompletedPosition(position % 
labels.length).drawView();
+
mWorkflowRunPresenter.runWorkflow(getIntent().getStringExtra(WORKFLOW_URL));
+}
+
+@Override
+public

[GitHub] incubator-taverna-mobile pull request #28: Taverna 2's workflow running feat...

2016-09-26 Thread sagar15795
GitHub user sagar15795 opened a pull request:

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

Taverna 2's workflow running feature 

I have implemented Taverna 2's Workflow running functionality 

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

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

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

https://github.com/apache/incubator-taverna-mobile/pull/28.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 #28


commit f417e4d135b72bf7873a836fd5eb5612cce380cb
Author: Sagar 
Date:   2016-08-25T15:50:01Z

add xml accept header constant

commit 9b4cc37d0546e8e184ffc78f224de66635e5a6a2
Author: Sagar 
Date:   2016-08-25T15:51:32Z

add workflowContent download method in DataManger layer and taverna service

commit ea80dae7e123aaab3ac7a2ee1d61adca7398b3fb
Author: Sagar 
Date:   2016-08-26T18:09:20Z

add taverna player service class

commit e3eb93b243f7fb5c8340350951f7c1d7298cb616
Author: Sagar 
Date:   2016-08-26T18:09:40Z

add header constant

commit 9ad5a112c32063c6c92d395dac2775e784544e71
Author: Sagar 
Date:   2016-08-26T18:10:47Z

add Retrofit service generator taverna player

commit 63402bdf3458c01642e6e1acb892dafbc5907826
Author: Sagar 
Date:   2016-08-26T18:11:40Z

add download workflow content and upload to taverna player method in Data 
layer

commit 093bf6cbc225129d69da84fbcb57aa5bda999746
Author: Sagar 
Date:   2016-08-28T17:04:52Z

add fab margin in dimens

commit 3fd55f3e1aec217704e82f53958de6f6e703012d
Author: Sagar 
Date:   2016-08-28T17:05:28Z

add fab button in detail workflow to run workflow

commit fcd4dff549d41093a7688f4519ebb39b16dc7683
Author: Sagar 
Date:   2016-08-30T19:27:13Z

workflow add to player done

commit 48a4992a1325026fae182748e59b875eba15bf51
Author: Sagar 
Date:   2016-09-09T06:31:16Z

add play icon

commit e089790e140cf8820c92538ed255794f36f53d59
Author: Sagar 
Date:   2016-09-15T08:18:14Z

add multidex and enable it

commit 08bdb7452800efecd2873b738217445c1d3a27bd
Author: Sagar 
Date:   2016-09-24T05:44:58Z

add json accept header constant

commit c70f85d94b18f3c560fa2d890e5c1d49a3a0d7d2
Author: Sagar 
Date:   2016-09-24T05:47:18Z

add multiple converter

commit ee9448cd2a7487262efa5b5525aa7fddcfc1471e
Author: Sagar 
Date:   2016-09-24T05:50:01Z

add gson and retrofit json converter library

commit 50385430d9e3053a62e35f16ff7bc1854652a395
Author: Sagar 
Date:   2016-09-24T06:03:45Z

add player workflow java bean

commit 3592433da4fb3142b51a0102fcb73b5c0f988201
Author: Sagar 
Date:   2016-09-24T06:07:36Z

add play icon on FAB button

commit 45e7b38f3005d3462ef39a0c7324917e98382224
Author: Sagar 
Date:   2016-09-24T06:10:09Z

add player login credential function in PreferenceHelper

commit 0f48388d8bcfbe6063330dc4bb3b8755b9b367af
Author: Sagar 
Date:   2016-09-24T09:23:56Z

update gradle

commit 81b1a7a2ea3d93b4d765cde86638357e9e3fd10f
Author: Sagar 
Date:   2016-09-24T09:30:18Z

update travis

commit 2e4c7bb03a8bd449fd1b31562fa9aa8a32988fa3
Author: Sagar 
Date:   2016-09-25T13:00:39Z

add stepview library

commit 1aa2c70a2163d448d3c5db9db8b10a53faaede46
Author: Sagar 
Date:   2016-09-25T16:10:33Z

add player login fragment with mvp classes

commit 6f6a98af02120277de6744dba07bc269e123df24
Author: Sagar 
Date:   2016-09-25T16:22:58Z

add get player user credential method

commit d16d467d4b4b4954e45e40edee65d9dd8ed53418
Author: Sagar 
Date:   2016-09-25T16:23:30Z

add methods in player service

commit b4d37257f9674d63b60688fb37d86c4464d43267
Author: Sagar 
Date:   2016-09-25T16:23:57Z

add downloading view fragment

commit 0e4e196ca972079cd0cbc4999387f809bfdab916
Author: Sagar 
Date:   2016-09-25T16:24:37Z

add methods in data manager

commit 1c6bb697d117bb258b60dfea7cee58c6d0a69fe8
Author: Sagar 
Date:   2016-09-25T16:25:09Z

add NonSwipeable ViewPager in utils

commit f887f45d7df970c488b08a4569e3a3015bc32493
Author: Sagar 
Date:   2016-09-25T16:25:45Z

add FAB click

commit adeb5df6c48bd5d2bb2ac77066775011f5c84853
Author: Sagar 
Date:   2016-09-25T16:26:22Z

remove unused method

commit 8757c9cac05bac05e0139f93d567b3c11de548b3
Author: Sagar 
Date:   2016-09-25T16:26:43Z

add activities in manifest

commit afa295d07a5119136bab809f86716f24eb5af78d
Author: Sagar 
Date:   2016-09-26T09:05:12Z

add content-uri in requested URL




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---