Skip to content

Commit

Permalink
Add About Page
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrivoruchko committed Aug 26, 2017
1 parent 7af954d commit d0161c1
Show file tree
Hide file tree
Showing 19 changed files with 181 additions and 33 deletions.
9 changes: 6 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ui.SettingsActivity"
android:label="@string/settings_activity_name"
android:launchMode="singleTop"
android:parentActivityName=".ui.StartActivity" />

<activity
android:name=".ui.ClientsActivity"
android:label="@string/clients_activity_name"
android:hardwareAccelerated="true"
android:label="@string/clients_activity_name"
android:launchMode="singleTop"
android:parentActivityName=".ui.StartActivity" />
<activity
android:name=".ui.AboutActivity"
android:label="@string/about_activity_name"
android:launchMode="singleTop"
android:parentActivityName=".ui.StartActivity" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ImageNotifyImpl(context: Context) : ImageNotify {
private val newAddressText: String = context.getString(R.string.image_generator_go_to_new_address)

init {
val tempBm = BitmapFactory.decodeResource(context.resources, R.drawable.ic_app)
val tempBm = BitmapFactory.decodeResource(context.resources, R.drawable.ic_app_icon)
logo = Bitmap.createScaledBitmap(tempBm, 192, 192, false)
tempBm.recycle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ class ForegroundService : Service(), ForegroundServiceView {

val smallView = RemoteViews(packageName, R.layout.start_notification_small)
smallView.setOnClickPendingIntent(R.id.linearLayoutStartNotificationSmall, pendingMainActivityIntent)
smallView.setImageViewResource(R.id.imageViewStartNotificationSmallIconMain, R.drawable.ic_app)
smallView.setImageViewResource(R.id.imageViewStartNotificationSmallIconMain, R.drawable.ic_app_icon)
smallView.setImageViewResource(R.id.imageViewStartNotificationSmallIconStart, R.drawable.ic_service_start_24dp)
smallView.setOnClickPendingIntent(R.id.imageViewStartNotificationSmallIconStart, startIntent)
builder.setCustomContentView(smallView)

val bigView = RemoteViews(packageName, R.layout.start_notification_big)
bigView.setOnClickPendingIntent(R.id.linearLayoutStartNotificationBig, pendingMainActivityIntent)
bigView.setImageViewResource(R.id.imageViewStartNotificationBigIconMain, R.drawable.ic_app)
bigView.setImageViewResource(R.id.imageViewStartNotificationBigIconMain, R.drawable.ic_app_icon)
bigView.setImageViewResource(R.id.imageViewStartNotificationBigIconStart, R.drawable.ic_service_start_24dp)
bigView.setImageViewResource(R.id.imageViewStartNotificationBigIconExit, R.drawable.ic_service_exit_24dp)
bigView.setOnClickPendingIntent(R.id.linearLayoutStartNotificationBigStart, startIntent)
Expand All @@ -386,14 +386,14 @@ class ForegroundService : Service(), ForegroundServiceView {

val smallView = RemoteViews(packageName, R.layout.stop_notification_small)
smallView.setOnClickPendingIntent(R.id.linearLayoutStopNotificationSmall, pendingMainActivityIntent)
smallView.setImageViewResource(R.id.imageViewStopNotificationSmallIconMain, R.drawable.ic_app)
smallView.setImageViewResource(R.id.imageViewStopNotificationSmallIconMain, R.drawable.ic_app_icon)
smallView.setImageViewResource(R.id.imageViewStopNotificationSmallIconStop, R.drawable.ic_service_stop_24dp)
smallView.setOnClickPendingIntent(R.id.imageViewStopNotificationSmallIconStop, stopIntent)
builder.setCustomContentView(smallView)

val bigView = RemoteViews(packageName, R.layout.stop_notification_big)
bigView.setOnClickPendingIntent(R.id.linearLayoutStopNotificationBig, pendingMainActivityIntent)
bigView.setImageViewResource(R.id.imageViewStopNotificationBigIconMain, R.drawable.ic_app)
bigView.setImageViewResource(R.id.imageViewStopNotificationBigIconMain, R.drawable.ic_app_icon)
bigView.setImageViewResource(R.id.imageViewStopNotificationBigIconStop, R.drawable.ic_service_stop_24dp)
bigView.setOnClickPendingIntent(R.id.linearLayoutStopNotificationBigStop, stopIntent)
builder.setCustomBigContentView(bigView)
Expand Down
39 changes: 39 additions & 0 deletions app/src/main/java/info/dvkr/screenstream/ui/AboutActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package info.dvkr.screenstream.ui

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import info.dvkr.screenstream.R
import kotlinx.android.synthetic.main.activity_about.*


class AboutActivity : AppCompatActivity() {

companion object {
fun getStartIntent(context: Context): Intent {
return Intent(context, AboutActivity::class.java)
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)

val version = applicationContext.packageManager.getPackageInfo(packageName, 0).versionName
textViewAboutVersion.text = getString(R.string.about_app_version).format(version)

textViewAboutDeveloperEmail.setOnClickListener {
val emailIntent = Intent(Intent.ACTION_SENDTO)
.setData(Uri.Builder().scheme("mailto").build())
.putExtra(Intent.EXTRA_EMAIL, arrayOf("Dmitriy Krivoruchko <[email protected]>"))
.putExtra(Intent.EXTRA_SUBJECT, "Screen Stream Feedback")
startActivity(Intent.createChooser(emailIntent, getString(R.string.start_activity_email_chooser_header)))
}

textViewAboutSources.setOnClickListener {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/dkrivoruchko/ScreenStream")))
}
}
}
20 changes: 4 additions & 16 deletions app/src/main/java/info/dvkr/screenstream/ui/StartActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ class StartActivity : BaseActivity(), StartActivityView {
// PrimaryDrawerItem().withIdentifier(5).withName("Local test").withSelectable(false).withIcon(R.drawable.ic_drawer_test_24dp),
DividerDrawerItem(),
PrimaryDrawerItem().withIdentifier(6).withName(R.string.start_activity_drawer_rate_app).withSelectable(false).withIcon(R.drawable.ic_drawer_rateapp_24dp),
PrimaryDrawerItem().withIdentifier(7).withName(R.string.start_activity_drawer_feedback).withSelectable(false).withIcon(R.drawable.ic_drawer_feedback_24dp),
PrimaryDrawerItem().withIdentifier(8).withName(R.string.start_activity_drawer_sources).withSelectable(false).withIcon(R.drawable.ic_drawer_sources_24dp)
PrimaryDrawerItem().withIdentifier(7).withName(R.string.start_activity_drawer_about).withSelectable(false).withIcon(R.drawable.ic_drawer_about_24dp)
)
.addStickyDrawerItems(
PrimaryDrawerItem().withIdentifier(9).withName(R.string.start_activity_drawer_exit).withIcon(R.drawable.ic_drawer_exit_24pd)
PrimaryDrawerItem().withIdentifier(8).withName(R.string.start_activity_drawer_exit).withIcon(R.drawable.ic_drawer_exit_24pd)
)
.withOnDrawerItemClickListener { _, _, drawerItem ->
if (drawerItem.identifier == 1L) if (drawer.isDrawerOpen) drawer.closeDrawer()
Expand All @@ -204,19 +203,8 @@ class StartActivity : BaseActivity(), StartActivityView {
}
}

if (drawerItem.identifier == 7L) {
val emailIntent = Intent(Intent.ACTION_SENDTO)
.setData(Uri.Builder().scheme("mailto").build())
.putExtra(Intent.EXTRA_EMAIL, arrayOf("Dmitriy Krivoruchko <[email protected]>"))
.putExtra(Intent.EXTRA_SUBJECT, "Screen Stream Feedback")
startActivity(Intent.createChooser(emailIntent, getString(R.string.start_activity_email_chooser_header)))
}

if (drawerItem.identifier == 8L) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/dkrivoruchko/ScreenStream")))
}

if (drawerItem.identifier == 9L) fromEvents.onNext(StartActivityView.FromEvent.AppExit())
if (drawerItem.identifier == 7L) startActivity(AboutActivity.getStartIntent(this))
if (drawerItem.identifier == 8L) fromEvents.onNext(StartActivityView.FromEvent.AppExit())
true
}
.build()
Expand Down
Binary file added app/src/main/res/drawable-nodpi/about_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-nodpi/ic_app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_drawer_about_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#1c313a"
android:pathData="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" />
</vector>
96 changes: 96 additions & 0 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="wrap_content"
android:scrollbars="vertical"
tools:context="info.dvkr.screenstream.ui.AboutActivity">

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp">

<ImageView
android:id="@+id/imageViewAbout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
app:srcCompat="@drawable/about_image" />

<TextView
android:id="@+id/textViewAbout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/about_app_name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colorPrimaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/imageViewAbout" />

<TextView
android:id="@+id/textViewAboutVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="@string/about_app_version"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorSecondaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewAbout" />

<TextView
android:id="@+id/textViewAboutDeveloper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="@string/about_developer_name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewAboutVersion" />

<TextView
android:id="@+id/textViewAboutDeveloperEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_about_feedback_24dp"
android:focusable="true"
android:gravity="center"
android:padding="8dp"
android:text="@string/about_developer_send_email"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewAboutDeveloper" />

<TextView
android:id="@+id/textViewAboutSources"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_about_sources_24dp"
android:focusable="true"
android:gravity="center"
android:padding="8dp"
android:text="@string/about_app_sources"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewAboutDeveloperEmail" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_start_drawer_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_app" />
app:srcCompat="@drawable/ic_app_icon" />

<TextView
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/start_notification_big.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:id="@+id/imageViewStartNotificationBigIconMain"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_app" />
app:srcCompat="@drawable/ic_app_icon" />

<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/start_notification_small.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:id="@+id/imageViewStartNotificationSmallIconMain"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_app" />
app:srcCompat="@drawable/ic_app_icon" />

<LinearLayout
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/stop_notification_big.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:id="@+id/imageViewStopNotificationBigIconMain"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_app" />
app:srcCompat="@drawable/ic_app_icon" />

<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/stop_notification_small.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:id="@+id/imageViewStopNotificationSmallIconMain"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_app" />
app:srcCompat="@drawable/ic_app_icon" />

<LinearLayout
android:layout_width="0dp"
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<string name="start_activity_drawer_traffic_clients">Траффик и клиенты</string>
<string name="start_activity_drawer_settings">Настройки</string>
<string name="start_activity_drawer_rate_app">Оценить приложение</string>
<string name="start_activity_drawer_feedback">Написать отзыв</string>
<string name="start_activity_drawer_sources">Исходный код</string>
<string name="start_activity_drawer_about">О приложении</string>
<string name="start_activity_drawer_exit">Выход</string>

<string name="start_activity_alert_title_warring">Предупреждение</string>
Expand Down Expand Up @@ -98,6 +97,13 @@
<string name="clients_activity_client_slow_network">Медленный</string>
<string name="clients_activity_client">Клиент:\u0020</string>

<!--AboutActivity-->
<string name="about_activity_name">О приложении</string>
<string name="about_app_version">Версия: %1$s</string>
<string name="about_developer_name">Разработано: Криворучко Дмитрий</string>
<string name="about_developer_send_email">Написать Email разработчику</string>
<string name="about_app_sources">Исходный код приложения</string>

<!--HTML text-->
<string name="html_stream_require_pin">Эта трансляция требует PIN-код для доступа к ней</string>
<string name="html_enter_pin">Введите PIN-код:\u0020</string>
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
<string name="start_activity_drawer_traffic_clients">Traffic &amp; clients</string>
<string name="start_activity_drawer_settings">Settings</string>
<string name="start_activity_drawer_rate_app">Rate app</string>
<string name="start_activity_drawer_feedback">Send email to developer</string>
<string name="start_activity_drawer_sources">Sources</string>
<string name="start_activity_drawer_about">About</string>
<string name="start_activity_drawer_exit">Exit</string>

<string name="start_activity_alert_title_warring">Warning</string>
Expand Down Expand Up @@ -101,6 +100,14 @@
<string name="clients_activity_client_slow_network">Slow connection</string>
<string name="clients_activity_client">Client:\u0020</string>

<!--AboutActivity-->
<string name="about_activity_name">About</string>
<string name="about_app_name" translatable="false">Screen Stream over HTTP</string>
<string name="about_app_version">Version: %1$s</string>
<string name="about_developer_name">Developed by Dmitriy Krivoruchko</string>
<string name="about_developer_send_email">Send email to developer</string>
<string name="about_app_sources">Application sources</string>

<!--HTML text-->
<string name="html_stream_require_pin">This stream requires PIN to access it</string>
<string name="html_enter_pin">Enter pin:\u0020</string>
Expand Down

0 comments on commit d0161c1

Please sign in to comment.