skip to Main Content

Android Studio – Button android studio, how to create a button that stops setonclicklistener function?

I have a button such as <com.google.android.material.button.MaterialButton android:id="@+id/button" style="@style/Widget.MaterialComponents.Button.OutlinedButton.Icon" android:layout_width="150dp" android:layout_height="50dp" android:text="@string/lightning" android:textColor="#FFFFFF" android:textSize="14sp" app:icon="@drawable/ic_baseline_flash_on_24" app:iconTint="@color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.061" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.239" app:strokeColor="@color/white" app:strokeWidth="1dp" /> I have created a setOnClickListener method and inside their is a loop. val btnClickMe1 =…

VIEW QUESTION

Android Studio – How to apply letter spacing in custom button?

I have one button and letterspacing is not working with it. Please check my following snippet code <style name="ButtonText_v2" parent="TextAppearance.AppCompat"> <item name="fontFamily">@font/silka_regular</item> <item name="android:letterSpacing">0.1</item> <item name="android:textSize">@dimen/dimen_14dp</item> </style> <style name="PrimaryButton_v2" parent="Widget.AppCompat.Button"> <item name="android:background">@drawable/button_selector_primary</item> <item name="android:textColor">@color/white</item> <item name="textAllCaps">true</item> <item name="textAppearance">@style/ButtonText_v2</item> </style> layout.xml…

VIEW QUESTION

Android Studio – Change activity's button state from fragment

Here I have code from both my activity and my fragment: Activity: class Activity0: AppCompatActivity() { private lateinit var binding: Activity0Binding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = Activity0Binding.inflate(layoutInflater) setContentView(binding.root) binding.popUpButton.setOnClickListener { supportFragmentManager.commit { replace(R.id.quiz_fragment_container, Activity0FragmentNull()) } binding.popUpButton.isEnabled =…

VIEW QUESTION
Back To Top
Search