Created
January 17, 2018 22:00
-
-
Save anonymous/c6073dd0282cb3c736bcf6dd7df1e103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.cris.zeiterfassungv2; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.widget.EditText; | |
public class newRowTextWatcher implements TextWatcher { | |
MainActivity ze; | |
public newRowTextWatcher(MainActivity Zeiterfassung) { | |
ze = Zeiterfassung; | |
} | |
@Override | |
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | |
} | |
@Override | |
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) | |
{ | |
} | |
@Override | |
public void afterTextChanged(Editable editable) { | |
EditText txt1 = (EditText) ze.lastRow.getChildAt(0); | |
EditText txt2 = (EditText) ze.lastRow.getChildAt(1); | |
EditText txt3 = (EditText) ze.lastRow.getChildAt(2); | |
EditText txt4 = (EditText) ze.lastRow.getChildAt(3); | |
EditText txt5 = (EditText) ze.lastRow.getChildAt(4); | |
EditText txt6 = (EditText) ze.lastRow.getChildAt(5); | |
EditText txt7 = (EditText) ze.lastRow.getChildAt(6); | |
if (txt1.getText().toString().equals("") && | |
txt2.getText().toString().equals("") && | |
txt3.getText().toString().equals("") && | |
txt4.getText().toString().equals("") && | |
txt5.getText().toString().equals("") && | |
txt6.getText().toString().equals("") && | |
txt7.getText().toString().equals("")) | |
{ | |
return; | |
} | |
else | |
ze.AddRow(); | |
}} | |
/* if(txt1.getText().toString().equals("")) | |
{ | |
if(txt2.getText().toString().equals("")) | |
{ | |
if(txt3.getText().toString().equals("")) | |
{ | |
if(txt4.getText().toString().equals("")) | |
{ | |
if(txt5.getText().toString().equals("")) | |
{ | |
if(txt6.getText().toString().equals("")) | |
{ | |
if(txt7.getText().toString().equals("")) | |
{ | |
return; | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
else | |
ze.AddRow(); | |
} | |
}*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment