Skip to content

Commit

Permalink
Added licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPERCILEX committed Nov 11, 2016
1 parent b79dc15 commit d31ac63
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 24 deletions.
@@ -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<LicenseEntry> 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();
}
}
Expand Up @@ -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;
}
Expand Down
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/current_scout_fragment.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- TODO use recycler_view standard -->
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand Down
File renamed without changes.
12 changes: 9 additions & 3 deletions app/src/main/res/menu/team_list.xml
Expand Up @@ -5,20 +5,26 @@

<item
android:id="@+id/action_sign_in"
android:orderInCategory="100"
android:orderInCategory="1"
android:title="@string/sign_in"
app:showAsAction="never"/>

<item
android:id="@+id/action_sign_out"
android:orderInCategory="100"
android:orderInCategory="2"
android:title="@string/sign_out"
app:showAsAction="never"/>

<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:orderInCategory="3"
android:title="@string/action_settings"
app:showAsAction="never"/>

<item
android:id="@+id/action_licenses"
android:orderInCategory="4"
android:title="@string/licenses"
app:showAsAction="never"/>

</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Expand Up @@ -13,6 +13,7 @@
<string name="sign_out">Sign out</string>
<string name="signed_in">Successfully signed in!</string>
<string name="sign_in_failed">Anonymous sign in failed</string>
<string name="licenses">Licenses</string>

<!-- Scout Activity -->
<string name="title_activity_scout">Scout</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions 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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions 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
23 changes: 15 additions & 8 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -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" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit d31ac63

Please sign in to comment.