add some licences

This commit is contained in:
tibbi 2016-06-02 19:45:38 +02:00
parent afafa00803
commit 4282a58771
6 changed files with 148 additions and 18 deletions

View File

@ -19,19 +19,6 @@
</intent-filter>
</activity>
<receiver
android:name=".MyWidgetProvider"
android:icon="@mipmap/ic_launcher"
android:label="Simple Calendar">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info"/>
</receiver>
<activity
android:name=".MyWidgetConfigure"
android:screenOrientation="portrait"
@ -45,6 +32,25 @@
android:name=".AboutActivity"
android:label="@string/about"
android:screenOrientation="portrait"/>
<activity
android:name=".LicenseActivity"
android:label="@string/third_party_licences"
android:screenOrientation="portrait"/>
<receiver
android:name=".MyWidgetProvider"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info"/>
</receiver>
</application>
</manifest>

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.calendar;
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);
}
}

View File

@ -0,0 +1,38 @@
package com.simplemobiletools.calendar;
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));
}
@OnClick(R.id.license_joda_title)
public void jodaClicked() {
openUrl(getResources().getString(R.string.joda_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_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"/>
<TextView
android:id="@+id/about_version"

View File

@ -0,0 +1,63 @@
<?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="wrap_content"
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="wrap_content"
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"/>
<TextView
android:id="@+id/license_joda_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:text="@string/joda_title"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/license_joda_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/joda_text"/>
</LinearLayout>
</ScrollView>

View File

@ -3,10 +3,23 @@
<!-- About -->
<string name="about">About</string>
<string name="website">For more simple apps please visit:\nhttp://simplemobiletools.com</string>
<string name="email_label">You can send your feedback and new app suggestions at:</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 or new app suggestions at:</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="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>
<string name="joda_title"><u>Joda-Time (Java date replacement)</u></string>
<string name="joda_text">Copyright 2013 JodaOrg\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="joda_url">https://github.com/JodaOrg/joda-time</string>
</resources>