/* * Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://mindorks.com/license/apache-v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.mindorks.framework.mvvm.ui.about; import android.arch.lifecycle.ViewModelProviders; import android.os.Bundle; import android.support.annotation.Nullable; import com.mindorks.framework.mvvm.BR; import com.mindorks.framework.mvvm.R; import com.mindorks.framework.mvvm.ViewModelProviderFactory; import com.mindorks.framework.mvvm.databinding.FragmentAboutBinding; import com.mindorks.framework.mvvm.ui.base.BaseFragment; import javax.inject.Inject; /** * Created by amitshekhar on 09/07/17. */ public class AboutFragment extends BaseFragment implements AboutNavigator { public static final String TAG = AboutFragment.class.getSimpleName(); @Inject ViewModelProviderFactory factory; private AboutViewModel mAboutViewModel; public static AboutFragment newInstance() { Bundle args = new Bundle(); AboutFragment fragment = new AboutFragment(); fragment.setArguments(args); return fragment; } @Override public int getBindingVariable() { return BR.viewModel; } @Override public int getLayoutId() { return R.layout.fragment_about; } @Override public AboutViewModel getViewModel() { mAboutViewModel = ViewModelProviders.of(this, factory).get(AboutViewModel.class); return mAboutViewModel; } @Override public void goBack() { getBaseActivity().onFragmentDetached(TAG); } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAboutViewModel.setNavigator(this); } }