Skip to content

Instantly share code, notes, and snippets.

View muzafakar's full-sized avatar
:octocat:
Uwu

Mehmed Zulfakar muzafakar

:octocat:
Uwu
  • vidio.com
  • Indonesia
View GitHub Profile
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Hello"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
object Data {
val contact = listOf(
"Orang pertama",
"orang kedua",
"Jade C. Lyons",
"Miriam J. Carpenter",
"Merrill G. Cruz",
"Graiden V. Richardson",
"Amber L. Workman",
"Neville L. Boyd",
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical"
android:layout_margin="8dp"
android:padding="4dp">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvChat"
android:layout_width="match_parent"
public class Chat {
private String username;
private String message;
public Chat() {
// Default Constructor kosong
}
public Chat(String username, String message) {
this.username = username;
@muzafakar
muzafakar / Android TimeZone Ids
Created November 11, 2019 01:11 — forked from arpit/Android TimeZone Ids
List of all Android TimeZone ids
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
<?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="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<!--Kalo error ganti ke ImageView-->
<de.hdodenhof.circleimageview.CircleImageView
class MainActivity : AppCompatActivity() {
private lateinit var adpOnBoarding: AdpOnBoarding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
adpOnBoarding = AdpOnBoarding(supportFragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)
tlDotsContainer.setupWithViewPager(vpOnBoarding)
vpOnBoarding.adapter = adpOnBoarding
class AdpOnBoarding(fm: FragmentManager, behavior: Int) : FragmentPagerAdapter(fm, behavior) {
private val fragments = mutableListOf<Fragment>()
fun addItem(fragment: Fragment) {
fragments.add(fragment)
notifyDataSetChanged()
}
override fun getItem(position: Int): Fragment = fragments[position]
class OnBoardingItemFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
inflater.inflate(R.layout.fragment_on_boarding_item, container, false)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
arguments?.let {
val animationId = it.getInt(LOTTIE)