Category : mvvm

There is an application that displays information about movies using the REST-API based on the MVVM pattern. The application already displays movies in Recycle, but for some reason I don’t get detailed information. I’m sure that I wrote something wrong in the Api-Client class. But that I can’t understand that’s why I’m asking for your ..

Read more

**The XMl file where from calling method of view Model** <variable name="viewModelDetail" type="com.joyor.viewmodel.HomeViewModel" /> </data> <ImageView android:id="@+id/profile" android:layout_width="@dimen/_30sdp" android:layout_height="match_parent" android:layout_marginEnd="@dimen/_5sdp" android:onClick="@{viewModelDetail.onProfileClick}" android:padding="@dimen/_5sdp" android:src="@drawable/ic_profile" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> …. …… ……. View Model Class implementation where on click for invoke method class HomeViewModel : ViewModel() { var isProfileClick: MutableLiveData<Boolean> = MutableLiveData() fun onProfileClick(view:View) { isProfileClick.value = ..

Read more

I am making an android app using laravell api. Currently i am logging in to my app using email but i want to change it with phone number. Please help me Here is my android code .. private void login() { try { if (password.getText().toString().isEmpty()) { Toast.makeText(this, getString(R.string.invalid_password), Toast.LENGTH_SHORT).show(); return; } if (mobile.isEmpty()) { Toast.makeText(this, ..

Read more

I want to display favored items from two tables: Item and ItemMoto. Both tables share same table Favourite. Portion of files are" FavouriteListFragment.java public class FavouriteListFragment extends PSFragment implements DataBoundListAdapter.DiffUtilDispatchedInterface { private final androidx.databinding.DataBindingComponent dataBindingComponent = new FragmentDataBindingComponent(this); private FavouriteViewModel favouriteViewModel; private FavouriteMotoViewModel favouriteViewModelMoto; @VisibleForTesting private AutoClearedValue<FragmentFavouriteListBinding> binding; private AutoClearedValue<ItemVerticalListAdapter> adapter; private AutoClearedValue<ItemAutoVerticalListAdapter> adapterMoto; @Override ..

Read more

I have a project that part of it uses MVVM Architecture ,,I use a repo to get the data from backend like this : private val spotlights: MutableLiveData<List<SpotlightModel>> = MutableLiveData() fun getSpotLight(segmentId: String, segmentType: String): MutableLiveData<List<SpotlightModel>>? { mProvider.getSpotLight( segmentType = segmentType, adType = TYPE_SPOT_LIGHT, segmentId = segmentId, topics = application.profileManger.topicsIds, publishers = application.profileManger.publisherIds, debug = ..

Read more

I am just getting into the android MVVM. In my project, I have 3 TextViews that will work as a radio group. In the above image, any of the options will be selected at a time. The XML for this is <data> <variable name="viewModel" type="com.builders.aimsfinance.ui.common.newcandidate.NewCandidateViewModel" /> </data> **** Some XML ***** <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" ..

Read more