Skip to content
Snippets Groups Projects
Commit 6aa32ead authored by Christian Dresen's avatar Christian Dresen
Browse files

Added Authentification, Added PinCodes

parent b6af9d22
No related branches found
No related tags found
No related merge requests found
Showing
with 589 additions and 22 deletions
......@@ -31,6 +31,7 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.0.1'
compile group: 'org.mindrot', name: 'jbcrypt', version: '0.4'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile group: 'com.squareup.retrofit' , name: 'retrofit' , version: '2.0.0-beta2'
......@@ -40,4 +41,5 @@ dependencies {
compile group: 'com.squareup.okhttp', name: 'okhttp', version: '2.7.5'
compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.5.3'
}
......@@ -16,8 +16,8 @@
android:theme="@style/AppTheme">
<meta-data android:name="AA_DB_NAME" android:value="warppay.db" />
<meta-data android:name="AA_DB_VERSION" android:value="9.1" />
<meta-data android:name="AA_DB_NAME" android:value="warppay_1.db" />
<meta-data android:name="AA_DB_VERSION" android:value="10" />
<activity
android:name="ms.warpzone.warppay.MainActivity"
......
......@@ -23,6 +23,7 @@ import ms.warpzone.warppay.R;
import ms.warpzone.warppay.data.models.local.Product;
import ms.warpzone.warppay.data.models.local.User;
import ms.warpzone.warppay.dialogs.BarcodeLearnDialog;
import ms.warpzone.warppay.dialogs.NewUserDialog;
import ms.warpzone.warppay.dialogs.SettingsDialog;
import ms.warpzone.warppay.manager.DataManager;
......@@ -39,6 +40,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
private IntentFilter[] mIntentFilters;
private String[][] mNFCTechLists;
private String barcode;
private BarcodeLearnDialog barcodeLearnDialog;
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
......@@ -123,6 +125,18 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
} else {
Toast.makeText(this, "Bitte User auswählen", Toast.LENGTH_LONG).show();
}
break;
case R.id.action_learn_barcode:
this.barcodeLearnDialog = new BarcodeLearnDialog();
MainManager.getInstance().setBarcodeLearning(true);
this.barcodeLearnDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
MainManager.getInstance().setBarcodeLearning(false);
}
});
this.barcodeLearnDialog.show();
break;
default:
break;
}
......@@ -144,14 +158,19 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
if(this.manager.getCurrentUser() != null) {
if (event.getAction() == KeyEvent.ACTION_UP) {
if (KeyEvent.KEYCODE_ENTER == event.getKeyCode()) {
Product p = Product.getOneByBarcode(this.barcode.trim().replace("\n", "").toString());
if (p != null) {
Order order = new Order(p);
UiManager.getInstance().addOrder(order);
this.manager.addOrder(order);
} else {
Toast.makeText(this, "Barcode not found: "+this.barcode, Toast.LENGTH_LONG).show();
}
/*if(this.manager.isBarcodeLearning()) {
this.barcodeLearnDialog.setBarcode(this.barcode.trim().replace("\n", "").toString());
} else {*/
Product p = Product.getOneByBarcode(this.barcode.trim().replace("\n", "").toString());
if (p != null) {
Order order = new Order(p);
UiManager.getInstance().addOrder(order);
this.manager.addOrder(order);
} else {
Toast.makeText(this, "Barcode not found: " + this.barcode, Toast.LENGTH_LONG).show();
}
//}
this.barcode = "";
} else {
this.barcode += (char) event.getUnicodeChar();
......
......@@ -36,4 +36,7 @@ public interface RestService {
@PUT("transaction/{userid}/")
Call<Void> saveTransaction(@Path("userid") String uid, @Body RestTransaction transaction);
@PUT("products/{productid}/barcode/")
Call<Void> saveBarcode(@Path("productid") int pid, @Body RestProduct product);
}
\ No newline at end of file
......@@ -17,14 +17,18 @@ public class Category extends Model {
@Column(name = "name")
private String name;
@Column(name = "position")
private float position;
public Category() {
super();
}
public Category(int cid, String name) {
public Category(int cid, String name, Float position) {
super();
this.cid = cid;
this.name = name;
this.position = position;
}
public int getCid() {
......@@ -46,6 +50,7 @@ public class Category extends Model {
public static List<Category> getAll() {
return new Select()
.from(Category.class)
.orderBy("position")
.execute();
}
......@@ -57,4 +62,11 @@ public class Category extends Model {
return this.name;
}
public float getPosition() {
return position;
}
public void setPosition(float position) {
this.position = position;
}
}
......@@ -8,6 +8,7 @@ import com.activeandroid.annotation.Table;
import com.activeandroid.query.Delete;
import com.activeandroid.query.Select;
import java.util.ArrayList;
import java.util.List;
@Table(name = "Products")
......@@ -25,6 +26,8 @@ public class Product extends Model {
@Column(name = "barcode")
private String barcode;
@Column(name = "position")
private float position;
@Column(name = "price")
private float price;
......@@ -36,13 +39,21 @@ public class Product extends Model {
super();
}
public Product(int pid, String name, String category, float price, int count) {
public Product(int pid, String name, String category, float price, int count, float position) {
super();
this.pid = pid;
this.name = name;
this.category = category;
this.price = price;
this.count = count;
this.position = position;
}
public static ArrayList<Product> getAllWithoutBarcode() {
return new Select()
.from(Product.class)
.where("barcode = ''")
.execute();
}
......@@ -94,6 +105,14 @@ public class Product extends Model {
this.barcode = barcode;
}
public float getPosition() {
return position;
}
public void setPosition(float position) {
this.position = position;
}
public static List<Product> getAll() {
return new Select()
.from(Product.class)
......@@ -112,6 +131,7 @@ public class Product extends Model {
return new Select()
.from(Product.class)
.where("category = ?", category)
.orderBy("position")
.execute();
}
......
......@@ -14,21 +14,26 @@ public class User extends Model {
@Column(name = "uid")
private String uid;
@Column(name = "credit")
private double credit;
@Column(name = "pinCode")
private String pinCode;
@Column(name = "card_id")
private String card_id;
@Column(name = "credit")
private double credit;
public User() {
super();
}
public User(String uid, double credit, String card_id) {
public User(String uid, String pinCode, double credit, String card_id) {
super();
this.uid = uid;
this.credit = credit;
this.card_id = card_id;
this.pinCode = pinCode;
}
public String getUserid() {
......@@ -80,4 +85,11 @@ public class User extends Model {
.executeSingle();
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
public String getPinCode() {
return pinCode;
}
}
......@@ -7,13 +7,16 @@ public class RestCategory {
private int id;
private String name;
private float position;
public RestCategory() {
super();
}
public RestCategory(int id, String name) {
public RestCategory(int id, String name, float position) {
this.id = id;
this.name = name;
this.position = position;
}
public int getId() {
......@@ -32,10 +35,19 @@ public class RestCategory {
this.name = name;
}
public float getPosition() {
return position;
}
public void setPosition(float position) {
this.position = position;
}
public Category toLocalCategory() {
Category c = new Category();
c.setCid(this.id);
c.setName(this.name);
c.setPosition(this.position);
return c;
}
......@@ -43,6 +55,7 @@ public class RestCategory {
RestCategory restCategory = new RestCategory();
restCategory.setId(category.getCid());
restCategory.setName(category.getName());
restCategory.setPosition(category.getPosition());
return restCategory;
}
}
......@@ -11,18 +11,20 @@ public class RestProduct {
private String barcode;
private Float price_vk;
private int stock_count;
private float position;
public RestProduct() {
super();
}
public RestProduct(int id, String name, String category,String barcode, Float price_vk, int stock_count) {
public RestProduct(int id, String name, String category,String barcode, Float price_vk, int stock_count, float position) {
this.id = id;
this.name = name;
this.category = category;
this.barcode = barcode;
this.price_vk = price_vk;
this.stock_count = stock_count;
this.position = position;
}
public int getId() {
......@@ -73,6 +75,7 @@ public class RestProduct {
p.setBarcode(this.barcode);
p.setPrice(this.price_vk);
p.setCount(this.stock_count);
p.setPosition(this.position);
return p;
}
......@@ -84,10 +87,23 @@ public class RestProduct {
restProduct.setBarcode(product.getBarcode());
restProduct.setCount(product.getCount());
restProduct.setPrice(product.getPrice());
restProduct.setPosition(product.getPosition());
return restProduct;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getBarcode() {
return barcode;
}
public float getPosition() {
return position;
}
public void setPosition(float position) {
this.position = position;
}
}
......@@ -8,16 +8,18 @@ public class RestUser {
private String uid;
private double credit;
private String card_id;
private String pinCode;
public RestUser() {
super();
}
public RestUser(String uid, double credit, String card_id) {
public RestUser(String uid, double credit, String card_id, String pinCode) {
super();
this.uid = uid;
this.credit = credit;
this.card_id = card_id;
this.pinCode = pinCode;
}
public String getUserid() {
......@@ -44,6 +46,10 @@ public class RestUser {
this.credit = credit;
}
public String getPinCode() {
return pinCode;
}
public String toString() {
return this.uid;
}
......@@ -53,13 +59,20 @@ public class RestUser {
u.setCardId(this.card_id);
u.setUserid(this.uid);
u.setCredit(this.credit);
u.setPinCode(this.pinCode);
return u;
}
public static RestUser fromLocalUser(User user) {
RestUser rest_user = new RestUser();
rest_user.setCardId(user.getCardId());
rest_user.setUserid(user.getUserid());
rest_user.setCredit(user.getCredit());
rest_user.setPinCode(user.getPinCode());
return rest_user;
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
}
package ms.warpzone.warppay.dialogs;
import android.app.Dialog;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.activeandroid.query.Select;
import org.w3c.dom.Text;
import java.io.IOException;
import java.util.ArrayList;
import ms.warpzone.warppay.MainActivity;
import ms.warpzone.warppay.R;
import ms.warpzone.warppay.data.models.local.Product;
import ms.warpzone.warppay.data.models.rest.RestProduct;
import ms.warpzone.warppay.data.models.rest.RestUser;
import ms.warpzone.warppay.manager.DataManager;
import ms.warpzone.warppay.manager.MainManager;
import ms.warpzone.warppay.manager.UiManager;
import ms.warpzone.warppay.orderList.ListViewAdapter;
import ms.warpzone.warppay.orderList.Order;
import retrofit.Callback;
import retrofit.Response;
import retrofit.Retrofit;
public class BarcodeLearnDialog extends Dialog implements View.OnClickListener, AdapterView.OnItemClickListener {
public MainActivity c;
public Dialog d;
private Button btnBarcodeSubmit, btnBarcodeDelete, btnExit;
private ListView lstBarcodeProducts;
private ArrayAdapter productAdapter;
private TextView txtBarcodeProductName, txtBarcodeProductBarcode;
private Product act_product;
private String barcode="";
public BarcodeLearnDialog() {
super(MainManager.getInstance().getMainActivity());
this.c = MainManager.getInstance().getMainActivity();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.barcode_learn_dialog);
this.btnExit = (Button) findViewById(R.id.btnBarcodeExit);
this.btnBarcodeSubmit = (Button) findViewById(R.id.btnBarcodeSubmit);
this.btnBarcodeDelete = (Button) findViewById(R.id.btnBarcodeDelete);
this.btnExit.setOnClickListener(this);
this.btnBarcodeSubmit.setOnClickListener(this);
this.btnBarcodeDelete.setOnClickListener(this);
this.enableButtons(false);
this.lstBarcodeProducts = (ListView)findViewById(R.id.lstBarcodeProducts);
this.productAdapter = new ArrayAdapter(MainManager.getInstance().getMainActivity(), android.R.layout.simple_list_item_1, new ArrayList<Product>());
this.lstBarcodeProducts.setAdapter(this.productAdapter);
this.productAdapter.addAll(Product.getAllWithoutBarcode());
this.lstBarcodeProducts.setOnItemClickListener(this);
this.txtBarcodeProductName = (TextView) findViewById(R.id.txtBarcodeProductName);
this.txtBarcodeProductBarcode = (TextView)findViewById(R.id.txtBarcodeProductBarcode);
this.txtBarcodeProductName.setText("");
this.txtBarcodeProductBarcode.setText("");
}
private void enableButtons(boolean enabled) {
this.btnBarcodeSubmit.setEnabled(enabled);
this.btnBarcodeDelete.setEnabled(enabled);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnBarcodeSubmit:
this.barcode = this.txtBarcodeProductBarcode.getText().toString();
if(this.barcode != "" && this.act_product != null) {
this.act_product.setBarcode(this.barcode);
this.act_product.save();
RestProduct p = RestProduct.fromLocalProduct(this.act_product);
MainManager.getInstance().getRestService().saveBarcode(p.getId(),p).enqueue(new Callback<Void>() {
@Override
public void onResponse(Response<Void> response, Retrofit retrofit) {
}
@Override
public void onFailure(Throwable t) {
Log.d("REST", t.getMessage());
}
});
this.productAdapter.remove(this.act_product);
this.act_product = null;
this.txtBarcodeProductBarcode.setText("");
this.txtBarcodeProductName.setText("");
this.barcode = "";
this.setBarcode("");
}
break;
case R.id.btnBarcodeDelete:
this.setBarcode("");
break;
case R.id.btnBarcodeExit:
dismiss();
break;
}
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
this.act_product = (Product) this.productAdapter.getItem(i);
this.txtBarcodeProductName.setText(this.act_product.getName());
}
private void setBarcode(String barcode) {
if(barcode != "") {
this.barcode = barcode;
this.txtBarcodeProductBarcode.setText(barcode);
this.enableButtons(true);
} else {
this.txtBarcodeProductBarcode.setText("");
this.enableButtons(false);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_UP) {
if (KeyEvent.KEYCODE_ENTER == event.getKeyCode()) {
this.setBarcode(this.barcode.trim().replace("\n", "").toString());
this.barcode = "";
} else {
this.barcode += (char) event.getUnicodeChar();
}
}
return super.dispatchKeyEvent(event);
}
}
package ms.warpzone.warppay.dialogs;
import android.app.Dialog;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.text.InputType;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import org.mindrot.jbcrypt.BCrypt;
import ms.warpzone.warppay.R;
import ms.warpzone.warppay.data.models.local.User;
import ms.warpzone.warppay.manager.DataManager;
import ms.warpzone.warppay.manager.MainManager;
public class PinCodesDialog extends Dialog implements View.OnClickListener, View.OnKeyListener {
private User user;
private Button btnSubmit;
private EditText etxtPinCode;
public PinCodesDialog(User user) {
super(MainManager.getInstance().getMainActivity());
this.user = user;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.pin_code_dialog);
this.btnSubmit = (Button) findViewById(R.id.btnSumit);
this.btnSubmit.setOnClickListener(this);
this.etxtPinCode = (EditText) findViewById(R.id.etxtPinCode);
this.etxtPinCode.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD);
this.etxtPinCode.setOnKeyListener(this);
}
private void checkPin() {
String pin = this.etxtPinCode.getText().toString();
if(BCrypt.checkpw(pin, this.user.getPinCode())) {
MainManager.getInstance().setCurrentUser(this.user, true);
this.etxtPinCode.setEnabled(false);
dismiss();
} else {
etxtPinCode.setBackgroundColor(Color.RED);
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnSumit:
this.checkPin();
break;
default:
break;
}
dismiss();
}
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if (KeyEvent.KEYCODE_ENTER == keyEvent.getKeyCode()) {
this.checkPin();
}
return false;
}
}
......@@ -43,6 +43,7 @@ public class ProductDialog extends Dialog implements View.OnClickListener {
Button prodButton = new Button(this.c.getApplicationContext());
prodButton.setHeight(200);
prodButton.setWidth(200);
prodButton.setGravity(0);
prodButton.setText(p.getName());
prodButton.setOnClickListener(this);
this.gridProducts.addView(prodButton);
......@@ -51,6 +52,7 @@ public class ProductDialog extends Dialog implements View.OnClickListener {
Button btn = new Button(this.c.getApplicationContext());
btn.setHeight(200);
btn.setWidth(200);
btn.setGravity(0);
btn.setText("");
btn.setEnabled(false);
this.gridProducts.addView(btn);
......
......@@ -6,7 +6,11 @@ import android.content.DialogInterface;
import android.util.Log;
import android.widget.Toast;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import org.mindrot.jbcrypt.BCrypt;
import java.io.IOException;
import java.io.InputStream;
......@@ -33,6 +37,7 @@ import ms.warpzone.warppay.data.models.rest.RestCategory;
import ms.warpzone.warppay.data.models.rest.RestProduct;
import ms.warpzone.warppay.data.models.rest.RestTransaction;
import ms.warpzone.warppay.data.models.rest.RestUser;
import ms.warpzone.warppay.dialogs.PinCodesDialog;
import ms.warpzone.warppay.orderList.Order;
import retrofit.Callback;
import retrofit.GsonConverterFactory;
......@@ -46,6 +51,7 @@ public class MainManager {
private SQLiteService sqLiteService;
private UiManager uiManager;
private DataManager dataManager;
private boolean barcodeLearning=false;
private static MainManager instance = new MainManager();
......@@ -64,9 +70,23 @@ public class MainManager {
.baseUrl("https://infra-test.warpzone/api/")
.addConverterFactory(GsonConverterFactory.create());
OkHttpClient okHttp = new OkHttpClient();
try {
okHttp.setSslSocketFactory(getSSLConfig(this.getMainActivity().getBaseContext()).getSocketFactory());
okHttp.networkInterceptors().add(new Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
Request request = chain.request();
Request newRequest;
newRequest = request.newBuilder()
.addHeader("Authorization", "Token ")
.build();
return chain.proceed(newRequest);
}
});
} catch (CertificateException e) {
e.printStackTrace();
} catch (IOException e) {
......@@ -164,7 +184,23 @@ public class MainManager {
}
public void setCurrentUser(User user) {
this.setCurrentUser(user,false);
}
public void setCurrentUser(User user, boolean authorized) {
if (user != null) {
if(user.getPinCode() != "" && !authorized) {
PinCodesDialog p = new PinCodesDialog(user);
p.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if(MainManager.getInstance().getCurrentUser() == null)
MainManager.getInstance().clearCurrentUser();
}
});
p.show();
return;
}
this.dataManager.setCurrentUser(user);
this.uiManager.setCurrentUser(user);
}
......@@ -271,4 +307,12 @@ public class MainManager {
.show();
}
}
public boolean isBarcodeLearning() {
return barcodeLearning;
}
public void setBarcodeLearning(boolean barcodeLearning) {
this.barcodeLearning = barcodeLearning;
}
}
......@@ -34,6 +34,7 @@ import ms.warpzone.warppay.data.models.rest.RestProduct;
import ms.warpzone.warppay.dialogs.ChargeDialog;
import ms.warpzone.warppay.dialogs.NewUserDialog;
import ms.warpzone.warppay.dialogs.PayChoiceDialog;
import ms.warpzone.warppay.dialogs.PinCodesDialog;
import ms.warpzone.warppay.listener.CategoryOnClickListener;
import ms.warpzone.warppay.orderList.ListViewAdapter;
import ms.warpzone.warppay.orderList.ListViewAdapterProducts;
......@@ -150,6 +151,7 @@ public class UiManager implements View.OnKeyListener, View.OnClickListener, Adap
this.gridCategories.setVisibility(visible);
this.btnPay.setEnabled(enable);
this.btnPay.setVisibility(visible);
this.txtSum.setVisibility(visible);
if(DataManager.getInstance().getIs_guest()) {
this.btnCharge.setEnabled(false);
this.btnCharge.setVisibility(View.INVISIBLE);
......@@ -195,15 +197,12 @@ public class UiManager implements View.OnKeyListener, View.OnClickListener, Adap
case R.id.btnLogout:
MainManager.getInstance().clearCurrentUser();
break;
case R.id.btnAddUser:
new NewUserDialog().show();
break;
case R.id.btnRefresh:
MainManager.getInstance().refreshData();
break;
case R.id.btnGuest:
DataManager.getInstance().setIs_guest(true);
MainManager.getInstance().setCurrentUser(new User("Guest",0,""));
MainManager.getInstance().setCurrentUser(new User("Guest","",0,""));
this.atxvName.setText("Gast");
this.atxvName.dismissDropDown();
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="489dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/lstBarcodeProducts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="12"
android:layout_row="2"
android:choiceMode="singleChoice" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Space
android:layout_width="wrap_content"
android:layout_height="10dp" />
<TextView
android:id="@+id/txtBarcodeProductName"
android:layout_width="413dp"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="36sp" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/txtBarcodeProductBarcode"
android:layout_width="416dp"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="36sp" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/btnBarcodeSubmit"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_weight="0.48"
android:text="Bestätigen" />
<Button
android:id="@+id/btnBarcodeDelete"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="@color/flatui_red"
android:text="Löschen" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<Button
android:id="@+id/btnBarcodeExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Beenden" />
<Space
android:layout_width="match_parent"
android:layout_height="100dp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Space
android:layout_width="60dp"
android:layout_height="175dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.38"
android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="0.38" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pinCodeDialog"
android:textSize="18sp"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="0.38" />
<EditText
android:id="@+id/etxtPinCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.38"
android:ems="10"
android:inputType="numberPassword"
android:textAlignment="center"
android:textAllCaps="false" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="0.38" />
<Button
android:id="@+id/btnSumit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.38"
android:background="@color/flatui_green"
android:text="Submit" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="0.38" />
</LinearLayout>
<Space
android:layout_width="60dp"
android:layout_height="175dp"
android:layout_weight="1" />
</LinearLayout>
\ No newline at end of file
......@@ -9,6 +9,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left"
android:orientation="horizontal"
android:layout_marginBottom="0dp"
android:layout_marginEnd="0dp"
android:layout_marginLeft="0dp"
......
......@@ -8,4 +8,10 @@
android:icon="@drawable/ic_menu_refresh"
android:title="@string/lernCardId" />
<item
android:id="@+id/action_learn_barcode"
android:orderInCategory="200"
android:icon="@drawable/ic_menu_refresh"
android:title="@string/lernBarcodes" />
</menu>
......@@ -29,6 +29,12 @@
<string name="save">Speichern</string>
<string name="abort">Abbrechen</string>
<string name="lernCardId">Learn Card ID</string>
<string name="lernBarcodes">Learn Barcodes</string>
<string name="pinCodeDialog">PinCode eingeben</string>
<string name="enterPinCode">Bitte PinCode eingeben</string>
<string name="btnDelete">Löschen</string>
<style name="ButtonText">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment