Add generic menus, and implement a basic layout for alert settings.

I should commit more often, sorry...
This commit is contained in:
bspeice 2013-10-04 20:22:54 -04:00
parent 412f894d92
commit d1467881f8
22 changed files with 125 additions and 48 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

View File

@ -1,16 +1,34 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Alerts" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/alerts_label_alerts_to_receive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
android:text="@string/alerts_label_alerts_to_receive"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<CheckBox
android:id="@+id/alerts_check_timed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/alerts_check_timed"
android:onClick="onClickTimedAlerts" />
<CheckBox
android:id="@+id/alerts_check_organizations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/alerts_check_organizations"
android:onClick="onClickOrganizationAlerts" />
<CheckBox
android:id="@+id/alerts_check_university"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/alerts_check_university"
android:onClick="onClickUniversityAlerts" />
</LinearLayout>

View File

@ -1,9 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_alert_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_alert_settings"/>
</menu>

12
res/menu/base.xml Normal file
View File

@ -0,0 +1,12 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/action_parking" android:title="@string/title_activity_parking" android:icon="@drawable/ic_action_directions" android:orderInCategory="50"></item><item android:id="@+id/action_registration" android:icon="@drawable/ic_action_view_as_list" android:title="@string/title_activity_registration" android:orderInCategory="200"/><item
android:id="@+id/action_alert_settings"
android:orderInCategory="100"
android:showAsAction="ifRoom"
android:title="@string/action_alert_settings"
android:icon="@drawable/ic_action_settings"/>
</menu>

View File

@ -1,10 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_alert_settings"
android:orderInCategory="100"
android:showAsAction="ifRoom"
android:title="@string/action_alert_settings"
android:icon="@drawable/ic_action_warning"/>
</menu>

View File

@ -1,9 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_alert_settings"/>
</menu>

View File

@ -1,9 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_alert_settings"/>
</menu>

View File

@ -7,5 +7,9 @@
<string name="title_activity_parking">Parking</string>
<string name="title_activity_registration">Registration</string>
<string name="title_activity_alerts">Alerts</string>
<string name="alerts_label_alerts_to_receive">Select Alerts to Receive:</string>
<string name="alerts_check_timed">Timed (Reserve Ticket...)</string>
<string name="alerts_check_organizations">Organizations</string>
<string name="alerts_check_university">University</string>
</resources>

View File

@ -1,6 +1,43 @@
package com.uncc.gameday.activities;
import com.uncc.gameday.R;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
public class Alerts extends MenuActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alerts);
}
public void onClickTimedAlerts(View view) {
if (((CheckBox) view).isChecked())
// Enable Timed alerts
;
else
// Disable Timed alerts
;
}
public void onClickOrganizationAlerts(View view) {
if (((CheckBox) view).isChecked())
// Enable Organization alerts
;
else
// Disable Organization alerts
;
}
public void onClickUniversityAlerts(View view) {
if (((CheckBox) view).isChecked())
// Enable University alerts
;
else
// Disable University alerts
;
}
}
}

View File

@ -1,6 +1,7 @@
package com.uncc.gameday.activities;
public class Home extends MenuActivity {
}

View File

@ -0,0 +1,42 @@
package com.uncc.gameday.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.uncc.gameday.R;
public class MenuActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.base, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.action_alert_settings:
startActivity(new Intent(this, Alerts.class));
break;
case R.id.action_registration:
startActivity(new Intent(this, Registration.class));
break;
case R.id.action_parking:
startActivity(new Intent(this, Parking.class));
break;
}
return true;
}
}