Skip to content

Commit e493c51

Browse files
committed
add licences
1 parent be9c365 commit e493c51

File tree

6 files changed

+108
-4
lines changed

6 files changed

+108
-4
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@
3333
android:label="@string/about"
3434
android:screenOrientation="portrait"/>
3535

36+
<activity
37+
android:name=".LicenseActivity"
38+
android:label="@string/license"
39+
android:screenOrientation="portrait"/>
40+
3641
<receiver
3742
android:name=".MyWidgetProvider"
3843
android:icon="@mipmap/ic_launcher"
39-
android:label="Simple Notes">
44+
android:label="@string/app_name">
4045
<intent-filter>
4146
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
4247
</intent-filter>

app/src/main/java/com/simplemobiletools/notes/AboutActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.simplemobiletools.notes;
22

3+
import android.content.Intent;
34
import android.content.res.Resources;
45
import android.os.Bundle;
56
import android.support.v7.app.AppCompatActivity;
@@ -11,6 +12,7 @@
1112

1213
import butterknife.BindView;
1314
import butterknife.ButterKnife;
15+
import butterknife.OnClick;
1416

1517
public class AboutActivity extends AppCompatActivity {
1618
@BindView(R.id.about_copyright) TextView copyright;
@@ -49,4 +51,10 @@ private void setupCopyright() {
4951
final String copyrightText = String.format(res.getString(R.string.copyright), year);
5052
copyright.setText(copyrightText);
5153
}
54+
55+
@OnClick(R.id.about_license)
56+
public void licenseClicked() {
57+
final Intent intent = new Intent(getApplicationContext(), LicenseActivity.class);
58+
startActivity(intent);
59+
}
5260
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.simplemobiletools.notes;
2+
3+
import android.content.Intent;
4+
import android.net.Uri;
5+
import android.os.Bundle;
6+
import android.support.v7.app.AppCompatActivity;
7+
8+
import butterknife.ButterKnife;
9+
import butterknife.OnClick;
10+
11+
public class LicenseActivity extends AppCompatActivity {
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_license);
16+
ButterKnife.bind(this);
17+
}
18+
19+
@OnClick(R.id.license_butterknife_title)
20+
public void butterKnifeClicked() {
21+
openUrl(getResources().getString(R.string.butterknife_url));
22+
}
23+
24+
@OnClick(R.id.license_ambilwarna_title)
25+
public void ambilwarnaClicked() {
26+
openUrl(getResources().getString(R.string.ambilwarna_url));
27+
}
28+
29+
private void openUrl(String url) {
30+
final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
31+
startActivity(browserIntent);
32+
}
33+
}

app/src/main/res/layout/activity_about.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
android:layout_width="match_parent"
3434
android:layout_height="wrap_content"
3535
android:layout_below="@+id/about_email"
36-
android:layout_marginTop="@dimen/activity_margin"
37-
android:text="@string/license"/>
36+
android:paddingBottom="@dimen/activity_margin"
37+
android:paddingTop="@dimen/activity_margin"
38+
android:text="@string/open_source_licences"
39+
android:textColor="@color/colorPrimary"/>
3840

3941
<TextView
4042
android:id="@+id/about_version"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ScrollView
3+
android:id="@+id/license_holder"
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent">
7+
8+
<LinearLayout
9+
android:id="@+id/license"
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:orientation="vertical"
13+
android:paddingBottom="@dimen/activity_margin"
14+
android:paddingLeft="@dimen/activity_margin"
15+
android:paddingRight="@dimen/activity_margin">
16+
17+
<TextView
18+
android:id="@+id/license_butterknife_title"
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:paddingTop="@dimen/activity_margin"
22+
android:text="@string/butterknife_title"
23+
android:textColor="@color/colorPrimary"/>
24+
25+
<TextView
26+
android:id="@+id/license_butterknife_text"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:text="@string/butterknife_text"/>
30+
31+
<TextView
32+
android:id="@+id/license_ambilwarna_title"
33+
android:layout_width="wrap_content"
34+
android:layout_height="wrap_content"
35+
android:paddingTop="@dimen/activity_margin"
36+
android:text="@string/ambilwarna_title"
37+
android:textColor="@color/colorPrimary"/>
38+
39+
<TextView
40+
android:id="@+id/license_ambilwarna_text"
41+
android:layout_width="wrap_content"
42+
android:layout_height="wrap_content"
43+
android:text="@string/ambilwarna_text"/>
44+
45+
</LinearLayout>
46+
</ScrollView>

app/src/main/res/values/strings.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88
<string name="website">For more simple apps please visit:\nhttp://simplemobiletools.com</string>
99
<string name="email_label">You can send your feedback and new app suggestions at:</string>
1010
<string name="email">[email protected]</string>
11-
<string name="license">License</string>
11+
<string name="open_source_licences"><u>Open-source licences</u></string>
1212
<string name="version">v %1$s</string>
1313
<string name="copyright">Copyright © Simple Mobile Tools %1$d</string>
14+
15+
<!--License-->
16+
<string name="license">License</string>
17+
<string name="butterknife_title">Butter Knife (view injector)</string>
18+
<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>
19+
<string name="butterknife_url">https://github.com/JakeWharton/butterknife</string>
20+
<string name="ambilwarna_title">AmbilWarna (color picker)</string>
21+
<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>
22+
<string name="ambilwarna_url">https://github.com/yukuku/ambilwarna</string>
23+
1424
</resources>

0 commit comments

Comments
 (0)