From e493c51857748750c033400a19276d8b5a248eb6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Jun 2016 17:08:43 +0200 Subject: [PATCH] add licences --- app/src/main/AndroidManifest.xml | 7 ++- .../notes/AboutActivity.java | 8 ++++ .../notes/LicenseActivity.java | 33 +++++++++++++ app/src/main/res/layout/activity_about.xml | 6 ++- app/src/main/res/layout/activity_license.xml | 46 +++++++++++++++++++ app/src/main/res/values/strings.xml | 12 ++++- 6 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/simplemobiletools/notes/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 e57bb246..615a4f62 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -33,10 +33,15 @@ android:label="@string/about" android:screenOrientation="portrait"/> + + + android:label="@string/app_name"> diff --git a/app/src/main/java/com/simplemobiletools/notes/AboutActivity.java b/app/src/main/java/com/simplemobiletools/notes/AboutActivity.java index 4234ae81..aa8940a5 100644 --- a/app/src/main/java/com/simplemobiletools/notes/AboutActivity.java +++ b/app/src/main/java/com/simplemobiletools/notes/AboutActivity.java @@ -1,5 +1,6 @@ package com.simplemobiletools.notes; +import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; @@ -11,6 +12,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; @@ -49,4 +51,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/notes/LicenseActivity.java b/app/src/main/java/com/simplemobiletools/notes/LicenseActivity.java new file mode 100644 index 00000000..7ad64adb --- /dev/null +++ b/app/src/main/java/com/simplemobiletools/notes/LicenseActivity.java @@ -0,0 +1,33 @@ +package com.simplemobiletools.notes; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; + +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(getResources().getString(R.string.butterknife_url)); + } + + @OnClick(R.id.license_ambilwarna_title) + public void ambilwarnaClicked() { + openUrl(getResources().getString(R.string.ambilwarna_url)); + } + + private void openUrl(String url) { + 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 e1949cfe..9539a4a8 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/open_source_licences" + android:textColor="@color/colorPrimary"/> + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d6b6fbe5..f2a9c378 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -8,7 +8,17 @@ For more simple apps please visit:\nhttp://simplemobiletools.com You can send your feedback and new app suggestions at: hello@simplemobiletools.com - License + Open-source licences v %1$s Copyright © Simple Mobile Tools %1$d + + + License + 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 + AmbilWarna (color picker) + Copyright 2009-2015 Yuku\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/yukuku/ambilwarna +