diff --git a/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/LicensesDialogFragment.java b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/LicensesDialogFragment.java new file mode 100644 index 000000000..3732a9e93 --- /dev/null +++ b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/LicensesDialogFragment.java @@ -0,0 +1,59 @@ +package com.supercilex.robotscouter.ui.teamlist; + +import android.app.Dialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v4.app.DialogFragment; +import android.support.v7.app.AlertDialog; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.View; + +import com.supercilex.robotscouter.R; + +import net.yslibrary.licenseadapter.LicenseAdapter; +import net.yslibrary.licenseadapter.LicenseEntry; +import net.yslibrary.licenseadapter.Licenses; + +import java.util.ArrayList; +import java.util.List; + +public class LicensesDialogFragment extends DialogFragment { + @NonNull + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + View rootView = getActivity().getLayoutInflater().inflate(R.layout.recycler_view, null); + + List licenses = new ArrayList<>(); + + licenses.add(Licenses.noContent("Firebase", + "Google Inc.", + "https://firebase.google.com/terms/")); + licenses.add(Licenses.fromGitHub("firebase/FirebaseUI-Android", + Licenses.LICENSE_APACHE_V2)); + licenses.add(Licenses.fromGitHub("firebase/firebase-jobdispatcher-android", + Licenses.LICENSE_APACHE_V2)); + licenses.add(Licenses.fromGitHub("square/retrofit", Licenses.LICENSE_APACHE_V2)); + licenses.add(Licenses.fromGitHub("bumptech/glide", "LICENSE")); + licenses.add(Licenses.fromGitHub("hdodenhof/CircleImageView", Licenses.LICENSE_APACHE_V2)); + licenses.add(Licenses.fromGitHub("Triple-T/gradle-play-publisher", Licenses.NAME_MIT)); + licenses.add(Licenses.fromGitHub("square/leakcanary", Licenses.LICENSE_APACHE_V2)); + licenses.add(Licenses.fromGitHub("yshrsmz/LicenseAdapter", Licenses.LICENSE_APACHE_V2)); + + RecyclerView list = (RecyclerView) rootView.findViewById(R.id.list); + list.setLayoutManager(new LinearLayoutManager(getContext())); + list.setAdapter(new LicenseAdapter(licenses)); + + Licenses.load(licenses); + + return new AlertDialog.Builder(getActivity()).setView(rootView) + .setTitle(getString(R.string.licenses)) + .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }) + .create(); + } +} diff --git a/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamListActivity.java b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamListActivity.java index 5df5a59d4..325c4d3a5 100644 --- a/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamListActivity.java +++ b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamListActivity.java @@ -88,6 +88,9 @@ public void onSuccess(Void aVoid) { }) .addOnFailureListener(new LogFailureListener()); break; + case R.id.action_licenses: + new LicensesDialogFragment().show(getSupportFragmentManager(), + getHelper().getTag()); case R.id.action_settings: break; } diff --git a/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamsFragment.java b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamsFragment.java index 76e6f066a..c58ec42a2 100644 --- a/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamsFragment.java +++ b/app/src/main/java/com/supercilex/robotscouter/ui/teamlist/TeamsFragment.java @@ -41,7 +41,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.team_list, container, false); + View rootView = inflater.inflate(R.layout.recycler_view, container, false); mManager = new LinearLayoutManager(getContext()); mTeams = (RecyclerView) rootView.findViewById(R.id.list); diff --git a/app/src/main/res/layout/current_scout_fragment.xml b/app/src/main/res/layout/current_scout_fragment.xml index 0ae704886..30402801d 100644 --- a/app/src/main/res/layout/current_scout_fragment.xml +++ b/app/src/main/res/layout/current_scout_fragment.xml @@ -1,4 +1,5 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9d3a49497..d1e892961 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,6 +13,7 @@ Sign out Successfully signed in! Anonymous sign in failed + Licenses Scout diff --git a/build.gradle b/build.gradle index 34dca4d87..0af67f94e 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ ext { versionProps['VERSION_CODE'] = code.toString() versionProps.store(versionPropsFile.newWriter(), - "# suppress inspection \"UnusedProperty\" for whole file") + "suppress inspection \"UnusedProperty\" for whole file") return code } else { diff --git a/gradle.properties b/gradle.properties index 2e12c64a9..935f98393 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -## suppress inspection "UnusedProperty" for whole file -#Fri Nov 11 00:28:13 PST 2016 +#suppress inspection "UnusedProperty" for whole file +#Fri Nov 11 13:23:13 PST 2016 org.gradle.jvmargs=-Xmx2048m -VERSION_CODE=1961 +VERSION_CODE=1967 android.enableBuildCache=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3baa851b2..835bd8e62 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b612ffdf2..7e7f229a0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Aug 06 22:28:38 PDT 2016 +#Fri Nov 11 13:10:41 PST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip +distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-3.3-20161111141334+0000-all.zip diff --git a/gradlew b/gradlew index 27309d923..4ef3a871f 100644 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -154,11 +154,18 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +# Escape application args +for s in "${@}" ; do + s=\"$s\" + APP_ARGS=$APP_ARGS" "$s +done + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 832fdb607..f9553162f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -49,7 +49,6 @@ goto fail @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line