Commit ca6c566b authored by Christian Dresen's avatar Christian Dresen
Browse files

no message

parent 7b317379
......@@ -10,6 +10,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
......@@ -23,8 +24,8 @@ import ms.itsecteam.warpdrink.orderList.Order;
public class MainActivity extends ActionBarActivity implements View.OnClickListener, View.OnKeyListener, AdapterView.OnItemClickListener, DialogInterface.OnClickListener {
private Button btnOneEuro, btnFiftyCent, btnPay, btnCharge, btnLogout;
private Button btnPay, btnCharge, btnLogout;
private ImageButton btnRefresh;
private TextView txtSum,txtCredit;
private ListView lstOrdered;
private AutoCompleteTextView atxvName;
......@@ -48,22 +49,16 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
getSupportActionBar().hide();
setContentView(R.layout.activity_main);
this.txtSum = (TextView) findViewById(R.id.txtSum);
this.txtCredit = (TextView)findViewById(R.id.txtCredit);
this.txtCredit.setText(getResources().getString(R.string.credit,0.0));
this.txtSum.setText(getResources().getString(R.string.total,0.0));
this.btnOneEuro = (Button) findViewById(R.id.btnOneEuro);
this.btnFiftyCent = (Button) findViewById(R.id.btnFiftyCent);
this.btnLogout = (Button) findViewById(R.id.btnLogout);
this.btnRefresh = (ImageButton) findViewById(R.id.btnRefresh);
this.btnPay = (Button) findViewById(R.id.btnPay);
this.btnCharge = (Button) findViewById(R.id.btnCharge);
this.btnLogout = (Button) findViewById(R.id.btnLogout);
this.btnOneEuro.setOnClickListener(this);
this.btnFiftyCent.setOnClickListener(this);
this.btnPay.setOnClickListener(this);
this.btnCharge.setOnClickListener(this);
this.btnLogout.setOnClickListener(this);
this.lstAdapter = new ListViewAdapter(this, R.layout.order_list_item, new ArrayList<Order>());
this.lstOrdered = (ListView) findViewById(R.id.lstOrdered);
......@@ -104,6 +99,7 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
}
private void enableControls(boolean enable) {
this.atxvName.setEnabled(!enable);
this.btnRefresh.setEnabled(!enable);
this.btnCharge.setEnabled(enable);
this.btnPay.setEnabled(enable);
this.btnLogout.setEnabled(enable);
......@@ -163,6 +159,9 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
case R.id.btnLogout:
clearCurrentUser();
break;
case R.id.btnRefresh:
Toast.makeText(this,"refresh" ,Toast.LENGTH_LONG).show();
break;
}
}
......
......@@ -40,7 +40,7 @@
android:layout_height="20px" />
<AutoCompleteTextView
android:layout_width="400dp"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:id="@+id/atxvName"
android:imeOptions="actionNext"
......@@ -48,6 +48,15 @@
android:layout_columnSpan="1"
android:layout_row="0"
android:layout_column="0" />
<ImageButton
android:layout_width="30dp"
android:layout_height="30dp"
android:id="@+id/btnRefresh"
android:scaleType="fitXY"
android:background="@drawable/ic_menu_refresh"
android:onClick="onClick"
android:layout_gravity="center_vertical" />
</LinearLayout>
<Space
......@@ -60,6 +69,7 @@
android:layout_row="3"
android:layout_column="1"
android:width="10dp"
android:onClick="onClick"
android:layout_width="300dp"></Button>
<Button
......@@ -71,6 +81,7 @@
android:layout_column="1"
android:width="10dp"
android:layout_width="300dp"
android:onClick="onClick"
android:layout_height="wrap_content" />
<Space
......@@ -115,6 +126,7 @@
android:layout_width="140dp"
android:layout_height="50dp"
android:layout_gravity="right"
android:onClick="onClick"
android:textSize="20dp" />
</LinearLayout>
......@@ -162,6 +174,7 @@
android:layout_column="1"
android:width="10dp"
android:layout_width="300dp"
android:onClick="onClick"
android:layout_height="60dp" />
<Space
......@@ -177,6 +190,7 @@
android:layout_column="0"
android:width="10dp"
android:layout_width="355dp"
android:onClick="onClick"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment