Skip to content

Commit be6b1d5

Browse files
committed
allow rotating the device
1 parent b1dd601 commit be6b1d5

File tree

4 files changed

+85
-94
lines changed

4 files changed

+85
-94
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
android:supportsRtl="true"
1111
android:theme="@style/AppTheme">
1212
<activity
13-
android:name=".activities.MainActivity"
14-
android:screenOrientation="portrait">
13+
android:name=".activities.MainActivity">
1514
<intent-filter>
1615
<action android:name="android.intent.action.MAIN"/>
1716

@@ -30,13 +29,11 @@
3029

3130
<activity
3231
android:name=".activities.AboutActivity"
33-
android:label="@string/about"
34-
android:screenOrientation="portrait"/>
32+
android:label="@string/about"/>
3533

3634
<activity
3735
android:name=".activities.LicenseActivity"
38-
android:label="@string/third_party_licences"
39-
android:screenOrientation="portrait"/>
36+
android:label="@string/third_party_licences"/>
4037

4138
<receiver
4239
android:name=".MyWidgetProvider"

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
public class AboutActivity extends AppCompatActivity {
2525
@BindView(R.id.about_copyright) TextView mCopyright;
26-
@BindView(R.id.about_version) TextView mVersion;
2726
@BindView(R.id.about_email) TextView mEmailTV;
2827
@BindView(R.id.about_rate_us) View mRateUs;
2928

@@ -37,7 +36,6 @@ protected void onCreate(Bundle savedInstanceState) {
3736
mRes = getResources();
3837

3938
setupEmail();
40-
setupVersion();
4139
setupCopyright();
4240
setupRateUs();
4341
}
@@ -50,15 +48,10 @@ private void setupEmail() {
5048
mEmailTV.setMovementMethod(LinkMovementMethod.getInstance());
5149
}
5250

53-
private void setupVersion() {
54-
final String versionName = BuildConfig.VERSION_NAME;
55-
final String versionText = String.format(mRes.getString(R.string.version), versionName);
56-
mVersion.setText(versionText);
57-
}
58-
5951
private void setupCopyright() {
52+
final String versionName = BuildConfig.VERSION_NAME;
6053
final int year = Calendar.getInstance().get(Calendar.YEAR);
61-
final String copyrightText = String.format(mRes.getString(R.string.copyright), year);
54+
final String copyrightText = String.format(mRes.getString(R.string.copyright), versionName, year);
6255
mCopyright.setText(copyrightText);
6356
}
6457

Lines changed: 79 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,95 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<RelativeLayout
3-
android:id="@+id/about_holder"
2+
<ScrollView
3+
android:id="@+id/about_scrollview"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:layout_margin="@dimen/activity_margin">
7+
android:fillViewport="true">
88

9-
<TextView
10-
android:id="@+id/about_website"
9+
<RelativeLayout
10+
android:id="@+id/about_holder"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
13-
android:autoLink="web"
14-
android:text="@string/website"/>
13+
android:paddingBottom="@dimen/activity_margin"
14+
android:paddingLeft="@dimen/activity_margin"
15+
android:paddingTop="@dimen/activity_margin">
1516

16-
<TextView
17-
android:id="@+id/about_email_label"
18-
android:layout_width="match_parent"
19-
android:layout_height="wrap_content"
20-
android:layout_below="@+id/about_website"
21-
android:layout_marginTop="@dimen/activity_margin"
22-
android:text="@string/email_label"/>
17+
<TextView
18+
android:id="@+id/about_website"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:autoLink="web"
22+
android:text="@string/website"/>
2323

24-
<TextView
25-
android:id="@+id/about_email"
26-
android:layout_width="match_parent"
27-
android:layout_height="wrap_content"
28-
android:layout_below="@+id/about_email_label"
29-
android:text="@string/email"/>
24+
<TextView
25+
android:id="@+id/about_email_label"
26+
android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
android:layout_below="@+id/about_website"
29+
android:layout_marginTop="@dimen/activity_margin"
30+
android:text="@string/email_label"/>
3031

31-
<TextView
32-
android:id="@+id/about_rate_us"
33-
android:layout_width="match_parent"
34-
android:layout_height="wrap_content"
35-
android:layout_below="@+id/about_email"
36-
android:layout_marginTop="@dimen/activity_margin"
37-
android:paddingTop="@dimen/activity_margin"
38-
android:text="@string/rate_us_underlined"
39-
android:textColor="@color/colorPrimary"/>
32+
<TextView
33+
android:id="@+id/about_email"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
android:layout_below="@+id/about_email_label"
37+
android:text="@string/email"/>
4038

41-
<TextView
42-
android:id="@+id/about_license"
43-
android:layout_width="match_parent"
44-
android:layout_height="wrap_content"
45-
android:layout_below="@+id/about_rate_us"
46-
android:layout_marginTop="@dimen/activity_margin"
47-
android:paddingBottom="@dimen/activity_margin"
48-
android:paddingTop="@dimen/activity_margin"
49-
android:text="@string/third_party_licences_underlined"
50-
android:textColor="@color/colorPrimary"/>
51-
52-
<TextView
53-
android:id="@+id/about_follow_us"
54-
android:layout_width="match_parent"
55-
android:layout_height="wrap_content"
56-
android:layout_below="@+id/about_license"
57-
android:paddingBottom="@dimen/social_padding"
58-
android:paddingTop="@dimen/activity_margin"
59-
android:text="@string/follow_us"/>
39+
<TextView
40+
android:id="@+id/about_rate_us"
41+
android:layout_width="match_parent"
42+
android:layout_height="wrap_content"
43+
android:layout_below="@+id/about_email"
44+
android:layout_marginTop="@dimen/activity_margin"
45+
android:paddingTop="@dimen/activity_margin"
46+
android:text="@string/rate_us_underlined"
47+
android:textColor="@color/colorPrimary"/>
6048

61-
<ImageView
62-
android:id="@+id/about_facebook"
63-
android:layout_width="@dimen/social_logo"
64-
android:layout_height="@dimen/social_logo"
65-
android:layout_below="@+id/about_follow_us"
66-
android:src="@mipmap/facebook"/>
49+
<TextView
50+
android:id="@+id/about_license"
51+
android:layout_width="match_parent"
52+
android:layout_height="wrap_content"
53+
android:layout_below="@+id/about_rate_us"
54+
android:layout_marginTop="@dimen/activity_margin"
55+
android:paddingBottom="@dimen/activity_margin"
56+
android:paddingTop="@dimen/activity_margin"
57+
android:text="@string/third_party_licences_underlined"
58+
android:textColor="@color/colorPrimary"/>
6759

68-
<ImageView
69-
android:id="@+id/about_gplus"
70-
android:layout_width="@dimen/social_logo"
71-
android:layout_height="@dimen/social_logo"
72-
android:layout_below="@+id/about_follow_us"
73-
android:layout_marginLeft="@dimen/social_padding"
74-
android:layout_toRightOf="@+id/about_facebook"
75-
android:src="@mipmap/gplus"/>
60+
<TextView
61+
android:id="@+id/about_follow_us"
62+
android:layout_width="match_parent"
63+
android:layout_height="wrap_content"
64+
android:layout_below="@+id/about_license"
65+
android:paddingBottom="@dimen/social_padding"
66+
android:paddingTop="@dimen/activity_margin"
67+
android:text="@string/follow_us"/>
7668

77-
<TextView
78-
android:id="@+id/about_version"
79-
android:layout_width="match_parent"
80-
android:layout_height="wrap_content"
81-
android:layout_above="@+id/about_copyright"
82-
android:gravity="center_horizontal"
83-
android:text="v 1.0"/>
69+
<ImageView
70+
android:id="@+id/about_facebook"
71+
android:layout_width="@dimen/social_logo"
72+
android:layout_height="@dimen/social_logo"
73+
android:layout_below="@+id/about_follow_us"
74+
android:src="@mipmap/facebook"/>
8475

85-
<TextView
86-
android:id="@+id/about_copyright"
87-
android:layout_width="match_parent"
88-
android:layout_height="wrap_content"
89-
android:layout_alignParentBottom="true"
90-
android:gravity="center_horizontal"
91-
android:text="Copyright © Simple Mobile Tools 2016"/>
76+
<ImageView
77+
android:id="@+id/about_gplus"
78+
android:layout_width="@dimen/social_logo"
79+
android:layout_height="@dimen/social_logo"
80+
android:layout_below="@+id/about_follow_us"
81+
android:layout_marginLeft="@dimen/social_padding"
82+
android:layout_toRightOf="@+id/about_facebook"
83+
android:src="@mipmap/gplus"/>
9284

93-
</RelativeLayout>
85+
<TextView
86+
android:id="@+id/about_copyright"
87+
android:layout_width="match_parent"
88+
android:layout_height="match_parent"
89+
android:layout_alignParentBottom="true"
90+
android:layout_below="@+id/about_gplus"
91+
android:gravity="center_horizontal|bottom"
92+
android:paddingTop="@dimen/activity_margin"
93+
android:text="v1.0\nCopyright © Simple Mobile Tools 2016"/>
94+
</RelativeLayout>
95+
</ScrollView>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
<string name="third_party_licences_underlined"><u>Third party licences</u></string>
1717
<string name="rate_us_underlined"><u>Rate us in the Play Store</u></string>
1818
<string name="follow_us">Follow us:</string>
19-
<string name="version">v %1$s</string>
20-
<string name="copyright">Copyright © Simple Mobile Tools %1$d</string>
19+
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
2120

2221
<!--License-->
2322
<string name="notice">This app uses the following third party libraries to make my life easier. Thank you.</string>

0 commit comments

Comments
 (0)