[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211138694 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java --- @@ -0,0 +1,87 @@ +package org.apache.taverna.mobile.tutorial; + +import android.support.test.espresso.intent.Intents; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.apache.taverna.mobile.ui.tutorial.TutorialActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.swipeLeft; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.intent.Intents.intended; +import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.not; + +@RunWith(AndroidJUnit4.class) +public class TutorialActivityTest { + +@Rule +public ActivityTestRule mActivityTestRule += new ActivityTestRule<>(TutorialActivity.class); + +@Before +public void setUp() { +mActivityTestRule.getActivity() +.getSupportFragmentManager().beginTransaction(); +} + +/** + * Check all the views present are visible + */ +@Test +public void CheckAllViewAreVisible() throws Exception { + +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.btn_next)).check(matches((isDisplayed(; +onView(withId(R.id.btn_skip)).check(matches((isDisplayed(; +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.slide_pager)).check(matches((isDisplayed(; +} + +/** + * Checks while clicking on skip button should start login activity + */ +@Test +public void clickingSkip_shouldStartLoginActivity() throws Exception { + +Intents.init(); +onView(withId(R.id.btn_skip)).perform(click()); +intended(hasComponent(LoginActivity.class.getName())); +Intents.release(); +} + +/** + * Check swipes are working on tutorial screens and on last tutorial screen while clicking on + * GOT IT it should go to login activity + */ +@Test +public void clickingNext_shouldGotoNextTutorial_onClickGotIt_ShouldGoToLoginActivity() +throws Exception { + +Intents.init(); +onView(withText(R.string.next)).check(matches(isDisplayed())); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withText("SKIP")).check(matches(not(isDisplayed(; --- End diff -- I have also requested to add a new scenario. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211138642 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java --- @@ -0,0 +1,87 @@ +package org.apache.taverna.mobile.tutorial; + +import android.support.test.espresso.intent.Intents; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.apache.taverna.mobile.ui.tutorial.TutorialActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.swipeLeft; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.intent.Intents.intended; +import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.not; + +@RunWith(AndroidJUnit4.class) +public class TutorialActivityTest { + +@Rule +public ActivityTestRule mActivityTestRule += new ActivityTestRule<>(TutorialActivity.class); + +@Before +public void setUp() { +mActivityTestRule.getActivity() +.getSupportFragmentManager().beginTransaction(); +} + +/** + * Check all the views present are visible + */ +@Test +public void CheckAllViewAreVisible() throws Exception { + +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.btn_next)).check(matches((isDisplayed(; +onView(withId(R.id.btn_skip)).check(matches((isDisplayed(; +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.slide_pager)).check(matches((isDisplayed(; +} + +/** + * Checks while clicking on skip button should start login activity + */ +@Test +public void clickingSkip_shouldStartLoginActivity() throws Exception { + +Intents.init(); +onView(withId(R.id.btn_skip)).perform(click()); +intended(hasComponent(LoginActivity.class.getName())); +Intents.release(); +} + +/** + * Check swipes are working on tutorial screens and on last tutorial screen while clicking on + * GOT IT it should go to login activity + */ +@Test +public void clickingNext_shouldGotoNextTutorial_onClickGotIt_ShouldGoToLoginActivity() +throws Exception { + +Intents.init(); +onView(withText(R.string.next)).check(matches(isDisplayed())); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withText("SKIP")).check(matches(not(isDisplayed(; --- End diff -- @Hiteshgautam01 `Please change the requested changes. Could you also write a test for the scenario that you first navigate to a random page and then click skip and verify is it navigating to LoginActivity or not?` ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091689 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - mEditTextEmail.addTextChangedListener(new CustomTextWatcher(mEditTextEmail)); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091695 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - mEditTextEmail.addTextChangedListener(new CustomTextWatcher(mEditTextEmail)); - - mEditTextPassword.addTextChangedListener(new CustomTextWatcher(mEditTextPassword)); - mEditTextEmail.setOnFocusChangeListener(this); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091699 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 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); - progressDialog = new ProgressDialog(getContext()); - progressDialog.setMessage("Please wait"); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091691 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - mEditTextEmail.addTextChangedListener(new CustomTextWatcher(mEditTextEmail)); - - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091742 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/tutorial/TutorialActivityTest.java --- @@ -0,0 +1,85 @@ +package org.apache.taverna.mobile.tutorial; + +import android.support.test.espresso.intent.Intents; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.apache.taverna.mobile.ui.tutorial.TutorialActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.swipeLeft; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.intent.Intents.intended; +import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; + +@RunWith(AndroidJUnit4.class) +public class TutorialActivityTest { + +@Rule +public ActivityTestRule mActivityTestRule += new ActivityTestRule<>(TutorialActivity.class); + +@Before +public void setUp() { +mActivityTestRule.getActivity() +.getSupportFragmentManager().beginTransaction(); +} + +/** + * Check all the views present are visible + */ +@Test +public void CheckAllViewAreVisible() throws Exception { + +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.btn_next)).check(matches((isDisplayed(; +onView(withId(R.id.btn_skip)).check(matches((isDisplayed(; +onView(withId(R.id.layoutDots)).check(matches((isDisplayed(; +onView(withId(R.id.slide_pager)).check(matches((isDisplayed(; +} + +/** + * Checks while clicking on skip button should start login activity + */ +@Test +public void clickingSkip_shouldStartLoginActivity() throws Exception { + +Intents.init(); +onView(withId(R.id.btn_skip)).perform(click()); +intended(hasComponent(LoginActivity.class.getName())); +Intents.release(); +} + +/** + * Check swipes are working on tutorial screens and on last tutorial screen while click on + * GOT IT it should go to login activity + */ +@Test +public void clickingNext_shouldGotoNextTutorial_onClickGotIt_ShouldGoToLoginActivity() +throws Exception { + +Intents.init(); +onView(withText(R.string.next)).check(matches(isDisplayed())); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withId(R.id.slide_pager)).perform(swipeLeft()); +onView(withText("GOT IT")).check(matches(isDisplayed())); --- End diff -- also verify that skip should not visible when "GOT IT" button is visible. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091697 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 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); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091698 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 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); - progressDialog = new ProgressDialog(getContext()); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #88: Added TutorialActivity Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/88#discussion_r211091688 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -102,20 +102,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - --- End diff -- revert this line. ---
[GitHub] incubator-taverna-mobile pull request #94: Added LoginActivity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/94#discussion_r209417733 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java --- @@ -0,0 +1,208 @@ +/* + * 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.login; + +import org.apache.taverna.mobile.FakeRemoteDataSource; +import org.apache.taverna.mobile.TestComponentRule; + +import org.apache.taverna.mobile.R; + +import org.apache.taverna.mobile.data.model.User; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import io.reactivex.Observable; + +import static android.os.SystemClock.sleep; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.typeText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.core.AllOf.allOf; + +@RunWith(AndroidJUnit4.class) +public class LoginActivityTest { + +User testUser; + +@Rule +public ActivityTestRule mActivityTestRule --- End diff -- why multiple activitytestrule? ---
[GitHub] incubator-taverna-mobile pull request #94: Added LoginActivity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/94#discussion_r209417749 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java --- @@ -0,0 +1,208 @@ +/* + * 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.login; + +import org.apache.taverna.mobile.FakeRemoteDataSource; +import org.apache.taverna.mobile.TestComponentRule; + +import org.apache.taverna.mobile.R; + +import org.apache.taverna.mobile.data.model.User; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import io.reactivex.Observable; + +import static android.os.SystemClock.sleep; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.typeText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.core.AllOf.allOf; + +@RunWith(AndroidJUnit4.class) +public class LoginActivityTest { + +User testUser; + +@Rule +public ActivityTestRule mActivityTestRule += new ActivityTestRule<>(LoginActivity.class); + +public final TestComponentRule component = +new TestComponentRule(InstrumentationRegistry.getTargetContext()); +public final ActivityTestRule mLoginActivityActivityTestRule = +new ActivityTestRule(LoginActivity.class, false, false) { +@Override +protected Intent getActivityIntent() { +/** + * Override the default intent so we pass a false flag for syncing so it doesn't --- End diff -- what type of syncing are you doing here? ---
[GitHub] incubator-taverna-mobile pull request #94: Added LoginActivity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/94#discussion_r209417738 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java --- @@ -0,0 +1,208 @@ +/* + * 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.login; + +import org.apache.taverna.mobile.FakeRemoteDataSource; +import org.apache.taverna.mobile.TestComponentRule; + +import org.apache.taverna.mobile.R; + +import org.apache.taverna.mobile.data.model.User; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import io.reactivex.Observable; + +import static android.os.SystemClock.sleep; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.typeText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.core.AllOf.allOf; + +@RunWith(AndroidJUnit4.class) +public class LoginActivityTest { + +User testUser; + +@Rule +public ActivityTestRule mActivityTestRule += new ActivityTestRule<>(LoginActivity.class); + +public final TestComponentRule component = +new TestComponentRule(InstrumentationRegistry.getTargetContext()); +public final ActivityTestRule mLoginActivityActivityTestRule = --- End diff -- can't we make it private? ---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r207101956 --- Diff: app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java --- @@ -0,0 +1,112 @@ +/* + * 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.login; + +import android.support.test.espresso.Espresso; +import android.support.test.filters.LargeTest; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.ui.login.LoginActivity; +import org.apache.taverna.mobile.ui.login.LoginPresenter; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static android.os.SystemClock.sleep; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.typeText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.CoreMatchers.allOf; +import static org.mockito.Mockito.mock; + +@RunWith(AndroidJUnit4.class) +@LargeTest +public class LoginActivityTest { + +private DataManager dataManager; +private LoginPresenter loginPresenter; --- End diff -- use this to mock the API response as you have done in jUnit testing. ---
[GitHub] incubator-taverna-mobile pull request #91: WorkflowDetailFragment Improvemen...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/91#discussion_r201679574 --- Diff: app/src/main/res/layout/fragment_detail_workflow.xml --- @@ -102,7 +111,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black" - android:textSize="@dimen/tv_uploader_name_text_size"/> + android:textSize="@dimen/tv_uploader_name_text_size" +android:layout_marginTop="4sp"/> --- End diff -- use `4dp` in place of `4sp`. and also move it to `dimens.xml` ---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r201674494 --- Diff: app/build.gradle --- @@ -125,7 +126,13 @@ dependencies { //Dependencies for JUNit and unit tests. testImplementation "junit:junit:4.12" -testImplementation "org.mockito:mockito-all:1.10.19" +testImplementation "org.mockito:mockito-all:$rootProject.mockito" +androidTestImplementation "com.android.support.test.espresso:espresso-core:$rootProject.espresso" +androidTestImplementation "com.android.support.test:runner:1.0.1" --- End diff -- do the same as above for all. ---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r199381284 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/login/LoginFragment.java --- @@ -104,16 +104,10 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { mEditTextEmail.addTextChangedListener(new CustomTextWatcher(mEditTextEmail)); - --- End diff -- remove unnecessary changes ---
[GitHub] incubator-taverna-mobile pull request #89: Added Login Activity UI Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/89#discussion_r199381168 --- Diff: app/build.gradle --- @@ -126,6 +127,12 @@ dependencies { //Dependencies for JUNit and unit tests. testImplementation "junit:junit:4.12" testImplementation "org.mockito:mockito-all:1.10.19" +androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.1" --- End diff -- declare all dependency version in one place like we have done above. ---
[GitHub] incubator-taverna-mobile pull request #87: Added WorkflowPresenter Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/87#discussion_r196769637 --- Diff: app/src/test/java/org/apache/taverna/mobile/ui/workflow/WorkflowPresenterTest.java --- @@ -0,0 +1,131 @@ +package org.apache.taverna.mobile.ui.workflow; + +import org.apache.taverna.mobile.FakeRemoteDataSource; +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.model.Workflows; +import org.apache.taverna.mobile.utils.RxSchedulersOverrideRule; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.Observable; + +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class WorkflowPresenterTest { + +@Rule +public final RxSchedulersOverrideRule rxSchedulersOverrideRule = new +RxSchedulersOverrideRule(); + +@Mock +DataManager dataManager; + +@Mock +WorkflowMvpView workflowMvpView; + +private Workflows workflows; +private WorkflowPresenter workflowPresenter; +private Map option_pg1; +private Map option_pg2; + +@Before +public void setUp() { + +workflowPresenter = new WorkflowPresenter(dataManager); +workflowPresenter.attachView(workflowMvpView); + +workflows = FakeRemoteDataSource.getWorkflowList(); + +option_pg1 = new HashMap<>(); +option_pg1.put("elements", "title,type,uploader,preview,created-at"); +option_pg1.put("page", String.valueOf(1)); +option_pg1.put("num", String.valueOf(10)); +option_pg1.put("order", "reverse"); + +option_pg2 = new HashMap<>(); --- End diff -- use `optionPage2` in place of `option_pg2` ---
[GitHub] incubator-taverna-mobile pull request #87: Added WorkflowPresenter Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/87#discussion_r196769008 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowPresenter.java --- @@ -72,9 +72,17 @@ public void loadAllWorkflow(int pageNumber) { .subscribeWith(new DisposableObserver() { @Override public void onNext(Workflows workflows) { -getMvpView().showProgressbar(false); -getMvpView().removeLoadMoreProgressbar(); -getMvpView().showWorkflows(workflows); +if (workflows.getWorkflowList() != null) { +getMvpView().showProgressbar(false); +getMvpView().removeLoadMoreProgressbar(); +getMvpView().showWorkflows(workflows); +} else if (workflows.getWorkflowList() == null && pageNumber == 1) { --- End diff -- make the logic this way. ``` else{ if(pageNumber == 1){ getMvpView().showSnackBar(R.string.no_workflows_found); } else { getMvpView().showSnackBar(R.string.no_more_workflows_avialable); } getMvpView().removeLoadMoreProgressbar(); } ``` ---
[GitHub] incubator-taverna-mobile pull request #87: Added WorkflowPresenter Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/87#discussion_r195927973 --- Diff: app/src/main/res/values/strings.xml --- @@ -166,6 +166,7 @@ limitations under the License. Enter valid email Enter valid password Failed to fetch Workflow +No workflows avialable --- End diff -- check it by page no if `pageNumber==0` then show this otherwise show what have I suggested to you. ---
[GitHub] incubator-taverna-mobile pull request #87: Added WorkflowPresenter Test
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/87#discussion_r195927188 --- Diff: app/src/main/res/values/strings.xml --- @@ -166,6 +166,7 @@ limitations under the License. Enter valid email Enter valid password Failed to fetch Workflow +No workflows avialable --- End diff -- make it `More workflows not available` ---
[GitHub] incubator-taverna-mobile pull request #86: Added announce. and favWorkflow p...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/86#discussion_r195907124 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/anouncements/AnnouncementPresenter.java --- @@ -62,7 +62,6 @@ public void detachView() { public void loadAllAnnouncement(int pageNumber) { checkViewAttached(); -getMvpView().showProgressbar(true); --- End diff -- Nice! ---
[GitHub] incubator-taverna-mobile pull request #86: Added announce. and favWorkflow p...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/86#discussion_r195899165 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/anouncements/AnnouncementPresenter.java --- @@ -62,7 +62,6 @@ public void detachView() { public void loadAllAnnouncement(int pageNumber) { checkViewAttached(); -getMvpView().showProgressbar(true); --- End diff -- why have you removed this line? ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192663024 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); + +String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar(); +Glide.with(getContext()) +.load(avatarUrl) +.diskCacheStrategy(DiskCacheStrategy.SOURCE) +.placeholder(R.drawable.ic_account_circle_black_24dp) +.error(R.drawable.ic_account_circle_black_24dp) +.into(new SimpleTarget() { +@Override +public void onResourceReady(GlideDrawable resource, GlideAnimation glideAnimation) { +userAvatar.setImageDrawable(resource); +} +}); + +if (name != null) { +userName.setText(name); +} else { +userName.setText(""); --- End diff -- @Hiteshgautam01 see this link https://stackoverflow.com/questions/20563524/how-to-add-and-in-android-strings-xml ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192662757 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); + +String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar(); +Glide.with(getContext()) +.load(avatarUrl) +.diskCacheStrategy(DiskCacheStrategy.SOURCE) +.placeholder(R.drawable.ic_account_circle_black_24dp) +.error(R.drawable.ic_account_circle_black_24dp) +.into(new SimpleTarget() { +@Override +public void onResourceReady(GlideDrawable resource, GlideAnimation glideAnimation) { +userAvatar.setImageDrawable(resource); +} +}); + +if (name != null) { +userName.setText(name); +} else { +userName.setText(""); +} + +if (description != null) { +description = android.text.Html.fromHtml(description).toString(); +userDescription.setText(d
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192662444 --- Diff: app/src/main/res/layout/nav_header.xml --- @@ -1,35 +1,67 @@ + +http://schemas.android.com/apk/res/android; + android:layout_width="match_parent" + android:layout_height="178dp" --- End diff -- Then make it 170dp ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192621687 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView UserName; + +@BindView(R.id.user_avatar) +CircleImageView UserAvatar; + +@BindView(R.id.user_email) +TextView UserEmail; + +@BindView(R.id.user_website) +TextView UserWebsite; + +@BindView(R.id.user_description) +TextView UserDescription; + +@BindView(R.id.user_city) +TextView UserCity; + +@BindView(R.id.user_country) +TextView UserCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { --- End diff -- have you used this function? Please delete it if you are not using it. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192621601 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView UserName; + +@BindView(R.id.user_avatar) +CircleImageView UserAvatar; + +@BindView(R.id.user_email) +TextView UserEmail; + +@BindView(R.id.user_website) +TextView UserWebsite; + +@BindView(R.id.user_description) +TextView UserDescription; + +@BindView(R.id.user_city) +TextView UserCity; + +@BindView(R.id.user_country) +TextView UserCountry; --- End diff -- make it `userCountry` or `mUserCountry`. And all the above also. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596819 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +283,43 @@ private void signOut() { finish(); } +private void setNavHeader() { + +View headerView = navigationView.getHeaderView(0); +String avatar = dataManager.getPreferencesHelper().getUserAvatar(); --- End diff -- make `avatar` to `avatarUrl` and `getUserAvatar()` to `getUserAvatarUrl()` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596968 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); --- End diff -- use `userEmail` in place of `email` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596861 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/favouriteworkflow/FavouriteWorkflowsActivity.java --- @@ -0,0 +1,60 @@ +package org.apache.taverna.mobile.ui.favouriteworkflow; + +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.utils.ActivityUtils; + +import butterknife.BindView; +import butterknife.ButterKnife; + +public class FavouriteWorkflowsActivity extends AppCompatActivity { + +@BindView(R.id.toolbar) +Toolbar mToolbar; + +@Override +protected void onCreate(@Nullable Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +setContentView(R.layout.activity_favourite_workflows); + +ButterKnife.bind(this); + +setSupportActionBar(mToolbar); +ActionBar actionbar = getSupportActionBar(); + +if (actionbar != null) { +actionbar.setHomeButtonEnabled(true); +actionbar.setDisplayHomeAsUpEnabled(true); +actionbar.setTitle("Favourite Workflows"); --- End diff -- move `"Favourite Workflows"`to `string.xml` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596873 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/myworkflows/MyWorkflowsActivity.java --- @@ -0,0 +1,60 @@ +package org.apache.taverna.mobile.ui.myworkflows; + +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.utils.ActivityUtils; + +import butterknife.BindView; +import butterknife.ButterKnife; + +public class MyWorkflowsActivity extends AppCompatActivity { + +@BindView(R.id.toolbar) +Toolbar mToolbar; + +@Override +protected void onCreate(@Nullable Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +setContentView(R.layout.activity_my_workflows); + +ButterKnife.bind(this); + +setSupportActionBar(mToolbar); +ActionBar actionbar = getSupportActionBar(); + +if (actionbar != null) { +actionbar.setHomeButtonEnabled(true); +actionbar.setDisplayHomeAsUpEnabled(true); +actionbar.setTitle("My Workflows"); --- End diff -- move `"My Workflows"` to `string.xml` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597150 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,322 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597253 --- Diff: app/src/main/res/layout/nav_header.xml --- @@ -1,35 +1,67 @@ + +http://schemas.android.com/apk/res/android; + android:layout_width="match_parent" + android:layout_height="178dp" + xmlns:app="http://schemas.android.com/apk/res-auto; + android:background="@drawable/nav_header" + android:orientation="vertical" + android:weightSum="1"> + http://schemas.android.com/apk/res/android; - xmlns:tools="http://schemas.android.com/tools; android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:orientation="vertical" - android:background="#ccc"> + android:layout_alignParentBottom="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_marginBottom="@dimen/layout_marginBottom"> - - + android:layout_marginLeft="@dimen/tv_layout_marginLeft" + android:textColor="@color/white" + android:text="@string/username" + android:textSize="@dimen/tv_textSize" + android:textStyle="bold" + /> + + + + + --- End diff -- move the close tag above ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597215 --- Diff: app/src/main/res/layout/nav_header.xml --- @@ -1,35 +1,67 @@ + +http://schemas.android.com/apk/res/android; + android:layout_width="match_parent" + android:layout_height="178dp" + xmlns:app="http://schemas.android.com/apk/res-auto; + android:background="@drawable/nav_header" + android:orientation="vertical" + android:weightSum="1"> + http://schemas.android.com/apk/res/android; - xmlns:tools="http://schemas.android.com/tools; android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:orientation="vertical" - android:background="#ccc"> + android:layout_alignParentBottom="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_marginBottom="@dimen/layout_marginBottom"> - - + android:layout_marginLeft="@dimen/tv_layout_marginLeft" + android:textColor="@color/white" + android:text="@string/username" + android:textSize="@dimen/tv_textSize" + android:textStyle="bold" + /> + + --- End diff -- move the close tag above ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597171 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,322 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597106 --- Diff: app/src/main/res/layout/activity_user_profile.xml --- @@ -0,0 +1,32 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:orientation="vertical"> + + + + --- End diff -- move the close tag above ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596947 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); --- End diff -- use `userName` in place of `name` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596956 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); --- End diff -- use `userDescription` in place of `description ` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597010 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); --- End diff -- use `userCity` in place of `city` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596997 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); --- End diff -- use `userWebsite` in place of `website` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597194 --- Diff: app/src/main/res/layout/nav_header.xml --- @@ -1,35 +1,67 @@ + +http://schemas.android.com/apk/res/android; + android:layout_width="match_parent" + android:layout_height="178dp" --- End diff -- why 178dp? ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597078 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); + +String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar(); +Glide.with(getContext()) +.load(avatarUrl) +.diskCacheStrategy(DiskCacheStrategy.SOURCE) +.placeholder(R.drawable.ic_account_circle_black_24dp) +.error(R.drawable.ic_account_circle_black_24dp) +.into(new SimpleTarget() { +@Override +public void onResourceReady(GlideDrawable resource, GlideAnimation glideAnimation) { +userAvatar.setImageDrawable(resource); +} +}); + +if (name != null) { +userName.setText(name); +} else { +userName.setText(""); +} + +if (description != null) { +description = android.text.Html.fromHtml(description).toString(); +userDescription.setText(d
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597204 --- Diff: app/src/main/res/layout/nav_header.xml --- @@ -1,35 +1,67 @@ + +http://schemas.android.com/apk/res/android; + android:layout_width="match_parent" + android:layout_height="178dp" + xmlns:app="http://schemas.android.com/apk/res-auto; + android:background="@drawable/nav_header" + android:orientation="vertical" + android:weightSum="1"> + http://schemas.android.com/apk/res/android; - xmlns:tools="http://schemas.android.com/tools; android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:orientation="vertical" - android:background="#ccc"> + android:layout_alignParentBottom="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:layout_marginBottom="@dimen/layout_marginBottom"> - - + android:layout_marginLeft="@dimen/tv_layout_marginLeft" + android:textColor="@color/white" + android:text="@string/username" + android:textSize="@dimen/tv_textSize" + android:textStyle="bold" + /> --- End diff -- move the close tag above ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596843 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +283,43 @@ private void signOut() { finish(); } +private void setNavHeader() { + +View headerView = navigationView.getHeaderView(0); +String avatar = dataManager.getPreferencesHelper().getUserAvatar(); +final CircleImageView navUserAvatar = headerView.findViewById(R.id.nav_user_avatar); + +Glide.with(getContext()) +.load(avatar) +.diskCacheStrategy(DiskCacheStrategy.SOURCE) +.placeholder(R.drawable.ic_account_circle_black_24dp) +.error(R.drawable.ic_account_circle_black_24dp) +.into(new SimpleTarget() { +@Override +public void onResourceReady(GlideDrawable resource, GlideAnimation glideAnimation) { +navUserAvatar.setImageDrawable(resource); +} +}); + +navUserAvatar.setOnClickListener(new View.OnClickListener() { --- End diff -- use `@onclick` annotation from butterknife library ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597068 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); + +String avatarUrl = dataManager.getPreferencesHelper().getUserAvatar(); +Glide.with(getContext()) +.load(avatarUrl) +.diskCacheStrategy(DiskCacheStrategy.SOURCE) +.placeholder(R.drawable.ic_account_circle_black_24dp) +.error(R.drawable.ic_account_circle_black_24dp) +.into(new SimpleTarget() { +@Override +public void onResourceReady(GlideDrawable resource, GlideAnimation glideAnimation) { +userAvatar.setImageDrawable(resource); +} +}); + +if (name != null) { +userName.setText(name); +} else { +userName.setText(""); --- End diff -- move ``to string.xml and use it in all fields. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192596897 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileActivity.java --- @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.taverna.mobile.ui.userprofile; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.utils.ActivityUtils; +import butterknife.BindView; +import butterknife.ButterKnife; + +public class UserProfileActivity extends AppCompatActivity { + +@BindView(R.id.toolbar) +Toolbar mToolbar; + +@Override +protected void onCreate(@Nullable Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +setContentView(R.layout.activity_user_profile); + +ButterKnife.bind(this); + +setSupportActionBar(mToolbar); +ActionBar actionbar = getSupportActionBar(); + +if (actionbar != null) { +actionbar.setHomeButtonEnabled(true); +actionbar.setDisplayHomeAsUpEnabled(true); +actionbar.setTitle("Profile"); --- End diff -- move `"Profile"` to `string.xml` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597025 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,154 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +} + +@OnClick(R.id.my_workflow_layout) +void myWorkflows(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +@OnClick(R.id.my_favorite_workflow_layout) +void myFavoriteWorkflow(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); --- End diff -- use `userCountry` in place of `country` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597102 --- Diff: app/src/main/res/layout/activity_favourite_workflows.xml --- @@ -0,0 +1,34 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:orientation="vertical"> + + + + --- End diff -- move the close tag above ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597157 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,322 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192597166 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,322 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579331 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +284,44 @@ private void signOut() { finish(); } +private void setNavHeader() { +NavigationView navigationView = findViewById(R.id.nav_view); +View header_view = navigationView.getHeaderView(0); + +String avatar = dataManager.getPreferencesHelper().getUserAvatar(); --- End diff -- I think this is avatar URL. So, Use `avatarUrl` in place of `avatar` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579307 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +284,44 @@ private void signOut() { finish(); } +private void setNavHeader() { +NavigationView navigationView = findViewById(R.id.nav_view); +View header_view = navigationView.getHeaderView(0); --- End diff -- make it `headeView` in place of `header_view` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579414 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileActivity.java --- @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.taverna.mobile.ui.userprofile; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.utils.Constants; +import butterknife.BindView; +import butterknife.ButterKnife; + +public class UserProfileActivity extends AppCompatActivity { + +@BindView(R.id.toolbar) +Toolbar mToolbar; + +@Override +protected void onCreate(@Nullable Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +setContentView(R.layout.activity_user_profile); + +ButterKnife.bind(this); + +setSupportActionBar(mToolbar); +ActionBar actionbar = getSupportActionBar(); + +if (actionbar != null) { +actionbar.setHomeButtonEnabled(true); +actionbar.setDisplayHomeAsUpEnabled(true); +actionbar.setTitle("Profile"); +} + +if (savedInstanceState == null) { +getSupportFragmentManager().beginTransaction() --- End diff -- use `ActivityUtils.addFragmentToActivity` method ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579292 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +284,44 @@ private void signOut() { finish(); } +private void setNavHeader() { +NavigationView navigationView = findViewById(R.id.nav_view); --- End diff -- use butterknife for this. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579461 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,163 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +@BindView(R.id.my_workflow_layout) +LinearLayout myWorkflowLayout; + +@BindView(R.id.my_favorite_workflow_layout) +LinearLayout myFavoriteWorkflowLayout; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +myWorkflowLayout.setOnClickListener(new View.OnClickListener() { +@Override +public void onClick(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} +}); + +myFavoriteWorkflowLayout.setOnClickListener(new View.OnClickListener() { +@Override +public void onClick(View v) { +Intent intent = new Intent(getActivity(), FavouriteWorkflowsActivity.class); +getActivity().startActivity(intent); +} +}); +} + +private void setUserDetail() { + +dataManager = new DataManager(new PreferencesHelper(getContext())); + +String name = dataManager.getPreferencesHelper().getUserName(); +String description = dataManager.getPreferencesHelper().getUserDescription(); +String email = dataManager.getPreferencesHelper().getUserEmail(); +String website = dataManager.getPreferencesHelper().getUserWebsite(); +String city = dataManager.getPreferencesHelper().getUserCity(); +String country = dataManager.getPreferencesHelper().getUserCountry(); + +String avatar = dataManager.getPreferencesHelper().getUserAvatar(); --- End diff -- make `avatar` to `avatarUrl` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579359 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/DashboardActivity.java --- @@ -271,6 +284,44 @@ private void signOut() { finish(); } +private void setNavHeader() { +NavigationView navigationView = findViewById(R.id.nav_view); +View header_view = navigationView.getHeaderView(0); + +String avatar = dataManager.getPreferencesHelper().getUserAvatar(); +final CircleImageView nav_user_avatar = header_view.findViewById(R.id.nav_user_avatar); --- End diff -- make it `navUserAvatar` in place of `nav_user_avatar` ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579612 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,325 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + + + + + + + --- End diff -- move this to above line ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579244 --- Diff: app/build.gradle --- @@ -68,6 +68,7 @@ dependencies { implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion" implementation "com.android.support:support-annotations:$rootProject.supportLibraryVersion" +implementation 'com.android.support:design:27.1.0' --- End diff -- We are already using this library. Check below line. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579246 --- Diff: app/build.gradle --- @@ -86,6 +87,7 @@ dependencies { //Dependencies for butterknife implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion" +implementation 'com.android.support:support-v4:27.1.1' --- End diff -- We are already using this library. Check below line. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579432 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,163 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +@BindView(R.id.my_workflow_layout) +LinearLayout myWorkflowLayout; + +@BindView(R.id.my_favorite_workflow_layout) +LinearLayout myFavoriteWorkflowLayout; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +myWorkflowLayout.setOnClickListener(new View.OnClickListener() { --- End diff -- use butterknife `@onClick` annotation for click listener. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579555 --- Diff: app/src/main/res/layout/fragment_user_profile.xml --- @@ -0,0 +1,325 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +xmlns:app="http://schemas.android.com/apk/res-auto; +android:orientation="vertical"> + + + + + + + + + + --- End diff -- move this to above line ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r192579439 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/userprofile/UserProfileFragment.java --- @@ -0,0 +1,163 @@ +package org.apache.taverna.mobile.ui.userprofile; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsActivity; +import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowsActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import de.hdodenhof.circleimageview.CircleImageView; + +import static android.os.Build.ID; + +public class UserProfileFragment extends Fragment { + +@BindView(R.id.user_name) +TextView userName; + +@BindView(R.id.user_avatar) +CircleImageView userAvatar; + +@BindView(R.id.user_email) +TextView userEmail; + +@BindView(R.id.user_website) +TextView userWebsite; + +@BindView(R.id.user_description) +TextView userDescription; + +@BindView(R.id.user_city) +TextView userCity; + +@BindView(R.id.user_country) +TextView userCountry; + +@BindView(R.id.my_workflow_layout) +LinearLayout myWorkflowLayout; + +@BindView(R.id.my_favorite_workflow_layout) +LinearLayout myFavoriteWorkflowLayout; + +private DataManager dataManager; + +public static UserProfileFragment newInstance(String id) { + +Bundle args = new Bundle(); + +args.putString(ID, id); + +UserProfileFragment fragment = new UserProfileFragment(); +fragment.setArguments(args); +return fragment; +} + +@Override +public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { +return inflater.inflate(R.layout.fragment_user_profile, parent, false); + +} + +@Override +public void onViewCreated(View view, Bundle savedInstanceState) { +ButterKnife.bind(this, view); + +setUserDetail(); + +myWorkflowLayout.setOnClickListener(new View.OnClickListener() { +@Override +public void onClick(View v) { +Intent intent = new Intent(getActivity(), MyWorkflowsActivity.class); +getActivity().startActivity(intent); +} +}); + +myFavoriteWorkflowLayout.setOnClickListener(new View.OnClickListener() { --- End diff -- use butterknife `@onClick` annotation for click listener. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191054525 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/UserProfileActivity.java --- @@ -0,0 +1,171 @@ +package org.apache.taverna.mobile.ui; + +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.animation.GlideAnimation; +import com.bumptech.glide.request.target.SimpleTarget; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.DataManager; +import org.apache.taverna.mobile.data.local.PreferencesHelper; + +import butterknife.BindView; +import butterknife.ButterKnife; +import de.hdodenhof.circleimageview.CircleImageView; + +import static org.apache.taverna.mobile.TavernaApplication.getContext; + + +public class UserProfileActivity extends AppCompatActivity{ + +@BindView(R.id.toolbar) +Toolbar mToolbar; + +@BindView(R.id.user_name) +TextView user_name; --- End diff -- Use camel notation for the variable name. Also, use `m` prefix for all class variables. ---
[GitHub] incubator-taverna-mobile pull request #78: Feat: User details in nav header ...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/78#discussion_r191046498 --- Diff: app/build.gradle --- @@ -86,6 +86,7 @@ dependencies { //Dependencies for butterknife implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion" +implementation 'com.android.support.constraint:constraint-layout:1.1.0' --- End diff -- remove this library. ---
[GitHub] incubator-taverna-mobile pull request #73: Fix: Improvements in UsageActivit...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/73#discussion_r18953 --- Diff: app/src/main/res/layout/activity_usage.xml --- @@ -33,16 +33,19 @@ +android:orientation="vertical"> +android:layout_height="wrap_content" +android:paddingBottom="@dimen/usageCardViewPaddingBotton" --- End diff -- change this also to `lowercase_underscore` conventions. ---
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184943037 --- Diff: app/src/main/res/layout/fragment_favourite_workflow_list.xml --- @@ -37,13 +37,37 @@ android:layout_centerVertical="true" android:visibility="visible"/> + +
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184943025 --- Diff: app/src/main/res/layout/fragment_favourite_workflow_list.xml --- @@ -37,13 +37,37 @@ android:layout_centerVertical="true" android:visibility="visible"/> + + + + +
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184942983 --- Diff: app/src/main/res/layout/fragment_dashboard.xml --- @@ -21,14 +21,35 @@ android:layout_height="match_parent" android:background="@color/grey_background"> - + +
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcements show fi...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r184889150 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/anouncements/AnnouncementPresenter.java --- @@ -110,4 +115,12 @@ public void onComplete() { })); } + +private Map<String, String> getAnnouncementQueryOptions() { +Map<String, String> option = new HashMap<>(); +option.put("order", "reverse"); +option.put("page", "pageNumber"); --- End diff -- I think you have to put value in place of `pageNumber` string ---
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184889080 --- Diff: app/src/main/res/layout/fragment_favourite_workflow_list.xml --- @@ -37,13 +37,37 @@ android:layout_centerVertical="true" android:visibility="visible"/> + +
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184889049 --- Diff: app/src/main/res/layout/fragment_dashboard.xml --- @@ -21,14 +21,35 @@ android:layout_height="match_parent" android:background="@color/grey_background"> - + +
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184889073 --- Diff: app/src/main/res/layout/fragment_favourite_workflow_list.xml --- @@ -37,13 +37,37 @@ android:layout_centerVertical="true" android:visibility="visible"/> + + + + +
[GitHub] incubator-taverna-mobile pull request #74: Fix: Replacing empty screens with...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/74#discussion_r184889038 --- Diff: app/src/main/res/layout/fragment_dashboard.xml --- @@ -21,14 +21,35 @@ android:layout_height="match_parent" android:background="@color/grey_background"> -
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcements show fi...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r180856614 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/anouncements/AnnouncementPresenter.java --- @@ -110,4 +115,11 @@ public void onComplete() { })); } + +private Map<String, String> getAnnouncementQueryOptions() { +Map<String, String> option = new HashMap<>(); +option.put("order", "reverse"); --- End diff -- add pageNumber query here. ---
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcements show fi...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r180856467 --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/TavernaService.java --- @@ -41,7 +41,8 @@ public interface TavernaService { @GET(APIEndPoint.ALL_ANNOUNCEMENT) -Observable getAllAnnouncements(@Query("page") int pageNumber); +Observable getAllAnnouncements(@Query("page") int pageNumber, --- End diff -- If we move it into `@QueryMap ` then it will be better ---
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcement show fir...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r180370190 --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/TavernaService.java --- @@ -40,7 +40,7 @@ public interface TavernaService { -@GET(APIEndPoint.ALL_ANNOUNCEMENT) +@GET(APIEndPoint.ALL_ANNOUNCEMENT + "?order=reverse") --- End diff -- @Hiteshgautam01 You can also check in workflow's details and workflow's API query for refrence. ---
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcement show fir...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r180369882 --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/TavernaService.java --- @@ -40,7 +40,7 @@ public interface TavernaService { -@GET(APIEndPoint.ALL_ANNOUNCEMENT) +@GET(APIEndPoint.ALL_ANNOUNCEMENT + "?order=reverse") --- End diff -- Yes, it is the static query. But we have to always define all query param at one place only so that if we need to debug then we can track it easily. ---
[GitHub] incubator-taverna-mobile pull request #72: Fix: Latest Announcement show fir...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/72#discussion_r180367593 --- Diff: app/src/main/java/org/apache/taverna/mobile/data/remote/TavernaService.java --- @@ -40,7 +40,7 @@ public interface TavernaService { -@GET(APIEndPoint.ALL_ANNOUNCEMENT) +@GET(APIEndPoint.ALL_ANNOUNCEMENT + "?order=reverse") --- End diff -- move this to query parameter of the function ---
[GitHub] incubator-taverna-mobile pull request #71: Adding myExperiment logo on login...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/71#discussion_r177642987 --- Diff: app/src/main/assets/apache_licence_notice.html --- @@ -229,6 +229,8 @@ Apache Taverna Mobile Copyright 2015-2018 The Apache Software Foundation +1.Disclaimer: myExperiment's Logo is nothing to do with Apache and is copyright to myExperiment. --- End diff -- move it line no 236. just add `myExperiment's Logo is nothing to do with Apache and is copyright to myExperiment.`. ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r176150019 --- Diff: app/src/main/res/layout/tutorial_slide3.xml --- @@ -0,0 +1,50 @@ + + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:background="@color/bg_screen3"> + + + + + +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r176149524 --- Diff: app/src/main/res/layout/activity_tutorial.xml --- @@ -0,0 +1,66 @@ + + +http://schemas.android.com/apk/res/android; +xmlns:app="http://schemas.android.com/apk/res-auto; +xmlns:tools="http://schemas.android.com/tools; +android:layout_width="match_parent" +android:layout_height="match_parent" +tools:showIn="@layout/activity_tutorial"> + + + + + + + +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r176149784 --- Diff: app/src/main/res/layout/tutorial_slide1.xml --- @@ -0,0 +1,48 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:background="@color/bg_screen1"> + + + + + +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r176149908 --- Diff: app/src/main/res/layout/tutorial_slide2.xml --- @@ -0,0 +1,50 @@ + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:background="@color/bg_screen2"> + + + + + +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r176150157 --- Diff: app/src/main/res/layout/tutorial_slide4.xml --- @@ -0,0 +1,50 @@ + + + +http://schemas.android.com/apk/res/android; +android:layout_width="match_parent" +android:layout_height="match_parent" +android:background="@color/bg_screen4"> + + + + + +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173862548 --- Diff: app/src/main/AndroidManifest.xml --- @@ -37,14 +37,18 @@ limitations under the License. android:label="@string/app_name"> +android:name=".ui.tutorial.TutorialActivity" --- End diff -- But first show flash screen then tutorial. And manage first time launch in flash screen. ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173696290 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,161 @@ +/* + * 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.tutorial; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.View; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; +import org.apache.taverna.mobile.ui.adapter.TutorialSliderAdapter; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener { + +@BindView(R.id.slide_pager) +ViewPager slidePager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + +int[] layouts; +private PreferencesHelper preferencesHelper; + +@Override +protected void onCreate(Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +preferencesHelper = new PreferencesHelper(this); +if (!preferencesHelper.isFirstTimeLaunch()) { +launchFlashScreen(); +finish(); +} + +setContentView(R.layout.activity_tutorial); + +ButterKnife.bind(this); + + +if (Build.VERSION.SDK_INT >= 21) { +getWindow().getDecorView() + .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE +| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); +} + +layouts = new int[]{ --- End diff -- use `TutorialSliderEnum` ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173696061 --- Diff: app/src/main/AndroidManifest.xml --- @@ -37,14 +37,18 @@ limitations under the License. android:label="@string/app_name"> +android:name=".ui.tutorial.TutorialActivity" --- End diff -- Launcher activity should be `FlashScreenActivity`. ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173627247 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,200 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener { + +@BindView(R.id.slide_pager) +ViewPager slidePager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + +int[] layouts; +private PreferencesHelper preferencesHelper; + +@Override +protected void onCreate(Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +preferencesHelper = new PreferencesHelper(this); +if (!preferencesHelper.isFirstTimeLaunch()) { +launchFlashScreen(); +finish(); +} + +setContentView(R.layout.activity_tutorial); + +ButterKnife.bind(this); + + +if (Build.VERSION.SDK_INT >= 21) { +getWindow().getDecorView() + .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE +| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); +} + +layouts = new int[]{ +R.layout.tutorial_slide1, +R.layout.tutorial_slide2, +R.layout.tutorial_slide3, +R.layout.tutorial_slide4}; + +addBottomDots(0); + +TutorialSliderAdapter tutorialSliderAdapter = new TutorialSliderAdapter(); +slidePager.setAdapter(tutorialSliderAdapter); +slidePager.addOnPageChangeListener(this); + +} + +@OnClick(R.id.btn_skip) +public void skipClick(View v) { +launchFlashScreen(); +} + +@OnClick(R.id.btn_next) +public void nextClick(View v) { +int current = getItem(+1); +if (current < layouts.length) { +slidePager.setCurrentItem(current); +} else { +launchFlashScreen(); +} +} + +public void addBottomDots(int currentPage) { +TextView[] dots = new TextView[layouts.length]; + +int[] colorsActive = getResources().getIntArray(R.array.array_dot_active); +int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive); + +dotsLayout.removeAllViews(); +for (int i = 0; i < dots.length; i++) { +dots[i] = new TextView(this); +dots[i].setText(Html.fromHtml("")); +dots[i].setTextSize(35); +dots[i].setTextColor(colorsInactive[currentPage]); +dotsLayout.addView(dots[i]); +} + +if (dots.length > 0) +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173627149 --- Diff: app/src/main/AndroidManifest.xml --- @@ -19,63 +19,67 @@ See the License for the specific language governing permissions and limitations under the License. --> http://schemas.android.com/apk/res/android; - package="org.apache.taverna.mobile"> --- End diff -- Revert all unwanted changes. Change only that line which is required ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173627173 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,200 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener { + +@BindView(R.id.slide_pager) +ViewPager slidePager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + +int[] layouts; +private PreferencesHelper preferencesHelper; + +@Override +protected void onCreate(Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +preferencesHelper = new PreferencesHelper(this); +if (!preferencesHelper.isFirstTimeLaunch()) { +launchFlashScreen(); +finish(); +} + +setContentView(R.layout.activity_tutorial); + +ButterKnife.bind(this); + + +if (Build.VERSION.SDK_INT >= 21) { +getWindow().getDecorView() + .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE +| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); +} + +layouts = new int[]{ +R.layout.tutorial_slide1, +R.layout.tutorial_slide2, +R.layout.tutorial_slide3, +R.layout.tutorial_slide4}; + +addBottomDots(0); + +TutorialSliderAdapter tutorialSliderAdapter = new TutorialSliderAdapter(); +slidePager.setAdapter(tutorialSliderAdapter); +slidePager.addOnPageChangeListener(this); + +} + +@OnClick(R.id.btn_skip) +public void skipClick(View v) { +launchFlashScreen(); +} + +@OnClick(R.id.btn_next) +public void nextClick(View v) { +int current = getItem(+1); +if (current < layouts.length) { +slidePager.setCurrentItem(current); +} else { +launchFlashScreen(); +} +} + +public void addBottomDots(int currentPage) { +TextView[] dots = new TextView[layouts.length]; + +int[] colorsActive = getResources().getIntArray(R.array.array_dot_active); +int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive); + +dotsLayout.removeAllViews(); +for (int i = 0; i < dots.length; i++) { +dots[i] = new TextView(this); +dots[i].setText(Html.fromHtml("")); +dots[i].setTextSize(35); +dots[i].setTextColor(colorsInactive[currentPage]); +dotsLayout.addView(dots[i]); +} + +if (dots.length > 0) +
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173626750 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,204 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity { + +@BindView(R.id.view_pager) +ViewPager viewPager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + + +ViewPagerAdapter viewPagerAdapter; +TextView[] dots; +int[] layouts; +PreferencesHelper preferencesHelper; + +@Override +protected void onCreate(Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +preferencesHelper = new PreferencesHelper(this); +if (!preferencesHelper.isFirstTimeLaunch()) { +launchFlashScreen(); +finish(); +} + +setContentView(R.layout.activity_tutorial); + +ButterKnife.bind(this); + + +if (Build.VERSION.SDK_INT >= 21) { +getWindow().getDecorView() + .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE +| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); +} + +layouts = new int[]{ +R.layout.tutorial_slide1, +R.layout.tutorial_slide2, +R.layout.tutorial_slide3, +R.layout.tutorial_slide4}; + +addBottomDots(0); + +viewPagerAdapter = new ViewPagerAdapter(); +viewPager.setAdapter(viewPagerAdapter); +viewPager.addOnPageChangeListener(viewPagerPageChangeListener); + +} + +@OnClick(R.id.btn_skip) +public void skipClick(View v) { +launchFlashScreen(); +} + +@OnClick(R.id.btn_next) +public void nextClick(View v) { +int current = getItem(+1); +if (current < layouts.length) { +viewPager.setCurrentItem(current); +} else { +launchFlashScreen(); +} +} + +public void addBottomDots(int currentPage) { +dots = new TextView[layouts.length]; + +int[] colorsActive = getResources().getIntArray(R.array.array_dot_active); +int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive); + +dotsLayout.removeAllViews(); +for (int i = 0; i < dots.length; i++) { +dots[i] = new TextView(this); +dots[i].setText(Html.fromHtml("")); +dots[i].setTextSize(35); +dots[i].setTextColor(colorsInactive[currentPage]); +dotsLayout.addView(dots[i]); +} + +if (dots.length > 0) +dots[currentP
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173626652 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,203 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity { + +@BindView(R.id.slide_pager) +ViewPager slidePager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + +private TutorialSliderAdapter tutorialSliderAdapter; +int[] layouts; +private PreferencesHelper preferencesHelper; + +@Override +protected void onCreate(Bundle savedInstanceState) { +super.onCreate(savedInstanceState); +preferencesHelper = new PreferencesHelper(this); +if (!preferencesHelper.isFirstTimeLaunch()) { +launchFlashScreen(); +finish(); +} + +setContentView(R.layout.activity_tutorial); + +ButterKnife.bind(this); + + +if (Build.VERSION.SDK_INT >= 21) { +getWindow().getDecorView() + .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE +| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); +} + +layouts = new int[]{ +R.layout.tutorial_slide1, +R.layout.tutorial_slide2, +R.layout.tutorial_slide3, +R.layout.tutorial_slide4}; + +addBottomDots(0); + +tutorialSliderAdapter = new TutorialSliderAdapter(); +slidePager.setAdapter(tutorialSliderAdapter); +slidePager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { +@Override +public void onPageScrolled(int position, float positionOffset, + int positionOffsetPixels) { + +} + +@Override +public void onPageSelected(int position) { +addBottomDots(position); + +if (position == layouts.length - 1) { +bNext.setText(getString(R.string.start)); +bSkip.setVisibility(View.GONE); +} else { +bNext.setText(getString(R.string.next)); +bSkip.setVisibility(View.VISIBLE); +} + +} + +@Override +public void onPageScrollStateChanged(int state) { + +} +}); + +} + +@OnClick(R.id.btn_skip) +public void skipClick(View v) { +launchFlashScreen(); +} + +@OnClick(R.id.btn_next) +public void nextClick(View v) { +int current = getItem(+1); +if (c
[GitHub] incubator-taverna-mobile pull request #69: Improvements in Login Screen UI
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/69#discussion_r173614685 --- Diff: app/src/main/res/drawable/login_button.xml --- @@ -0,0 +1,24 @@ + + + +http://schemas.android.com/apk/res/android; +android:shape="rectangle" android:padding="10dp"> + --- End diff -- remove this unwanted comment ---
[GitHub] incubator-taverna-mobile pull request #69: Improvements in Login Screen UI
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/69#discussion_r173614694 --- Diff: app/src/main/res/drawable/login_button.xml --- @@ -0,0 +1,24 @@ + + + +http://schemas.android.com/apk/res/android; +android:shape="rectangle" android:padding="10dp"> + + + --- End diff -- Move this to `dimens.xml` ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173370036 --- Diff: app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java --- @@ -65,10 +65,14 @@ private final SharedPreferences sharedPref; private Context mContext; +private SharedPreferences.Editor editor; --- End diff -- This variable is not needed ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173370197 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,204 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity { + +@BindView(R.id.view_pager) +ViewPager viewPager; --- End diff -- make it more meaningful. ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173370470 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,204 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity { + +@BindView(R.id.view_pager) +ViewPager viewPager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + + +ViewPagerAdapter viewPagerAdapter; +TextView[] dots; +int[] layouts; +PreferencesHelper preferencesHelper; --- End diff -- make it private. ---
[GitHub] incubator-taverna-mobile pull request #66: Adds tutorial screens on first st...
Github user sagar15795 commented on a diff in the pull request: https://github.com/apache/incubator-taverna-mobile/pull/66#discussion_r173370457 --- Diff: app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java --- @@ -0,0 +1,204 @@ +package org.apache.taverna.mobile.ui.tutorial; + +/* + * 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. + */ + +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.apache.taverna.mobile.R; +import org.apache.taverna.mobile.data.local.PreferencesHelper; +import org.apache.taverna.mobile.ui.FlashScreenActivity; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + + +public class TutorialActivity extends AppCompatActivity { + +@BindView(R.id.view_pager) +ViewPager viewPager; + +@BindView(R.id.layoutDots) +LinearLayout dotsLayout; + +@BindView(R.id.btn_skip) +Button bSkip; + +@BindView(R.id.btn_next) +Button bNext; + + +ViewPagerAdapter viewPagerAdapter; +TextView[] dots; +int[] layouts; --- End diff -- make it private. ---