You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by ia...@apache.org on 2016/10/13 13:28:52 UTC
[01/10] incubator-taverna-mobile git commit: Remove empty line at end
from build.gradle
Repository: incubator-taverna-mobile
Updated Branches:
refs/heads/master 665531ea6 -> 8a6819eed
Remove empty line at end from build.gradle
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/a3ef86f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/a3ef86f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/a3ef86f9
Branch: refs/heads/master
Commit: a3ef86f9f32c2a9aed70225091b6da8c22731e4f
Parents: 665531e
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Tue Oct 11 15:51:14 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Tue Oct 11 15:51:14 2016 +0100
----------------------------------------------------------------------
app/build.gradle | 2 +-
.../mobile/ui/licences/LicenceFragment.java | 109 +++++++++++++++++++
.../ui/licences/LicenceRecyclerViewAdapter.java | 78 +++++++++++++
.../ui/licences/licence/LicenceContent.java | 80 ++++++++++++++
app/src/main/res/layout/fragment_licence.xml | 20 ++++
.../main/res/layout/fragment_licence_list.xml | 13 +++
6 files changed, 301 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/build.gradle
----------------------------------------------------------------------
diff --git a/app/build.gradle b/app/build.gradle
index 2282111..051a337 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -81,4 +81,4 @@ dependencies {
compile 'com.anton46:stepsview:0.0.2'
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
new file mode 100644
index 0000000..f97be38
--- /dev/null
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
@@ -0,0 +1,109 @@
+package org.apache.taverna.mobile.ui.licences;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import mobile.taverna.apache.org.tavernamobile.R;
+
+import org.apache.taverna.mobile.ui.licences.dummy.DummyContent;
+import org.apache.taverna.mobile.ui.licences.dummy.DummyContent.DummyItem;
+
+/**
+ * A fragment representing a list of Items.
+ * <p/>
+ * Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
+ * interface.
+ */
+public class LicenceFragment extends Fragment {
+
+ // TODO: Customize parameter argument names
+ private static final String ARG_COLUMN_COUNT = "column-count";
+ // TODO: Customize parameters
+ private int mColumnCount = 1;
+ private OnListFragmentInteractionListener mListener;
+
+ /**
+ * Mandatory empty constructor for the fragment manager to instantiate the
+ * fragment (e.g. upon screen orientation changes).
+ */
+ public LicenceFragment() {
+ }
+
+ // TODO: Customize parameter initialization
+ @SuppressWarnings("unused")
+ public static LicenceFragment newInstance(int columnCount) {
+ LicenceFragment fragment = new LicenceFragment();
+ Bundle args = new Bundle();
+ args.putInt(ARG_COLUMN_COUNT, columnCount);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (getArguments() != null) {
+ mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_licence_list, container, false);
+
+ // Set the adapter
+ if (view instanceof RecyclerView) {
+ Context context = view.getContext();
+ RecyclerView recyclerView = (RecyclerView) view;
+ if (mColumnCount <= 1) {
+ recyclerView.setLayoutManager(new LinearLayoutManager(context));
+ } else {
+ recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
+ }
+ recyclerView.setAdapter(new MyLicenceRecyclerViewAdapter(DummyContent.ITEMS, mListener));
+ }
+ return view;
+ }
+
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+ if (context instanceof OnListFragmentInteractionListener) {
+ mListener = (OnListFragmentInteractionListener) context;
+ } else {
+ throw new RuntimeException(context.toString()
+ + " must implement OnListFragmentInteractionListener");
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ super.onDetach();
+ mListener = null;
+ }
+
+ /**
+ * This interface must be implemented by activities that contain this
+ * fragment to allow an interaction in this fragment to be communicated
+ * to the activity and potentially other fragments contained in that
+ * activity.
+ * <p/>
+ * See the Android Training lesson <a href=
+ * "http://developer.android.com/training/basics/fragments/communicating.html"
+ * >Communicating with Other Fragments</a> for more information.
+ */
+ public interface OnListFragmentInteractionListener {
+ // TODO: Update argument type and name
+ void onListFragmentInteraction(DummyItem item);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
new file mode 100644
index 0000000..85ff0b5
--- /dev/null
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
@@ -0,0 +1,78 @@
+package org.apache.taverna.mobile.ui.licences;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import org.apache.taverna.mobile.R;
+import org.apache.taverna.mobile.ui.licences.LicenceFragment.OnListFragmentInteractionListener;
+import org.apache.taverna.mobile.ui.licences.licence.LicenceContent.DummyItem;
+
+import java.util.List;
+
+/**
+ * {@link RecyclerView.Adapter} that can display a {@link DummyItem} and makes a call to the
+ * specified {@link OnListFragmentInteractionListener}.
+ * TODO: Replace the implementation with code for your data type.
+ */
+public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecyclerViewAdapter.ViewHolder> {
+
+ private final List<DummyItem> mValues;
+ private final OnListFragmentInteractionListener mListener;
+
+ public LicenceRecyclerViewAdapter(List<DummyItem> items, OnListFragmentInteractionListener listener) {
+ mValues = items;
+ mListener = listener;
+ }
+
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext())
+ .inflate(R.layout.fragment_item, parent, false);
+ return new ViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(final ViewHolder holder, int position) {
+ holder.mItem = mValues.get(position);
+ holder.mIdView.setText(mValues.get(position).id);
+ holder.mContentView.setText(mValues.get(position).content);
+
+ holder.mView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (null != mListener) {
+ // Notify the active callbacks interface (the activity, if the
+ // fragment is attached to one) that an item has been selected.
+ mListener.onListFragmentInteraction(holder.mItem);
+ }
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ return mValues.size();
+ }
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+ public final View mView;
+ public final TextView mIdView;
+ public final TextView mContentView;
+ public DummyItem mItem;
+
+ public ViewHolder(View view) {
+ super(view);
+ mView = view;
+ mIdView = (TextView) view.findViewById(R.id.id);
+ mContentView = (TextView) view.findViewById(R.id.content);
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " '" + mContentView.getText() + "'";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
new file mode 100644
index 0000000..3b403ff
--- /dev/null
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
@@ -0,0 +1,80 @@
+package org.apache.taverna.mobile.ui.licences.licence;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Helper class for providing sample content for user interfaces created by
+ * Android template wizards.
+ * <p>
+ * TODO: Replace all uses of this class before publishing your app.
+ */
+public class LicenceContent {
+
+ /**
+ * An array of sample (dummy) items.
+ */
+ public static final List<LicenceItem> ITEMS = new ArrayList<LicenceItem>();
+ private static String licence_json = "[{'library': 'dropbox-android-sdk','version': '1.6.3'}, {'library': 'json_simple','version': '1.1'}, {'libary': 'sjxp','version': '2.2'}, {'library': 'com.android.support:appcompat','version': 'v7:23.3.0'}, {'library': 'com.android.support:cardview','version': 'v7:23.3.0'}, {'library': 'com.android.support:recyclerview','version': 'v7:23.3.0'}, {'library': 'com.android.support:support','version': 'v4:23.3.0'}, {'library': 'com.android.support:design','version': ':23.3.0'}, {'library': 'com.squareup.retrofit2:retrofit','version': '2.0.2'}, {'library': 'com.squareup.retrofit2:adapter-rxjava', 'version': '2.0.2'}, { 'library': 'com.squareup.okhttp3:logging-interceptor', 'version': '3.2.0'}, { 'library': 'com.squareup.retrofit2:converter-simplexml', 'version': '2.0.2'}, { 'library': 'com.jakewharton:butterknife', 'version': '8.0.1'}, { 'library': 'com.jakewharton:butterknife-compiler', 'version': '8.0.1'}, {'library':
'io.reactivex:rxandroid', 'version': '1.2.0'}, {'library': 'io.reactivex:rxjava', 'version': '1.1.4'}, {'library': 'org.simpleframework:simple-xml', 'version': '2.7. +'}, { 'library': 'com.github.bumptech.glide:glide', 'version': '3.6.0'}, { 'libray': 'com.caverock:androidsvg', 'version': '1.2.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-processor', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-core', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow', 'version': '3.0.1'}, { 'library': 'com.facebook.stetho:stetho', 'version': '1.3.1'}, { 'library': 'com.facebook.stetho:stetho-okhttp', 'version': '3: 1.3.1'}, { 'library': 'com.github.chrisbanes:PhotoView', 'version': '1.2.6'}, { 'library': 'com.androidsupport:multidex','version': '1.0.0'}, {'library': 'com.google.code.gson:gson','version': '2.7'}, {'library': 'com.squareup.retrofit2:converter-gson','version': '2.0.2'}, {'library':
'com.anton46:stepsview','version': '0.0.2'}]";
+
+ /**
+ * A map of sample (dummy) items, by ID.
+ */
+ public static final Map<String, LicenceItem> ITEM_MAP = new HashMap<String, LicenceItem>();
+
+ private static final int COUNT = 25;
+
+ static {
+ JSONArray licenceList = null;
+ try {
+ licenceList = new JSONArray(licence_json);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ for (int i=0; i < licenceList.length(); i++) {
+ try {
+ JSONObject libraryDetails = licenceList.getJSONObject(i);
+ String libraryName = libraryDetails.getString("library");
+ String libraryVersion = libraryDetails.getString("version");
+ addItem(createLicenceItem(i, libraryName, libraryVersion));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static void addItem(LicenceItem item) {
+ ITEMS.add(item);
+ ITEM_MAP.put(item.id, item);
+ }
+
+ private static LicenceItem createLicenceItem(int position, String name, String version) {
+ return new LicenceItem(String.valueOf(position), name, version);
+ }
+
+ /**
+ * A dummy item representing a piece of content.
+ */
+ public static class LicenceItem {
+ public final String id;
+ public final String name;
+ public final String version;
+
+ public LicenceItem(String id, String name, String version) {
+ this.id = id;
+ this.name = name;
+ this.version = version;
+ }
+
+ @Override
+ public String toString() {
+ return name + " " + version;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/src/main/res/layout/fragment_licence.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence.xml b/app/src/main/res/layout/fragment_licence.xml
new file mode 100644
index 0000000..ba5b613
--- /dev/null
+++ b/app/src/main/res/layout/fragment_licence.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/id"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:textAppearance="?attr/textAppearanceListItem" />
+
+ <TextView
+ android:id="@+id/content"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:textAppearance="?attr/textAppearanceListItem" />
+</LinearLayout>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/a3ef86f9/app/src/main/res/layout/fragment_licence_list.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence_list.xml b/app/src/main/res/layout/fragment_licence_list.xml
new file mode 100644
index 0000000..350829d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_licence_list.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/list"
+ android:name="org.apache.taverna.mobile.ui.org.apache.taverna.mobile.ui.licences.LicenceFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ app:layoutManager="LinearLayoutManager"
+ tools:context="org.apache.taverna.mobile.ui.org.apache.taverna.mobile.ui.licences.LicenceFragment"
+ tools:listitem="@layout/fragment_licence" />
[04/10] incubator-taverna-mobile git commit: More text views for
licence
Posted by ia...@apache.org.
More text views for licence
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/c395b803
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/c395b803
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/c395b803
Branch: refs/heads/master
Commit: c395b8033967f3cc2d8992e6950a818c0b744bfe
Parents: b05192b
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Tue Oct 11 16:01:54 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Tue Oct 11 16:01:54 2016 +0100
----------------------------------------------------------------------
app/src/main/res/layout/fragment_licence.xml | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/c395b803/app/src/main/res/layout/fragment_licence.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence.xml b/app/src/main/res/layout/fragment_licence.xml
index ba5b613..9813018 100644
--- a/app/src/main/res/layout/fragment_licence.xml
+++ b/app/src/main/res/layout/fragment_licence.xml
@@ -5,14 +5,19 @@
android:orientation="horizontal">
<TextView
- android:id="@+id/id"
+ android:id="@+id/name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:textAppearance="?attr/textAppearanceListItem" />
+ <TextView
+ android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
-
<TextView
- android:id="@+id/content"
+ android:id="@+id/licence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
[02/10] incubator-taverna-mobile git commit: First version of licence
viewer
Posted by ia...@apache.org.
First version of licence viewer
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/b05192ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/b05192ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/b05192ba
Branch: refs/heads/master
Commit: b05192ba70c9d668abe2f2a42a3a62643990b4f6
Parents: a3ef86f
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Tue Oct 11 15:53:44 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Tue Oct 11 15:53:44 2016 +0100
----------------------------------------------------------------------
.../activities/DashboardMainActivity.java | 21 ++++++++++-
.../mobile/ui/licences/LicenceFragment.java | 38 ++++----------------
.../ui/licences/LicenceRecyclerViewAdapter.java | 18 ++++------
.../ui/licences/licence/LicenceContent.java | 17 ++-------
.../main/res/layout/fragment_licence_list.xml | 2 +-
app/src/main/res/menu/drawer_view.xml | 4 +++
app/src/main/res/values/strings.xml | 1 +
7 files changed, 42 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/java/org/apache/taverna/mobile/activities/DashboardMainActivity.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/activities/DashboardMainActivity.java b/app/src/main/java/org/apache/taverna/mobile/activities/DashboardMainActivity.java
index 511ab2c..3d88865 100644
--- a/app/src/main/java/org/apache/taverna/mobile/activities/DashboardMainActivity.java
+++ b/app/src/main/java/org/apache/taverna/mobile/activities/DashboardMainActivity.java
@@ -55,14 +55,16 @@ import org.apache.taverna.mobile.data.DataManager;
import org.apache.taverna.mobile.data.local.PreferencesHelper;
import org.apache.taverna.mobile.ui.anouncements.AnnouncementFragment;
import org.apache.taverna.mobile.ui.favouriteworkflow.FavouriteWorkflowsFragment;
+import org.apache.taverna.mobile.ui.licences.licence.LicenceContent;
import org.apache.taverna.mobile.ui.myworkflows.MyWorkflowFragment;
+import org.apache.taverna.mobile.ui.licences.LicenceFragment;
import org.apache.taverna.mobile.ui.workflow.WorkflowFragment;
import org.apache.taverna.mobile.utils.ActivityUtils;
import org.apache.taverna.mobile.utils.WorkflowOpen;
import java.io.File;
-public class DashboardMainActivity extends AppCompatActivity {
+public class DashboardMainActivity extends AppCompatActivity implements LicenceFragment.OnListFragmentInteractionListener {
public static final String APP_DIRECTORY_NAME = "TavernaMobile";
private final int SELECT_WORKFLOW = 10;
@@ -226,6 +228,19 @@ public class DashboardMainActivity extends AppCompatActivity {
mDrawerLayout.closeDrawers();
return true;
+ case R.id.os_licences:
+
+ fragment = new LicenceFragment();
+ ActivityUtils
+ .addFragmentToActivity(
+ getSupportFragmentManager(),
+ fragment,
+ R.id.frame_container);
+
+ menuItem.setChecked(true);
+ mDrawerLayout.closeDrawers();
+ return true;
+
case R.id.nav_settings:
startActivity(new Intent(getApplicationContext(),
@@ -372,4 +387,8 @@ public class DashboardMainActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item);
}
+ @Override
+ public void onListFragmentInteraction(LicenceContent.LicenceItem item) {
+
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
index f97be38..ae68460 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceFragment.java
@@ -3,30 +3,23 @@ package org.apache.taverna.mobile.ui.licences;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
-import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import mobile.taverna.apache.org.tavernamobile.R;
-
-import org.apache.taverna.mobile.ui.licences.dummy.DummyContent;
-import org.apache.taverna.mobile.ui.licences.dummy.DummyContent.DummyItem;
+import org.apache.taverna.mobile.R;
+import org.apache.taverna.mobile.ui.licences.licence.LicenceContent;
/**
- * A fragment representing a list of Items.
+ * A fragment representing a list of Licence Items.
* <p/>
* Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
* interface.
*/
public class LicenceFragment extends Fragment {
- // TODO: Customize parameter argument names
- private static final String ARG_COLUMN_COUNT = "column-count";
- // TODO: Customize parameters
- private int mColumnCount = 1;
private OnListFragmentInteractionListener mListener;
/**
@@ -36,23 +29,9 @@ public class LicenceFragment extends Fragment {
public LicenceFragment() {
}
- // TODO: Customize parameter initialization
- @SuppressWarnings("unused")
- public static LicenceFragment newInstance(int columnCount) {
- LicenceFragment fragment = new LicenceFragment();
- Bundle args = new Bundle();
- args.putInt(ARG_COLUMN_COUNT, columnCount);
- fragment.setArguments(args);
- return fragment;
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- if (getArguments() != null) {
- mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
- }
}
@Override
@@ -64,12 +43,8 @@ public class LicenceFragment extends Fragment {
if (view instanceof RecyclerView) {
Context context = view.getContext();
RecyclerView recyclerView = (RecyclerView) view;
- if (mColumnCount <= 1) {
- recyclerView.setLayoutManager(new LinearLayoutManager(context));
- } else {
- recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
- }
- recyclerView.setAdapter(new MyLicenceRecyclerViewAdapter(DummyContent.ITEMS, mListener));
+ recyclerView.setLayoutManager(new LinearLayoutManager(context));
+ recyclerView.setAdapter(new LicenceRecyclerViewAdapter(LicenceContent.ITEMS, mListener));
}
return view;
}
@@ -103,7 +78,6 @@ public class LicenceFragment extends Fragment {
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnListFragmentInteractionListener {
- // TODO: Update argument type and name
- void onListFragmentInteraction(DummyItem item);
+ void onListFragmentInteraction(LicenceContent.LicenceItem item);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
index 85ff0b5..e3b66d3 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
@@ -8,21 +8,20 @@ import android.widget.TextView;
import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.ui.licences.LicenceFragment.OnListFragmentInteractionListener;
-import org.apache.taverna.mobile.ui.licences.licence.LicenceContent.DummyItem;
+import org.apache.taverna.mobile.ui.licences.licence.LicenceContent.LicenceItem;
import java.util.List;
/**
- * {@link RecyclerView.Adapter} that can display a {@link DummyItem} and makes a call to the
+ * {@link RecyclerView.Adapter} that can display a {@link LicenceItem} and makes a call to the
* specified {@link OnListFragmentInteractionListener}.
- * TODO: Replace the implementation with code for your data type.
*/
public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecyclerViewAdapter.ViewHolder> {
- private final List<DummyItem> mValues;
+ private final List<LicenceItem> mValues;
private final OnListFragmentInteractionListener mListener;
- public LicenceRecyclerViewAdapter(List<DummyItem> items, OnListFragmentInteractionListener listener) {
+ public LicenceRecyclerViewAdapter(List<LicenceItem> items, OnListFragmentInteractionListener listener) {
mValues = items;
mListener = listener;
}
@@ -30,15 +29,14 @@ public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecy
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
- .inflate(R.layout.fragment_item, parent, false);
+ .inflate(R.layout.fragment_licence, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.mItem = mValues.get(position);
- holder.mIdView.setText(mValues.get(position).id);
- holder.mContentView.setText(mValues.get(position).content);
+ holder.mContentView.setText(mValues.get(position).toString());
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
@@ -59,14 +57,12 @@ public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecy
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
- public final TextView mIdView;
public final TextView mContentView;
- public DummyItem mItem;
+ public LicenceItem mItem;
public ViewHolder(View view) {
super(view);
mView = view;
- mIdView = (TextView) view.findViewById(R.id.id);
mContentView = (TextView) view.findViewById(R.id.content);
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
index 3b403ff..e5131c4 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
@@ -10,26 +10,16 @@ import java.util.List;
import java.util.Map;
/**
- * Helper class for providing sample content for user interfaces created by
- * Android template wizards.
- * <p>
- * TODO: Replace all uses of this class before publishing your app.
+ * Create licence items from JSON string and add to list
*/
public class LicenceContent {
/**
- * An array of sample (dummy) items.
+ * An array of licence items.
*/
public static final List<LicenceItem> ITEMS = new ArrayList<LicenceItem>();
private static String licence_json = "[{'library': 'dropbox-android-sdk','version': '1.6.3'}, {'library': 'json_simple','version': '1.1'}, {'libary': 'sjxp','version': '2.2'}, {'library': 'com.android.support:appcompat','version': 'v7:23.3.0'}, {'library': 'com.android.support:cardview','version': 'v7:23.3.0'}, {'library': 'com.android.support:recyclerview','version': 'v7:23.3.0'}, {'library': 'com.android.support:support','version': 'v4:23.3.0'}, {'library': 'com.android.support:design','version': ':23.3.0'}, {'library': 'com.squareup.retrofit2:retrofit','version': '2.0.2'}, {'library': 'com.squareup.retrofit2:adapter-rxjava', 'version': '2.0.2'}, { 'library': 'com.squareup.okhttp3:logging-interceptor', 'version': '3.2.0'}, { 'library': 'com.squareup.retrofit2:converter-simplexml', 'version': '2.0.2'}, { 'library': 'com.jakewharton:butterknife', 'version': '8.0.1'}, { 'library': 'com.jakewharton:butterknife-compiler', 'version': '8.0.1'}, {'library':
'io.reactivex:rxandroid', 'version': '1.2.0'}, {'library': 'io.reactivex:rxjava', 'version': '1.1.4'}, {'library': 'org.simpleframework:simple-xml', 'version': '2.7. +'}, { 'library': 'com.github.bumptech.glide:glide', 'version': '3.6.0'}, { 'libray': 'com.caverock:androidsvg', 'version': '1.2.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-processor', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-core', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow', 'version': '3.0.1'}, { 'library': 'com.facebook.stetho:stetho', 'version': '1.3.1'}, { 'library': 'com.facebook.stetho:stetho-okhttp', 'version': '3: 1.3.1'}, { 'library': 'com.github.chrisbanes:PhotoView', 'version': '1.2.6'}, { 'library': 'com.androidsupport:multidex','version': '1.0.0'}, {'library': 'com.google.code.gson:gson','version': '2.7'}, {'library': 'com.squareup.retrofit2:converter-gson','version': '2.0.2'}, {'library':
'com.anton46:stepsview','version': '0.0.2'}]";
- /**
- * A map of sample (dummy) items, by ID.
- */
- public static final Map<String, LicenceItem> ITEM_MAP = new HashMap<String, LicenceItem>();
-
- private static final int COUNT = 25;
-
static {
JSONArray licenceList = null;
try {
@@ -51,7 +41,6 @@ public class LicenceContent {
private static void addItem(LicenceItem item) {
ITEMS.add(item);
- ITEM_MAP.put(item.id, item);
}
private static LicenceItem createLicenceItem(int position, String name, String version) {
@@ -59,7 +48,7 @@ public class LicenceContent {
}
/**
- * A dummy item representing a piece of content.
+ * A licence item containing info about a library used by the app.
*/
public static class LicenceItem {
public final String id;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/res/layout/fragment_licence_list.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence_list.xml b/app/src/main/res/layout/fragment_licence_list.xml
index 350829d..97a6935 100644
--- a/app/src/main/res/layout/fragment_licence_list.xml
+++ b/app/src/main/res/layout/fragment_licence_list.xml
@@ -9,5 +9,5 @@
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
- tools:context="org.apache.taverna.mobile.ui.org.apache.taverna.mobile.ui.licences.LicenceFragment"
+ tools:context=".ui.licences.LicenceFragment"
tools:listitem="@layout/fragment_licence" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/res/menu/drawer_view.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/menu/drawer_view.xml b/app/src/main/res/menu/drawer_view.xml
index 93337df..9cd5a26 100644
--- a/app/src/main/res/menu/drawer_view.xml
+++ b/app/src/main/res/menu/drawer_view.xml
@@ -48,6 +48,10 @@
android:icon="@drawable/ic_about_web"
android:title="About"/>
<item
+ android:id="@+id/os_licences"
+ android:icon="@drawable/ic_about_web"
+ android:title="@string/os_licences"/>
+ <item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_setting_workflows_web"
android:title="Settings"/>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/b05192ba/app/src/main/res/values/strings.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8e531ae..d58fe29 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
+ <string name="os_licences">Licence info</string>
<string name="app_name">Taverna Mobile</string>
<string name="hello_world">Empty</string>
<string name="action_settings">Settings</string>
[08/10] incubator-taverna-mobile git commit: Better layout for
licence view
Posted by ia...@apache.org.
Better layout for licence view
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/1f600d1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/1f600d1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/1f600d1a
Branch: refs/heads/master
Commit: 1f600d1a95e832cdb9256ee958e48a32e7f52ab3
Parents: 94ba319
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Wed Oct 12 17:29:45 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Wed Oct 12 17:29:45 2016 +0100
----------------------------------------------------------------------
app/src/main/res/layout/fragment_licence.xml | 98 ++++++++++++++++-------
app/src/main/res/values/strings.xml | 2 +
2 files changed, 71 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/1f600d1a/app/src/main/res/layout/fragment_licence.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence.xml b/app/src/main/res/layout/fragment_licence.xml
index a155813..4d08d88 100644
--- a/app/src/main/res/layout/fragment_licence.xml
+++ b/app/src/main/res/layout/fragment_licence.xml
@@ -1,39 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/card_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:layout_marginBottom="@dimen/announcementCardMarginVertical"
+ android:layout_marginRight="@dimen/announcementCardMarginHorizontal"
+ android:layout_marginTop="@dimen/announcementCardMarginVertical"
+ android:paddingBottom="5dp"
+ card_view:cardCornerRadius="2dp"
+ card_view:cardElevation="2pt">
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
<TextView
android:id="@+id/licence_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
android:layout_gravity="center_horizontal"
- android:textAppearance="?attr/textAppearanceListItem" />
-<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_weight="1">
- <TextView
- android:id="@+id/licence_version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:layout_weight="50"
- android:layout_gravity="left"
- android:gravity="left"
- android:textAppearance="?attr/textAppearanceListItem" />
+ android:textAppearance="?attr/textAppearanceListItem"
+ android:textStyle="bold"
+ android:paddingBottom="5dp"/>
- <TextView
- android:id="@+id/licence_licence"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:layout_weight="50"
- android:layout_gravity="right"
- android:gravity="right"
- android:textAppearance="?attr/textAppearanceListItem" />
-</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ android:paddingLeft="10dp">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:orientation="vertical">
+ <TextView
+ android:id="@+id/licence_version_text_holder"
+ android:text="@string/os_licence_version_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?attr/textAppearanceListItem"
+ android:textSize="14sp"
+ android:textStyle="bold" />
+ <TextView
+ android:id="@+id/licence_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?attr/textAppearanceListItem" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/licence_licence_text_holder"
+ android:text="@string/os_licence_licence_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?attr/textAppearanceListItem"
+ android:textSize="14sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/licence_licence"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?attr/textAppearanceListItem" />
+ </LinearLayout>
+
+ </LinearLayout>
+ </LinearLayout>
+</android.support.v7.widget.CardView>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/1f600d1a/app/src/main/res/values/strings.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d58fe29..0769dde 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
+ <string name="os_licence_version_text">Version:</string>
+ <string name="os_licence_licence_text">Licence:</string>
<string name="os_licences">Licence info</string>
<string name="app_name">Taverna Mobile</string>
<string name="hello_world">Empty</string>
[06/10] incubator-taverna-mobile git commit: Use 3 text views for
licence info
Posted by ia...@apache.org.
Use 3 text views for licence info
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/d7600246
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/d7600246
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/d7600246
Branch: refs/heads/master
Commit: d76002461d9792a90c581c9e6132503e3339e690
Parents: 398f0c4
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Wed Oct 12 11:11:54 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Wed Oct 12 11:11:54 2016 +0100
----------------------------------------------------------------------
.../ui/licences/LicenceRecyclerViewAdapter.java | 14 ++++--
.../ui/licences/licence/LicenceContent.java | 28 +++++++++--
app/src/main/res/layout/fragment_licence.xml | 50 ++++++++++++--------
3 files changed, 63 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/d7600246/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
index e3b66d3..cf1a980 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
@@ -36,7 +36,9 @@ public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecy
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.mItem = mValues.get(position);
- holder.mContentView.setText(mValues.get(position).toString());
+ holder.mLicenceNameView.setText(mValues.get(position).getName());
+ holder.mLicenceVersionView.setText(mValues.get(position).getVersion());
+ holder.mLicenceLicenceView.setText("Unknown");
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
@@ -57,18 +59,22 @@ public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecy
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
- public final TextView mContentView;
+ public final TextView mLicenceNameView;
+ public final TextView mLicenceVersionView;
+ public final TextView mLicenceLicenceView;
public LicenceItem mItem;
public ViewHolder(View view) {
super(view);
mView = view;
- mContentView = (TextView) view.findViewById(R.id.content);
+ mLicenceNameView = (TextView) view.findViewById(R.id.licence_name);
+ mLicenceVersionView = (TextView) view.findViewById(R.id.licence_version);
+ mLicenceLicenceView = (TextView) view.findViewById(R.id.licence_licence);
}
@Override
public String toString() {
- return super.toString() + " '" + mContentView.getText() + "'";
+ return super.toString() + " " + mLicenceNameView.getText() + " " + mLicenceVersionView.getText() + " " + mLicenceLicenceView.getText();
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/d7600246/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
index e5131c4..adbca0d 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
@@ -32,7 +32,7 @@ public class LicenceContent {
JSONObject libraryDetails = licenceList.getJSONObject(i);
String libraryName = libraryDetails.getString("library");
String libraryVersion = libraryDetails.getString("version");
- addItem(createLicenceItem(i, libraryName, libraryVersion));
+ addItem(createLicenceItem(i, libraryName, libraryVersion, ""));
} catch (JSONException e) {
e.printStackTrace();
}
@@ -43,8 +43,8 @@ public class LicenceContent {
ITEMS.add(item);
}
- private static LicenceItem createLicenceItem(int position, String name, String version) {
- return new LicenceItem(String.valueOf(position), name, version);
+ private static LicenceItem createLicenceItem(int position, String name, String version, String licence) {
+ return new LicenceItem(String.valueOf(position), name, version, licence);
}
/**
@@ -54,16 +54,34 @@ public class LicenceContent {
public final String id;
public final String name;
public final String version;
+ public final String licence;
- public LicenceItem(String id, String name, String version) {
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getLicence() {
+ return licence;
+ }
+
+ public LicenceItem(String id, String name, String version, String licence) {
this.id = id;
this.name = name;
this.version = version;
+ this.licence = licence;
}
@Override
public String toString() {
- return name + " " + version;
+ return name + " " + version + " " + licence;
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/d7600246/app/src/main/res/layout/fragment_licence.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence.xml b/app/src/main/res/layout/fragment_licence.xml
index 9813018..c1fdb6a 100644
--- a/app/src/main/res/layout/fragment_licence.xml
+++ b/app/src/main/res/layout/fragment_licence.xml
@@ -1,25 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
- <TextView
- android:id="@+id/name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:textAppearance="?attr/textAppearanceListItem" />
- <TextView
- android:id="@+id/version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:textAppearance="?attr/textAppearanceListItem" />
- <TextView
- android:id="@+id/licence"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:textAppearance="?attr/textAppearanceListItem" />
-</LinearLayout>
+ <TextView
+ android:id="@+id/licence_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:layout_toLeftOf="@+id/licence_version"
+ android:layout_weight="40"
+ android:gravity="center_horizontal"
+ android:textAppearance="?attr/textAppearanceListItem" />
+
+ <TextView
+ android:id="@+id/licence_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:layout_toLeftOf="@+id/licence_licence"
+ android:layout_weight="20"
+ android:gravity="center_horizontal"
+ android:textAppearance="?attr/textAppearanceListItem" />
+
+ <TextView
+ android:id="@+id/licence_licence"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:layout_weight="20"
+ android:gravity="center_horizontal"
+ android:textAppearance="?attr/textAppearanceListItem" />
+</LinearLayout>
\ No newline at end of file
[03/10] incubator-taverna-mobile git commit: Android studio and
supporting lib updates
Posted by ia...@apache.org.
Android studio and supporting lib updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/64aaf7a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/64aaf7a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/64aaf7a8
Branch: refs/heads/master
Commit: 64aaf7a857a30612206d4030df6fa49ab9b3a23c
Parents: 665531e
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Tue Oct 11 15:54:47 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Tue Oct 11 15:54:47 2016 +0100
----------------------------------------------------------------------
app/src/main/res/values/dimens.xml | 7 ++++---
build.gradle | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/64aaf7a8/app/src/main/res/values/dimens.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index bc2312b..e444114 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -16,9 +16,9 @@ limitations under the License.
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
- <dimen name="app_bar_top_padding">0dp</dimen>
- <dimen name="cardMarginHorizontal">10dp</dimen>
- <dimen name="cardMarginVertical">8dp</dimen>
+ <dimen name="app_bar_top_padding">0dp</dimen>
+ <dimen name="cardMarginHorizontal">10dp</dimen>
+ <dimen name="cardMarginVertical">8dp</dimen>
<!--Announcement Card margin-->
<dimen name="announcementCardMarginHorizontal">5dp</dimen>
@@ -29,4 +29,5 @@ limitations under the License.
<dimen name="navigation_drawer_width">240dp</dimen>
<dimen name="item_offset">3dp</dimen>
<dimen name="fab_margin">16dp</dimen>
+ <dimen name="text_margin">16dp</dimen>
</resources>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/64aaf7a8/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a67b30d..db53127 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.0'
+ classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.1"
// NOTE: Do not place your application dependencies here; they belong
[07/10] incubator-taverna-mobile git commit: Align the licence info
Posted by ia...@apache.org.
Align the licence info
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/94ba319e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/94ba319e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/94ba319e
Branch: refs/heads/master
Commit: 94ba319eb3491ae302cf695037f6e5d71810abaa
Parents: d760024
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Wed Oct 12 13:27:58 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Wed Oct 12 13:27:58 2016 +0100
----------------------------------------------------------------------
app/src/main/res/layout/fragment_licence.xml | 48 ++++++++++++-----------
1 file changed, 26 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/94ba319e/app/src/main/res/layout/fragment_licence.xml
----------------------------------------------------------------------
diff --git a/app/src/main/res/layout/fragment_licence.xml b/app/src/main/res/layout/fragment_licence.xml
index c1fdb6a..a155813 100644
--- a/app/src/main/res/layout/fragment_licence.xml
+++ b/app/src/main/res/layout/fragment_licence.xml
@@ -2,34 +2,38 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="vertical">
<TextView
android:id="@+id/licence_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
- android:layout_toLeftOf="@+id/licence_version"
- android:layout_weight="40"
- android:gravity="center_horizontal"
- android:textAppearance="?attr/textAppearanceListItem" />
-
- <TextView
- android:id="@+id/licence_version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:layout_toLeftOf="@+id/licence_licence"
- android:layout_weight="20"
- android:gravity="center_horizontal"
+ android:layout_gravity="center_horizontal"
android:textAppearance="?attr/textAppearanceListItem" />
+<LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_weight="1">
+ <TextView
+ android:id="@+id/licence_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:layout_weight="50"
+ android:layout_gravity="left"
+ android:gravity="left"
+ android:textAppearance="?attr/textAppearanceListItem" />
- <TextView
- android:id="@+id/licence_licence"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/text_margin"
- android:layout_weight="20"
- android:gravity="center_horizontal"
- android:textAppearance="?attr/textAppearanceListItem" />
+ <TextView
+ android:id="@+id/licence_licence"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/text_margin"
+ android:layout_weight="50"
+ android:layout_gravity="right"
+ android:gravity="right"
+ android:textAppearance="?attr/textAppearanceListItem" />
+</LinearLayout>
</LinearLayout>
\ No newline at end of file
[10/10] incubator-taverna-mobile git commit: Actual licence types for
dependencies
Posted by ia...@apache.org.
Actual licence types for dependencies
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/8a6819ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/8a6819ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/8a6819ee
Branch: refs/heads/master
Commit: 8a6819eedc9b80c0ad7f67182eab840e9b3c44fd
Parents: 467c343
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Thu Oct 13 14:23:09 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Thu Oct 13 14:23:09 2016 +0100
----------------------------------------------------------------------
.../taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java | 2 +-
.../taverna/mobile/ui/licences/licence/LicenceContent.java | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/8a6819ee/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
index cf1a980..2d37cec 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/LicenceRecyclerViewAdapter.java
@@ -38,7 +38,7 @@ public class LicenceRecyclerViewAdapter extends RecyclerView.Adapter<LicenceRecy
holder.mItem = mValues.get(position);
holder.mLicenceNameView.setText(mValues.get(position).getName());
holder.mLicenceVersionView.setText(mValues.get(position).getVersion());
- holder.mLicenceLicenceView.setText("Unknown");
+ holder.mLicenceLicenceView.setText(mValues.get(position).getLicence());
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/8a6819ee/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
index adbca0d..f43f790 100644
--- a/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
+++ b/app/src/main/java/org/apache/taverna/mobile/ui/licences/licence/LicenceContent.java
@@ -18,7 +18,7 @@ public class LicenceContent {
* An array of licence items.
*/
public static final List<LicenceItem> ITEMS = new ArrayList<LicenceItem>();
- private static String licence_json = "[{'library': 'dropbox-android-sdk','version': '1.6.3'}, {'library': 'json_simple','version': '1.1'}, {'libary': 'sjxp','version': '2.2'}, {'library': 'com.android.support:appcompat','version': 'v7:23.3.0'}, {'library': 'com.android.support:cardview','version': 'v7:23.3.0'}, {'library': 'com.android.support:recyclerview','version': 'v7:23.3.0'}, {'library': 'com.android.support:support','version': 'v4:23.3.0'}, {'library': 'com.android.support:design','version': ':23.3.0'}, {'library': 'com.squareup.retrofit2:retrofit','version': '2.0.2'}, {'library': 'com.squareup.retrofit2:adapter-rxjava', 'version': '2.0.2'}, { 'library': 'com.squareup.okhttp3:logging-interceptor', 'version': '3.2.0'}, { 'library': 'com.squareup.retrofit2:converter-simplexml', 'version': '2.0.2'}, { 'library': 'com.jakewharton:butterknife', 'version': '8.0.1'}, { 'library': 'com.jakewharton:butterknife-compiler', 'version': '8.0.1'}, {'library':
'io.reactivex:rxandroid', 'version': '1.2.0'}, {'library': 'io.reactivex:rxjava', 'version': '1.1.4'}, {'library': 'org.simpleframework:simple-xml', 'version': '2.7. +'}, { 'library': 'com.github.bumptech.glide:glide', 'version': '3.6.0'}, { 'libray': 'com.caverock:androidsvg', 'version': '1.2.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-processor', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-core', 'version': '3.0.1'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow', 'version': '3.0.1'}, { 'library': 'com.facebook.stetho:stetho', 'version': '1.3.1'}, { 'library': 'com.facebook.stetho:stetho-okhttp', 'version': '3: 1.3.1'}, { 'library': 'com.github.chrisbanes:PhotoView', 'version': '1.2.6'}, { 'library': 'com.androidsupport:multidex','version': '1.0.0'}, {'library': 'com.google.code.gson:gson','version': '2.7'}, {'library': 'com.squareup.retrofit2:converter-gson','version': '2.0.2'}, {'library':
'com.anton46:stepsview','version': '0.0.2'}]";
+ private static String licence_json = "[{'library': 'dropbox-android-sdk','version': '1.6.3', 'licence': 'MIT'}, {'library': 'json_simple','version': '1.1','licence': 'Apache 2'}, {'libary': 'sjxp','version': '2.2', 'licence': 'Apache 2'}, {'library': 'com.android.support:appcompat','version': 'v7:23.3.0', 'licence': 'Apache 2'}, {'library': 'com.android.support:cardview','version': 'v7:23.3.0', 'licence': 'Apache 2'}, {'library': 'com.android.support:recyclerview','version': 'v7:23.3.0', 'licence': 'Apache 2'}, {'library': 'com.android.support:support','version': 'v4:23.3.0', 'licence': 'Apache 2'}, {'library': 'com.android.support:design','version': ':23.3.0', 'licence': 'Apache 2'}, {'library': 'com.squareup.retrofit2:retrofit','version': '2.0.2', 'licence': 'Apache 2'}, {'library': 'com.squareup.retrofit2:adapter-rxjava', 'version': '2.0.2', 'licence': 'Apache 2'}, { 'library': 'com.squareup.okhttp3:logging-interceptor', 'version': '3.2.0', 'licence': 'Apache 2'}, { 'library'
: 'com.squareup.retrofit2:converter-simplexml', 'version': '2.0.2', 'licence': 'Apache 2'}, { 'library': 'com.jakewharton:butterknife', 'version': '8.0.1', 'licence': 'Apache 2'}, { 'library': 'com.jakewharton:butterknife-compiler', 'version': '8.0.1', 'licence': 'Apache 2'}, {'library': 'io.reactivex:rxandroid', 'version': '1.2.0', 'licence': 'Apache 2'}, {'library': 'io.reactivex:rxjava', 'version': '1.1.4', 'licence': 'Apache 2'}, {'library': 'org.simpleframework:simple-xml', 'version': '2.7. +', 'licence': 'Apache 2'}, { 'library': 'com.github.bumptech.glide:glide', 'version': '3.6.0', 'licence': 'BSD, MIT & Apache 2'}, { 'library': 'com.caverock:androidsvg', 'version': '1.2.1', 'licence': 'Apache 2'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-processor', 'version': '3.0.1', 'licence': 'MIT'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow-core', 'version': '3.0.1', 'licence': 'MIT'}, { 'library': 'com.github.Raizlabs.DBFlow:dbflow', 'version': '3.0.1', 'licence': 'MIT
'}, { 'library': 'com.facebook.stetho:stetho', 'version': '1.3.1', 'licence': 'BSD'}, { 'library': 'com.facebook.stetho:stetho-okhttp', 'version': '3: 1.3.1', 'licence': 'BSD'}, { 'library': 'com.github.chrisbanes:PhotoView', 'version': '1.2.6', 'licence': 'Apache 2'}, { 'library': 'com.androidsupport:multidex','version': '1.0.0', 'licence': 'Apache 2'}, {'library': 'com.google.code.gson:gson','version': '2.7', 'licence': 'Apache 2'}, {'library': 'com.squareup.retrofit2:converter-gson','version': '2.0.2', 'licence': 'Apache 2'}, {'library': 'com.anton46:stepsview','version': '0.0.2', 'licence': 'Apache 2'}]";
static {
JSONArray licenceList = null;
@@ -32,7 +32,8 @@ public class LicenceContent {
JSONObject libraryDetails = licenceList.getJSONObject(i);
String libraryName = libraryDetails.getString("library");
String libraryVersion = libraryDetails.getString("version");
- addItem(createLicenceItem(i, libraryName, libraryVersion, ""));
+ String licenceVersion = libraryDetails.getString("licence");
+ addItem(createLicenceItem(i, libraryName, libraryVersion, licenceVersion));
} catch (JSONException e) {
e.printStackTrace();
}
[05/10] incubator-taverna-mobile git commit: Merge branch 'master'
into ian_licence_data
Posted by ia...@apache.org.
Merge branch 'master' into ian_licence_data
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/398f0c4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/398f0c4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/398f0c4a
Branch: refs/heads/master
Commit: 398f0c4a98ae237b7f4f6838753ab12321474ed1
Parents: c395b80 64aaf7a
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Tue Oct 11 16:01:56 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Tue Oct 11 16:01:56 2016 +0100
----------------------------------------------------------------------
app/src/main/res/values/dimens.xml | 7 ++++---
build.gradle | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[09/10] incubator-taverna-mobile git commit: min sdk 17 since some
properties require it
Posted by ia...@apache.org.
min sdk 17 since some properties require it
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/467c3437
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/467c3437
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/467c3437
Branch: refs/heads/master
Commit: 467c34371a5b233dea649fc63158640b3ccfc3ee
Parents: 1f600d1
Author: Ian Dunlop <ia...@manchester.ac.uk>
Authored: Wed Oct 12 17:30:09 2016 +0100
Committer: Ian Dunlop <ia...@manchester.ac.uk>
Committed: Wed Oct 12 17:30:09 2016 +0100
----------------------------------------------------------------------
app/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/467c3437/app/build.gradle
----------------------------------------------------------------------
diff --git a/app/build.gradle b/app/build.gradle
index 051a337..8eec8d0 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -12,7 +12,7 @@ android {
}
defaultConfig {
applicationId "mobile.taverna.apache.org.tavernamobile"
- minSdkVersion 16
+ minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"