Popup kein leerer input
This commit is contained in:
parent
f4efa3fef5
commit
87e0edf947
@ -17,6 +17,8 @@ import android.support.v4.widget.SwipeRefreshLayout;
|
|||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -250,12 +252,38 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
ImageButton addClose = (ImageButton) customView.findViewById(R.id.addClose);
|
ImageButton addClose = (ImageButton) customView.findViewById(R.id.addClose);
|
||||||
colorBtn = (Button) customView.findViewById(R.id.addColor);
|
colorBtn = (Button) customView.findViewById(R.id.addColor);
|
||||||
Button addFertig = (Button) customView.findViewById(R.id.addFertig);
|
final Button addFertig = (Button) customView.findViewById(R.id.addFertig);
|
||||||
final EditText name = (EditText) customView.findViewById(R.id.addName);
|
final EditText name = (EditText) customView.findViewById(R.id.addName);
|
||||||
final EditText description = (EditText) customView.findViewById(R.id.addDescription);
|
final EditText description = (EditText) customView.findViewById(R.id.addDescription);
|
||||||
|
|
||||||
Picasso.get().load(R.drawable.close).into(addClose);
|
Picasso.get().load(R.drawable.close).into(addClose);
|
||||||
|
|
||||||
|
if(!name.getText().toString().isEmpty()){
|
||||||
|
addFertig.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
addFertig.setEnabled(false);
|
||||||
|
}
|
||||||
|
name.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
if(!name.getText().toString().isEmpty()){
|
||||||
|
addFertig.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
addFertig.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (fromDB) {
|
if (fromDB) {
|
||||||
Shoppinglist dbShoppinglist = db.getShoppinglist(sl_id);
|
Shoppinglist dbShoppinglist = db.getShoppinglist(sl_id);
|
||||||
String colorstring;
|
String colorstring;
|
||||||
@ -498,8 +526,35 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
popupAddShare.dismiss();
|
popupAddShare.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
final Button finish = (Button) popupContentView.findViewById(R.id.shareAddFinish);
|
||||||
|
|
||||||
|
if(!linkEingabe.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
linkEingabe.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
if(!linkEingabe.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Button finish = (Button) popupContentView.findViewById(R.id.shareAddFinish);
|
|
||||||
finish.setOnClickListener(new View.OnClickListener() {
|
finish.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -9,6 +9,8 @@ import android.support.design.widget.FloatingActionButton;
|
|||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -178,7 +180,7 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
ImageButton close = (ImageButton) customView.findViewById(R.id.itemClose);
|
ImageButton close = (ImageButton) customView.findViewById(R.id.itemClose);
|
||||||
final EditText name = (EditText) customView.findViewById(R.id.itemName);
|
final EditText name = (EditText) customView.findViewById(R.id.itemName);
|
||||||
final EditText count = (EditText) customView.findViewById(R.id.itemAnzahl);
|
final EditText count = (EditText) customView.findViewById(R.id.itemAnzahl);
|
||||||
Button finish = (Button) customView.findViewById(R.id.itemFinish);
|
final Button finish = (Button) customView.findViewById(R.id.itemFinish);
|
||||||
|
|
||||||
|
|
||||||
Picasso.get().load(R.drawable.close).into(close);
|
Picasso.get().load(R.drawable.close).into(close);
|
||||||
@ -193,6 +195,34 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
colorString = "ffffff";
|
colorString = "ffffff";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!name.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
TextWatcher tw = new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
if(!name.getText().toString().isEmpty() && !count.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
count.addTextChangedListener(tw);
|
||||||
|
name.addTextChangedListener(tw);
|
||||||
|
|
||||||
finish.setOnClickListener(new View.OnClickListener() {
|
finish.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -9,6 +9,8 @@ import android.support.design.widget.FloatingActionButton;
|
|||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -129,7 +131,7 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
ImageButton close = (ImageButton) customView.findViewById(R.id.groupClose);
|
ImageButton close = (ImageButton) customView.findViewById(R.id.groupClose);
|
||||||
final EditText name = (EditText) customView.findViewById(R.id.groupName);
|
final EditText name = (EditText) customView.findViewById(R.id.groupName);
|
||||||
Button color = (Button) customView.findViewById(R.id.groupColor);
|
Button color = (Button) customView.findViewById(R.id.groupColor);
|
||||||
Button finish = (Button) customView.findViewById(R.id.groupFinish);
|
final Button finish = (Button) customView.findViewById(R.id.groupFinish);
|
||||||
|
|
||||||
this.colorBtn = color;
|
this.colorBtn = color;
|
||||||
|
|
||||||
@ -149,6 +151,32 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
colorString = "ffffff";
|
colorString = "ffffff";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!name.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
name.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
if(!name.getText().toString().isEmpty()){
|
||||||
|
finish.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
finish.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
finish.setOnClickListener(new View.OnClickListener() {
|
finish.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user