add licences

This commit is contained in:
tibbi 2016-06-02 17:08:43 +02:00
parent be9c365268
commit e493c51857
6 changed files with 108 additions and 4 deletions

View File

@ -33,10 +33,15 @@
android:label="@string/about"
android:screenOrientation="portrait"/>
<activity
android:name=".LicenseActivity"
android:label="@string/license"
android:screenOrientation="portrait"/>
<receiver
android:name=".MyWidgetProvider"
android:icon="@mipmap/ic_launcher"
android:label="Simple Notes">
android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>

View File

@ -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);
}
}

View File

@ -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);
}
}

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/open_source_licences"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/about_version"

View File

@ -0,0 +1,46 @@
<?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:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin">
<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"/>
</LinearLayout>
</ScrollView>

View File

@ -8,7 +8,17 @@
<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="email">hello@simplemobiletools.com</string>
<string name="license">License</string>
<string name="open_source_licences"><u>Open-source licences</u></string>
<string name="version">v %1$s</string>
<string name="copyright">Copyright © Simple Mobile Tools %1$d</string>
<!--License-->
<string name="license">License</string>
<string name="butterknife_title">Butter Knife (view injector)</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">AmbilWarna (color picker)</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>