add some licences

This commit is contained in:
tibbi 2016-06-02 21:52:42 +02:00
parent f863febba1
commit b8c16e42c1
6 changed files with 133 additions and 5 deletions

View file

@ -31,5 +31,10 @@
android:name=".activities.AboutActivity"
android:label="@string/about"
android:screenOrientation="portrait"/>
<activity
android:name=".activities.LicenseActivity"
android:label="@string/third_party_licences"
android:screenOrientation="portrait"/>
</application>
</manifest>

View file

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

View file

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

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="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_subsampling_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:text="@string/subsampling_title"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/license_subsampling_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subsampling_text"/>
<TextView
android:id="@+id/license_glide_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin"
android:text="@string/glide_title"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/license_glide_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/glide_text"/>
</LinearLayout>
</ScrollView>

View file

@ -32,10 +32,24 @@
<!-- 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="subsampling_title"><u>Subsampling Scale Image View (zoomable imageviews)</u></string>
<string name="subsampling_text">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.</string>
<string name="subsampling_url">https://github.com/davemorrissey/subsampling-scale-image-view</string>
<string name="glide_title"><u>Glide (image loading and caching)</u></string>
<string name="glide_text">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.</string>
<string name="glide_url">https://github.com/bumptech/glide</string>
</resources>