add Licences

This commit is contained in:
tibbi 2016-06-02 20:12:52 +02:00
parent caae3a0426
commit 99e7655e27
6 changed files with 113 additions and 5 deletions

View File

@ -26,6 +26,11 @@
android:label="@string/about" android:label="@string/about"
android:screenOrientation="portrait"/> android:screenOrientation="portrait"/>
<activity
android:name=".LicenseActivity"
android:label="@string/third_party_licences"
android:screenOrientation="portrait"/>
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="android.support.v4.content.FileProvider"
android:authorities="com.simplemobiletools.draw.fileprovider" android:authorities="com.simplemobiletools.draw.fileprovider"

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.draw; package com.simplemobiletools.draw;
import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
@ -11,6 +12,7 @@ import java.util.Calendar;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick;
public class AboutActivity extends AppCompatActivity { public class AboutActivity extends AppCompatActivity {
@BindView(R.id.about_copyright) TextView copyright; @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); final String copyrightText = String.format(res.getString(R.string.copyright), year);
copyright.setText(copyrightText); copyright.setText(copyrightText);
} }
@OnClick(R.id.about_license)
public void licenseClicked() {
final Intent intent = new Intent(getApplicationContext(), LicenseActivity.class);
startActivity(intent);
}
} }

View File

@ -0,0 +1,33 @@
package com.simplemobiletools.draw;
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);
}
}

View File

@ -33,8 +33,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/about_email" android:layout_below="@+id/about_email"
android:layout_marginTop="@dimen/activity_margin" android:paddingBottom="@dimen/activity_margin"
android:text="@string/license"/> android:paddingTop="@dimen/activity_margin"
android:text="@string/third_party_licences_underlined"
android:textColor="@color/colorPrimary"/>
<TextView <TextView
android:id="@+id/about_version" android:id="@+id/about_version"

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/license_holder"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/activity_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/notice"/>
<TextView
android:id="@+id/license_butterknife_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:text="@string/butterknife_title"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/license_butterknife_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/butterknife_text"/>
<TextView
android:id="@+id/license_ambilwarna_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:text="@string/ambilwarna_title"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/license_ambilwarna_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ambilwarna_text"/>
</LinearLayout>
</ScrollView>

View File

@ -12,10 +12,21 @@
<!-- About --> <!-- About -->
<string name="about">About</string> <string name="about">About</string>
<string name="website">For more simple apps please visit:\nhttp://simplemobiletools.com</string> <string name="website">For more simple apps or source codes please visit:\nhttp://simplemobiletools.com</string>
<string name="email_label">You can send your feedback and new app suggestions at:</string> <string name="email_label">You can send your feedback or new app suggestions at:</string>
<string name="email">hello@simplemobiletools.com</string> <string name="email">hello@simplemobiletools.com</string>
<string name="license">License</string> <string name="third_party_licences_underlined"><u>Third party licences</u></string>
<string name="version">v %1$s</string> <string name="version">v %1$s</string>
<string name="copyright">Copyright © Simple Mobile Tools %1$d</string> <string name="copyright">Copyright © Simple Mobile Tools %1$d</string>
<!--License-->
<string name="notice">This app uses the following third party libraries to make my life easier. Thank you.</string>
<string name="third_party_licences">Third party licences</string>
<string name="butterknife_title"><u>Butter Knife (view injector)</u></string>
<string name="butterknife_text">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.</string>
<string name="butterknife_url">https://github.com/JakeWharton/butterknife</string>
<string name="ambilwarna_title"><u>AmbilWarna (color picker)</u></string>
<string name="ambilwarna_text">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.</string>
<string name="ambilwarna_url">https://github.com/yukuku/ambilwarna</string>
</resources> </resources>