parent
7861a8fe1d
commit
50adddc006
@ -0,0 +1,59 @@
|
|||||||
|
package com.example.shakecraft
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
|
||||||
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
private const val ARG_PARAM1 = "param1"
|
||||||
|
private const val ARG_PARAM2 = "param2"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple [Fragment] subclass.
|
||||||
|
* Use the [BossFragment.newInstance] factory method to
|
||||||
|
* create an instance of this fragment.
|
||||||
|
*/
|
||||||
|
class BossFragment : Fragment() {
|
||||||
|
// TODO: Rename and change types of parameters
|
||||||
|
private var param1: String? = null
|
||||||
|
private var param2: String? = null
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
arguments?.let {
|
||||||
|
param1 = it.getString(ARG_PARAM1)
|
||||||
|
param2 = it.getString(ARG_PARAM2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater, container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View? {
|
||||||
|
// Inflate the layout for this fragment
|
||||||
|
return inflater.inflate(R.layout.fragment_boss, container, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
/**
|
||||||
|
* Use this factory method to create a new instance of
|
||||||
|
* this fragment using the provided parameters.
|
||||||
|
*
|
||||||
|
* @param param1 Parameter 1.
|
||||||
|
* @param param2 Parameter 2.
|
||||||
|
* @return A new instance of fragment BossFragment.
|
||||||
|
*/
|
||||||
|
// TODO: Rename and change types and number of parameters
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(param1: String, param2: String) =
|
||||||
|
BossFragment().apply {
|
||||||
|
arguments = Bundle().apply {
|
||||||
|
putString(ARG_PARAM1, param1)
|
||||||
|
putString(ARG_PARAM2, param2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 573 KiB |
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="#3B3B3B"></solid>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="@color/red"></solid>
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="#3B3B3B"></solid>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="@color/blue"></solid>
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="#3B3B3B"></solid>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="60dp"></corners>
|
||||||
|
<solid android:color="@color/yellow"></solid>
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,86 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/backgroundboss"
|
||||||
|
android:scaleType="center"
|
||||||
|
tools:context=".BossFragment">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frameLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="50dp"
|
||||||
|
android:paddingBottom="20dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:drawableStart="@drawable/back"
|
||||||
|
android:drawableTint="@color/blue"
|
||||||
|
android:text="Home"
|
||||||
|
android:textColor="@color/blue"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="Dungeon"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="130dp"
|
||||||
|
android:src="@drawable/image_boss"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/frameLayout" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar2"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:layout_marginHorizontal="50dp"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="20"
|
||||||
|
android:progressDrawable="@drawable/custom_boss_progressbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="50dp"
|
||||||
|
android:layout_marginTop="100dp"
|
||||||
|
android:dividerHeight="0dp"
|
||||||
|
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/progressBar2"
|
||||||
|
tools:listitem="@layout/list_item" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in new issue