-Add the new buttons push animation to the buttons in the activity_licence.xml and java source

This commit is contained in:
dtvv 2018-10-12 03:04:07 -05:00
parent 24dba53c5f
commit 074e37076d

View file

@ -4,7 +4,11 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import com.thekhaeng.pushdownanim.PushDownAnim;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -20,8 +24,17 @@ public class LicenseActivity extends AppCompatActivity {
@BindView(R.id.wvEULA) WebView wvEULA;
@BindView(R.id.btnDisAgree)
Button btnDisAgree;
@BindView(R.id.btnAgree)
Button btnAgree;
CrystalDatabase db;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -29,6 +42,24 @@ public class LicenseActivity extends AppCompatActivity {
ButterKnife.bind(this);
/*
* Integration of library with button efects
* */
PushDownAnim.setPushDownAnimTo(btnDisAgree)
.setOnClickListener( new View.OnClickListener(){
@Override
public void onClick( View view ){
onDisagree();
}
} );
PushDownAnim.setPushDownAnimTo(btnAgree)
.setOnClickListener( new View.OnClickListener(){
@Override
public void onClick( View view ){
onAgree();
}
} );
db = CrystalDatabase.getAppDatabase(this.getApplicationContext());
int licenseVersion = getResources().getInteger(R.integer.license_version);
GeneralSetting generalSettingLastLicenseRead = db.generalSettingDao().getSettingByName(GeneralSetting.SETTING_LAST_LICENSE_READ);