-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7af954d
commit d0161c1
Showing
19 changed files
with
181 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/info/dvkr/screenstream/ui/AboutActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"))) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() | ||
|
@@ -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() | ||
|
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters