From b8c16e42c1325ba3e5e4583e6316ebdd16afbf0d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Jun 2016 21:52:42 +0200 Subject: [PATCH] add some licences --- app/src/main/AndroidManifest.xml | 5 ++ .../gallery/activities/AboutActivity.java | 8 +++ .../gallery/activities/LicenseActivity.java | 36 +++++++++++ app/src/main/res/layout/activity_about.xml | 6 +- app/src/main/res/layout/activity_license.xml | 63 +++++++++++++++++++ app/src/main/res/values/strings.xml | 20 +++++- 6 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/com/simplemobiletools/gallery/activities/LicenseActivity.java create mode 100644 app/src/main/res/layout/activity_license.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 43311c536..72e98dcff 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -31,5 +31,10 @@ android:name=".activities.AboutActivity" android:label="@string/about" android:screenOrientation="portrait"/> + + diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/AboutActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/AboutActivity.java index 772936d2a..be730d84a 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/AboutActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/AboutActivity.java @@ -1,5 +1,6 @@ package com.simplemobiletools.gallery.activities; +import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; @@ -14,6 +15,7 @@ import java.util.Calendar; import butterknife.BindView; import butterknife.ButterKnife; +import butterknife.OnClick; public class AboutActivity extends AppCompatActivity { @BindView(R.id.about_copyright) TextView copyright; @@ -52,4 +54,10 @@ public class AboutActivity extends AppCompatActivity { final String copyrightText = String.format(res.getString(R.string.copyright), year); copyright.setText(copyrightText); } + + @OnClick(R.id.about_license) + public void licenseClicked() { + final Intent intent = new Intent(getApplicationContext(), LicenseActivity.class); + startActivity(intent); + } } diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/LicenseActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/LicenseActivity.java new file mode 100644 index 000000000..86f3ecd03 --- /dev/null +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/LicenseActivity.java @@ -0,0 +1,36 @@ +package com.simplemobiletools.gallery.activities; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; + +import com.simplemobiletools.gallery.R; + +import butterknife.ButterKnife; +import butterknife.OnClick; + +public class LicenseActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_license); + ButterKnife.bind(this); + } + + @OnClick(R.id.license_butterknife_title) + public void butterKnifeClicked() { + openUrl(R.string.butterknife_url); + } + + @OnClick(R.id.license_subsampling_title) + public void subsamplingClicked() { + openUrl(R.string.subsampling_url); + } + + private void openUrl(int id) { + final String url = getResources().getString(id); + final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + startActivity(browserIntent); + } +} diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index e1949cfe6..1efaa9417 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -33,8 +33,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/about_email" - android:layout_marginTop="@dimen/activity_margin" - android:text="@string/license"/> + android:paddingBottom="@dimen/activity_margin" + android:paddingTop="@dimen/activity_margin" + android:text="@string/third_party_licences_underlined" + android:textColor="@color/colorPrimary"/> + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7d22a2e4e..33f524b3a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,10 +32,24 @@ About - For more simple apps please visit:\nhttp://simplemobiletools.com - You can send your feedback and new app suggestions at: + For more simple apps or source codes please visit:\nhttp://simplemobiletools.com + You can send your feedback or new app suggestions at: hello@simplemobiletools.com - License + Third party licences v %1$s Copyright © Simple Mobile Tools %1$d + + + This app uses the following third party libraries to make my life easier. Thank you. + Third party licences + Butter Knife (view injector) + Copyright 2013 Jake Wharton\n\nLicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions and limitations under the License. + https://github.com/JakeWharton/butterknife + Subsampling Scale Image View (zoomable imageviews) + Copyright 2016 davemorrissey\n\nLicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions and limitations under the License. + https://github.com/davemorrissey/subsampling-scale-image-view + Glide (image loading and caching) + Copyright 2014 Google, Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS\'\' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + https://github.com/bumptech/glide +