Skip to content

Commit

Permalink
Modify the about activity to include a referral link
Browse files Browse the repository at this point in the history
  • Loading branch information
WillWcchan committed Jul 20, 2020
1 parent 6ec3479 commit a57a3d7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.ActionBar;
Expand Down Expand Up @@ -41,6 +43,10 @@ protected void onCreate(Bundle savedInstanceState) {
Log.e(AboutActivity.this.getLocalClassName(), "Unable to set Up Action");
}
}

// Adding a hyperlink in android application through TextView
TextView robinHoodTextView = findViewById(R.id.robinhood_referral_textView);
robinHoodTextView.setMovementMethod(LinkMovementMethod.getInstance());
}

// Source: https://www.tutorialspoint.com/android/android_sending_email.htm#:~:text=Intent%20Object%20-%20Extra%20to%20send%20Email%20,that%20i%20...%20%203%20more%20rows%20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);

// Load up the SplashScreen when the app is brought up and after 2 seconds load the main app
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Expand Down
41 changes: 33 additions & 8 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_height="100sp"
android:layout_marginTop="20sp"
android:contentDescription="@string/app_logo"
android:src="@drawable/ic_place"
android:src="@drawable/logo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
Expand All @@ -33,7 +33,7 @@
android:id="@+id/about_app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginTop="20sp"
android:autofillHints="@string/app_name"
android:background="@null"
android:focusableInTouchMode="false"
Expand All @@ -51,7 +51,7 @@
android:id="@+id/about_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginTop="20sp"
android:autofillHints="@string/current_version"
android:background="@null"
android:focusableInTouchMode="false"
Expand All @@ -67,7 +67,7 @@
android:id="@+id/about_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginTop="20sp"
android:autofillHints="@string/author_name"
android:background="@null"
android:focusableInTouchMode="false"
Expand All @@ -82,7 +82,7 @@
android:id="@+id/about_contact_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:layout_marginTop="20sp"
android:autofillHints="@string/contact_information"
android:background="@null"
android:focusableInTouchMode="false"
Expand All @@ -97,7 +97,7 @@
android:id="@+id/about_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginTop="20sp"
android:autofillHints="@string/email_address"
android:ems="10"
android:focusableInTouchMode="false"
Expand All @@ -110,4 +110,29 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/about_contact_information" />

<TextView
android:id="@+id/supportTexView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20sp"
android:gravity="center"
android:text="@string/referral_links_to_support_the_creator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/about_email" />

<TextView
android:id="@+id/robinhood_referral_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:layout_marginRight="20sp"
android:layout_marginBottom="20sp"
android:text="@string/robinhood_referral_link"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/supportTexView" />


</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,10 @@
<string name="no_random_stock_selected_yet">No random stock selected yet</string>
<string name="delete_all_stocks">Delete all stocks</string>
<string name="about">About</string>
<string name="referral_links_to_support_the_creator">Referral Link(s) to support the creator</string>

<string name="robinhood_referral_link">
<a href="https://join.robinhood.com/williac1866"> https://join.robinhood.com/williac1866 </a>
</string>

</resources>

0 comments on commit a57a3d7

Please sign in to comment.