<commit_before>package com.camnter.mvvm.view;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

/**
 * Description：MVVMActivity
 * Created by：CaMnter
 */

public abstract class MVVMActivity extends AppCompatActivity {

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (this.getLayoutId() == 0) return;
        ViewDataBinding binding = DataBindingUtil.setContentView(this, this.getLayoutId());
        try {
            this.castingBinding(binding);
            this.onAfterDataBinding(savedInstanceState);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * Fill in layout id
     *
     * @return layout id
     */
    protected abstract int getLayoutId();

    /**
     * @param binding binding
     */
    protected abstract void castingBinding(@NonNull final ViewDataBinding binding);

    /**
     * on after data binding
     *
     * @param savedInstanceState savedInstanceState
     */
    protected abstract void onAfterDataBinding(@NonNull final Bundle savedInstanceState);

}<commit_msg>[Update] MVVMActivity in mvvm module<commit_after>package com.camnter.mvvm.view;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

/**
 * Description：MVVMActivity
 * Created by：CaMnter
 */

public abstract class MVVMActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        this.onBeforeDataBinding(savedInstanceState);
        if (this.getLayoutId() == 0) return;
        try {
            ViewDataBinding binding = DataBindingUtil.setContentView(this, this.getLayoutId());
            // binding success
            this.onCastingBinding(binding);
            // cast success
            this.baseActivityInit();
            this.onAfterDataBinding(savedInstanceState);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    /**
     * Fill in layout id
     *
     * @return layout id
     */
    protected abstract int getLayoutId();

    /**
     * on casting binding
     *
     * @param binding binding
     */
    protected abstract void onCastingBinding(@NonNull final ViewDataBinding binding);


    /**
     * on before data binding
     *
     * @param savedInstanceState savedInstanceState
     */
    protected void onBeforeDataBinding(@NonNull final Bundle savedInstanceState) {
        // Nothing to do
    }


    /**
     * baseActivity init
     */
    protected void baseActivityInit() {
        // Nothing to do
    }


    /**
     * on after data binding
     *
     * @param savedInstanceState savedInstanceState
     */
    protected abstract void onAfterDataBinding(@NonNull final Bundle savedInstanceState);

}
{'fraction_non_alphanumeric': 0.0888030888030888, 'fraction_numerical': 0.001287001287001287, 'mean_word_length': 2.7322929171668666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4635599', 'n_tokens_mistral': 838, 'n_tokens_neox': 790, 'n_words': 191}