add plus fragment and wiki button redirect to codefirst repository 🎉

SQLite
Lucas Delanier 2 years ago
parent a78a234fde
commit dcc94a9845

@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.sensor.accelerometer" />
<application
android:allowBackup="true"
@ -12,9 +13,6 @@
android:supportsRtl="true"
android:theme="@style/Theme.ShakeCraft"
tools:targetApi="31">
<activity
android:name=".CollectActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true">

@ -1,13 +1,16 @@
package com.example.shakecraft
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
class PlusFragment : Fragment() {
private lateinit var buttonWiki : LinearLayout
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -19,7 +22,23 @@ class PlusFragment : Fragment() {
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_plus, container, false)
val view = inflater.inflate(R.layout.fragment_plus, container, false)
// Initialize views
setUpRecyclerView(view)
return view
}
private fun setUpRecyclerView(view: View,) {
buttonWiki = view.findViewById(R.id.wikiButton)
buttonWiki.setOnClickListener{
val url = "https://codefirst.iut.uca.fr/git/lucas.delanier/ShakeAndCraft"
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
intent.setPackage("com.android.chrome")
startActivity(intent)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -1,13 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/black_800"
tools:context=".PlusFragment">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:paddingBottom="20dp"
android:text="@string/plus_title"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttonForge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_800"
android:text="plus fragment" />
android:layout_marginHorizontal="15dp"
android:layout_height="60dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:layout_marginVertical="10dp"
android:background="@drawable/rounded_border_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2">
<LinearLayout
android:id="@+id/wikiButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:contentDescription="@string/wikiImage"
android:id="@+id/imageView2"
android:layout_width="60dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="60dp"
android:src="@drawable/wiki_image" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shake&amp;Craft Wiki"
android:textColor="@color/white"
android:textStyle="bold" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Development info, gameplay &amp; more"
android:textColor="@color/grey_300"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save