Adding an about activity to the App
This commit is contained in:
parent
69c1b88ff4
commit
642e2af23e
7 changed files with 147 additions and 25 deletions
25
app/src/main/java/com/keylesspalace/tusky/AboutActivity.java
Normal file
25
app/src/main/java/com/keylesspalace/tusky/AboutActivity.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package com.keylesspalace.tusky;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
private TextView mVersionTextView;
|
||||
|
||||
@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.textView);
|
||||
String versionName = BuildConfig.VERSION_NAME;
|
||||
|
||||
mVersionTextView.
|
||||
setText(getString(R.string.about_application_version)+ versionName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -266,7 +266,8 @@ public class MainActivity extends BaseActivity {
|
|||
new PrimaryDrawerItem().withIdentifier(2).withName(getString(R.string.action_view_blocks)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_block),
|
||||
new DividerDrawerItem(),
|
||||
new SecondaryDrawerItem().withIdentifier(3).withName(getString(R.string.action_view_preferences)).withSelectable(false),
|
||||
new SecondaryDrawerItem().withIdentifier(4).withName(getString(R.string.action_logout)).withSelectable(false)
|
||||
new SecondaryDrawerItem().withIdentifier(4).withName(getString(R.string.about_title_activity)).withSelectable(false),
|
||||
new SecondaryDrawerItem().withIdentifier(5).withName(getString(R.string.action_logout)).withSelectable(false)
|
||||
)
|
||||
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
|
||||
@Override
|
||||
|
|
@ -290,6 +291,9 @@ public class MainActivity extends BaseActivity {
|
|||
Intent intent = new Intent(MainActivity.this, PreferencesActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (drawerItemIdentifier == 4) {
|
||||
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (drawerItemIdentifier == 5) {
|
||||
logout();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue