Adds views for dashboard.
This commit is contained in:
@@ -4,7 +4,6 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
@@ -13,15 +12,21 @@ import com.majinnaibu.monstercards.R;
|
||||
import com.majinnaibu.monstercards.ui.shared.MCFragment;
|
||||
|
||||
public class DashboardFragment extends MCFragment {
|
||||
|
||||
private ViewHolder mHolder;
|
||||
private DashboardViewModel dashboardViewModel;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
dashboardViewModel = new ViewModelProvider(this).get(DashboardViewModel.class);
|
||||
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
|
||||
final TextView textView = root.findViewById(R.id.text_dashboard);
|
||||
dashboardViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||
mHolder = new ViewHolder(root);
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
||||
|
||||
private static class ViewHolder {
|
||||
ViewHolder(View root) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user