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

no message

parent 7b317379
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ import android.widget.AdapterView; ...@@ -10,6 +10,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView; import android.widget.AutoCompleteTextView;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -23,8 +24,8 @@ import ms.itsecteam.warpdrink.orderList.Order; ...@@ -23,8 +24,8 @@ import ms.itsecteam.warpdrink.orderList.Order;
public class MainActivity extends ActionBarActivity implements View.OnClickListener, View.OnKeyListener, AdapterView.OnItemClickListener, DialogInterface.OnClickListener { public class MainActivity extends ActionBarActivity implements View.OnClickListener, View.OnKeyListener, AdapterView.OnItemClickListener, DialogInterface.OnClickListener {
private Button btnPay, btnCharge, btnLogout;
private Button btnOneEuro, btnFiftyCent, btnPay, btnCharge, btnLogout; private ImageButton btnRefresh;
private TextView txtSum,txtCredit; private TextView txtSum,txtCredit;
private ListView lstOrdered; private ListView lstOrdered;
private AutoCompleteTextView atxvName; private AutoCompleteTextView atxvName;
...@@ -48,22 +49,16 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe ...@@ -48,22 +49,16 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
getSupportActionBar().hide(); getSupportActionBar().hide();
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
this.txtSum = (TextView) findViewById(R.id.txtSum); this.txtSum = (TextView) findViewById(R.id.txtSum);
this.txtCredit = (TextView)findViewById(R.id.txtCredit); this.txtCredit = (TextView)findViewById(R.id.txtCredit);
this.txtCredit.setText(getResources().getString(R.string.credit,0.0)); this.txtCredit.setText(getResources().getString(R.string.credit,0.0));
this.txtSum.setText(getResources().getString(R.string.total,0.0)); this.txtSum.setText(getResources().getString(R.string.total,0.0));
this.btnOneEuro = (Button) findViewById(R.id.btnOneEuro); this.btnLogout = (Button) findViewById(R.id.btnLogout);
this.btnFiftyCent = (Button) findViewById(R.id.btnFiftyCent); this.btnRefresh = (ImageButton) findViewById(R.id.btnRefresh);
this.btnPay = (Button) findViewById(R.id.btnPay); this.btnPay = (Button) findViewById(R.id.btnPay);
this.btnCharge = (Button) findViewById(R.id.btnCharge); 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.lstAdapter = new ListViewAdapter(this, R.layout.order_list_item, new ArrayList<Order>());
this.lstOrdered = (ListView) findViewById(R.id.lstOrdered); this.lstOrdered = (ListView) findViewById(R.id.lstOrdered);
...@@ -104,6 +99,7 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe ...@@ -104,6 +99,7 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
} }
private void enableControls(boolean enable) { private void enableControls(boolean enable) {
this.atxvName.setEnabled(!enable); this.atxvName.setEnabled(!enable);
this.btnRefresh.setEnabled(!enable);
this.btnCharge.setEnabled(enable); this.btnCharge.setEnabled(enable);
this.btnPay.setEnabled(enable); this.btnPay.setEnabled(enable);
this.btnLogout.setEnabled(enable); this.btnLogout.setEnabled(enable);
...@@ -163,6 +159,9 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe ...@@ -163,6 +159,9 @@ public class MainActivity extends ActionBarActivity implements View.OnClickListe
case R.id.btnLogout: case R.id.btnLogout:
clearCurrentUser(); clearCurrentUser();
break; break;
case R.id.btnRefresh:
Toast.makeText(this,"refresh" ,Toast.LENGTH_LONG).show();
break;
} }
} }
......
WarpDrinkApp/app/src/main/res/drawable/ic_menu_refresh.png

4.62 KiB

...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
android:layout_height="20px" /> android:layout_height="20px" />
<AutoCompleteTextView <AutoCompleteTextView
android:layout_width="400dp" android:layout_width="350dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/atxvName" android:id="@+id/atxvName"
android:imeOptions="actionNext" android:imeOptions="actionNext"
...@@ -48,6 +48,15 @@ ...@@ -48,6 +48,15 @@
android:layout_columnSpan="1" android:layout_columnSpan="1"
android:layout_row="0" android:layout_row="0"
android:layout_column="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> </LinearLayout>
<Space <Space
...@@ -60,6 +69,7 @@ ...@@ -60,6 +69,7 @@
android:layout_row="3" android:layout_row="3"
android:layout_column="1" android:layout_column="1"
android:width="10dp" android:width="10dp"
android:onClick="onClick"
android:layout_width="300dp"></Button> android:layout_width="300dp"></Button>
<Button <Button
...@@ -71,6 +81,7 @@ ...@@ -71,6 +81,7 @@
android:layout_column="1" android:layout_column="1"
android:width="10dp" android:width="10dp"
android:layout_width="300dp" android:layout_width="300dp"
android:onClick="onClick"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<Space <Space
...@@ -115,6 +126,7 @@ ...@@ -115,6 +126,7 @@
android:layout_width="140dp" android:layout_width="140dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_gravity="right" android:layout_gravity="right"
android:onClick="onClick"
android:textSize="20dp" /> android:textSize="20dp" />
</LinearLayout> </LinearLayout>
...@@ -162,6 +174,7 @@ ...@@ -162,6 +174,7 @@
android:layout_column="1" android:layout_column="1"
android:width="10dp" android:width="10dp"
android:layout_width="300dp" android:layout_width="300dp"
android:onClick="onClick"
android:layout_height="60dp" /> android:layout_height="60dp" />
<Space <Space
...@@ -177,6 +190,7 @@ ...@@ -177,6 +190,7 @@
android:layout_column="0" android:layout_column="0"
android:width="10dp" android:width="10dp"
android:layout_width="355dp" android:layout_width="355dp"
android:onClick="onClick"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
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