diff --git a/CHANGELOG.md b/CHANGELOG.md
index d4fa48da..97026597 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+### v1.0.4
+- Updated: README
+
### v1.0.3
- Update opoc
- Better visibility for counter badge
diff --git a/README.md b/README.md
index efa50121..c81fbf2a 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,84 @@
-[![F-Droid](https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png)](https://f-droid.org/repository/browse/?fdid=com.github.dfa.diaspora_android)
-
-[![CircleCI](https://circleci.com/gh/Diaspora-for-Android/dandelion.svg?style=shield)](https://circleci.com/gh/Diaspora-for-Android/dandelion)
+[![GitHub release](https://img.shields.io/github/tag/diaspora-for-android/dandelion.svg)](https://github.com/diaspora-for-android/dandelion/releases)
+[![Donate](https://img.shields.io/badge/donate-bitcoin-orange.svg)](https://gsantner.github.io/#donate)
+[![CircleCI](https://circleci.com/gh/Diaspora-for-Android/dandelion.svg?style=shield)](https://circleci.com/gh/Diaspora-for-Android/dandelion)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/diaspora-for-android/localized.svg)](https://crowdin.com/project/diaspora-for-android)
[![Chat - Matrix](https://img.shields.io/badge/chat-on%20matrix-blue.svg)](https://matrix.to/#/#dandelion:matrix.org) [![Chat - FreeNode IRC](https://img.shields.io/badge/chat-on%20irc-blue.svg)](https://kiwiirc.com/client/irc.freenode.net/?nick=dandelion-anon|?##dandelion)
-
-
# dandelion\*
+
+This is an unofficial webview based client for the community-run, distributed social network diaspora*.
-This is an unofficial webview based client for the community-run, distributed social network **[diaspora*](https://diasporafoundation.org/)**. It's currently under development and should be used with that in mind. Please submit any bugs you might find.
+
-- Download latest release on ([F-Droid](https://f-droid.org/repository/browse/?fdid=com.github.dfa.diaspora_android))
-- Download latest nightly - [secondlion\*](https://gsantner.gitlab.io/fdroid/latest/com.github.dfa.secondlion.apk)
-- Watch [Changelog](https://github.com/Diaspora-for-Android/dandelion/blob/master/CHANGELOG.md)
-- See [Screenshots](https://github.com/Diaspora-for-Android/dandelion/blob/master/SCREENSHOTS.md)
-- Get updates from our diaspora\* account: [dandelion00@diasp.org](https://diasp.org/people/48b78420923501341ef3782bcb452bd5)
-## Contributions
-We are always open for any kind of contribution. (PR's, bug reports, feature requests, translations, ..)
-If you got any questions feel free to contact us on IRC, XMPP or Gitter. You can start chatting by clicking on the [blue chat badges](#badgers) listed on top.
+## Description
+This is an unofficial webview based client for the community-run, distributed social network diaspora*.
+It's currently under development and should be used with that in mind. Please submit any bugs you might find.
-We use Crowdin to translate dandelion\*. Join our project here: . If your desired language is not listed please contact the maintainers/owner.
-
-Note that the main project members are working on this project for free during leisure time, are mostly busy with their job/university/school, and may not react or start coding immediately.
-
-### License
-dandelion\* is released under GNU GENERAL PUBLIC LICENSE (see [LICENCE](https://github.com/Diaspora-for-Android/dandelion/blob/master/LICENSE.md)).
-The translations (strings.xml) are licensed CC0 1.0.
-
-### WebApp
+#### WebApp
The app is developed as a WebApp because currently diaspora\* doesn't have an functional API that can be used to create a native interface to retrieve the user's data, publications, direct messages and so on. That's why there are currently only WebApps for diaspora\* out there.
[Stay tuned on diaspora\* issues](https://github.com/diaspora/diaspora/labels/api) about API.
Why is a WebApp better than using the mobile site on a browser?
Basically it provides better integration with the system (events coming into and going out of the app), notifications, customized interface and functions and a nice little icon that takes you directly to your favorite social network :)
-### Device Requirements
+#### Device Requirements
The minimum Android version supported is Jelly Bean, Android v4.2.0 / API 17
-### App Permissions
+### Privacy & Permissions
dandelion\* requires access to the Internet and to external storage to be able to upload photos when creating a new post and for taking screenshots.
-## Maintainers
+
+## Contributions
+The project is always open for contributions and accepts pull requests.
+The project uses [AOSP Java Code Style](https://source.android.com/source/code-style#follow-field-naming-conventions), with one exception: private members are `_camelCase` instead of `mBigCamel`. You may use Android Studios _auto reformat feature_ before sending a PR.
+
+We use Crowdin to translate dandelion\*. Join our project here: . If your desired language is not listed please contact the maintainers/owner.
+
+Join our IRC or Matrix channel (bridged) and say hello! Don't be afraid to start talking. [![Chat - Matrix](https://img.shields.io/badge/chat-on%20matrix-blue.svg)](https://matrix.to/#/#dandelion:matrix.org) [![Chat - FreeNode IRC](https://img.shields.io/badge/chat-on%20irc-blue.svg)](https://kiwiirc.com/client/irc.freenode.net/?nick=dandelion-anon|?##dandelion)
+
+Note that the main project members are working on this project for free during leisure time, are mostly busy with their job/university/school, and may not react or start coding immediately.
+
+
+#### Resources
+* Project: [Changelog](/CHANGELOG.md) | [Issues level/beginner](https://github.com/diaspora-for-android/dandelion/issues?q=is%3Aissue+is%3Aopen+label%3Alevel%2Fbeginner) | [License](/LICENSE.txt) | [CoC](/CODE_OF_CONDUCT.md)
+* Project diaspora\* account: [dandelion00@diasp.org](https://diasp.org/people/48b78420923501341ef3782bcb452bd5)
+* diaspora\*: [GitHub](https://github.com/diaspora/diaspora) | [Web](https://diasporafoundation.org) | [d\* HQ account](https://pod.diaspora.software/people/7bca7c80311b01332d046c626dd55703)
+* App on F-Droid: [Metadata](https://gitlab.com/fdroid/fdroiddata/blob/master/metadata/com.github.dfa.diaspora_android.txt) | [Page](https://f-droid.org/packages/com.github.dfa.diaspora_android/) | [Wiki](https://f-droid.org/wiki/page/com.github.dfa.diaspora_android) | [Build log](https://f-droid.org/wiki/page/com.github.dfa.diaspora_android/lastbuild)
+
+
+## Licensing
+dandelion\* is released under GNU GENERAL PUBLIC LICENSE (see [LICENCE](https://github.com/Diaspora-for-Android/dandelion/blob/master/LICENSE.md)).
+The app is licensed GPL v3. Localization files and resources (strings\*.xml) are licensed CC0 1.0.
+For more licensing informations, see [`3rd party licenses`](/app/src/main/res/raw/licenses_3rd_party.md).
+
+
+
+### Notice
+#### Maintainers
- gsantner ([GitHub](https://github.com/gsantner), [Web](https://gsantner.github.io), [diaspora*](https://pod.geraspora.de/people/d1cbdd70095301341e834860008dbc6c))
- Bitcoin: [1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5](https://gsantner.github.io/donate/#donate)
- vanitasvitae ([GitHub](https://github.com/vanitasvitae), [diaspora*](https://pod.geraspora.de/people/bbd7af90fbec013213e34860008dbc6c))
diff --git a/app/src/main/java/io/github/gsantner/opoc/util/AppSettingsBase.java b/app/src/main/java/io/github/gsantner/opoc/util/AppSettingsBase.java
index 48de2967..53cfc2b1 100644
--- a/app/src/main/java/io/github/gsantner/opoc/util/AppSettingsBase.java
+++ b/app/src/main/java/io/github/gsantner/opoc/util/AppSettingsBase.java
@@ -1,9 +1,9 @@
/*
- * ---------------------------------------------------------------------------- *
- * Gregor Santner wrote this file. You can do whatever
- * you want with this stuff. If we meet some day, and you think this stuff is
- * worth it, you can buy me a coke in return. Provided as is without any kind
- * of warranty. No attribution required. - Gregor Santner
+ * ------------------------------------------------------------------------------
+ * Gregor Santner wrote this. You can do whatever you want
+ * with it. If we meet some day, and you think it is worth it, you can buy me a
+ * coke in return. Provided as is without any kind of warranty. Do not blame or
+ * sue me if something goes wrong. No attribution required. - Gregor Santner
*
* License: Creative Commons Zero (CC0 1.0)
* http://creativecommons.org/publicdomain/zero/1.0/
diff --git a/app/src/main/java/io/github/gsantner/opoc/util/Helpers.java b/app/src/main/java/io/github/gsantner/opoc/util/Helpers.java
index adf4b046..f9f2d452 100644
--- a/app/src/main/java/io/github/gsantner/opoc/util/Helpers.java
+++ b/app/src/main/java/io/github/gsantner/opoc/util/Helpers.java
@@ -1,11 +1,11 @@
/*
- * ---------------------------------------------------------------------------- *
- * Gregor Santner wrote this file. You can do whatever
- * you want with this stuff. If we meet some day, and you think this stuff is
- * worth it, you can buy me a coke in return. Provided as is without any kind
- * of warranty. No attribution required. - Gregor Santner
+ * ------------------------------------------------------------------------------
+ * Gregor Santner wrote this. You can do whatever you want
+ * with it. If we meet some day, and you think it is worth it, you can buy me a
+ * coke in return. Provided as is without any kind of warranty. Do not blame or
+ * sue me if something goes wrong. No attribution required. - Gregor Santner
*
- * License of this file: Creative Commons Zero (CC0 1.0)
+ * License: Creative Commons Zero (CC0 1.0)
* http://creativecommons.org/publicdomain/zero/1.0/
* ----------------------------------------------------------------------------
*/
@@ -21,6 +21,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
@@ -45,10 +46,9 @@ import android.widget.TextView;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.lang.reflect.Field;
import java.util.Locale;
-@SuppressWarnings({"WeakerAccess", "unused", "SameParameterValue", "SpellCheckingInspection"})
+@SuppressWarnings({"WeakerAccess", "unused", "SameParameterValue", "SpellCheckingInspection", "deprecation"})
public class Helpers {
//########################
//## Members, Constructors
@@ -126,26 +126,19 @@ public class Helpers {
}
/**
- * https://stackoverflow.com/a/25267049
- * Gets a field from the project's BuildConfig. This is useful when, for example, flavors
- * are used at the project level to set custom fields.
- *
- * @param fieldName The name of the field-to-access
- * @return The value of the field, or {@code null} if the field is not found.
+ * Get field from PackageId.BuildConfig
+ * May be helpful in libraries, where a access to
+ * BuildConfig would only get values of the library
+ * rather than the app ones
*/
public Object getBuildConfigValue(String fieldName) {
try {
- Class> clazz = Class.forName(_context.getPackageName() + ".BuildConfig");
- Field field = clazz.getField(fieldName);
- return field.get(null);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
+ Class> c = Class.forName(_context.getPackageName() + ".BuildConfig");
+ return c.getField(fieldName).get(null);
+ } catch (Exception e) {
e.printStackTrace();
+ return null;
}
- return null;
}
public boolean getBuildConfigBoolean(String fieldName, boolean defaultValue) {
@@ -220,6 +213,7 @@ public class Helpers {
}
@SuppressLint("RestrictedApi")
+ @SuppressWarnings("RestrictedApi")
public void setTintColorOfButton(AppCompatButton button, @ColorRes int resColor) {
button.setSupportBackgroundTintList(ColorStateList.valueOf(
color(resColor)
@@ -288,14 +282,15 @@ public class Helpers {
? new Locale(code.substring(0, 2), code.substring(4, 6)) // de-rAt
: new Locale(code); // de
}
- return Locale.getDefault();
+ return Resources.getSystem().getConfiguration().locale;
}
- // "en"/"de"/"de-rAt"; Empty string = default locale
+ // en/de/de-rAt ; Empty string -> default locale
public void setAppLanguage(String androidLocaleString) {
Locale locale = getLocaleByAndroidCode(androidLocaleString);
Configuration config = _context.getResources().getConfiguration();
- config.locale = locale != null ? locale : Locale.getDefault();
+ config.locale = (locale != null && !androidLocaleString.isEmpty())
+ ? locale : Resources.getSystem().getConfiguration().locale;
_context.getResources().updateConfiguration(config, null);
}
@@ -306,6 +301,7 @@ public class Helpers {
+ (0.114 * Color.blue(colorOnBottomInt)))));
}
+
public float px2dp(final float px) {
return px / _context.getResources().getDisplayMetrics().density;
}
diff --git a/app/src/main/java/io/github/gsantner/opoc/util/HelpersA.java b/app/src/main/java/io/github/gsantner/opoc/util/HelpersA.java
index dbf530bb..95ac1ca6 100644
--- a/app/src/main/java/io/github/gsantner/opoc/util/HelpersA.java
+++ b/app/src/main/java/io/github/gsantner/opoc/util/HelpersA.java
@@ -1,11 +1,11 @@
/*
- * ---------------------------------------------------------------------------- *
- * Gregor Santner wrote this file. You can do whatever
- * you want with this stuff. If we meet some day, and you think this stuff is
- * worth it, you can buy me a coke in return. Provided as is without any kind
- * of warranty. No attribution required. - Gregor Santner
+ * ------------------------------------------------------------------------------
+ * Gregor Santner wrote this. You can do whatever you want
+ * with it. If we meet some day, and you think it is worth it, you can buy me a
+ * coke in return. Provided as is without any kind of warranty. Do not blame or
+ * sue me if something goes wrong. No attribution required. - Gregor Santner
*
- * License of this file: Creative Commons Zero (CC0 1.0)
+ * License: Creative Commons Zero (CC0 1.0)
* http://creativecommons.org/publicdomain/zero/1.0/
* ----------------------------------------------------------------------------
*/
@@ -44,9 +44,9 @@ public class HelpersA extends Helpers {
/**
* Animate to specified Activity
*
- * @param to The class of the _activity
- * @param finishFromActivity true: Finish the current _activity
- * @param requestCode Request code for stating the _activity, not waiting for result if null
+ * @param to The class of the activity
+ * @param finishFromActivity true: Finish the current activity
+ * @param requestCode Request code for stating the activity, not waiting for result if null
*/
public void animateToActivity(Class to, Boolean finishFromActivity, Integer requestCode) {
animateToActivity(new Intent(_activity, to), finishFromActivity, requestCode);
@@ -56,9 +56,9 @@ public class HelpersA extends Helpers {
* Animate to Activity specified in intent
* Requires animation resources
*
- * @param intent Intent to open start an _activity
- * @param finishFromActivity true: Finish the current _activity
- * @param requestCode Request code for stating the _activity, not waiting for result if null
+ * @param intent Intent to open start an activity
+ * @param finishFromActivity true: Finish the current activity
+ * @param requestCode Request code for stating the activity, not waiting for result if null
*/
public void animateToActivity(Intent intent, Boolean finishFromActivity, Integer requestCode) {
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
diff --git a/app/src/main/java/io/github/gsantner/opoc/util/SimpleMarkdownParser.java b/app/src/main/java/io/github/gsantner/opoc/util/SimpleMarkdownParser.java
index b96f3c0f..0895f98d 100644
--- a/app/src/main/java/io/github/gsantner/opoc/util/SimpleMarkdownParser.java
+++ b/app/src/main/java/io/github/gsantner/opoc/util/SimpleMarkdownParser.java
@@ -1,11 +1,11 @@
/*
- * ---------------------------------------------------------------------------- *
- * Gregor Santner wrote this file. You can do whatever
- * you want with this stuff. If we meet some day, and you think this stuff is
- * worth it, you can buy me a coke in return. Provided as is without any kind
- * of warranty. No attribution required. - Gregor Santner
+ * ------------------------------------------------------------------------------
+ * Gregor Santner wrote this. You can do whatever you want
+ * with it. If we meet some day, and you think it is worth it, you can buy me a
+ * coke in return. Provided as is without any kind of warranty. Do not blame or
+ * sue me if something goes wrong. No attribution required. - Gregor Santner
*
- * License of this file: Creative Commons Zero (CC0 1.0)
+ * License: Creative Commons Zero (CC0 1.0)
* http://creativecommons.org/publicdomain/zero/1.0/
* ----------------------------------------------------------------------------
*/
@@ -50,7 +50,7 @@ public class SimpleMarkdownParser {
public final static SmpFilter FILTER_ANDROID_TEXTVIEW = new SmpFilter() {
@Override
public String filter(String text) {
- // TextView supports a limited set of _html tags, most notably
+ // TextView supports a limited set of html tags, most notably
// a href, b, big, font size&color, i, li, small, u
// Don't start new line if 2 empty lines and heading
@@ -111,6 +111,22 @@ public class SimpleMarkdownParser {
}
};
+ public final static SmpFilter FILTER_CHANGELOG = new SmpFilter() {
+ @Override
+ public String filter(String text) {
+ text = text
+ .replace("New:", "New:")
+ .replace("Added:", "Added:")
+ .replace("Fixed:", "Fixed:")
+ .replace("Removed:", "Removed:")
+ .replace("Updated:", "Updated:")
+ .replace("Improved:", "Improved:")
+ .replace("Modified:", "Modified:")
+ ;
+ return text;
+ }
+ };
+
//########################
//## Singleton
//########################