Adding an about activity to the App

This commit is contained in:
serage.betelmal 2017-04-15 19:05:25 +01:00
parent 69c1b88ff4
commit 642e2af23e
7 changed files with 147 additions and 25 deletions

View File

@ -50,6 +50,7 @@ dependencies {
compile 'com.jakewharton:butterknife:8.4.0' compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.google.firebase:firebase-messaging:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1' compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
} }

View File

@ -13,7 +13,10 @@
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" /> <meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<activity android:name=".SplashActivity"> <activity android:name=".SplashActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -41,55 +44,68 @@
android:windowSoftInputMode="stateVisible|adjustResize"> android:windowSoftInputMode="stateVisible|adjustResize">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" /> <data android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" /> <data android:mimeType="image/*" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" /> <action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" /> <data android:mimeType="image/*" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".ViewVideoActivity" android:configChanges="orientation|keyboardHidden|screenSize" /> <activity
android:name=".ViewVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name=".ViewThreadActivity" /> <activity android:name=".ViewThreadActivity" />
<activity android:name=".ViewTagActivity" /> <activity android:name=".ViewTagActivity" />
<activity android:name=".AccountActivity" /> <activity android:name=".AccountActivity" />
<activity android:name=".PreferencesActivity" /> <activity android:name=".PreferencesActivity" />
<activity android:name=".FavouritesActivity" /> <activity android:name=".FavouritesActivity" />
<activity android:name=".BlocksActivity" /> <activity android:name=".BlocksActivity" />
<activity android:name=".AboutActivity" />
<activity <activity
android:name=".ReportActivity" android:name=".ReportActivity"
android:windowSoftInputMode="stateVisible|adjustResize" /> android:windowSoftInputMode="stateVisible|adjustResize" />
<service android:name=".MyFirebaseInstanceIdService" android:exported="true"> <service
android:name=".MyFirebaseInstanceIdService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter> </intent-filter>
</service> </service>
<service
<service android:name=".MyFirebaseMessagingService" android:exported="true"> android:name=".MyFirebaseMessagingService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/> <action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter> </intent-filter>
</service> </service>
<receiver android:name=".NotificationClearBroadcastReceiver" /> <receiver android:name=".NotificationClearBroadcastReceiver" />
<service <service
tools:targetApi="24" android:name=".TuskyTileService"
android:name="com.keylesspalace.tusky.TuskyTileService"
android:icon="@drawable/ic_send_24dp" android:icon="@drawable/ic_send_24dp"
android:label="Compose Toot" android:label="Compose Toot"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
tools:targetApi="24">
<intent-filter> <intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/> <action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter> </intent-filter>
</service> </service>
</application> </application>
</manifest> </manifest>

View 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);
}
}

View File

@ -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 PrimaryDrawerItem().withIdentifier(2).withName(getString(R.string.action_view_blocks)).withSelectable(false).withIcon(GoogleMaterial.Icon.gmd_block),
new DividerDrawerItem(), new DividerDrawerItem(),
new SecondaryDrawerItem().withIdentifier(3).withName(getString(R.string.action_view_preferences)).withSelectable(false), 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() { .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override @Override
@ -290,6 +291,9 @@ public class MainActivity extends BaseActivity {
Intent intent = new Intent(MainActivity.this, PreferencesActivity.class); Intent intent = new Intent(MainActivity.this, PreferencesActivity.class);
startActivity(intent); startActivity(intent);
} else if (drawerItemIdentifier == 4) { } else if (drawerItemIdentifier == 4) {
Intent intent = new Intent(MainActivity.this, AboutActivity.class);
startActivity(intent);
} else if (drawerItemIdentifier == 5) {
logout(); logout();
} }
} }

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<com.mikhaellopez.circularfillableloaders.CircularFillableLoaders
android:id="@+id/circularFillableLoaders"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:src="@mipmap/ic_logo"
app:cfl_border="true"
app:cfl_border_width="4dp"
app:cfl_progress="80"
app:cfl_wave_amplitude="0.08"
app:cfl_wave_color="?attr/splash_wave_color" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="TextView"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</android.support.v7.widget.LinearLayoutCompat>
</android.support.design.widget.CoordinatorLayout>

View File

@ -141,4 +141,7 @@
<string name="description_account_locked">Locked Account</string> <string name="description_account_locked">Locked Account</string>
<string name="about_title_activity">About</string>
<string name="about_application_version">App version:</string>
</resources> </resources>

View File

@ -30,7 +30,8 @@
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item> <item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_dark</item> <item name="android:textColorTertiary">@color/text_color_tertiary_dark</item>
<item name="android:textColorPrimaryInverse">@color/text_color_primary_inverse_dark</item> <item name="android:textColorPrimaryInverse">@color/text_color_primary_inverse_dark</item>
<item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_dark</item> <item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_dark
</item>
<item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_dark</item> <item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_dark</item>
<item name="android:actionMenuTextColor">@color/text_color_primary_dark</item> <item name="android:actionMenuTextColor">@color/text_color_primary_dark</item>
@ -53,11 +54,15 @@
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_dark</item> <item name="tab_page_margin_drawable">@drawable/tab_page_margin_dark</item>
<item name="account_header_background_color">@color/account_header_background_dark</item> <item name="account_header_background_color">@color/account_header_background_dark</item>
<item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark</item> <item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark</item>
<item name="account_toolbar_icon_tint_collapsed">@color/account_toolbar_icon_collapsed_dark</item> <item name="account_toolbar_icon_tint_collapsed">
<item name="account_toolbar_popup_theme">@style/AppTheme.Account.ToolbarPopupTheme.Dark</item> @color/account_toolbar_icon_collapsed_dark
</item>
<item name="account_toolbar_popup_theme">@style/AppTheme.Account.ToolbarPopupTheme.Dark
</item>
<item name="compose_close_button_tint">@color/toolbar_icon_dark</item> <item name="compose_close_button_tint">@color/toolbar_icon_dark</item>
<item name="compose_media_button_tint">@color/compose_media_button_dark</item> <item name="compose_media_button_tint">@color/compose_media_button_dark</item>
<item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_dark</item> <item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_dark
</item>
<item name="compose_mention_color">@color/color_accent_dark</item> <item name="compose_mention_color">@color/color_accent_dark</item>
<item name="compose_content_warning_bar_background">@drawable/border_background_dark</item> <item name="compose_content_warning_bar_background">@drawable/border_background_dark</item>
<item name="compose_nsfw_button_color">@color/image_button_dark</item> <item name="compose_nsfw_button_color">@color/image_button_dark</item>
@ -116,8 +121,10 @@
<item name="android:textColorSecondary">@color/text_color_secondary_light</item> <item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_light</item> <item name="android:textColorTertiary">@color/text_color_tertiary_light</item>
<item name="android:textColorPrimaryInverse">@color/text_color_primary_inverse_light</item> <item name="android:textColorPrimaryInverse">@color/text_color_primary_inverse_light</item>
<item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_light</item> <item name="android:textColorSecondaryInverse">@color/text_color_secondary_inverse_light
<item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_light</item> </item>
<item name="android:textColorTertiaryInverse">@color/text_color_tertiary_inverse_light
</item>
<item name="android:actionMenuTextColor">@color/text_color_primary_light</item> <item name="android:actionMenuTextColor">@color/text_color_primary_light</item>
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog.Light</item> <item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog.Light</item>
@ -132,18 +139,25 @@
<item name="status_favourite_active_drawable">@drawable/favourite_active_light</item> <item name="status_favourite_active_drawable">@drawable/favourite_active_light</item>
<item name="status_favourite_inactive_drawable">@drawable/favourite_inactive_light</item> <item name="status_favourite_inactive_drawable">@drawable/favourite_inactive_light</item>
<item name="content_warning_button">@drawable/toggle_small_light</item> <item name="content_warning_button">@drawable/toggle_small_light</item>
<item name="sensitive_media_warning_background_color">@color/sensitive_media_warning_background_light</item> <item name="sensitive_media_warning_background_color">
@color/sensitive_media_warning_background_light
</item>
<item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_light</item> <item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_light</item>
<item name="status_divider_drawable">@drawable/status_divider_light</item> <item name="status_divider_drawable">@drawable/status_divider_light</item>
<item name="tab_icon_selected_tint">@color/color_accent_light</item> <item name="tab_icon_selected_tint">@color/color_accent_light</item>
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_light</item> <item name="tab_page_margin_drawable">@drawable/tab_page_margin_light</item>
<item name="account_header_background_color">@color/account_header_background_light</item> <item name="account_header_background_color">@color/account_header_background_light</item>
<item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark</item> <!--Default to dark on purpose, because header backgrounds with gradients are always dark.--> <item name="account_toolbar_icon_tint_uncollapsed">@color/toolbar_icon_dark
<item name="account_toolbar_icon_tint_collapsed">@color/account_toolbar_icon_collapsed_light</item> </item> <!--Default to dark on purpose, because header backgrounds with gradients are always dark.-->
<item name="account_toolbar_popup_theme">@style/AppTheme.Account.ToolbarPopupTheme.Light</item> <item name="account_toolbar_icon_tint_collapsed">
@color/account_toolbar_icon_collapsed_light
</item>
<item name="account_toolbar_popup_theme">@style/AppTheme.Account.ToolbarPopupTheme.Light
</item>
<item name="compose_close_button_tint">@color/toolbar_icon_light</item> <item name="compose_close_button_tint">@color/toolbar_icon_light</item>
<item name="compose_media_button_tint">@color/compose_media_button_light</item> <item name="compose_media_button_tint">@color/compose_media_button_light</item>
<item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_light</item> <item name="compose_media_button_disabled_tint">@color/compose_media_button_disabled_light
</item>
<item name="compose_mention_color">@color/compose_mention_light</item> <item name="compose_mention_color">@color/compose_mention_light</item>
<item name="compose_content_warning_bar_background">@drawable/border_background_light</item> <item name="compose_content_warning_bar_background">@drawable/border_background_light</item>
<item name="compose_nsfw_button_color">@color/image_button_light</item> <item name="compose_nsfw_button_color">@color/image_button_light</item>
@ -159,7 +173,8 @@
<item name="material_drawer_divider">@color/color_primary_dark_light</item> <item name="material_drawer_divider">@color/color_primary_dark_light</item>
<item name="material_drawer_selected">@color/color_primary_light</item> <item name="material_drawer_selected">@color/color_primary_light</item>
<item name="material_drawer_selected_text">@color/text_color_primary_light</item> <item name="material_drawer_selected_text">@color/text_color_primary_light</item>
<item name="material_drawer_header_selection_text">@color/text_color_primary_dark</item> <!--Intentionally dark so it can be overlayed over the account's header image.--> <item name="material_drawer_header_selection_text">@color/text_color_primary_dark
</item> <!--Intentionally dark so it can be overlayed over the account's header image.-->
<item name="floatingSearch_backgroundColor">@color/toolbar_background_light</item> <item name="floatingSearch_backgroundColor">@color/toolbar_background_light</item>
<item name="floatingSearch_viewTextColor">@color/text_color_secondary_light</item> <item name="floatingSearch_viewTextColor">@color/text_color_secondary_light</item>
@ -187,4 +202,8 @@
<item name="windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources> </resources>