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 ..
Category : mvvm
**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 = ..
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, ..
In the small app I’m developing I want the users to have the option to turn automatic updates on and off. So that when activated, the data in the repository is updated every, lets say, 1 hour. And if turned off, the data will refresh only when the users open the app, and at least ..
I am a beginner in MVVM and LiveData architecture, so I am having some difficulties in solving my problem. I have a LoginActivity where I have two fields (username and password) and I click the Login button to make a request to the TMDB API. In this activity I have an observer when I receive ..
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 ..
I have created a database with ROOM where I verify if the username and password are registered in it, I would like to know if there is any redundancy or what suggestion you could give me. //Dao @Dao interface UserDao { @Query("SELECT * FROM user_table WHERE userName = :name AND password =:password") fun readAllData(name: String, ..
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 = ..
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" ..
I am new to mvvm architecture and jetpack navigation. I am trying to get list of blog from firestore in my application. But while screen orientation,It is not maintaining its state. it is creating new call to firebase. Please help me with this and Is it not good practice to use mvvm this way. I ..
Recent Comments