From 236dab5626351a96d3f8c2e992836e5835e4590c Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Thu, 17 Sep 2015 17:43:37 +0200 Subject: Update JavaDoc --- aboutit/.gitignore | 1 - aboutit/build.gradle | 84 ------- aboutit/proguard-rules.pro | 22 -- .../java/com/snilius/aboutit/ApplicationTest.java | 13 -- aboutit/src/main/AndroidManifest.xml | 5 - .../src/main/java/com/snilius/aboutit/AboutIt.java | 257 --------------------- .../java/com/snilius/aboutit/CustomLicense.java | 21 -- aboutit/src/main/java/com/snilius/aboutit/L.java | 26 --- .../main/java/com/snilius/aboutit/LibBuilder.java | 49 ---- .../main/java/com/snilius/aboutit/LibSkeleton.java | 12 - .../main/java/com/snilius/aboutit/LicenseBase.java | 15 -- aboutit/src/main/res/values/strings.xml | 3 - 12 files changed, 508 deletions(-) delete mode 100644 aboutit/.gitignore delete mode 100644 aboutit/build.gradle delete mode 100644 aboutit/proguard-rules.pro delete mode 100644 aboutit/src/androidTest/java/com/snilius/aboutit/ApplicationTest.java delete mode 100644 aboutit/src/main/AndroidManifest.xml delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/AboutIt.java delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/CustomLicense.java delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/L.java delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/LibBuilder.java delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/LibSkeleton.java delete mode 100644 aboutit/src/main/java/com/snilius/aboutit/LicenseBase.java delete mode 100644 aboutit/src/main/res/values/strings.xml (limited to 'aboutit') diff --git a/aboutit/.gitignore b/aboutit/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/aboutit/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/aboutit/build.gradle b/aboutit/build.gradle deleted file mode 100644 index d377df0..0000000 --- a/aboutit/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'maven' -apply plugin: 'signing' -apply plugin: 'nexus-workflow' - -group = "com.snilius.aboutit" -archivesBaseName = "aboutit" -version = "1.2.0" - -android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' - - defaultConfig { - minSdkVersion 14 - targetSdkVersion 23 - versionCode 6 - versionName version - } - buildTypes { - release { - minifyEnabled false - } - } -} - -dependencies { - compile 'com.android.support:appcompat-v7:23.0.1' -} - -configurations { - archives { - extendsFrom configurations.default - } -} - -signing { - sign configurations.archives -} - -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - - pom.project { - name 'AboutIt' - packaging 'jar' - // optionally artifactId can be defined here - description 'A About-page creator' - url 'https://github.com/victorhaggqvist/AboutIt' - - scm { - connection 'scm:git:https://github.com/victorhaggqvist/AboutIt.git' - developerConnection 'scm:git:https://github.com/victorhaggqvist/AboutIt.git' - url 'https://github.com/victorhaggqvist/AboutIt' - } - - licenses { - license { - name 'The Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - - developers { - developer { - id 'atriix' - name 'Victor Häggqvist' - email 'victor@snilius.com' - } - } - } - } - } -} \ No newline at end of file diff --git a/aboutit/proguard-rules.pro b/aboutit/proguard-rules.pro deleted file mode 100644 index 1e3e67e..0000000 --- a/aboutit/proguard-rules.pro +++ /dev/null @@ -1,22 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /opt/android-sdk-linux/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} --dontshrink - --keep class com.snilius.aboutit { - public *; -} \ No newline at end of file diff --git a/aboutit/src/androidTest/java/com/snilius/aboutit/ApplicationTest.java b/aboutit/src/androidTest/java/com/snilius/aboutit/ApplicationTest.java deleted file mode 100644 index c6f81f4..0000000 --- a/aboutit/src/androidTest/java/com/snilius/aboutit/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.snilius.aboutit; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/aboutit/src/main/AndroidManifest.xml b/aboutit/src/main/AndroidManifest.xml deleted file mode 100644 index 65c8a5d..0000000 --- a/aboutit/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/aboutit/src/main/java/com/snilius/aboutit/AboutIt.java b/aboutit/src/main/java/com/snilius/aboutit/AboutIt.java deleted file mode 100644 index 1a2195f..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/AboutIt.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.snilius.aboutit; - -import android.app.Activity; -import android.support.annotation.IdRes; -import android.support.annotation.StringRes; -import android.text.util.Linkify; -import android.widget.TextView; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -/** - *

AboutIt

- * A About-page creator - * - *
- * {@code
- * new AboutIt(this).app(R.string.app_name)
- *     .buildInfo(BuildConfig.DEBUG, BuildConfig.VERSION_CODE, BuildConfig.VERSION_NAME)
- *     .copyright("Example Business")
- *     .libLicense("AboutIt", "Victor Häggqvist", L.AP2, "https://github.com/victorhaggqvist/aboutit")
- *     .toTextView(R.id.about_text);
- * }
- * 
- * - * @author Victor Häggqvist - * @since 12/29/14 - * @version 1.0 - */ -public class AboutIt { - - private String copyright = null; - private int year = 0; - private int endYear = 0; - private List libs = new ArrayList<>(); - private Activity activity; - private String appName = null; - private boolean debug; - private int versionCode; - private String versionName; - private String releaseName = null; - private String description = null; - - /** - * Create a page generator - * @param activity The about page activity - */ - public AboutIt(Activity activity) { - - this.activity = activity; - } - - /** - * Generate text and put in @ref{about_text} - * @param about_text Resource it of destination TextView - */ - @SuppressWarnings("StringConcatenationInsideStringBufferAppend") - public void toTextView(@IdRes int about_text) { - TextView out = (TextView) activity.findViewById(about_text); - out.setAutoLinkMask(Linkify.WEB_URLS); - - endYear = endYear(); - - StringBuilder sb = new StringBuilder(); - if (appName != null) - sb.append(appName+" v"+getVersionString()+"\n"); - - if (copyright != null) { - sb.append("Copyright (c) "); - if (year != 0) - sb.append(year + (endYear != 0 ? " - " + endYear : "") + " "); - sb.append(copyright + "\n\n"); - } - - if (description != null) - sb.append(description+"\n\n"); - - // Sort library list alphabetically by name - Collections.sort(libs, new Comparator() { - @Override - public int compare(Lib lhs, Lib rhs) { - return lhs.name.compareTo(rhs.name); - } - }); - - for(Lib l:libs){ - sb.append(l.byLine() + "\n"); - } - - out.setText(sb.toString()); - } - - /** - * Get a baked version string. - * Version string is build from build info and release name - * It will look something like '1.42 (42-debug)' - * @return baked version string - */ - public String getVersionString() { - releaseName = "-"+(releaseName != null?releaseName:(debug?"debug":"")); - return versionName+" ("+versionCode+releaseName+")"; - } - - /** - * Determine what end year to show - * @return year to show - */ - private int endYear() { - if (endYear != 0) { - return endYear; - } else { - Calendar now = Calendar.getInstance(); - int yearNow = now.get(Calendar.YEAR); - if (year == yearNow) - return 0; - else - return yearNow; - } - } - - /** - * Get String by id - * @param stringId String id - * @return String - */ - private String s(@StringRes int stringId) { - return activity.getString(stringId); - } - - /** - * Copyright name - * @param copyright Name - */ - public AboutIt copyright(String copyright){ - this.copyright = copyright; - return this; - } - - /** - * Start copyright year. - * If there is no start year no year will be displayed at all. - * @param year Year - */ - public AboutIt year(int year) { - this.year = year; - return this; - } - - /** - * Add a library to the list - * @param name Name of Library - * @param author Author of library - * @param license Library license, defined by L - * @param url Url to or otherwise reference to library - * @see L - */ - public AboutIt libLicense(String name, String author, L license, String url) { - libs.add(new Lib(name, author, license, url)); - return this; - } - - /** - * Add a library to the list - * @param library A library build with LibBuilder - */ - public AboutIt libLicense(Lib library) { - libs.add(library); - return this; - } - - /** - * App name to display - * @param stringResource A string resource id - */ - public AboutIt app(@StringRes int stringResource) { - this.appName = s(stringResource); - return this; - } - - /** - * App name to display - * @see #app(int) - */ - public AboutIt app(String appName) { - this.appName = appName; - return this; - } - - /** - * Set a custom release name. Override the default name eg. beta - * @param releaseName The release name - */ - public AboutIt release(String releaseName){ - this.releaseName = releaseName; - return this; - } - - /** - * App build info. To be used in conjunction with the BuildConfig class - * {@code .buildInfo(BuildConfig.DEBUG, BuildConfig.VERSION_CODE, BuildConfig.VERSION_NAME)} - * - * @param debug If is debug build - * @param versionCode Version code - * @param versionName Version name - */ - public AboutIt buildInfo(boolean debug, int versionCode, String versionName) { - this.debug = debug; - this.versionCode = versionCode; - this.versionName = versionName; - return this; - } - - /** - * A longer description - * @param stringResource A string resource id - */ - public AboutIt description(@StringRes int stringResource) { - description = s(stringResource); - return this; - } - - /** - * A longer description - * @param description The description - * @see #description(int) - */ - public AboutIt description(String description) { - this.description = description; - return this; - } - - /** - * Holder for libraries - */ - static class Lib { - - final String name; - final String author; - final LicenseBase license; - final String url; - - public Lib(String name, String author, LicenseBase license, String url) { - - this.name = name; - this.author = author; - this.license = license; - this.url = url; - } - - String byLine() { - return name + " by " + author + " under " + license.display() + ", " + url; - } - } -} diff --git a/aboutit/src/main/java/com/snilius/aboutit/CustomLicense.java b/aboutit/src/main/java/com/snilius/aboutit/CustomLicense.java deleted file mode 100644 index 82df0cd..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/CustomLicense.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.snilius.aboutit; - -/** - * Custom license holder - * @author Victor Häggqvist - * @since 9/17/15 - */ -public class CustomLicense implements LicenseBase { - - private String displayName; - - public CustomLicense(String displayName) { - - this.displayName = displayName; - } - - @Override - public String display() { - return displayName; - } -} diff --git a/aboutit/src/main/java/com/snilius/aboutit/L.java b/aboutit/src/main/java/com/snilius/aboutit/L.java deleted file mode 100644 index 2181464..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/L.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.snilius.aboutit; - -/** - * License Definitions - * @author Victor Häggqvist - * @since 12/29/14 - */ -public enum L implements LicenseBase { - AP2("Apache License, Version 2.0"), MIT("MIT"), - GPL2("GPL v2.0"), GPL3("GPL v3.0"), AGPL3("Affero GPL v3.0"), - BSD("BSD"), SBSD("Simplified BSD"), NBSD("New BSD"); - - private String mDisplayname; - - L(String displayname) { - mDisplayname = displayname; - } - - /** - * {@inheritDoc} - */ - public String display() { - return mDisplayname; - } - -} diff --git a/aboutit/src/main/java/com/snilius/aboutit/LibBuilder.java b/aboutit/src/main/java/com/snilius/aboutit/LibBuilder.java deleted file mode 100644 index df5c653..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/LibBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.snilius.aboutit; - -/** - * Library builder - * @author Victor Häggqvist - * @since 9/17/15 - */ -public class LibBuilder { - - private String name; - private String author; - private LicenseBase license; - private String url; - - public LibBuilder() { - name = ""; - author = ""; - license= null; - url = ""; - } - - public LibBuilder name(String name) { - - this.name = name; - return this; - } - - public LibBuilder author(String author) { - - this.author = author; - return this; - } - - public LibBuilder license(LicenseBase license) { - - this.license = license; - return this; - } - - public LibBuilder url(String url) { - this.url = url; - return this; - } - - public AboutIt.Lib build() { - return new AboutIt.Lib(name, author, license,url); - } - -} diff --git a/aboutit/src/main/java/com/snilius/aboutit/LibSkeleton.java b/aboutit/src/main/java/com/snilius/aboutit/LibSkeleton.java deleted file mode 100644 index 244f3a0..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/LibSkeleton.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.snilius.aboutit; - -/** - * Library skeleton for creation of presets - * @author Victor Häggqvist - * @since 9/17/15 - */ -public class LibSkeleton extends AboutIt.Lib { - public LibSkeleton(String name, String author, LicenseBase license, String url) { - super(name, author, license, url); - } -} diff --git a/aboutit/src/main/java/com/snilius/aboutit/LicenseBase.java b/aboutit/src/main/java/com/snilius/aboutit/LicenseBase.java deleted file mode 100644 index 0398556..0000000 --- a/aboutit/src/main/java/com/snilius/aboutit/LicenseBase.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.snilius.aboutit; - -/** - * License base - * @author Victor Häggqvist - * @since 9/17/15 - */ -public interface LicenseBase { - - /** - * Get display name for license - * @return display name - */ - String display(); -} diff --git a/aboutit/src/main/res/values/strings.xml b/aboutit/src/main/res/values/strings.xml deleted file mode 100644 index 9b430f7..0000000 --- a/aboutit/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AboutIt - -- cgit v1.2.3