Skip to content

Instantly share code, notes, and snippets.

View siscofran999's full-sized avatar
🌴
Sans Boy

Fransisco siscofran999

🌴
Sans Boy
  • Jakarta, Indonesia
View GitHub Profile
<?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"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/frm_layout"
class LottieBottomNav : LinearLayout {
private var mLayoutParams: LayoutParams? = null
private var mActiveView: LottieAnimationView? = null
private var mMenus: List<LottieMenu>? = null
private var mListener: OnNavigationItemSelectedListener? = null
private var mActiveMenuId = 0
constructor(context: Context) : super(context) {
init()
{
"menu": [
{
"id": 0,
"title": "Trash",
"lottie_asset": "trash.json",
"active_animation_start_index": 1,
"inactive_still_index": 0
},
{
private fun showDialogAnimation(checked: Boolean) {
val dialogBuilder = AlertDialog.Builder(this, R.style.Flip)
val dialogLayout = LayoutInflater.from(this).inflate(R.layout.dialog_card, null)
val dialog = dialogBuilder.create()
dialog.setView(dialogLayout)
val cardMan: AppCompatImageView = dialogLayout.findViewById(R.id.card_man)
val cardFemale: AppCompatImageView = dialogLayout.findViewById(R.id.card_female)
val mSetRightOut = AnimatorInflater.loadAnimator(this, R.animator.anim_flip1) as AnimatorSet
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:valueFrom="0"
android:valueTo="180"
android:propertyName="rotationY"
android:duration="1500" />
<objectAnimator
android:valueFrom="1.0"
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:valueFrom="1.0"
android:valueTo="0.0"
android:propertyName="alpha"
android:duration="0" />
<objectAnimator
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<ImageView
android:id="@+id/card_man"
android:layout_width="121dp"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/toggleSwitch"
android:layout_width="wrap_content"
val tabs = tabLayout.getChildAt(0) as ViewGroup
for (i in 0 until tabs.childCount - 1) {
val tab = tabs.getChildAt(i)
val layoutParams = tab.layoutParams as LinearLayout.LayoutParams
layoutParams.marginEnd = dpToPx(resources, 8f).toInt()
layoutParams.marginStart = dpToPx(resources, 8f).toInt()
tab.layoutParams = layoutParams
tabLayout.requestLayout()
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorBg">#202125</color>
<color name="colorText">#7e8186</color>
<color name="colorTextSelected">#379477</color>
<color name="colorBgTabSelected">#043d2e</color>
<color name="transparent">#00000000</color>
</resources>