diff --git a/app/build.gradle b/app/build.gradle index 58d486e8..62555c02 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,6 +46,7 @@ dependencies { compile 'com.android.support:support-v13:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.android.support:exifinterface:25.3.1' + compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' compile 'com.squareup.retrofit2:retrofit:2.2.0' compile 'com.squareup.retrofit2:converter-gson:2.2.0' compile 'com.squareup.picasso:picasso:2.5.2' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b5724943..fc1c151d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -72,6 +72,7 @@ + diff --git a/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java new file mode 100644 index 00000000..06c53226 --- /dev/null +++ b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java @@ -0,0 +1,44 @@ +package com.keylesspalace.tusky; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +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; + + @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); + + String versionName = BuildConfig.VERSION_NAME; + + mVersionTextView.setText(getString(R.string.about_application_version) + versionName); + mTuskyAccountButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onAccountTVClick(); + } + }); + } + + private void onAccountTVClick() { + Intent intent = new Intent(this, AccountActivity.class); + intent.putExtra("id", "72306"); + startActivity(intent); + } +} diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index a2347ec9..7f183a94 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -299,7 +299,8 @@ public class MainActivity extends BaseActivity implements SFragment.OnUserRemove new PrimaryDrawerItem().withIdentifier(3).withName(getString(R.string.action_view_blocks)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_block), new DividerDrawerItem(), new SecondaryDrawerItem().withIdentifier(4).withName(getString(R.string.action_view_preferences)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_settings), - new SecondaryDrawerItem().withIdentifier(5).withName(getString(R.string.action_logout)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_exit_to_app) + new SecondaryDrawerItem().withIdentifier(5).withName(getString(R.string.about_title_activity)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_info), + new SecondaryDrawerItem().withIdentifier(6).withName(getString(R.string.action_logout)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_exit_to_app) ) .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override @@ -325,8 +326,11 @@ public class MainActivity extends BaseActivity implements SFragment.OnUserRemove Intent intent = new Intent(MainActivity.this, PreferencesActivity.class); startActivity(intent); } else if (drawerItemIdentifier == 5) { - logout(); + Intent intent = new Intent(MainActivity.this, AboutActivity.class); + startActivity(intent); } else if (drawerItemIdentifier == 6) { + logout(); + } else if (drawerItemIdentifier == 7) { Intent intent = new Intent(MainActivity.this, AccountListActivity.class); intent.putExtra("type", AccountListActivity.Type.FOLLOW_REQUESTS); startActivity(intent); diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml new file mode 100644 index 00000000..d28963d0 --- /dev/null +++ b/app/src/main/res/layout/activity_about.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + +