Code und Imports Optimierung
This commit is contained in:
parent
f719fe1326
commit
42ffa7cadb
@ -7,7 +7,7 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instrumented test, which will execute on an Android device.
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
package at.smartshopper.smartshopper.activitys;
|
package at.smartshopper.smartshopper.activitys;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
@ -11,8 +11,6 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.support.design.widget.TabLayout;
|
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
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;
|
||||||
@ -29,9 +27,6 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.R;
|
|
||||||
|
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
import android.widget.TabHost;
|
import android.widget.TabHost;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -43,22 +38,14 @@ import com.google.firebase.auth.FirebaseAuth;
|
|||||||
import com.google.firebase.auth.FirebaseUser;
|
import com.google.firebase.auth.FirebaseUser;
|
||||||
import com.google.firebase.iid.FirebaseInstanceId;
|
import com.google.firebase.iid.FirebaseInstanceId;
|
||||||
import com.google.firebase.iid.InstanceIdResult;
|
import com.google.firebase.iid.InstanceIdResult;
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.w3c.dom.Text;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.customViews.SpaceItemDecoration;
|
|
||||||
import at.smartshopper.smartshopper.db.Database;
|
import at.smartshopper.smartshopper.db.Database;
|
||||||
import at.smartshopper.smartshopper.shoppinglist.Shoppinglist;
|
import at.smartshopper.smartshopper.shoppinglist.Shoppinglist;
|
||||||
import at.smartshopper.smartshopper.shoppinglist.ShoppinglistAdapter;
|
import at.smartshopper.smartshopper.shoppinglist.ShoppinglistAdapter;
|
||||||
@ -73,6 +60,18 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
private PopupWindow popupWindowAdd, popupShare, popupAddShare, popupEditShare;
|
private PopupWindow popupWindowAdd, popupShare, popupAddShare, popupEditShare;
|
||||||
private String color;
|
private String color;
|
||||||
private Button colorBtn;
|
private Button colorBtn;
|
||||||
|
//Für Double Back press to exit
|
||||||
|
private boolean doubleBackToExitPressedOnce = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convertiert eine int farbe in eine hexa dezimale Farbe
|
||||||
|
*
|
||||||
|
* @param color Farbe zum umwandeln in int
|
||||||
|
* @return farbe als hex im string
|
||||||
|
*/
|
||||||
|
private static String colorToHexString(int color) {
|
||||||
|
return String.format("#%06X", 0xFFFFFFFF & color);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setzt das atribut color wenn die activity colorpicker beendet wird
|
* Setzt das atribut color wenn die activity colorpicker beendet wird
|
||||||
@ -91,18 +90,17 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt den msg token
|
* Holt den msg token
|
||||||
*
|
* <p>
|
||||||
* SETZT IHN NOCH NED
|
* SETZT IHN NOCH NED
|
||||||
*
|
* <p>
|
||||||
*
|
* <p>
|
||||||
* WEITER PROGRAMMIERN
|
* WEITER PROGRAMMIERN
|
||||||
*
|
* <p>
|
||||||
* MIR FEHLT NOCH DIE DB VON LUKAS
|
* MIR FEHLT NOCH DIE DB VON LUKAS
|
||||||
*/
|
*/
|
||||||
private void setMsgId(){
|
private void setMsgId() {
|
||||||
FirebaseInstanceId.getInstance().getInstanceId()
|
FirebaseInstanceId.getInstance().getInstanceId()
|
||||||
.addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
|
.addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
|
||||||
@Override
|
@Override
|
||||||
@ -126,17 +124,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Convertiert eine int farbe in eine hexa dezimale Farbe
|
|
||||||
*
|
|
||||||
* @param color Farbe zum umwandeln in int
|
|
||||||
* @return farbe als hex im string
|
|
||||||
*/
|
|
||||||
private static String colorToHexString(int color) {
|
|
||||||
return String.format("#%06X", 0xFFFFFFFF & color);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -258,9 +245,9 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
Picasso.get().load(R.drawable.close).into(addClose);
|
Picasso.get().load(R.drawable.close).into(addClose);
|
||||||
|
|
||||||
if(!name.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty()) {
|
||||||
addFertig.setEnabled(true);
|
addFertig.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
addFertig.setEnabled(false);
|
addFertig.setEnabled(false);
|
||||||
}
|
}
|
||||||
name.addTextChangedListener(new TextWatcher() {
|
name.addTextChangedListener(new TextWatcher() {
|
||||||
@ -276,9 +263,9 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
if(!name.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty()) {
|
||||||
addFertig.setEnabled(true);
|
addFertig.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
addFertig.setEnabled(false);
|
addFertig.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -401,7 +388,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
ownswiperefresh.setRefreshing(false);
|
ownswiperefresh.setRefreshing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macht eine Datenbankverbindung und holt alle Shoppinglists die mit dem User geteilt werden, diese werden auf dem recycled view angezeigt
|
* Macht eine Datenbankverbindung und holt alle Shoppinglists die mit dem User geteilt werden, diese werden auf dem recycled view angezeigt
|
||||||
*
|
*
|
||||||
@ -472,7 +458,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
@ -480,7 +465,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu item Action listener
|
* Menu item Action listener
|
||||||
*
|
*
|
||||||
@ -528,9 +512,9 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
});
|
});
|
||||||
final Button finish = (Button) popupContentView.findViewById(R.id.shareAddFinish);
|
final Button finish = (Button) popupContentView.findViewById(R.id.shareAddFinish);
|
||||||
|
|
||||||
if(!linkEingabe.getText().toString().isEmpty()){
|
if (!linkEingabe.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
linkEingabe.addTextChangedListener(new TextWatcher() {
|
linkEingabe.addTextChangedListener(new TextWatcher() {
|
||||||
@ -546,9 +530,9 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
if(!linkEingabe.getText().toString().isEmpty()){
|
if (!linkEingabe.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,7 +545,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
String invite = linkEingabe.getText().toString();
|
String invite = linkEingabe.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db.addInviteLink(invite, FirebaseAuth.getInstance().getCurrentUser().getUid());
|
db.addInviteLink(invite, FirebaseAuth.getInstance().getCurrentUser().getUid());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@ -602,10 +585,6 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
popupAddShare.update();
|
popupAddShare.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Für Double Back press to exit
|
|
||||||
private boolean doubleBackToExitPressedOnce = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 Mal Zurück Drücken um die App zu schließen
|
* 2 Mal Zurück Drücken um die App zu schließen
|
||||||
*/
|
*/
|
||||||
@ -635,7 +614,7 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
*
|
*
|
||||||
* @param sl_id Die Shoppingliste dieser Id wird gelöscht
|
* @param sl_id Die Shoppingliste dieser Id wird gelöscht
|
||||||
*/
|
*/
|
||||||
private void onItemClickContainer(String sl_id){
|
private void onItemClickContainer(String sl_id) {
|
||||||
try {
|
try {
|
||||||
db.delShoppinglist(sl_id);
|
db.delShoppinglist(sl_id);
|
||||||
refreshOwnShoppinglist(FirebaseAuth.getInstance().getCurrentUser().getUid());
|
refreshOwnShoppinglist(FirebaseAuth.getInstance().getCurrentUser().getUid());
|
||||||
@ -649,7 +628,7 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
*
|
*
|
||||||
* @param sl_id Die Shoppinglist die bearbeitet werden soll
|
* @param sl_id Die Shoppinglist die bearbeitet werden soll
|
||||||
*/
|
*/
|
||||||
private void onChangeItemClickContainer(String sl_id, View v){
|
private void onChangeItemClickContainer(String sl_id, View v) {
|
||||||
try {
|
try {
|
||||||
showShoppinglistEditView(true, sl_id, "Shoppingliste bearbeiten", v);
|
showShoppinglistEditView(true, sl_id, "Shoppingliste bearbeiten", v);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@ -659,7 +638,7 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onShoppinglistClickContainer(String sl_id, View v){
|
private void onShoppinglistClickContainer(String sl_id, View v) {
|
||||||
Intent intent = new Intent(this, ShoppinglistDetails.class);
|
Intent intent = new Intent(this, ShoppinglistDetails.class);
|
||||||
intent.putExtra("sl_id", sl_id);
|
intent.putExtra("sl_id", sl_id);
|
||||||
|
|
||||||
@ -688,10 +667,11 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt den Invitelink einer Shoppingliste
|
* Holt den Invitelink einer Shoppingliste
|
||||||
|
*
|
||||||
* @param sl_id Die Shoppingliste von der der invitelink gewünscht ist
|
* @param sl_id Die Shoppingliste von der der invitelink gewünscht ist
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getInviteLink(String sl_id){
|
private String getInviteLink(String sl_id) {
|
||||||
String link = null;
|
String link = null;
|
||||||
try {
|
try {
|
||||||
if (db.isShared(sl_id)) {
|
if (db.isShared(sl_id)) {
|
||||||
@ -781,9 +761,10 @@ public class Dash extends AppCompatActivity implements ShoppinglistAdapter.OnIte
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Kopiert einen Text in die Zwischenablage
|
* Kopiert einen Text in die Zwischenablage
|
||||||
|
*
|
||||||
* @param text Der Text, welcher zu kopieren ist
|
* @param text Der Text, welcher zu kopieren ist
|
||||||
*/
|
*/
|
||||||
private void copyText(String text){
|
private void copyText(String text) {
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
ClipData clip = ClipData.newPlainText("SmartShopper", text);
|
ClipData clip = ClipData.newPlainText("SmartShopper", text);
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package at.smartshopper.smartshopper.activitys;
|
package at.smartshopper.smartshopper.activitys;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
|
||||||
@ -14,8 +14,6 @@ import java.util.List;
|
|||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.customViews.SpaceItemDecoration;
|
import at.smartshopper.smartshopper.customViews.SpaceItemDecoration;
|
||||||
import at.smartshopper.smartshopper.db.Database;
|
import at.smartshopper.smartshopper.db.Database;
|
||||||
import at.smartshopper.smartshopper.shoppinglist.Shoppinglist;
|
|
||||||
import at.smartshopper.smartshopper.shoppinglist.ShoppinglistSharedAdapter;
|
|
||||||
import at.smartshopper.smartshopper.shoppinglist.details.item.Item;
|
import at.smartshopper.smartshopper.shoppinglist.details.item.Item;
|
||||||
import at.smartshopper.smartshopper.shoppinglist.details.item.ItemShoppinglistDetailsAdapter;
|
import at.smartshopper.smartshopper.shoppinglist.details.item.ItemShoppinglistDetailsAdapter;
|
||||||
|
|
||||||
@ -58,6 +56,7 @@ public class DoneItemActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Zeigt alle erledigten Items an
|
* Zeigt alle erledigten Items an
|
||||||
|
*
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
*/
|
*/
|
||||||
@ -68,7 +67,7 @@ public class DoneItemActivity extends AppCompatActivity {
|
|||||||
RecyclerView.ItemDecoration itemDecoration;
|
RecyclerView.ItemDecoration itemDecoration;
|
||||||
|
|
||||||
while (doneRecycle.getItemDecorationCount() > 0
|
while (doneRecycle.getItemDecorationCount() > 0
|
||||||
&&(itemDecoration = doneRecycle.getItemDecorationAt(0)) != null) {
|
&& (itemDecoration = doneRecycle.getItemDecorationAt(0)) != null) {
|
||||||
doneRecycle.removeItemDecoration(itemDecoration);
|
doneRecycle.removeItemDecoration(itemDecoration);
|
||||||
}
|
}
|
||||||
doneRecycle.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
doneRecycle.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
||||||
|
@ -58,7 +58,7 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
this.groupNameString = myIntent.getStringExtra("groupNameString"); // will return "SecondKeyValue"
|
this.groupNameString = myIntent.getStringExtra("groupNameString"); // will return "SecondKeyValue"
|
||||||
this.db = new Database();
|
this.db = new Database();
|
||||||
|
|
||||||
this.groupName = (TextView)findViewById(R.id.groupViewName);
|
this.groupName = (TextView) findViewById(R.id.groupViewName);
|
||||||
this.groupName.setText(groupNameString);
|
this.groupName.setText(groupNameString);
|
||||||
|
|
||||||
this.colorView = (View) findViewById(R.id.itemListColorView);
|
this.colorView = (View) findViewById(R.id.itemListColorView);
|
||||||
@ -86,7 +86,7 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fabAddItem = (FloatingActionButton)findViewById(R.id.fabItemAdd);
|
this.fabAddItem = (FloatingActionButton) findViewById(R.id.fabItemAdd);
|
||||||
|
|
||||||
fabAddItem.setOnClickListener(new View.OnClickListener() {
|
fabAddItem.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -119,7 +119,7 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
RecyclerView.ItemDecoration itemDecoration;
|
RecyclerView.ItemDecoration itemDecoration;
|
||||||
|
|
||||||
while (itemsListRecycler.getItemDecorationCount() > 0
|
while (itemsListRecycler.getItemDecorationCount() > 0
|
||||||
&&(itemDecoration = itemsListRecycler.getItemDecorationAt(0)) != null) {
|
&& (itemDecoration = itemsListRecycler.getItemDecorationAt(0)) != null) {
|
||||||
itemsListRecycler.removeItemDecoration(itemDecoration);
|
itemsListRecycler.removeItemDecoration(itemDecoration);
|
||||||
}
|
}
|
||||||
itemsListRecycler.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
itemsListRecycler.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
||||||
@ -195,9 +195,9 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
colorString = "ffffff";
|
colorString = "ffffff";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!name.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
TextWatcher tw = new TextWatcher() {
|
TextWatcher tw = new TextWatcher() {
|
||||||
@ -213,9 +213,9 @@ public class ItemListActivity extends Activity implements ItemAdapter.OnItemEdit
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
if(!name.getText().toString().isEmpty() && !count.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty() && !count.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package at.smartshopper.smartshopper.activitys;
|
package at.smartshopper.smartshopper.activitys;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -27,9 +27,6 @@ import com.google.firebase.auth.FirebaseUser;
|
|||||||
import com.google.firebase.auth.GoogleAuthProvider;
|
import com.google.firebase.auth.GoogleAuthProvider;
|
||||||
import com.google.firebase.iid.FirebaseInstanceId;
|
import com.google.firebase.iid.FirebaseInstanceId;
|
||||||
import com.google.firebase.iid.InstanceIdResult;
|
import com.google.firebase.iid.InstanceIdResult;
|
||||||
import com.google.firebase.messaging.FirebaseMessaging;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
@ -40,11 +37,12 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private static final String TAG = "SMASH";
|
private static final String TAG = "SMASH";
|
||||||
private static final int RC_SIGN_IN = 1;
|
private static final int RC_SIGN_IN = 1;
|
||||||
private FirebaseAuth mAuth;
|
|
||||||
private Database db;
|
|
||||||
|
|
||||||
SignInButton button;
|
SignInButton button;
|
||||||
GoogleSignInClient mGoogleSignInClient;
|
GoogleSignInClient mGoogleSignInClient;
|
||||||
|
private FirebaseAuth mAuth;
|
||||||
|
private Database db;
|
||||||
|
//Für Double Back press to exit
|
||||||
|
private boolean doubleBackToExitPressedOnce = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
@ -142,7 +140,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erstellt einen Account mit Email und Passwort
|
* Erstellt einen Account mit Email und Passwort
|
||||||
*
|
*
|
||||||
@ -170,7 +167,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -244,7 +240,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prüft ob der User bereits eingelogt ist. Wenn ja, wird er auf die Dash Activity weitergeleitet
|
* Prüft ob der User bereits eingelogt ist. Wenn ja, wird er auf die Dash Activity weitergeleitet
|
||||||
*/
|
*/
|
||||||
@ -259,9 +254,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Für Double Back press to exit
|
|
||||||
private boolean doubleBackToExitPressedOnce = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 Mal Zurück Drücken um die App zu schließen
|
* 2 Mal Zurück Drücken um die App zu schließen
|
||||||
*/
|
*/
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package at.smartshopper.smartshopper.activitys;
|
package at.smartshopper.smartshopper.activitys;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Activity;
|
|
||||||
import android.support.design.widget.FloatingActionButton;
|
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;
|
||||||
@ -22,14 +22,10 @@ import android.widget.PopupWindow;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.firebase.auth.FirebaseAuth;
|
import com.google.firebase.auth.FirebaseAuth;
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -50,6 +46,16 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
private Button colorBtn;
|
private Button colorBtn;
|
||||||
private SwipeRefreshLayout detailsSwiperefresh;
|
private SwipeRefreshLayout detailsSwiperefresh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convertiert eine int farbe in eine hexa dezimale Farbe
|
||||||
|
*
|
||||||
|
* @param color Farbe zum umwandeln in int
|
||||||
|
* @return farbe als hex im string
|
||||||
|
*/
|
||||||
|
private static String colorToHexString(int color) {
|
||||||
|
return String.format("#%06X", 0xFFFFFFFF & color);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -110,7 +116,6 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zeigt ein Popup zum bearbeiten und erstellen von groups
|
* Zeigt ein Popup zum bearbeiten und erstellen von groups
|
||||||
* Wenn from db true ist wird die groupid benötigt
|
* Wenn from db true ist wird die groupid benötigt
|
||||||
@ -151,9 +156,9 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
colorString = "ffffff";
|
colorString = "ffffff";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!name.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
name.addTextChangedListener(new TextWatcher() {
|
name.addTextChangedListener(new TextWatcher() {
|
||||||
@ -169,9 +174,9 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
if(!name.getText().toString().isEmpty()){
|
if (!name.getText().toString().isEmpty()) {
|
||||||
finish.setEnabled(true);
|
finish.setEnabled(true);
|
||||||
}else{
|
} else {
|
||||||
finish.setEnabled(false);
|
finish.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,16 +269,6 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Convertiert eine int farbe in eine hexa dezimale Farbe
|
|
||||||
*
|
|
||||||
* @param color Farbe zum umwandeln in int
|
|
||||||
* @return farbe als hex im string
|
|
||||||
*/
|
|
||||||
private static String colorToHexString(int color) {
|
|
||||||
return String.format("#%06X", 0xFFFFFFFF & color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zeigt das Card View der Shoppinglist Details an
|
* Zeigt das Card View der Shoppinglist Details an
|
||||||
*
|
*
|
||||||
@ -287,7 +282,7 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
|
|||||||
RecyclerView.ItemDecoration itemDecoration;
|
RecyclerView.ItemDecoration itemDecoration;
|
||||||
|
|
||||||
while (detailsRecycleView.getItemDecorationCount() > 0
|
while (detailsRecycleView.getItemDecorationCount() > 0
|
||||||
&&(itemDecoration = detailsRecycleView.getItemDecorationAt(0)) != null) {
|
&& (itemDecoration = detailsRecycleView.getItemDecorationAt(0)) != null) {
|
||||||
detailsRecycleView.removeItemDecoration(itemDecoration);
|
detailsRecycleView.removeItemDecoration(itemDecoration);
|
||||||
}
|
}
|
||||||
detailsRecycleView.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
detailsRecycleView.addItemDecoration(new SpaceItemDecoration(spacingInPixels));
|
||||||
|
@ -37,9 +37,9 @@ public class RoundCornersTransformation implements com.squareup.picasso.Transfor
|
|||||||
/**
|
/**
|
||||||
* Creates rounded transformation for top or bottom corners.
|
* Creates rounded transformation for top or bottom corners.
|
||||||
*
|
*
|
||||||
* @param radius radius is corner radii in dp
|
* @param radius radius is corner radii in dp
|
||||||
* @param margin margin is the board in dp
|
* @param margin margin is the board in dp
|
||||||
* @param topCornersOnly Rounded corner for top corners only.
|
* @param topCornersOnly Rounded corner for top corners only.
|
||||||
* @param bottomCornersOnly Rounded corner for bottom corners only.
|
* @param bottomCornersOnly Rounded corner for bottom corners only.
|
||||||
*/
|
*/
|
||||||
public RoundCornersTransformation(final int radius, final int margin, boolean topCornersOnly,
|
public RoundCornersTransformation(final int radius, final int margin, boolean topCornersOnly,
|
||||||
@ -50,49 +50,16 @@ public class RoundCornersTransformation implements com.squareup.picasso.Transfor
|
|||||||
KEY = "rounded_" + radius + margin + topCorners + bottomCorners;
|
KEY = "rounded_" + radius + margin + topCorners + bottomCorners;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Bitmap transform(final Bitmap source) {
|
|
||||||
final Paint paint = new Paint();
|
|
||||||
paint.setAntiAlias(true);
|
|
||||||
paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
|
|
||||||
|
|
||||||
Bitmap output = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Config.ARGB_8888);
|
|
||||||
Canvas canvas = new Canvas(output);
|
|
||||||
if(topCorners && bottomCorners) {
|
|
||||||
// Uses native method to draw symmetric rounded corners
|
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, source.getWidth() - margin,
|
|
||||||
source.getHeight() - margin), radius, radius, paint);
|
|
||||||
} else {
|
|
||||||
// Uses custom path to generate rounded corner individually
|
|
||||||
canvas.drawPath(RoundedRect(margin, margin, source.getWidth() - margin,
|
|
||||||
source.getHeight() - margin, radius, radius, topCorners, topCorners,
|
|
||||||
bottomCorners, bottomCorners), paint);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (source != output) {
|
|
||||||
source.recycle();
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String key() {
|
|
||||||
return "rounded_" + radius + margin;
|
|
||||||
// return KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares a path for rounded corner selectively.
|
* Prepares a path for rounded corner selectively.
|
||||||
* Source taken from http://stackoverflow.com/a/35668889/6635889
|
* Source taken from http://stackoverflow.com/a/35668889/6635889
|
||||||
* @param leftX The X coordinate of the left side of the rectangle
|
*
|
||||||
* @param topY The Y coordinate of the top of the rectangle
|
* @param leftX The X coordinate of the left side of the rectangle
|
||||||
* @param rightX The X coordinate of the right side of the rectangle
|
* @param topY The Y coordinate of the top of the rectangle
|
||||||
* @param bottomY The Y coordinate of the bottom of the rectangle
|
* @param rightX The X coordinate of the right side of the rectangle
|
||||||
* @param rx The x-radius of the oval used to round the corners
|
* @param bottomY The Y coordinate of the bottom of the rectangle
|
||||||
* @param ry The y-radius of the oval used to round the corners
|
* @param rx The x-radius of the oval used to round the corners
|
||||||
|
* @param ry The y-radius of the oval used to round the corners
|
||||||
* @param topLeft
|
* @param topLeft
|
||||||
* @param topRight
|
* @param topRight
|
||||||
* @param bottomRight
|
* @param bottomRight
|
||||||
@ -115,31 +82,31 @@ public class RoundCornersTransformation implements com.squareup.picasso.Transfor
|
|||||||
path.moveTo(rightX, topY + ry);
|
path.moveTo(rightX, topY + ry);
|
||||||
if (topRight)
|
if (topRight)
|
||||||
path.rQuadTo(0, -ry, -rx, -ry);//top-right corner
|
path.rQuadTo(0, -ry, -rx, -ry);//top-right corner
|
||||||
else{
|
else {
|
||||||
path.rLineTo(0, -ry);
|
path.rLineTo(0, -ry);
|
||||||
path.rLineTo(-rx,0);
|
path.rLineTo(-rx, 0);
|
||||||
}
|
}
|
||||||
path.rLineTo(-widthMinusCorners, 0);
|
path.rLineTo(-widthMinusCorners, 0);
|
||||||
if (topLeft)
|
if (topLeft)
|
||||||
path.rQuadTo(-rx, 0, -rx, ry); //top-left corner
|
path.rQuadTo(-rx, 0, -rx, ry); //top-left corner
|
||||||
else{
|
else {
|
||||||
path.rLineTo(-rx, 0);
|
path.rLineTo(-rx, 0);
|
||||||
path.rLineTo(0,ry);
|
path.rLineTo(0, ry);
|
||||||
}
|
}
|
||||||
path.rLineTo(0, heightMinusCorners);
|
path.rLineTo(0, heightMinusCorners);
|
||||||
|
|
||||||
if (bottomLeft)
|
if (bottomLeft)
|
||||||
path.rQuadTo(0, ry, rx, ry);//bottom-left corner
|
path.rQuadTo(0, ry, rx, ry);//bottom-left corner
|
||||||
else{
|
else {
|
||||||
path.rLineTo(0, ry);
|
path.rLineTo(0, ry);
|
||||||
path.rLineTo(rx,0);
|
path.rLineTo(rx, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
path.rLineTo(widthMinusCorners, 0);
|
path.rLineTo(widthMinusCorners, 0);
|
||||||
if (bottomRight)
|
if (bottomRight)
|
||||||
path.rQuadTo(rx, 0, rx, -ry); //bottom-right corner
|
path.rQuadTo(rx, 0, rx, -ry); //bottom-right corner
|
||||||
else{
|
else {
|
||||||
path.rLineTo(rx,0);
|
path.rLineTo(rx, 0);
|
||||||
path.rLineTo(0, -ry);
|
path.rLineTo(0, -ry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,4 +116,37 @@ public class RoundCornersTransformation implements com.squareup.picasso.Transfor
|
|||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bitmap transform(final Bitmap source) {
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
|
||||||
|
|
||||||
|
Bitmap output = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(output);
|
||||||
|
if (topCorners && bottomCorners) {
|
||||||
|
// Uses native method to draw symmetric rounded corners
|
||||||
|
canvas.drawRoundRect(new RectF(margin, margin, source.getWidth() - margin,
|
||||||
|
source.getHeight() - margin), radius, radius, paint);
|
||||||
|
} else {
|
||||||
|
// Uses custom path to generate rounded corner individually
|
||||||
|
canvas.drawPath(RoundedRect(margin, margin, source.getWidth() - margin,
|
||||||
|
source.getHeight() - margin, radius, radius, topCorners, topCorners,
|
||||||
|
bottomCorners, bottomCorners), paint);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (source != output) {
|
||||||
|
source.recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String key() {
|
||||||
|
return "rounded_" + radius + margin;
|
||||||
|
// return KEY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
package at.smartshopper.smartshopper.db;
|
package at.smartshopper.smartshopper.db;
|
||||||
|
|
||||||
import android.os.StrictMode;
|
import android.os.StrictMode;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.google.firebase.auth.FirebaseAuth;
|
import com.google.firebase.auth.FirebaseAuth;
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.shoppinglist.Member;
|
import at.smartshopper.smartshopper.shoppinglist.Member;
|
||||||
@ -29,7 +23,6 @@ import at.smartshopper.smartshopper.shoppinglist.details.item.Item;
|
|||||||
|
|
||||||
public class Database {
|
public class Database {
|
||||||
|
|
||||||
private transient Connection conect;
|
|
||||||
final private String HOST = "188.166.124.80";
|
final private String HOST = "188.166.124.80";
|
||||||
final private String DB_NAME = "smartshopperdb";
|
final private String DB_NAME = "smartshopperdb";
|
||||||
final private String USERNAME = "smartshopper-user";
|
final private String USERNAME = "smartshopper-user";
|
||||||
@ -39,6 +32,7 @@ public class Database {
|
|||||||
final private int groupIdLength = 10;
|
final private int groupIdLength = 10;
|
||||||
final private int itemIdLength = 10;
|
final private int itemIdLength = 10;
|
||||||
final private int inviteLength = 50;
|
final private int inviteLength = 50;
|
||||||
|
private transient Connection conect;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,7 +105,7 @@ public class Database {
|
|||||||
String SQL = "SELECT row_to_json(\"User\") as obj FROM \"User\" JOIN \"Shoppinglist_member\" USING (username) WHERE sl_id = ?";
|
String SQL = "SELECT row_to_json(\"User\") as obj FROM \"User\" JOIN \"Shoppinglist_member\" USING (username) WHERE sl_id = ?";
|
||||||
ArrayList<Member> members = new ArrayList();
|
ArrayList<Member> members = new ArrayList();
|
||||||
List<JSONObject> jsonObjects = executeQueryJSONObject(SQL, sl_id);
|
List<JSONObject> jsonObjects = executeQueryJSONObject(SQL, sl_id);
|
||||||
for(int i = 0; i < jsonObjects.size(); i++){
|
for (int i = 0; i < jsonObjects.size(); i++) {
|
||||||
JSONObject jsonObject = jsonObjects.get(i);
|
JSONObject jsonObject = jsonObjects.get(i);
|
||||||
members.add(new Member(jsonObject.getString("username"), jsonObject.getString("message_id"), jsonObject.getString("name"), jsonObject.getString("picture"), jsonObject.getString("email")));
|
members.add(new Member(jsonObject.getString("username"), jsonObject.getString("message_id"), jsonObject.getString("name"), jsonObject.getString("picture"), jsonObject.getString("email")));
|
||||||
}
|
}
|
||||||
@ -133,6 +127,7 @@ public class Database {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stopt eine Einladung, indem der Member die liste nichtmehr sehen kann
|
* Stopt eine Einladung, indem der Member die liste nichtmehr sehen kann
|
||||||
|
*
|
||||||
* @param invitelink Der invitelink
|
* @param invitelink Der invitelink
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
@ -143,7 +138,7 @@ public class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getinviteFromLink(String eingabeLink){
|
private String getinviteFromLink(String eingabeLink) {
|
||||||
String delString = null;
|
String delString = null;
|
||||||
if (eingabeLink.contains("https://")) {
|
if (eingabeLink.contains("https://")) {
|
||||||
delString = "https://www.smartshopper.cf/invite/";
|
delString = "https://www.smartshopper.cf/invite/";
|
||||||
@ -158,6 +153,7 @@ public class Database {
|
|||||||
|
|
||||||
return invite;
|
return invite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gibt den Invite link einer Shoppingliste zurück, wenn keiner vorhanden ist --> null
|
* Gibt den Invite link einer Shoppingliste zurück, wenn keiner vorhanden ist --> null
|
||||||
*
|
*
|
||||||
@ -227,7 +223,7 @@ public class Database {
|
|||||||
String SQL = "SELECT row_to_json(\"Shoppinglist\") AS obj FROM \"Shoppinglist\" WHERE sl_id = ?";
|
String SQL = "SELECT row_to_json(\"Shoppinglist\") AS obj FROM \"Shoppinglist\" WHERE sl_id = ?";
|
||||||
boolean returnBoolean = false;
|
boolean returnBoolean = false;
|
||||||
List<JSONObject> jsonObjects = executeQueryJSONObject(SQL, sl_id);
|
List<JSONObject> jsonObjects = executeQueryJSONObject(SQL, sl_id);
|
||||||
for(int i = 0; i < jsonObjects.size(); i++){
|
for (int i = 0; i < jsonObjects.size(); i++) {
|
||||||
JSONObject jsonObject = jsonObjects.get(i);
|
JSONObject jsonObject = jsonObjects.get(i);
|
||||||
if (jsonObject.getString("invitelink").equals("null")) {
|
if (jsonObject.getString("invitelink").equals("null")) {
|
||||||
returnBoolean = false;
|
returnBoolean = false;
|
||||||
@ -740,7 +736,7 @@ public class Database {
|
|||||||
/**
|
/**
|
||||||
* Führt ein SQL Befehl aus und gibt die antwort in ein JSONObject List
|
* Führt ein SQL Befehl aus und gibt die antwort in ein JSONObject List
|
||||||
*
|
*
|
||||||
* @param SQL Der SQL der auszuführen ist
|
* @param SQL Der SQL der auszuführen ist
|
||||||
* @return Das ergebnis als JSONObject
|
* @return Das ergebnis als JSONObject
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
@ -758,7 +754,7 @@ public class Database {
|
|||||||
/**
|
/**
|
||||||
* Führt ein SQL Befehl aus und gibt die antwort in ein JSONObject List
|
* Führt ein SQL Befehl aus und gibt die antwort in ein JSONObject List
|
||||||
*
|
*
|
||||||
* @param SQL Der SQL der auszuführen ist
|
* @param SQL Der SQL der auszuführen ist
|
||||||
* @return Das ergebnis als JSONObject
|
* @return Das ergebnis als JSONObject
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
|
@ -8,12 +8,12 @@ import android.media.RingtoneManager;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||||
import com.google.firebase.messaging.RemoteMessage;
|
import com.google.firebase.messaging.RemoteMessage;
|
||||||
|
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.activitys.Dash;
|
|
||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
|
import at.smartshopper.smartshopper.activitys.Dash;
|
||||||
|
|
||||||
public class MyFirebaseMessagingService extends FirebaseMessagingService {
|
public class MyFirebaseMessagingService extends FirebaseMessagingService {
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Persist token to third-party servers.
|
* Persist token to third-party servers.
|
||||||
*
|
* <p>
|
||||||
* Modify this method to associate the user's FCM InstanceID token with any server-side account
|
* Modify this method to associate the user's FCM InstanceID token with any server-side account
|
||||||
* maintained by your application.
|
* maintained by your application.
|
||||||
*
|
*
|
||||||
@ -88,8 +88,8 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService {
|
|||||||
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
// NotificationChannel channel = new NotificationChannel(channelId,
|
// NotificationChannel channel = new NotificationChannel(channelId,
|
||||||
// "Channel human readable title",
|
// "Channel human readable title",
|
||||||
// NotificationManager.IMPORTANCE_DEFAULT);
|
// NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
// notificationManager.createNotificationChannel(channel);
|
// notificationManager.createNotificationChannel(channel);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
|
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
|
||||||
|
@ -3,7 +3,7 @@ package at.smartshopper.smartshopper.shoppinglist;
|
|||||||
public class Member {
|
public class Member {
|
||||||
private String uid, msid, name, pic, email;
|
private String uid, msid, name, pic, email;
|
||||||
|
|
||||||
public Member(String uid, String msid, String name, String pic, String email){
|
public Member(String uid, String msid, String name, String pic, String email) {
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
this.msid = msid;
|
this.msid = msid;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -3,18 +3,18 @@ package at.smartshopper.smartshopper.shoppinglist;
|
|||||||
public class Shoppinglist {
|
public class Shoppinglist {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String sl_id, name, description, invitelink, color;
|
private String sl_id, name, description, invitelink, color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erstellt ein Object von Shoppinglist.
|
* Erstellt ein Object von Shoppinglist.
|
||||||
* @param sl_id Shoppinglist ID
|
*
|
||||||
* @param name Shoppinglist Name
|
* @param sl_id Shoppinglist ID
|
||||||
|
* @param name Shoppinglist Name
|
||||||
* @param description Shoppinglist Beschreibung
|
* @param description Shoppinglist Beschreibung
|
||||||
* @param invitelink Shoppinglist Einladungslink
|
* @param invitelink Shoppinglist Einladungslink
|
||||||
* @param color Shoppinglist Farbe
|
* @param color Shoppinglist Farbe
|
||||||
*/
|
*/
|
||||||
public Shoppinglist(String sl_id, String name, String description, String invitelink, String color){
|
public Shoppinglist(String sl_id, String name, String description, String invitelink, String color) {
|
||||||
this.sl_id = sl_id;
|
this.sl_id = sl_id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
@ -22,23 +22,29 @@ public class Shoppinglist {
|
|||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSlId(){
|
public String getSlId() {
|
||||||
return this.sl_id;
|
return this.sl_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getname(){
|
public String getname() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getdescription(){return this.description;}
|
public String getdescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
public String getInvitelink(){return this.invitelink;}
|
public String getInvitelink() {
|
||||||
|
return this.invitelink;
|
||||||
|
}
|
||||||
|
|
||||||
public String getcolor(){ return this.color;}
|
public String getcolor() {
|
||||||
|
return this.color;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(){
|
public String toString() {
|
||||||
return "SL_ID: " + sl_id + " name: " + name + " description: " + description + " invitelink: " + invitelink + " color: "+ color;
|
return "SL_ID: " + sl_id + " name: " + name + " description: " + description + " invitelink: " + invitelink + " color: " + color;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
package at.smartshopper.smartshopper.shoppinglist;
|
package at.smartshopper.smartshopper.shoppinglist;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.media.Image;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -20,11 +17,9 @@ import com.google.firebase.auth.FirebaseAuth;
|
|||||||
import com.google.firebase.auth.FirebaseUser;
|
import com.google.firebase.auth.FirebaseUser;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.activitys.ShoppinglistDetails;
|
|
||||||
import at.smartshopper.smartshopper.customViews.RoundCornersTransformation;
|
import at.smartshopper.smartshopper.customViews.RoundCornersTransformation;
|
||||||
import at.smartshopper.smartshopper.db.Database;
|
import at.smartshopper.smartshopper.db.Database;
|
||||||
|
|
||||||
@ -140,6 +135,7 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapte
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt die anzahl der items in dem Adapter
|
* Holt die anzahl der items in dem Adapter
|
||||||
|
*
|
||||||
* @return Anzahl der Items in dem Adapter
|
* @return Anzahl der Items in dem Adapter
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -147,6 +143,42 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapte
|
|||||||
return shoppinglist.size();
|
return shoppinglist.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onChangeClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnChangeClick(OnChangeItemClick onChangeClick) {
|
||||||
|
this.onChangeClick = onChangeClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnItemClicked event
|
||||||
|
*
|
||||||
|
* @param onClick Der Click Listener
|
||||||
|
*/
|
||||||
|
public void setOnDelClick(OnItemClicked onClick) {
|
||||||
|
this.onClick = onClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onShareClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnShareClick(OnShareClick onShareClick) {
|
||||||
|
this.onShareClick = onShareClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onShoppinglistClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnShoppinglistClick(OnShoppinglistClick onShoppinglistClick) {
|
||||||
|
this.onShoppinglistClick = onShoppinglistClick;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
@ -157,60 +189,24 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapte
|
|||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface OnChangeItemClick{
|
public interface OnChangeItemClick {
|
||||||
void onChangeItemClick(String sl_id, View v);
|
void onChangeItemClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onChangeClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnChangeClick(OnChangeItemClick onChangeClick){
|
|
||||||
this.onChangeClick = onChangeClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnItemClicked event
|
|
||||||
* @param onClick Der Click Listener
|
|
||||||
*/
|
|
||||||
public void setOnDelClick(OnItemClicked onClick)
|
|
||||||
{
|
|
||||||
this.onClick=onClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface OnShareClick{
|
public interface OnShareClick {
|
||||||
void onShareClick(String sl_id, View v);
|
void onShareClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onShareClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnShareClick(OnShareClick onShareClick){
|
|
||||||
this.onShareClick = onShareClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface OnShoppinglistClick{
|
public interface OnShoppinglistClick {
|
||||||
void onShoppinglistClick(String sl_id, View v);
|
void onShoppinglistClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onShoppinglistClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnShoppinglistClick(OnShoppinglistClick onShoppinglistClick){
|
|
||||||
this.onShoppinglistClick = onShoppinglistClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
||||||
*/
|
*/
|
||||||
|
@ -2,7 +2,6 @@ package at.smartshopper.smartshopper.shoppinglist;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -13,8 +12,6 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.firebase.auth.FirebaseAuth;
|
|
||||||
import com.google.firebase.auth.FirebaseUser;
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@ -121,14 +118,12 @@ public class ShoppinglistSharedAdapter extends RecyclerView.Adapter<Shoppinglist
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt die anzahl der items in dem Adapter
|
* Holt die anzahl der items in dem Adapter
|
||||||
|
*
|
||||||
* @return Anzahl der Items in dem Adapter
|
* @return Anzahl der Items in dem Adapter
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -136,6 +131,42 @@ public class ShoppinglistSharedAdapter extends RecyclerView.Adapter<Shoppinglist
|
|||||||
return shoppinglist.size();
|
return shoppinglist.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onChangeClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnChangeClick(SharedOnChangeItemClick onChangeClick) {
|
||||||
|
this.sharedOnChangeClick = onChangeClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnItemClicked event
|
||||||
|
*
|
||||||
|
* @param onClick Der Click Listener
|
||||||
|
*/
|
||||||
|
public void setOnDelClick(SharedOnItemClicked onClick) {
|
||||||
|
this.sharedOnClick = onClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onShareClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnShareClick(SharedOnShareClick onShareClick) {
|
||||||
|
this.sharedOnShareClick = onShareClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onShoppinglistClick Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setOnShoppinglistClick(SharedOnShoppinglistClick onShoppinglistClick) {
|
||||||
|
this.sharedOnShoppinglistClick = onShoppinglistClick;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
@ -146,60 +177,24 @@ public class ShoppinglistSharedAdapter extends RecyclerView.Adapter<Shoppinglist
|
|||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface SharedOnChangeItemClick{
|
public interface SharedOnChangeItemClick {
|
||||||
void sharedOnChangeItemClick(String sl_id, View v);
|
void sharedOnChangeItemClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onChangeClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnChangeClick(SharedOnChangeItemClick onChangeClick){
|
|
||||||
this.sharedOnChangeClick = onChangeClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnItemClicked event
|
|
||||||
* @param onClick Der Click Listener
|
|
||||||
*/
|
|
||||||
public void setOnDelClick(SharedOnItemClicked onClick)
|
|
||||||
{
|
|
||||||
this.sharedOnClick=onClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface SharedOnShareClick{
|
public interface SharedOnShareClick {
|
||||||
void sharedOnShareClick(String sl_id, View v);
|
void sharedOnShareClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onShareClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnShareClick(SharedOnShareClick onShareClick){
|
|
||||||
this.sharedOnShareClick = onShareClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
* Interface damit onoclick in der dash activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
public interface SharedOnShoppinglistClick{
|
public interface SharedOnShoppinglistClick {
|
||||||
void sharedOnShoppinglistClick(String sl_id, View v);
|
void sharedOnShoppinglistClick(String sl_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onShoppinglistClick Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setOnShoppinglistClick(SharedOnShoppinglistClick onShoppinglistClick){
|
|
||||||
this.sharedOnShoppinglistClick = onShoppinglistClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ public class Details {
|
|||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItem(Item item){
|
public void addItem(Item item) {
|
||||||
this.items.add(item);
|
this.items.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,11 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.activitys.ItemListActivity;
|
import at.smartshopper.smartshopper.activitys.ItemListActivity;
|
||||||
import at.smartshopper.smartshopper.customViews.SpaceItemDecoration;
|
import at.smartshopper.smartshopper.customViews.SpaceItemDecoration;
|
||||||
@ -75,9 +78,6 @@ public class DetailsAdapter extends RecyclerView.Adapter<DetailsAdapter.MyViewHo
|
|||||||
itemsrecycle.setAdapter(itemAdapter);
|
itemsrecycle.setAdapter(itemAdapter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int cardcolor;
|
int cardcolor;
|
||||||
try {
|
try {
|
||||||
cardcolor = Color.parseColor(details.get(i).getGroup().getColor());
|
cardcolor = Color.parseColor(details.get(i).getGroup().getColor());
|
||||||
@ -123,18 +123,42 @@ public class DetailsAdapter extends RecyclerView.Adapter<DetailsAdapter.MyViewHo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der Shoppinglistdetails activity ausgeführt werden kann
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onCardClicked Der Click event Listener
|
||||||
*/
|
*/
|
||||||
public interface OnCardClicked {
|
public void setCardClick(OnCardClicked onCardClicked) {
|
||||||
void onCardClick(String group_id, String sl_id, String groupName, View v);
|
this.onCardClicked = onCardClicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setzt das OnChangeItemClick event
|
* Setzt das OnChangeItemClick event
|
||||||
* @param onCardClicked Der Click event Listener
|
*
|
||||||
|
* @param onGroupDeleteClicked Der Click event Listener
|
||||||
*/
|
*/
|
||||||
public void setCardClick(OnCardClicked onCardClicked){
|
public void setGroupDeleteClick(OnGroupDeleteClicked onGroupDeleteClicked) {
|
||||||
this.onCardClicked = onCardClicked;
|
this.onGroupDeleteClicked = onGroupDeleteClicked;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt das OnChangeItemClick event
|
||||||
|
*
|
||||||
|
* @param onGroupEditClicked Der Click event Listener
|
||||||
|
*/
|
||||||
|
public void setGroupEditClick(OnGroupEditClicked onGroupEditClicked) {
|
||||||
|
this.onGroupEditClicked = onGroupEditClicked;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return details.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface damit onoclick in der Shoppinglistdetails activity ausgeführt werden kann
|
||||||
|
*/
|
||||||
|
public interface OnCardClicked {
|
||||||
|
void onCardClick(String group_id, String sl_id, String groupName, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,14 +168,6 @@ public class DetailsAdapter extends RecyclerView.Adapter<DetailsAdapter.MyViewHo
|
|||||||
void onGroupDeleteClick(String sl_id, String group_id, View v);
|
void onGroupDeleteClick(String sl_id, String group_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onGroupDeleteClicked Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setGroupDeleteClick(OnGroupDeleteClicked onGroupDeleteClicked){
|
|
||||||
this.onGroupDeleteClicked = onGroupDeleteClicked;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface damit onoclick in der Shoppinglistdetails activity ausgeführt werden kann
|
* Interface damit onoclick in der Shoppinglistdetails activity ausgeführt werden kann
|
||||||
*/
|
*/
|
||||||
@ -159,19 +175,6 @@ public class DetailsAdapter extends RecyclerView.Adapter<DetailsAdapter.MyViewHo
|
|||||||
void onGroupEditClick(String sl_id, String group_id, View v);
|
void onGroupEditClick(String sl_id, String group_id, View v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Setzt das OnChangeItemClick event
|
|
||||||
* @param onGroupEditClicked Der Click event Listener
|
|
||||||
*/
|
|
||||||
public void setGroupEditClick(OnGroupEditClicked onGroupEditClicked){
|
|
||||||
this.onGroupEditClicked = onGroupEditClicked;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return details.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
||||||
*/
|
*/
|
||||||
|
@ -14,9 +14,9 @@ public class Group {
|
|||||||
this.sl_id = sl_id;
|
this.sl_id = sl_id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
String colorstring;
|
String colorstring;
|
||||||
if(color.contains("#")){
|
if (color.contains("#")) {
|
||||||
colorstring = color;
|
colorstring = color;
|
||||||
}else{
|
} else {
|
||||||
colorstring = "#" + color;
|
colorstring = "#" + color;
|
||||||
}
|
}
|
||||||
this.color = colorstring;
|
this.color = colorstring;
|
||||||
@ -36,11 +36,11 @@ public class Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getColor() {
|
public String getColor() {
|
||||||
if(color.isEmpty()){
|
if (color.isEmpty()) {
|
||||||
return "#FFFFFF";
|
return "#FFFFFF";
|
||||||
}else if (!color.contains("#")){
|
} else if (!color.contains("#")) {
|
||||||
return "#" + this.color;
|
return "#" + this.color;
|
||||||
}else {
|
} else {
|
||||||
return this.color;
|
return this.color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ public class Item {
|
|||||||
private String name;
|
private String name;
|
||||||
private String count;
|
private String count;
|
||||||
|
|
||||||
public Item(String item_id, String group_id, String sl_id, String name, String count){
|
public Item(String item_id, String group_id, String sl_id, String name, String count) {
|
||||||
this.item_id = item_id;
|
this.item_id = item_id;
|
||||||
this.group_id = group_id;
|
this.group_id = group_id;
|
||||||
this.sl_id = sl_id;
|
this.sl_id = sl_id;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
package at.smartshopper.smartshopper.shoppinglist.details.item;
|
package at.smartshopper.smartshopper.shoppinglist.details.item;
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -16,15 +14,9 @@ import android.widget.TextView;
|
|||||||
import com.google.firebase.auth.FirebaseAuth;
|
import com.google.firebase.auth.FirebaseAuth;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.db.Database;
|
|
||||||
import at.smartshopper.smartshopper.shoppinglist.ShoppinglistAdapter;
|
|
||||||
|
|
||||||
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.MyViewHolder> {
|
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.MyViewHolder> {
|
||||||
|
|
||||||
@ -97,26 +89,14 @@ public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.MyViewHolder>
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnItemDelClicked {
|
|
||||||
void onItemDelClicked(String item_id, String group_id, String sl_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setItemDelClick(OnItemDelClicked onItemDelClicked) {
|
public void setItemDelClick(OnItemDelClicked onItemDelClicked) {
|
||||||
this.onItemDelClicked = onItemDelClicked;
|
this.onItemDelClicked = onItemDelClicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnItemEditClicked {
|
|
||||||
void onItemEditClicked(String item_id, String group_id, String sl_id, View v);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnItemEditClick(OnItemEditClicked onItemEditClick) {
|
public void setOnItemEditClick(OnItemEditClicked onItemEditClick) {
|
||||||
this.onItemEditClick = onItemEditClick;
|
this.onItemEditClick = onItemEditClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnItemCheckClicked {
|
|
||||||
void onItemCheckClicked(String uid, String name, String itemId, String groupId, String sl_id, int count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnItemCheckClick(OnItemCheckClicked onItemCheckClick) {
|
public void setOnItemCheckClick(OnItemCheckClicked onItemCheckClick) {
|
||||||
this.onItemCheckClick = onItemCheckClick;
|
this.onItemCheckClick = onItemCheckClick;
|
||||||
}
|
}
|
||||||
@ -126,6 +106,18 @@ public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.MyViewHolder>
|
|||||||
return data.size();
|
return data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface OnItemDelClicked {
|
||||||
|
void onItemDelClicked(String item_id, String group_id, String sl_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemEditClicked {
|
||||||
|
void onItemEditClicked(String item_id, String group_id, String sl_id, View v);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemCheckClicked {
|
||||||
|
void onItemCheckClicked(String uid, String name, String itemId, String groupId, String sl_id, int count);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
||||||
*/
|
*/
|
||||||
|
@ -6,20 +6,13 @@ import android.support.v7.widget.RecyclerView;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.firebase.auth.FirebaseAuth;
|
|
||||||
import com.squareup.picasso.Picasso;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
import at.smartshopper.smartshopper.R;
|
import at.smartshopper.smartshopper.R;
|
||||||
import at.smartshopper.smartshopper.db.Database;
|
import at.smartshopper.smartshopper.db.Database;
|
||||||
|
|
||||||
@ -78,11 +71,6 @@ public class ItemShoppinglistDetailsAdapter extends RecyclerView.Adapter<ItemSho
|
|||||||
itemAnzahl.setText(data.get(i).getCount());
|
itemAnzahl.setText(data.get(i).getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface OnItemEditClicked {
|
|
||||||
void onItemEditClicked(String item_id, String group_id, String sl_id, String groupName, View v);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnItemEditClick(OnItemEditClicked onItemEditClick) {
|
public void setOnItemEditClick(OnItemEditClicked onItemEditClick) {
|
||||||
this.onItemEditClick = onItemEditClick;
|
this.onItemEditClick = onItemEditClick;
|
||||||
}
|
}
|
||||||
@ -92,6 +80,10 @@ public class ItemShoppinglistDetailsAdapter extends RecyclerView.Adapter<ItemSho
|
|||||||
return data.size();
|
return data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface OnItemEditClicked {
|
||||||
|
void onItemEditClicked(String item_id, String group_id, String sl_id, String groupName, View v);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
* Haltet alle elemente. Durch ein Objekt von dem kann jedes Element welches hier drinnen angeführt ist verwendet werden
|
||||||
*/
|
*/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
@ -9,7 +9,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:padding="16dp" >
|
android:padding="16dp">
|
||||||
|
|
||||||
<com.github.danielnilsson9.colorpickerview.view.ColorPickerView
|
<com.github.danielnilsson9.colorpickerview.view.ColorPickerView
|
||||||
android:id="@id/colorpickerview__color_picker_view"
|
android:id="@id/colorpickerview__color_picker_view"
|
||||||
@ -20,11 +20,11 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
|
android:layout_below="@id/colorpickerview__color_picker_view"
|
||||||
android:layout_alignLeft="@id/colorpickerview__color_picker_view"
|
android:layout_alignLeft="@id/colorpickerview__color_picker_view"
|
||||||
android:layout_alignRight="@id/colorpickerview__color_picker_view"
|
android:layout_alignRight="@id/colorpickerview__color_picker_view"
|
||||||
android:layout_below="@id/colorpickerview__color_picker_view"
|
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.github.danielnilsson9.colorpickerview.view.ColorPanelView
|
<com.github.danielnilsson9.colorpickerview.view.ColorPanelView
|
||||||
android:id="@id/colorpickerview__color_panel_old"
|
android:id="@id/colorpickerview__color_panel_old"
|
||||||
@ -56,7 +56,7 @@
|
|||||||
style="@android:style/ButtonBar"
|
style="@android:style/ButtonBar"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/okButton"
|
android:id="@+id/okButton"
|
||||||
@ -70,7 +70,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@android:string/cancel" />
|
android:text="@android:string/cancel" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,8 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:layout_editor_absoluteY="232dp" />
|
tools:layout_editor_absoluteY="232dp" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/cardViewGroup"
|
android:id="@+id/cardViewGroup"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/itemCardView"
|
android:id="@+id/itemCardView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent" android:layout_height="match_parent">
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -32,7 +33,7 @@
|
|||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center" >
|
android:gravity="center">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/linkausgabe"
|
android:id="@+id/linkausgabe"
|
||||||
@ -46,7 +47,7 @@
|
|||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center" >
|
android:gravity="center">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/copyButton"
|
android:id="@+id/copyButton"
|
||||||
@ -58,7 +59,7 @@
|
|||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center" >
|
android:gravity="center">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/delShare"
|
android:id="@+id/delShare"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/addInvite"
|
android:id="@+id/addInvite"
|
||||||
android:title="Insert Invite" />
|
android:title="Insert Invite" />
|
||||||
@ -9,6 +8,6 @@
|
|||||||
android:title="Erledigte Einkäufe" />
|
android:title="Erledigte Einkäufe" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/logoutBtn"
|
android:id="@+id/logoutBtn"
|
||||||
android:title="Logout"
|
android:enabled="true"
|
||||||
android:enabled="true" />
|
android:title="Logout" />
|
||||||
</menu>
|
</menu>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_launcher_background"/>
|
<background android:drawable="@color/ic_launcher_background" />
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_launcher_background"/>
|
<background android:drawable="@color/ic_launcher_background" />
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
|
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
@ -2,7 +2,7 @@ package at.smartshopper.smartshopper;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user