-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
21 changed files
with
391 additions
and
58 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
37 changes: 37 additions & 0 deletions
37
app/src/main/java/it/univpm/spottedkotlin/view/TutorialActivity.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,37 @@ | ||
package it.univpm.spottedkotlin.view | ||
|
||
import android.os.Bundle | ||
import android.view.MotionEvent | ||
import com.google.android.material.snackbar.Snackbar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.ui.AppBarConfiguration | ||
import androidx.navigation.ui.navigateUp | ||
import androidx.navigation.ui.setupActionBarWithNavController | ||
import it.univpm.spottedkotlin.R | ||
import it.univpm.spottedkotlin.databinding.ActivityTutorialBinding | ||
import it.univpm.spottedkotlin.extension.function.goto | ||
import it.univpm.spottedkotlin.managers.IOManager | ||
|
||
class TutorialActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityTutorialBinding | ||
private var index = 0; | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivityTutorialBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
binding.tutorialContainer.setOnClickListener{ | ||
if (index>=2){ | ||
goto<FirstActivity>() | ||
IOManager.writeKey("first_access",false) | ||
return@setOnClickListener | ||
} | ||
binding.tutorialContainer.findNavController().navigate( | ||
if (index == 0) R.id.tutorial_fragment_1_to_tutorial_fragment_2 else R.id.tutorial_fragment_2_to_tutorial_fragment_3 | ||
) | ||
index++ | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/it/univpm/spottedkotlin/view/fragments/Tutorial1Fragment.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,28 @@ | ||
package it.univpm.spottedkotlin.view.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.viewModels | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.fragment.findNavController | ||
import it.univpm.spottedkotlin.R | ||
import it.univpm.spottedkotlin.databinding.FirstFragmentBinding | ||
import it.univpm.spottedkotlin.databinding.Tutorial1FragmentBinding | ||
import it.univpm.spottedkotlin.viewmodel.FirstActivityViewModel | ||
|
||
|
||
class Tutorial1Fragment : Fragment() { | ||
private lateinit var binding: Tutorial1FragmentBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
binding = Tutorial1FragmentBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/it/univpm/spottedkotlin/view/fragments/Tutorial2Fragment.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,29 @@ | ||
package it.univpm.spottedkotlin.view.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.viewModels | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.fragment.findNavController | ||
import it.univpm.spottedkotlin.R | ||
import it.univpm.spottedkotlin.databinding.FirstFragmentBinding | ||
import it.univpm.spottedkotlin.databinding.Tutorial1FragmentBinding | ||
import it.univpm.spottedkotlin.databinding.Tutorial2FragmentBinding | ||
import it.univpm.spottedkotlin.viewmodel.FirstActivityViewModel | ||
|
||
|
||
class Tutorial2Fragment : Fragment() { | ||
private lateinit var binding: Tutorial2FragmentBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
binding = Tutorial2FragmentBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/it/univpm/spottedkotlin/view/fragments/Tutorial3Fragment.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,29 @@ | ||
package it.univpm.spottedkotlin.view.fragments | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.viewModels | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.fragment.findNavController | ||
import it.univpm.spottedkotlin.R | ||
import it.univpm.spottedkotlin.databinding.FirstFragmentBinding | ||
import it.univpm.spottedkotlin.databinding.Tutorial1FragmentBinding | ||
import it.univpm.spottedkotlin.databinding.Tutorial3FragmentBinding | ||
import it.univpm.spottedkotlin.viewmodel.FirstActivityViewModel | ||
|
||
|
||
class Tutorial3Fragment : Fragment() { | ||
private lateinit var binding: Tutorial3FragmentBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
binding = Tutorial3FragmentBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
} |
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.
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,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android = "http://schemas.android.com/apk/res/android" | ||
xmlns:app = "http://schemas.android.com/apk/res-auto" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "match_parent"> | ||
|
||
<androidx.fragment.app.FragmentContainerView | ||
android:id = "@+id/tutorial_container" | ||
android:name = "androidx.navigation.fragment.NavHostFragment" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "match_parent" | ||
app:defaultNavHost = "true" | ||
app:navGraph = "@navigation/tutorial_nav_graph"/> | ||
|
||
</RelativeLayout> |
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,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android = "http://schemas.android.com/apk/res/android" | ||
xmlns:app = "http://schemas.android.com/apk/res-auto" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "match_parent" | ||
android:background = "@color/grey"> | ||
<LinearLayout android:layout_width = "match_parent" | ||
android:layout_height = "wrap_content" | ||
android:layout_marginTop = "160dp" | ||
android:orientation = "vertical" | ||
android:paddingHorizontal = "80dp" | ||
app:layout_constraintTop_toTopOf = "parent" | ||
app:layout_constraintEnd_toEndOf = "parent" | ||
app:layout_constraintStart_toStartOf = "parent"> | ||
|
||
<TextView style = "@style/LabelBold" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "wrap_content" | ||
android:textAlignment="center" | ||
android:textSize="28sp" | ||
android:text = "Dai un nome ai volti"/> | ||
<View android:layout_width = "wrap_content" | ||
android:layout_height = "14dp"/> | ||
<TextView style = "@style/LabelRegular" | ||
android:layout_width = "match_parent" | ||
android:textAlignment="center" | ||
android:textSize="18sp" | ||
android:layout_height = "wrap_content" | ||
android:lineHeight="23dp" | ||
android:text = "Scopri l'identità delle persone che incortri nelle tue giornate"/> | ||
|
||
<!--HLine--> | ||
<View android:layout_width = "50dp" | ||
android:layout_height = "6dp" | ||
android:layout_marginTop = "30dp" | ||
android:layout_gravity="center" | ||
android:foreground = "@drawable/border_rounded_black_small"/> | ||
|
||
</LinearLayout> | ||
|
||
<ImageView android:layout_width = "wrap_content" | ||
android:layout_height = "300dp" | ||
android:adjustViewBounds = "true" | ||
android:scaleType = "centerCrop" | ||
android:src = "@drawable/spotted_tutorial_1" | ||
app:layout_constraintBottom_toBottomOf = "parent" | ||
app:layout_constraintEnd_toEndOf = "parent"/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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,53 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android = "http://schemas.android.com/apk/res/android" | ||
xmlns:app = "http://schemas.android.com/apk/res-auto" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "match_parent" | ||
android:background = "@color/black"> | ||
<LinearLayout android:layout_width = "match_parent" | ||
android:layout_height = "wrap_content" | ||
android:layout_marginTop = "140dp" | ||
android:orientation = "vertical" | ||
android:paddingHorizontal = "80dp" | ||
app:layout_constraintTop_toTopOf = "parent" | ||
app:layout_constraintEnd_toEndOf = "parent" | ||
app:layout_constraintStart_toStartOf = "parent"> | ||
|
||
<TextView style = "@style/LabelBold" | ||
android:layout_width = "match_parent" | ||
android:layout_height = "wrap_content" | ||
android:textAlignment="center" | ||
android:textSize="28sp" | ||
android:textColor="@color/white" | ||
android:text = "Interagisci con la community"/> | ||
<View android:layout_width = "wrap_content" | ||
android:layout_height = "14dp"/> | ||
<TextView style = "@style/LabelRegular" | ||
android:layout_width = "match_parent" | ||
android:textAlignment="center" | ||
android:textSize="18sp" | ||
android:textColor="@color/white" | ||
android:layout_height = "wrap_content" | ||
android:lineHeight="23dp" | ||
android:text = "Commenta, segui e riconosciti negli spot"/> | ||
|
||
<!--HLine--> | ||
<View android:layout_width = "50dp" | ||
android:layout_height = "6dp" | ||
android:layout_marginTop = "30dp" | ||
android:layout_gravity="center" | ||
android:foreground = "@drawable/border_rounded_white_small"/> | ||
|
||
</LinearLayout> | ||
|
||
<ImageView android:layout_width = "wrap_content" | ||
android:layout_height = "300dp" | ||
android:adjustViewBounds = "true" | ||
android:scaleType = "centerCrop" | ||
android:src = "@drawable/spotted_tutorial_2" | ||
app:layout_constraintBottom_toBottomOf = "parent" | ||
android:layout_marginBottom="20dp" | ||
|
||
app:layout_constraintEnd_toEndOf = "parent"/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.