Skip to content

Commit

Permalink
Add Some Hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanWidjanarko committed Dec 17, 2021
1 parent 9d9eada commit 6b7f7f4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,27 @@ package com.trolle.trolleapp.ui.side_menu
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.trolle.trolleapp.R
import android.content.Intent
import android.net.Uri
import android.view.View


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

fun openBrowser(view: View) {

//Get url from tag
val url = view.getTag() as String
val intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.addCategory(Intent.CATEGORY_BROWSABLE)

//pass the url to intent data
intent.data = Uri.parse(url)
startActivity(intent)
}
}
35 changes: 28 additions & 7 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ivan"
android:contentDescription="@string/member_1" />
android:tag="@string/linkedin_link_ivan"
android:onClick="openBrowser"
android:contentDescription="@string/member_1"
tools:ignore="UsingOnClickInXml" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
Expand All @@ -96,7 +99,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/hanif"
android:contentDescription="@string/member_2" />
android:tag="@string/linkedin_link_hanif"
android:onClick="openBrowser"
android:contentDescription="@string/member_2"
tools:ignore="UsingOnClickInXml" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
Expand All @@ -114,7 +120,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/syarif"
android:contentDescription="@string/member_3" />
android:tag="@string/linkedin_link_syarif"
android:onClick="openBrowser"
android:contentDescription="@string/member_3"
tools:ignore="UsingOnClickInXml" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
Expand All @@ -131,7 +140,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/aad"
android:contentDescription="@string/member_4" />
android:tag="@string/linkedin_link_aad"
android:onClick="openBrowser"
android:contentDescription="@string/member_4"
tools:ignore="UsingOnClickInXml" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
Expand All @@ -148,7 +160,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/elloy"
android:contentDescription="@string/member_5" />
android:tag="@string/linkedin_link_elloy"
android:onClick="openBrowser"
android:contentDescription="@string/member_5"
tools:ignore="UsingOnClickInXml" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Expand All @@ -168,15 +183,21 @@
android:layout_height="50dp"
android:layout_margin="25dp"
android:src="@drawable/youtube"
android:contentDescription="@string/website" />
android:tag="@string/youtube_link"
android:onClick="openBrowser"
android:contentDescription="@string/youtube"
tools:ignore="UsingOnClickInXml" />

<ImageView
android:id="@+id/image_view_website"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="25dp"
android:src="@drawable/website"
android:contentDescription="@string/youtube" />
android:tag="@string/website_link"
android:onClick="openBrowser"
android:contentDescription="@string/website"
tools:ignore="UsingOnClickInXml" />

</LinearLayout>

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@
<string name="end_of_the_list">- end of the list -</string>
<string name="sign_in_with_google">Sign in with Google</string>
<string name="sign_up_with_google">Sign up with Google</string>
<string name="youtube_link">https://bit.ly/troll-e_video</string>
<string name="website_link">https://competent-wing-9bbbd5.netlify.app/</string>
<string name="linkedin_link_ivan">https://www.linkedin.com/in/ivanwidjanarko/</string>
<string name="linkedin_link_hanif">https://www.linkedin.com/in/haidarhnf/</string>
<string name="linkedin_link_syarif">https://www.linkedin.com/in/skudou/</string>
<string name="linkedin_link_aad">https://www.linkedin.com/in/m-asad-m/</string>
<string name="linkedin_link_elloy">https://www.linkedin.com/in/jonathan-elloy-692433197/</string>
</resources>

0 comments on commit 6b7f7f4

Please sign in to comment.