From 551d73baeeee7a16f32d1e21611a017747456060 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Sun, 7 May 2017 22:00:29 -0400 Subject: [PATCH] Makes about page work with light theme and landscape orientation. --- .../keylesspalace/tusky/AboutActivity.java | 19 +-- app/src/main/res/layout/activity_about.xml | 126 +++++++++--------- app/src/main/res/values/strings.xml | 12 +- app/src/main/res/values/styles.xml | 43 ++---- 4 files changed, 90 insertions(+), 110 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java index 06c53226c..bc5fd14eb 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java @@ -8,26 +8,21 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; -public class AboutActivity extends AppCompatActivity { - private TextView mVersionTextView; - private TextView mProjectSiteTextView; - private TextView mFeatureSiteTextView; - private Button mTuskyAccountButton; - +public class AboutActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); - mVersionTextView = (TextView) findViewById(R.id.versionTV); - mProjectSiteTextView = (TextView) findViewById(R.id.projectURL_TV); - mFeatureSiteTextView = (TextView) findViewById(R.id.featuresURL_TV); - mTuskyAccountButton = (Button) findViewById(R.id.tusky_profile_button); + + TextView versionTextView = (TextView) findViewById(R.id.versionTV); + Button mTuskyAccountButton = (Button) findViewById(R.id.tusky_profile_button); String versionName = BuildConfig.VERSION_NAME; - - mVersionTextView.setText(getString(R.string.about_application_version) + versionName); + String versionFormat = getString(R.string.about_application_version); + versionTextView.setText(String.format(versionFormat, versionName)); mTuskyAccountButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index d28963d08..2c83347e7 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -4,87 +4,85 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="@dimen/material_drawer_item_padding" tools:context="com.keylesspalace.tusky.AboutActivity"> - + android:layout_height="match_parent" + android:orientation="vertical"> + android:background="?attr/colorPrimary" /> - + + - - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:orientation="vertical" - android:id="@+id/linearLayoutCompat"> + - + - + - +