allow rotating the device

This commit is contained in:
tibbi 2016-07-11 20:51:58 +02:00
parent 6b2fceb820
commit 6061acd911
5 changed files with 189 additions and 193 deletions

View file

@ -15,8 +15,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".activities.MainActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@ -35,18 +34,15 @@
<activity
android:name=".activities.AboutActivity"
android:label="@string/about"
android:screenOrientation="portrait"/>
android:label="@string/about"/>
<activity
android:name=".activities.LicenseActivity"
android:label="@string/third_party_licences"
android:screenOrientation="portrait"/>
android:label="@string/third_party_licences"/>
<activity
android:name=".activities.SettingsActivity"
android:label="@string/settings"
android:screenOrientation="portrait"/>
android:label="@string/settings"/>
<service
android:name=".MusicService"

View file

@ -25,7 +25,6 @@ import butterknife.OnClick;
public class AboutActivity extends AppCompatActivity {
@BindView(R.id.about_copyright) TextView mCopyright;
@BindView(R.id.about_version) TextView mVersion;
@BindView(R.id.about_email) TextView mEmailTV;
@BindView(R.id.about_rate_us) View mRateUs;
@ -39,7 +38,6 @@ public class AboutActivity extends AppCompatActivity {
mRes = getResources();
setupEmail();
setupVersion();
setupCopyright();
setupRateUs();
}
@ -70,15 +68,10 @@ public class AboutActivity extends AppCompatActivity {
mEmailTV.setMovementMethod(LinkMovementMethod.getInstance());
}
private void setupVersion() {
final String versionName = BuildConfig.VERSION_NAME;
final String versionText = String.format(mRes.getString(R.string.version), versionName);
mVersion.setText(versionText);
}
private void setupCopyright() {
final String versionName = BuildConfig.VERSION_NAME;
final int year = Calendar.getInstance().get(Calendar.YEAR);
final String copyrightText = String.format(mRes.getString(R.string.copyright), year);
final String copyrightText = String.format(mRes.getString(R.string.copyright), versionName, year);
mCopyright.setText(copyrightText);
}

View file

@ -1,93 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/about_holder"
<ScrollView
android:id="@+id/about_scrollview"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_margin">
android:fillViewport="true">
<TextView
android:id="@+id/about_website"
<RelativeLayout
android:id="@+id/about_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/website"/>
<TextView
android:id="@+id/about_email_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_website"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/email_label"/>
<TextView
android:id="@+id/about_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_email_label"
android:text="@string/email"/>
<TextView
android:id="@+id/about_rate_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_email"
android:layout_marginTop="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/rate_us_underlined"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/about_license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_rate_us"
android:layout_marginTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/third_party_licences_underlined"
android:textColor="@color/colorPrimary"/>
android:paddingLeft="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
<TextView
android:id="@+id/about_follow_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_license"
android:paddingBottom="@dimen/social_padding"
android:paddingTop="@dimen/activity_margin"
android:text="@string/follow_us"/>
<TextView
android:id="@+id/about_website"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/website"/>
<ImageView
android:id="@+id/about_facebook"
android:layout_width="@dimen/social_logo"
android:layout_height="@dimen/social_logo"
android:layout_below="@+id/about_follow_us"
android:src="@mipmap/facebook"/>
<TextView
android:id="@+id/about_email_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_website"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/email_label"/>
<ImageView
android:id="@+id/about_gplus"
android:layout_width="@dimen/social_logo"
android:layout_height="@dimen/social_logo"
android:layout_below="@+id/about_follow_us"
android:layout_marginLeft="@dimen/social_padding"
android:layout_toRightOf="@+id/about_facebook"
android:src="@mipmap/gplus"/>
<TextView
android:id="@+id/about_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_email_label"
android:text="@string/email"/>
<TextView
android:id="@+id/about_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/about_copyright"
android:gravity="center_horizontal"
android:text="v 1.0"/>
<TextView
android:id="@+id/about_rate_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_email"
android:layout_marginTop="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/rate_us_underlined"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/about_copyright"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:text="Copyright © Simple Mobile Tools 2016"/>
<TextView
android:id="@+id/about_license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_rate_us"
android:layout_marginTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/third_party_licences_underlined"
android:textColor="@color/colorPrimary"/>
</RelativeLayout>
<TextView
android:id="@+id/about_follow_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_license"
android:paddingBottom="@dimen/social_padding"
android:paddingTop="@dimen/activity_margin"
android:text="@string/follow_us"/>
<ImageView
android:id="@+id/about_facebook"
android:layout_width="@dimen/social_logo"
android:layout_height="@dimen/social_logo"
android:layout_below="@+id/about_follow_us"
android:src="@mipmap/facebook"/>
<ImageView
android:id="@+id/about_gplus"
android:layout_width="@dimen/social_logo"
android:layout_height="@dimen/social_logo"
android:layout_below="@+id/about_follow_us"
android:layout_marginLeft="@dimen/social_padding"
android:layout_toRightOf="@+id/about_facebook"
android:src="@mipmap/gplus"/>
<TextView
android:id="@+id/about_copyright"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_below="@+id/about_gplus"
android:gravity="center_horizontal|bottom"
android:paddingTop="@dimen/activity_margin"
android:text="v1.0\nCopyright © Simple Mobile Tools 2016"/>
</RelativeLayout>
</ScrollView>

View file

@ -1,113 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/settings_holder"
<ScrollView
android:id="@+id/settings_scrollview"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/settings_shuffle_holder"
<LinearLayout
android:id="@+id/settings_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_padding"
android:background="?android:attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/settings_shuffle_label"
android:layout_width="wrap_content"
<RelativeLayout
android:id="@+id/settings_shuffle_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/shuffle"/>
android:layout_marginTop="@dimen/settings_padding"
android:background="?android:attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<android.support.v7.widget.SwitchCompat
android:id="@+id/settings_shuffle"
android:layout_width="wrap_content"
<TextView
android:id="@+id/settings_shuffle_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/shuffle"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/settings_shuffle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@null"
android:clickable="false"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_numeric_progress_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@null"
android:clickable="false"/>
android:layout_marginTop="@dimen/settings_padding"
android:background="?android:attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
</RelativeLayout>
<TextView
android:id="@+id/settings_numeric_progress_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/numeric_progress"/>
<RelativeLayout
android:id="@+id/settings_numeric_progress_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_padding"
android:background="?android:attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<android.support.v7.widget.SwitchCompat
android:id="@+id/settings_numeric_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@null"
android:clickable="false"/>
<TextView
android:id="@+id/settings_numeric_progress_label"
android:layout_width="wrap_content"
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_sorting_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/numeric_progress"/>
android:layout_marginTop="@dimen/settings_padding"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/settings_padding"
android:paddingTop="@dimen/activity_margin">
<android.support.v7.widget.SwitchCompat
android:id="@+id/settings_numeric_progress"
android:layout_width="wrap_content"
<TextView
android:id="@+id/settings_sorting_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/sort_by"/>
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/settings_sorting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:entries="@array/sorting"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_equalizer_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@null"
android:clickable="false"/>
android:layout_marginTop="@dimen/settings_padding"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/settings_padding"
android:paddingTop="@dimen/activity_margin">
</RelativeLayout>
<TextView
android:id="@+id/settings_equalizer_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/equalizer"/>
<RelativeLayout
android:id="@+id/settings_sorting_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_padding"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/settings_padding"
android:paddingTop="@dimen/activity_margin">
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/settings_equalizer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
<TextView
android:id="@+id/settings_sorting_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/sort_by"/>
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/settings_sorting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:entries="@array/sorting"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_equalizer_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_padding"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/settings_padding"
android:paddingTop="@dimen/activity_margin">
<TextView
android:id="@+id/settings_equalizer_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding"
android:text="@string/equalizer"/>
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/settings_equalizer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>

View file

@ -34,8 +34,7 @@
<string name="third_party_licences_underlined"><u>Third party licences</u></string>
<string name="rate_us_underlined"><u>Rate us in the Play Store</u></string>
<string name="follow_us">Follow us:</string>
<string name="version">v %1$s</string>
<string name="copyright">Copyright © Simple Mobile Tools %1$d</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>
<!--License-->
<string name="notice">This app uses the following third party libraries to make my life easier. Thank you.</string>