viewmodel Questions
1
Solved
I would like my app users to be able to cancel file upload.
My coroutine upload job in ViewModel looks like this
private var uploadImageJob: Job? = null
private val _uploadResult = MutableLiveDat...
5
Solved
I'm working an the second version of an application, and as part of the rewrite I have to move to an MVVM architecture. I'm getting pressure to put absolutely every bit of code in the view model cl...
3
Solved
I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel...
Bocock asked 28/11, 2014 at 5:36
2
Solved
I have a ViewModel class, and a Model class in that.
class WorksheetViewModel {
private Worksheet worksheet;
public Worksheet getWorksheet() {
return worksheet;
}
public void setWorksheet(...
Sussna asked 11/12, 2017 at 9:21
2
I'm having a recyclerview (verticalRV) which scrolls vertically.
Each item in this recyclerview(horizontalRV) is a Horizontal recyclerview.
Inside the verticalRV itemViewHodler im trying to fetch d...
Esmerolda asked 22/2, 2019 at 10:58
1
Solved
Was wondering how someone would deal with this.
I have a fragment that has a respective view model. That view model has an injected repo in its constructor. However when using "by viewModels()" to...
2
I have an app that uses ViewModel and MutableLiveData to bind live data to my UI. After hours westing my time! and review all sample on the internet I couldn't find the reason for the problem.
My...
Angelus asked 20/5, 2018 at 10:3
1
I am trying, without success, to solve a problem for days. I would like to update my recyclerView whenever the records of a particular model change in the Database (DB Room). I use ViewModel to han...
Winegrower asked 1/9, 2017 at 12:16
2
Solved
Instances of the new ViewModel class can survive configuration changes if used in the following fashion:
mViewModel = ViewModelProviders.of(this).get(MyViewModel.class);
However, in addition to ...
Endear asked 30/5, 2017 at 7:36
2
Solved
I am trying to create lifecycle-aware view models. But I can't find ViewModelProviders class in my Android project, only ViewModelProvider. There seems to be no android.arch.lifecycle.ViewModelProv...
3
I want to set the focus in a SearchBox control after do some asynchronous operations, and I would like to do it from my ViewModel.
How could I do this possible?
EDIT
ViewModel code:
private bo...
Grazynagreabe asked 25/8, 2015 at 14:4
4
I have a loginViewModel for my login Activity, in activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="...
Vagrant asked 3/10, 2019 at 8:48
3
Solved
Is there a way to pass data variable to included layout?
parent layout
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ap...
Alarise asked 3/10, 2019 at 8:8
6
I have a ViewModel named SharedViewModel:
public class SharedViewModel<T> extends ViewModel {
private final MutableLiveData<T> selected = new MutableLiveData<>();
public voi...
Realize asked 19/6, 2017 at 22:51
2
Solved
I have a form that is used to create a memo, to do that I am using a rich text editor to provide some styling, this creates html tags in order to apply style. When I post that text, the mvc throws ...
Grider asked 2/9, 2014 at 18:41
1
I am getting this log when I start a fragment after selecting language for the first time, i.e changing Locale and also first time string resources are loaded based on selected language.
E/cr_Vari...
6
Solved
I must preface this with I'm very new to viewmodels. That being said, I want to have a create view with payment and subscription info, like a paytment registration page. I want to update multiple e...
Unmitigated asked 12/12, 2015 at 20:48
18
I mostly being stuck with android data binding BR issue. There is single activity.xml always but generated binding class showing error. Please let me know how to resolve this issue.
Talent asked 26/5, 2018 at 3:15
12
Solved
I have 2 models:
public class Person
{
public int PersonID { get; set; }
public string PersonName { get; set; }
}
public class Order
{
public int OrderID { get; set; }
public int TotalSum { ge...
Nigercongo asked 5/4, 2011 at 10:49
2
Solved
I am working on an Android App using the MVVM pattern along LiveData (possibly Transformations) and DataBinding between View and ViewModel. Since the app is "growing", now ViewModels contain lots o...
1
Solved
I have a data collection of type ObservableCollection (say instance as myClassTypes). After some user operation, this myClassTypes populated with values in ViewModel. In view, there is a TextBox wh...
Miyokomizar asked 15/6, 2019 at 0:34
8
Solved
I have a standard Domain Layer entity:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set;}
}
which has some kind of validat...
Redhanded asked 15/1, 2010 at 22:53
5
Solved
Recently I am exploring Android Architecture, that has been introduced recently by google. From the Documentation I have found this:
public class MyViewModel extends ViewModel {
private MutableLi...
Merriweather asked 26/5, 2017 at 15:15
2
I am currently studying about MVVM architectural pattern but I got confused between Custom ViewModel class that Extends BaseObservable and Another ViewModel which is provided by Android itself.
Profluent asked 10/5, 2018 at 10:14
0
I want to share the same Viewmodel between my base fragment along with opened BottomSheetDialogFragment
So this is how i observe to same viewmodel between these two fragment.
BottomSheetDialogFra...
Spivey asked 7/4, 2019 at 16:40
© 2022 - 2024 — McMap. All rights reserved.